mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
More tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13102 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a53beeafcd
commit
f12fed6759
4 changed files with 104 additions and 96 deletions
|
@ -3,7 +3,8 @@
|
||||||
* Headers/gnustep/base/NSObjCRuntime.h: Remove bad markup in comments.
|
* Headers/gnustep/base/NSObjCRuntime.h: Remove bad markup in comments.
|
||||||
* Headers/gnustep/base/NSString.h: Remove private class declaration
|
* Headers/gnustep/base/NSString.h: Remove private class declaration
|
||||||
and hide internals of NXConstantString behind dummy interface while
|
and hide internals of NXConstantString behind dummy interface while
|
||||||
improving comments.
|
improving comments. Fix long overdue declaraction of methods in
|
||||||
|
clsses rather than protocols.
|
||||||
* Source/GSUserDefaults.h: removed
|
* Source/GSUserDefaults.h: removed
|
||||||
* Source/GSPrivate.h: added
|
* Source/GSPrivate.h: added
|
||||||
* Source/GSCompatibility.m: fix for hidden private info.
|
* Source/GSCompatibility.m: fix for hidden private info.
|
||||||
|
|
|
@ -100,7 +100,7 @@ enum {
|
||||||
NSOpenStepUnicodeReservedBase = 0xF400
|
NSOpenStepUnicodeReservedBase = 0xF400
|
||||||
};
|
};
|
||||||
|
|
||||||
@protocol NSString <NSCoding, NSCopying, NSMutableCopying>
|
@interface NSString :NSObject <NSCoding, NSCopying, NSMutableCopying>
|
||||||
|
|
||||||
// Creating Temporary Strings
|
// Creating Temporary Strings
|
||||||
+ (id) string;
|
+ (id) string;
|
||||||
|
@ -226,7 +226,8 @@ enum {
|
||||||
matchesIntoArray: (NSArray**)outputArray
|
matchesIntoArray: (NSArray**)outputArray
|
||||||
filterTypes: (NSArray*)filterTypes;
|
filterTypes: (NSArray*)filterTypes;
|
||||||
- (const char*) fileSystemRepresentation;
|
- (const char*) fileSystemRepresentation;
|
||||||
- (BOOL) getFileSystemRepresentation: (char*)buffer maxLength: (unsigned int)l;
|
- (BOOL) getFileSystemRepresentation: (char*)buffer
|
||||||
|
maxLength: (unsigned int)size;
|
||||||
- (NSString*) lastPathComponent;
|
- (NSString*) lastPathComponent;
|
||||||
- (NSString*) pathExtension;
|
- (NSString*) pathExtension;
|
||||||
- (NSString*) stringByAbbreviatingWithTildeInPath;
|
- (NSString*) stringByAbbreviatingWithTildeInPath;
|
||||||
|
@ -251,19 +252,19 @@ enum {
|
||||||
+ (id) stringWithFormat: (NSString*)format
|
+ (id) stringWithFormat: (NSString*)format
|
||||||
arguments: (va_list)argList;
|
arguments: (va_list)argList;
|
||||||
+ (id) stringWithString: (NSString*) aString;
|
+ (id) stringWithString: (NSString*) aString;
|
||||||
+ (id) stringWithContentsOfURL: (NSURL*)anURL;
|
+ (id) stringWithContentsOfURL: (NSURL*)url;
|
||||||
+ (id) stringWithUTF8String: (const char*)bytes;
|
+ (id) stringWithUTF8String: (const char*)bytes;
|
||||||
- (id) initWithFormat: (NSString*)format
|
- (id) initWithFormat: (NSString*)format
|
||||||
locale: (NSDictionary*)dictionary, ...;
|
locale: (NSDictionary*)locale, ...;
|
||||||
- (id) initWithFormat: (NSString*)format
|
- (id) initWithFormat: (NSString*)format
|
||||||
locale: (NSDictionary*)dictionary
|
locale: (NSDictionary*)locale
|
||||||
arguments: (va_list)argList;
|
arguments: (va_list)arg_list;
|
||||||
- (id) initWithUTF8String: (const char *)bytes;
|
- (id) initWithUTF8String: (const char *)bytes;
|
||||||
- (id) initWithContentsOfURL: (NSURL*)anURL;
|
- (id) initWithContentsOfURL: (NSURL*)url;
|
||||||
- (NSString*) substringWithRange: (NSRange)aRange;
|
- (NSString*) substringWithRange: (NSRange)aRange;
|
||||||
- (NSComparisonResult) caseInsensitiveCompare: (NSString*)aString;
|
- (NSComparisonResult) caseInsensitiveCompare: (NSString*)aString;
|
||||||
- (NSComparisonResult)compare:(NSString *)string
|
- (NSComparisonResult)compare:(NSString *)string
|
||||||
options:(unsigned)mask
|
options:(unsigned int)mask
|
||||||
range:(NSRange)compareRange
|
range:(NSRange)compareRange
|
||||||
locale:(NSDictionary *)dict;
|
locale:(NSDictionary *)dict;
|
||||||
- (NSComparisonResult)localizedCompare:(NSString *)string;
|
- (NSComparisonResult)localizedCompare:(NSString *)string;
|
||||||
|
@ -284,47 +285,39 @@ enum {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NO_GNUSTEP
|
#ifndef NO_GNUSTEP
|
||||||
|
+ (Class) constantStringClass;
|
||||||
- (BOOL) boolValue;
|
- (BOOL) boolValue;
|
||||||
#endif /* NO_GNUSTEP */
|
#endif /* NO_GNUSTEP */
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface NSString : NSObject <NSString>
|
@interface NSMutableString : NSString
|
||||||
+ (Class) constantStringClass;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@class NSMutableString;
|
|
||||||
|
|
||||||
@protocol NSMutableString <NSString>
|
|
||||||
|
|
||||||
// Creating Temporary Strings
|
// Creating Temporary Strings
|
||||||
+ (id) string;
|
+ (id) string;
|
||||||
+ (id) stringWithCharacters: (const unichar*)chars
|
+ (id) stringWithCharacters: (const unichar*)characters
|
||||||
length: (unsigned int)length;
|
length: (unsigned int)length;
|
||||||
+ (id) stringWithCString: (const char*)byteString
|
+ (id) stringWithCString: (const char*)byteString
|
||||||
length: (unsigned int)length;
|
length: (unsigned int)length;
|
||||||
+ (id) stringWithCString: (const char*) byteString;
|
+ (id) stringWithCString: (const char*) byteString;
|
||||||
+ (id) stringWithFormat: (NSString*)format,...;
|
+ (id) stringWithFormat: (NSString*)format,...;
|
||||||
+ (id) stringWithContentsOfFile:(NSString *)path;
|
+ (id) stringWithContentsOfFile: (NSString*)path;
|
||||||
+ (NSMutableString*) stringWithCapacity: (unsigned)capacity;
|
+ (NSMutableString*) stringWithCapacity: (unsigned int)capacity;
|
||||||
|
|
||||||
// Initializing Newly Allocated Strings
|
// Initializing Newly Allocated Strings
|
||||||
- (id) initWithCapacity: (unsigned)capacity;
|
- (id) initWithCapacity: (unsigned int)capacity;
|
||||||
|
|
||||||
// Modify A String
|
// Modify A String
|
||||||
- (void) appendFormat: (NSString*)format, ...;
|
- (void) appendFormat: (NSString*)format, ...;
|
||||||
- (void) appendString: (NSString*)aString;
|
- (void) appendString: (NSString*)aString;
|
||||||
- (void) deleteCharactersInRange: (NSRange)range;
|
- (void) deleteCharactersInRange: (NSRange)range;
|
||||||
- (void) insertString: (NSString*)aString atIndex:(unsigned)index;
|
- (void) insertString: (NSString*)aString atIndex: (unsigned int)loc;
|
||||||
- (void) replaceCharactersInRange: (NSRange)range
|
- (void) replaceCharactersInRange: (NSRange)range
|
||||||
withString: (NSString*)aString;
|
withString: (NSString*)aString;
|
||||||
- (void) setString: (NSString*)aString;
|
- (void) setString: (NSString*)aString;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface NSMutableString : NSString <NSMutableString>
|
|
||||||
@end
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>The NXConstantString class is used to hold constant 8-bit character
|
* <p>The NXConstantString class is used to hold constant 8-bit character
|
||||||
* string objects produced by the compiler where it sees @"..." in the
|
* string objects produced by the compiler where it sees @"..." in the
|
||||||
|
|
|
@ -3334,6 +3334,12 @@ transmute(ivars self, NSString *aString)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Access instance variables of NXConstnatString class consistently
|
||||||
|
* with other concrete NSString subclasses.
|
||||||
|
*/
|
||||||
|
#define _self ((ivars)self)
|
||||||
|
|
||||||
- (id) initWithCharacters: (unichar*)byteString
|
- (id) initWithCharacters: (unichar*)byteString
|
||||||
length: (unsigned int)length
|
length: (unsigned int)length
|
||||||
freeWhenDone: (BOOL)flag
|
freeWhenDone: (BOOL)flag
|
||||||
|
@ -3358,7 +3364,7 @@ transmute(ivars self, NSString *aString)
|
||||||
|
|
||||||
- (const char*) cString
|
- (const char*) cString
|
||||||
{
|
{
|
||||||
return (const char*)nxcsptr;
|
return _self->_contents.c;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) retain
|
- (id) retain
|
||||||
|
@ -3410,7 +3416,7 @@ transmute(ivars self, NSString *aString)
|
||||||
{
|
{
|
||||||
unsigned ret = 0;
|
unsigned ret = 0;
|
||||||
|
|
||||||
int len = nxcslen;
|
int len = _self->_count;
|
||||||
|
|
||||||
if (len > NSHashStringLength)
|
if (len > NSHashStringLength)
|
||||||
len = NSHashStringLength;
|
len = NSHashStringLength;
|
||||||
|
@ -3419,7 +3425,7 @@ transmute(ivars self, NSString *aString)
|
||||||
const unsigned char *p;
|
const unsigned char *p;
|
||||||
unsigned char_count = 0;
|
unsigned char_count = 0;
|
||||||
|
|
||||||
p = nxcsptr;
|
p = _self->_contents.c;
|
||||||
while (*p != 0 && char_count++ < NSHashStringLength)
|
while (*p != 0 && char_count++ < NSHashStringLength)
|
||||||
{
|
{
|
||||||
unichar c = *p++;
|
unichar c = *p++;
|
||||||
|
@ -3471,17 +3477,20 @@ transmute(ivars self, NSString *aString)
|
||||||
{
|
{
|
||||||
ivars other = (ivars)anObject;
|
ivars other = (ivars)anObject;
|
||||||
|
|
||||||
if (nxcslen != other->_count)
|
if (_self->_count != other->_count)
|
||||||
return NO;
|
return NO;
|
||||||
if (memcmp(nxcsptr, other->_contents.c, nxcslen) != 0)
|
if (memcmp(_self->_contents.c, other->_contents.c, _self->_count) != 0)
|
||||||
return NO;
|
return NO;
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
else if (GSObjCIsKindOf(c, GSUnicodeStringClass) == YES
|
else if (GSObjCIsKindOf(c, GSUnicodeStringClass) == YES
|
||||||
|| c == GSMutableStringClass)
|
|| c == GSMutableStringClass)
|
||||||
{
|
{
|
||||||
if (strCompCsUs(self, anObject, 0, (NSRange){0,nxcslen}) == NSOrderedSame)
|
if (strCompCsUs(self, anObject, 0, (NSRange){0,_self->_count})
|
||||||
return YES;
|
== NSOrderedSame)
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
else if (GSObjCIsKindOf(c, NSStringClass))
|
else if (GSObjCIsKindOf(c, NSStringClass))
|
||||||
|
@ -3518,17 +3527,20 @@ transmute(ivars self, NSString *aString)
|
||||||
{
|
{
|
||||||
ivars other = (ivars)anObject;
|
ivars other = (ivars)anObject;
|
||||||
|
|
||||||
if (nxcslen != other->_count)
|
if (_self->_count != other->_count)
|
||||||
return NO;
|
return NO;
|
||||||
if (memcmp(nxcsptr, other->_contents.c, nxcslen) != 0)
|
if (memcmp(_self->_contents.c, other->_contents.c, _self->_count) != 0)
|
||||||
return NO;
|
return NO;
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
else if (GSObjCIsKindOf(c, GSUnicodeStringClass) == YES
|
else if (GSObjCIsKindOf(c, GSUnicodeStringClass) == YES
|
||||||
|| c == GSMutableStringClass)
|
|| c == GSMutableStringClass)
|
||||||
{
|
{
|
||||||
if (strCompCsUs(self, anObject, 0, (NSRange){0,nxcslen}) == NSOrderedSame)
|
if (strCompCsUs(self, anObject, 0, (NSRange){0,_self->_count})
|
||||||
return YES;
|
== NSOrderedSame)
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
else if (GSObjCIsKindOf(c, NSStringClass))
|
else if (GSObjCIsKindOf(c, NSStringClass))
|
||||||
|
|
|
@ -111,7 +111,7 @@ static Class plDictionary;
|
||||||
static id (*plSet)(id, SEL, id, id) = 0;
|
static id (*plSet)(id, SEL, id, id) = 0;
|
||||||
|
|
||||||
static id (*plAlloc)(Class, SEL, NSZone*) = 0;
|
static id (*plAlloc)(Class, SEL, NSZone*) = 0;
|
||||||
static id (*plInit)(id, SEL, unichar*, unsigned) = 0;
|
static id (*plInit)(id, SEL, unichar*, unsigned int) = 0;
|
||||||
|
|
||||||
static SEL plSel;
|
static SEL plSel;
|
||||||
static SEL cMemberSel = 0;
|
static SEL cMemberSel = 0;
|
||||||
|
@ -455,7 +455,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id) stringWithCharacters: (const unichar*)chars
|
+ (id) stringWithCharacters: (const unichar*)chars
|
||||||
length: (unsigned)length
|
length: (unsigned int)length
|
||||||
{
|
{
|
||||||
NSString *obj;
|
NSString *obj;
|
||||||
|
|
||||||
|
@ -475,7 +475,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id) stringWithCString: (const char*)byteString
|
+ (id) stringWithCString: (const char*)byteString
|
||||||
length: (unsigned)length
|
length: (unsigned int)length
|
||||||
{
|
{
|
||||||
NSString *obj;
|
NSString *obj;
|
||||||
|
|
||||||
|
@ -538,7 +538,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
|
|
||||||
/* This is the designated initializer. */
|
/* This is the designated initializer. */
|
||||||
- (id) initWithCharactersNoCopy: (unichar*)chars
|
- (id) initWithCharactersNoCopy: (unichar*)chars
|
||||||
length: (unsigned)length
|
length: (unsigned int)length
|
||||||
freeWhenDone: (BOOL)flag
|
freeWhenDone: (BOOL)flag
|
||||||
{
|
{
|
||||||
[self subclassResponsibility: _cmd];
|
[self subclassResponsibility: _cmd];
|
||||||
|
@ -546,7 +546,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCharacters: (const unichar*)chars
|
- (id) initWithCharacters: (const unichar*)chars
|
||||||
length: (unsigned)length
|
length: (unsigned int)length
|
||||||
{
|
{
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
{
|
{
|
||||||
|
@ -603,7 +603,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCStringNoCopy: (char*)byteString
|
- (id) initWithCStringNoCopy: (char*)byteString
|
||||||
length: (unsigned)length
|
length: (unsigned int)length
|
||||||
freeWhenDone: (BOOL)flag
|
freeWhenDone: (BOOL)flag
|
||||||
{
|
{
|
||||||
unichar *buf;
|
unichar *buf;
|
||||||
|
@ -619,7 +619,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCString: (const char*)byteString length: (unsigned)length
|
- (id) initWithCString: (const char*)byteString length: (unsigned int)length
|
||||||
{
|
{
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
{
|
{
|
||||||
|
@ -1234,7 +1234,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
|
|
||||||
// Getting a String's Length
|
// Getting a String's Length
|
||||||
|
|
||||||
- (unsigned) length
|
- (unsigned int) length
|
||||||
{
|
{
|
||||||
[self subclassResponsibility: _cmd];
|
[self subclassResponsibility: _cmd];
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1242,7 +1242,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
|
|
||||||
// Accessing Characters
|
// Accessing Characters
|
||||||
|
|
||||||
- (unichar) characterAtIndex: (unsigned)index
|
- (unichar) characterAtIndex: (unsigned int)index
|
||||||
{
|
{
|
||||||
[self subclassResponsibility: _cmd];
|
[self subclassResponsibility: _cmd];
|
||||||
return (unichar)0;
|
return (unichar)0;
|
||||||
|
@ -1261,7 +1261,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
{
|
{
|
||||||
unsigned l = [self length];
|
unsigned l = [self length];
|
||||||
unsigned i;
|
unsigned i;
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
GS_RANGE_CHECK(aRange, l);
|
GS_RANGE_CHECK(aRange, l);
|
||||||
|
|
||||||
|
@ -1335,12 +1335,12 @@ handle_printf_atsign (FILE *stream,
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*) substringFromIndex: (unsigned)index
|
- (NSString*) substringFromIndex: (unsigned int)index
|
||||||
{
|
{
|
||||||
return [self substringWithRange: ((NSRange){index, [self length]-index})];
|
return [self substringWithRange: ((NSRange){index, [self length]-index})];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*) substringToIndex: (unsigned)index
|
- (NSString*) substringToIndex: (unsigned int)index
|
||||||
{
|
{
|
||||||
return [self substringWithRange: ((NSRange){0,index})];;
|
return [self substringWithRange: ((NSRange){0,index})];;
|
||||||
}
|
}
|
||||||
|
@ -1379,7 +1379,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSRange) rangeOfCharacterFromSet: (NSCharacterSet*)aSet
|
- (NSRange) rangeOfCharacterFromSet: (NSCharacterSet*)aSet
|
||||||
options: (unsigned)mask
|
options: (unsigned int)mask
|
||||||
{
|
{
|
||||||
NSRange all = NSMakeRange(0, [self length]);
|
NSRange all = NSMakeRange(0, [self length]);
|
||||||
|
|
||||||
|
@ -1389,7 +1389,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSRange) rangeOfCharacterFromSet: (NSCharacterSet*)aSet
|
- (NSRange) rangeOfCharacterFromSet: (NSCharacterSet*)aSet
|
||||||
options: (unsigned)mask
|
options: (unsigned int)mask
|
||||||
range: (NSRange)aRange
|
range: (NSRange)aRange
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -1397,7 +1397,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
int stop;
|
int stop;
|
||||||
int step;
|
int step;
|
||||||
NSRange range;
|
NSRange range;
|
||||||
unichar (*cImp)(id, SEL, unsigned);
|
unichar (*cImp)(id, SEL, unsigned int);
|
||||||
BOOL (*mImp)(id, SEL, unichar);
|
BOOL (*mImp)(id, SEL, unichar);
|
||||||
|
|
||||||
i = [self length];
|
i = [self length];
|
||||||
|
@ -1414,7 +1414,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
range.location = NSNotFound;
|
range.location = NSNotFound;
|
||||||
range.length = 0;
|
range.length = 0;
|
||||||
|
|
||||||
cImp = (unichar(*)(id,SEL,unsigned)) [self methodForSelector: caiSel];
|
cImp = (unichar(*)(id,SEL,unsigned int)) [self methodForSelector: caiSel];
|
||||||
mImp = (BOOL(*)(id,SEL,unichar))
|
mImp = (BOOL(*)(id,SEL,unichar))
|
||||||
[aSet methodForSelector: cMemberSel];
|
[aSet methodForSelector: cMemberSel];
|
||||||
|
|
||||||
|
@ -1442,7 +1442,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSRange) rangeOfString: (NSString*)string
|
- (NSRange) rangeOfString: (NSString*)string
|
||||||
options: (unsigned)mask
|
options: (unsigned int)mask
|
||||||
{
|
{
|
||||||
NSRange all = NSMakeRange(0, [self length]);
|
NSRange all = NSMakeRange(0, [self length]);
|
||||||
|
|
||||||
|
@ -1452,7 +1452,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSRange) rangeOfString: (NSString *) aString
|
- (NSRange) rangeOfString: (NSString *) aString
|
||||||
options: (unsigned) mask
|
options: (unsigned int) mask
|
||||||
range: (NSRange) aRange
|
range: (NSRange) aRange
|
||||||
{
|
{
|
||||||
if (aString == nil)
|
if (aString == nil)
|
||||||
|
@ -1468,7 +1468,8 @@ handle_printf_atsign (FILE *stream,
|
||||||
return range.length ? range.location : NSNotFound;
|
return range.length ? range.location : NSNotFound;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (unsigned int) indexOfString: (NSString*)substring fromIndex: (unsigned)index
|
- (unsigned int) indexOfString: (NSString*)substring
|
||||||
|
fromIndex: (unsigned int)index
|
||||||
{
|
{
|
||||||
NSRange range = {index, [self length] - index};
|
NSRange range = {index, [self length] - index};
|
||||||
|
|
||||||
|
@ -1478,13 +1479,13 @@ handle_printf_atsign (FILE *stream,
|
||||||
|
|
||||||
// Determining Composed Character Sequences
|
// Determining Composed Character Sequences
|
||||||
|
|
||||||
- (NSRange) rangeOfComposedCharacterSequenceAtIndex: (unsigned)anIndex
|
- (NSRange) rangeOfComposedCharacterSequenceAtIndex: (unsigned int)anIndex
|
||||||
{
|
{
|
||||||
unsigned start;
|
unsigned start;
|
||||||
unsigned end;
|
unsigned end;
|
||||||
unsigned length = [self length];
|
unsigned length = [self length];
|
||||||
unichar ch;
|
unichar ch;
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
NSCharacterSet *nbSet = [NSCharacterSet nonBaseCharacterSet];
|
NSCharacterSet *nbSet = [NSCharacterSet nonBaseCharacterSet];
|
||||||
|
|
||||||
if (anIndex >= length)
|
if (anIndex >= length)
|
||||||
|
@ -1515,7 +1516,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSComparisonResult) compare: (NSString*)aString
|
- (NSComparisonResult) compare: (NSString*)aString
|
||||||
options: (unsigned)mask
|
options: (unsigned int)mask
|
||||||
{
|
{
|
||||||
return [self compare: aString options: mask
|
return [self compare: aString options: mask
|
||||||
range: ((NSRange){0, [self length]})];
|
range: ((NSRange){0, [self length]})];
|
||||||
|
@ -1523,7 +1524,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
|
|
||||||
// xxx Should implement full POSIX.2 collate
|
// xxx Should implement full POSIX.2 collate
|
||||||
- (NSComparisonResult) compare: (NSString*)aString
|
- (NSComparisonResult) compare: (NSString*)aString
|
||||||
options: (unsigned)mask
|
options: (unsigned int)mask
|
||||||
range: (NSRange)aRange
|
range: (NSRange)aRange
|
||||||
{
|
{
|
||||||
if (aString == nil)
|
if (aString == nil)
|
||||||
|
@ -1584,7 +1585,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
* for other purposes in a bitfield in the concrete string subclasses, so we
|
* for other purposes in a bitfield in the concrete string subclasses, so we
|
||||||
* must not use the full unsigned integer.
|
* must not use the full unsigned integer.
|
||||||
*/
|
*/
|
||||||
- (unsigned) hash
|
- (unsigned int) hash
|
||||||
{
|
{
|
||||||
unsigned ret = 0;
|
unsigned ret = 0;
|
||||||
|
|
||||||
|
@ -1628,7 +1629,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
// Getting a Shared Prefix
|
// Getting a Shared Prefix
|
||||||
|
|
||||||
- (NSString*) commonPrefixWithString: (NSString*)aString
|
- (NSString*) commonPrefixWithString: (NSString*)aString
|
||||||
options: (unsigned)mask
|
options: (unsigned int)mask
|
||||||
{
|
{
|
||||||
if (mask & NSLiteralSearch)
|
if (mask & NSLiteralSearch)
|
||||||
{
|
{
|
||||||
|
@ -1669,12 +1670,12 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unichar (*scImp)(NSString*, SEL, unsigned);
|
unichar (*scImp)(NSString*, SEL, unsigned int);
|
||||||
unichar (*ocImp)(NSString*, SEL, unsigned);
|
unichar (*ocImp)(NSString*, SEL, unsigned int);
|
||||||
void (*sgImp)(NSString*, SEL, unichar*, NSRange) = 0;
|
void (*sgImp)(NSString*, SEL, unichar*, NSRange) = 0;
|
||||||
void (*ogImp)(NSString*, SEL, unichar*, NSRange) = 0;
|
void (*ogImp)(NSString*, SEL, unichar*, NSRange) = 0;
|
||||||
NSRange (*srImp)(NSString*, SEL, unsigned) = 0;
|
NSRange (*srImp)(NSString*, SEL, unsigned int) = 0;
|
||||||
NSRange (*orImp)(NSString*, SEL, unsigned) = 0;
|
NSRange (*orImp)(NSString*, SEL, unsigned int) = 0;
|
||||||
BOOL gotRangeImps = NO;
|
BOOL gotRangeImps = NO;
|
||||||
BOOL gotFetchImps = NO;
|
BOOL gotFetchImps = NO;
|
||||||
NSRange sRange;
|
NSRange sRange;
|
||||||
|
@ -1773,14 +1774,14 @@ handle_printf_atsign (FILE *stream,
|
||||||
return NSMakeRange(startIndex, lineEndIndex - startIndex);
|
return NSMakeRange(startIndex, lineEndIndex - startIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) getLineStart: (unsigned *)startIndex
|
- (void) getLineStart: (unsigned int *)startIndex
|
||||||
end: (unsigned *)lineEndIndex
|
end: (unsigned int *)lineEndIndex
|
||||||
contentsEnd: (unsigned *)contentsEndIndex
|
contentsEnd: (unsigned int *)contentsEndIndex
|
||||||
forRange: (NSRange)aRange
|
forRange: (NSRange)aRange
|
||||||
{
|
{
|
||||||
unichar thischar;
|
unichar thischar;
|
||||||
unsigned start, end, len;
|
unsigned start, end, len;
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
len = [self length];
|
len = [self length];
|
||||||
GS_RANGE_CHECK(aRange, len);
|
GS_RANGE_CHECK(aRange, len);
|
||||||
|
@ -1950,7 +1951,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
unichar *s;
|
unichar *s;
|
||||||
unsigned count;
|
unsigned count;
|
||||||
unsigned len = [self length];
|
unsigned len = [self length];
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
{
|
{
|
||||||
|
@ -1972,7 +1973,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
unichar *s;
|
unichar *s;
|
||||||
unsigned count;
|
unsigned count;
|
||||||
unsigned len = [self length];
|
unsigned len = [self length];
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
{
|
{
|
||||||
|
@ -2042,7 +2043,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
return (const char*)[m bytes];
|
return (const char*)[m bytes];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (unsigned) cStringLength
|
- (unsigned int) cStringLength
|
||||||
{
|
{
|
||||||
NSData *d;
|
NSData *d;
|
||||||
|
|
||||||
|
@ -2059,7 +2060,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) getCString: (char*)buffer
|
- (void) getCString: (char*)buffer
|
||||||
maxLength: (unsigned)maxLength
|
maxLength: (unsigned int)maxLength
|
||||||
{
|
{
|
||||||
[self getCString: buffer maxLength: maxLength
|
[self getCString: buffer maxLength: maxLength
|
||||||
range: ((NSRange){0, [self length]})
|
range: ((NSRange){0, [self length]})
|
||||||
|
@ -2067,13 +2068,13 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) getCString: (char*)buffer
|
- (void) getCString: (char*)buffer
|
||||||
maxLength: (unsigned)maxLength
|
maxLength: (unsigned int)maxLength
|
||||||
range: (NSRange)aRange
|
range: (NSRange)aRange
|
||||||
remainingRange: (NSRange*)leftoverRange
|
remainingRange: (NSRange*)leftoverRange
|
||||||
{
|
{
|
||||||
unsigned len;
|
unsigned len;
|
||||||
unsigned count;
|
unsigned count;
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
len = [self cStringLength];
|
len = [self cStringLength];
|
||||||
GS_RANGE_CHECK(aRange, len);
|
GS_RANGE_CHECK(aRange, len);
|
||||||
|
@ -2188,7 +2189,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
{
|
{
|
||||||
unsigned int count = 0;
|
unsigned int count = 0;
|
||||||
unsigned int len = [self length];
|
unsigned int len = [self length];
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
{
|
{
|
||||||
|
@ -2376,7 +2377,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
|
|
||||||
// Manipulating File System Paths
|
// Manipulating File System Paths
|
||||||
|
|
||||||
- (unsigned) completePathIntoString: (NSString**)outputName
|
- (unsigned int) completePathIntoString: (NSString**)outputName
|
||||||
caseSensitive: (BOOL)flag
|
caseSensitive: (BOOL)flag
|
||||||
matchesIntoArray: (NSArray**)outputArray
|
matchesIntoArray: (NSArray**)outputArray
|
||||||
filterTypes: (NSArray*)filterTypes
|
filterTypes: (NSArray*)filterTypes
|
||||||
|
@ -2445,7 +2446,8 @@ handle_printf_atsign (FILE *stream,
|
||||||
return [fm fileSystemRepresentationWithPath: self];
|
return [fm fileSystemRepresentationWithPath: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) getFileSystemRepresentation: (char*)buffer maxLength: (unsigned)size
|
- (BOOL) getFileSystemRepresentation: (char*)buffer
|
||||||
|
maxLength: (unsigned int)size
|
||||||
{
|
{
|
||||||
const char* ptr = [self fileSystemRepresentation];
|
const char* ptr = [self fileSystemRepresentation];
|
||||||
if (strlen(ptr) > size)
|
if (strlen(ptr) > size)
|
||||||
|
@ -2865,7 +2867,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
{
|
{
|
||||||
NSMutableString *s;
|
NSMutableString *s;
|
||||||
NSRange r;
|
NSRange r;
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
/* Expand `~' in the path */
|
/* Expand `~' in the path */
|
||||||
s = AUTORELEASE([[self stringByExpandingTildeInPath] mutableCopy]);
|
s = AUTORELEASE([[self stringByExpandingTildeInPath] mutableCopy]);
|
||||||
|
@ -2978,7 +2980,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
||||||
while (count < len)
|
while (count < len)
|
||||||
|
@ -3153,7 +3155,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSComparisonResult) compare: (NSString *)string
|
- (NSComparisonResult) compare: (NSString *)string
|
||||||
options: (unsigned)mask
|
options: (unsigned int)mask
|
||||||
range: (NSRange)compareRange
|
range: (NSRange)compareRange
|
||||||
locale: (NSDictionary *)dict
|
locale: (NSDictionary *)dict
|
||||||
{
|
{
|
||||||
|
@ -3207,7 +3209,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) descriptionWithLocale: (NSDictionary*)aLocale
|
- (void) descriptionWithLocale: (NSDictionary*)aLocale
|
||||||
indent: (unsigned)level
|
indent: (unsigned int)level
|
||||||
to: (id<GNUDescriptionDestination>)output
|
to: (id<GNUDescriptionDestination>)output
|
||||||
{
|
{
|
||||||
unsigned length;
|
unsigned length;
|
||||||
|
@ -3357,7 +3359,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
{
|
{
|
||||||
unsigned count = [self length];
|
unsigned count = [self length];
|
||||||
|
|
||||||
[aCoder encodeValueOfObjCType: @encode(unsigned) at: &count];
|
[aCoder encodeValueOfObjCType: @encode(unsigned int) at: &count];
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
NSStringEncoding enc = NSUnicodeStringEncoding;
|
NSStringEncoding enc = NSUnicodeStringEncoding;
|
||||||
|
@ -3378,7 +3380,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
{
|
{
|
||||||
unsigned count;
|
unsigned count;
|
||||||
|
|
||||||
[aCoder decodeValueOfObjCType: @encode(unsigned) at: &count];
|
[aCoder decodeValueOfObjCType: @encode(unsigned int) at: &count];
|
||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
|
@ -3498,7 +3500,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
NSDefaultMallocZone()] initWithCapacity: 0]);
|
NSDefaultMallocZone()] initWithCapacity: 0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSMutableString*) stringWithCapacity: (unsigned)capacity
|
+ (NSMutableString*) stringWithCapacity: (unsigned int)capacity
|
||||||
{
|
{
|
||||||
return AUTORELEASE([[GSMutableStringClass allocWithZone:
|
return AUTORELEASE([[GSMutableStringClass allocWithZone:
|
||||||
NSDefaultMallocZone()] initWithCapacity: capacity]);
|
NSDefaultMallocZone()] initWithCapacity: capacity]);
|
||||||
|
@ -3506,7 +3508,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
|
|
||||||
/* Inefficient. */
|
/* Inefficient. */
|
||||||
+ (NSString*) stringWithCharacters: (const unichar*)characters
|
+ (NSString*) stringWithCharacters: (const unichar*)characters
|
||||||
length: (unsigned)length
|
length: (unsigned int)length
|
||||||
{
|
{
|
||||||
return AUTORELEASE([[GSMutableStringClass allocWithZone:
|
return AUTORELEASE([[GSMutableStringClass allocWithZone:
|
||||||
NSDefaultMallocZone()] initWithCharacters: characters length: length]);
|
NSDefaultMallocZone()] initWithCharacters: characters length: length]);
|
||||||
|
@ -3525,7 +3527,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSString*) stringWithCString: (const char*)byteString
|
+ (NSString*) stringWithCString: (const char*)byteString
|
||||||
length: (unsigned)length
|
length: (unsigned int)length
|
||||||
{
|
{
|
||||||
return AUTORELEASE([[GSMutableStringClass allocWithZone:
|
return AUTORELEASE([[GSMutableStringClass allocWithZone:
|
||||||
NSDefaultMallocZone()] initWithCString: byteString length: length]);
|
NSDefaultMallocZone()] initWithCString: byteString length: length]);
|
||||||
|
@ -3541,14 +3543,14 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Designated initialiser
|
// Designated initialiser
|
||||||
- (id) initWithCapacity: (unsigned)capacity
|
- (id) initWithCapacity: (unsigned int)capacity
|
||||||
{
|
{
|
||||||
[self subclassResponsibility: _cmd];
|
[self subclassResponsibility: _cmd];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCharactersNoCopy: (unichar*)chars
|
- (id) initWithCharactersNoCopy: (unichar*)chars
|
||||||
length: (unsigned)length
|
length: (unsigned int)length
|
||||||
freeWhenDone: (BOOL)flag
|
freeWhenDone: (BOOL)flag
|
||||||
{
|
{
|
||||||
if ((self = [self initWithCapacity: length]) != nil && length > 0)
|
if ((self = [self initWithCapacity: length]) != nil && length > 0)
|
||||||
|
@ -3566,7 +3568,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCStringNoCopy: (char*)chars
|
- (id) initWithCStringNoCopy: (char*)chars
|
||||||
length: (unsigned)length
|
length: (unsigned int)length
|
||||||
freeWhenDone: (BOOL)flag
|
freeWhenDone: (BOOL)flag
|
||||||
{
|
{
|
||||||
if ((self = [self initWithCapacity: length]) != nil && length > 0)
|
if ((self = [self initWithCapacity: length]) != nil && length > 0)
|
||||||
|
@ -3618,7 +3620,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
[self replaceCharactersInRange: range withString: nil];
|
[self replaceCharactersInRange: range withString: nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) insertString: (NSString*)aString atIndex: (unsigned)loc
|
- (void) insertString: (NSString*)aString atIndex: (unsigned int)loc
|
||||||
{
|
{
|
||||||
NSRange range = {loc, 0};
|
NSRange range = {loc, 0};
|
||||||
[self replaceCharactersInRange: range withString: aString];
|
[self replaceCharactersInRange: range withString: aString];
|
||||||
|
@ -3649,7 +3651,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
{
|
{
|
||||||
unsigned location = 0;
|
unsigned location = 0;
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
||||||
while (location < length && isspace((*caiImp)(self, caiSel, location)))
|
while (location < length && isspace((*caiImp)(self, caiSel, location)))
|
||||||
|
@ -3671,7 +3673,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
{
|
{
|
||||||
unsigned location = length;
|
unsigned location = length;
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
||||||
while (location > 0)
|
while (location > 0)
|
||||||
|
@ -3697,7 +3699,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
{
|
{
|
||||||
unsigned start = 0;
|
unsigned start = 0;
|
||||||
unsigned end = length;
|
unsigned end = length;
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
||||||
while (start < length && isspace((*caiImp)(self, caiSel, start)))
|
while (start < length && isspace((*caiImp)(self, caiSel, start)))
|
||||||
|
@ -3733,7 +3735,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
{
|
{
|
||||||
unsigned location = 0;
|
unsigned location = 0;
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
||||||
while (location < length && isspace((*caiImp)(self, caiSel, location)))
|
while (location < length && isspace((*caiImp)(self, caiSel, location)))
|
||||||
|
@ -3754,7 +3756,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
{
|
{
|
||||||
unsigned location = length;
|
unsigned location = length;
|
||||||
unichar (*caiImp)(NSString*, SEL, unsigned);
|
unichar (*caiImp)(NSString*, SEL, unsigned int);
|
||||||
|
|
||||||
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
caiImp = (unichar (*)())[self methodForSelector: caiSel];
|
||||||
while (location > 0)
|
while (location > 0)
|
||||||
|
@ -4648,7 +4650,7 @@ setupPl()
|
||||||
#endif
|
#endif
|
||||||
plAlloc = (id (*)(id, SEL, NSZone*))
|
plAlloc = (id (*)(id, SEL, NSZone*))
|
||||||
[NSStringClass methodForSelector: @selector(allocWithZone:)];
|
[NSStringClass methodForSelector: @selector(allocWithZone:)];
|
||||||
plInit = (id (*)(id, SEL, unichar*, unsigned))
|
plInit = (id (*)(id, SEL, unichar*, unsigned int))
|
||||||
[NSStringClass instanceMethodForSelector: plSel];
|
[NSStringClass instanceMethodForSelector: plSel];
|
||||||
|
|
||||||
plArray = [GSMutableArray class];
|
plArray = [GSMutableArray class];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue