mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-05-08 14:10:39 +00:00
o added primitive -setString
o changes for MOSX compatibility git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18349 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2be86cd8e3
commit
dbd77afec1
1 changed files with 30 additions and 4 deletions
|
@ -49,12 +49,17 @@ RCS_ID("$Id$")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
- (id) initWithCharactersNoCopy: (unichar*)chars
|
- (id) initWithCharactersNoCopy: (unichar*)chars
|
||||||
length: (unsigned)length
|
length: (unsigned)length
|
||||||
freeWhenDone: (BOOL)flag
|
freeWhenDone: (BOOL)flag
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if (!_string)
|
if (_string)
|
||||||
|
_string=[_string initWithCharactersNoCopy:chars
|
||||||
|
length:length
|
||||||
|
freeWhenDone:flag];
|
||||||
|
else
|
||||||
_string=[[NSMutableString alloc] initWithCharactersNoCopy:chars
|
_string=[[NSMutableString alloc] initWithCharactersNoCopy:chars
|
||||||
length:length
|
length:length
|
||||||
freeWhenDone:flag];
|
freeWhenDone:flag];
|
||||||
|
@ -62,12 +67,17 @@ RCS_ID("$Id$")
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
- (id) initWithCStringNoCopy: (char*)byteString
|
- (id) initWithCStringNoCopy: (char*)byteString
|
||||||
length: (unsigned)length
|
length: (unsigned)length
|
||||||
freeWhenDone: (BOOL)flag
|
freeWhenDone: (BOOL)flag
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if (!_string)
|
if (_string)
|
||||||
|
_string=[_string initWithCStringNoCopy:byteString
|
||||||
|
length:length
|
||||||
|
freeWhenDone:flag];
|
||||||
|
else
|
||||||
_string=[[NSMutableString alloc] initWithCStringNoCopy:byteString
|
_string=[[NSMutableString alloc] initWithCStringNoCopy:byteString
|
||||||
length:length
|
length:length
|
||||||
freeWhenDone:flag];
|
freeWhenDone:flag];
|
||||||
|
@ -75,26 +85,32 @@ RCS_ID("$Id$")
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
- (id) initWithCapacity: (unsigned)capacity
|
- (id) initWithCapacity: (unsigned)capacity
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if (!_string)
|
if (_string)
|
||||||
|
_string=[_string initWithCapacity:capacity];
|
||||||
|
else
|
||||||
_string=[[NSMutableString alloc] initWithCapacity:capacity];
|
_string=[[NSMutableString alloc] initWithCapacity:capacity];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
- (unsigned) length
|
- (unsigned) length
|
||||||
{
|
{
|
||||||
return [_string length];
|
return [_string length];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
- (unichar) characterAtIndex: (unsigned)index
|
- (unichar) characterAtIndex: (unsigned)index
|
||||||
{
|
{
|
||||||
NSAssert(_string,@"No String");
|
NSAssert(_string,@"No String");
|
||||||
return [_string characterAtIndex:index];
|
return [_string characterAtIndex:index];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
- (void) replaceCharactersInRange: (NSRange)range
|
- (void) replaceCharactersInRange: (NSRange)range
|
||||||
withString: (NSString*)aString
|
withString: (NSString*)aString
|
||||||
{
|
{
|
||||||
|
@ -105,11 +121,13 @@ RCS_ID("$Id$")
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
-(BOOL)canBeConvertedToEncoding:(NSStringEncoding)encoding
|
-(BOOL)canBeConvertedToEncoding:(NSStringEncoding)encoding
|
||||||
{
|
{
|
||||||
return [_string canBeConvertedToEncoding:encoding];
|
return [_string canBeConvertedToEncoding:encoding];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
-(void)dealloc
|
-(void)dealloc
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
@ -122,6 +140,7 @@ RCS_ID("$Id$")
|
||||||
GSWLogMemC("GSWElementIDString end of dealloc");
|
GSWLogMemC("GSWElementIDString end of dealloc");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
-(void)getCString:(char*)buffer
|
-(void)getCString:(char*)buffer
|
||||||
maxLength:(unsigned int)maxLength
|
maxLength:(unsigned int)maxLength
|
||||||
range:(NSRange)aRange
|
range:(NSRange)aRange
|
||||||
|
@ -134,6 +153,7 @@ RCS_ID("$Id$")
|
||||||
remainingRange:leftoverRange];
|
remainingRange:leftoverRange];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
-(void)getCString:(char*)buffer
|
-(void)getCString:(char*)buffer
|
||||||
maxLength:(unsigned int)maxLength;
|
maxLength:(unsigned int)maxLength;
|
||||||
{
|
{
|
||||||
|
@ -142,12 +162,14 @@ RCS_ID("$Id$")
|
||||||
maxLength:maxLength];
|
maxLength:maxLength];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
-(void)getCString:(char *)buffer;
|
-(void)getCString:(char *)buffer;
|
||||||
{
|
{
|
||||||
NSAssert(_string,@"No String");
|
NSAssert(_string,@"No String");
|
||||||
return [_string getCString:buffer];
|
return [_string getCString:buffer];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithCoder:(NSCoder*)decoder
|
-(id)initWithCoder:(NSCoder*)decoder
|
||||||
{
|
{
|
||||||
DESTROY(_string);
|
DESTROY(_string);
|
||||||
|
@ -157,6 +179,7 @@ RCS_ID("$Id$")
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
-(void)encodeWithCoder:(NSCoder*)encoder
|
-(void)encodeWithCoder:(NSCoder*)encoder
|
||||||
{
|
{
|
||||||
NSAssert(_string,@"No String");
|
NSAssert(_string,@"No String");
|
||||||
|
@ -164,17 +187,18 @@ RCS_ID("$Id$")
|
||||||
at:&_string];
|
at:&_string];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
-(const char*)cString
|
-(const char*)cString
|
||||||
{
|
{
|
||||||
return [_string cString];
|
return [_string cString];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
-(unsigned int)cStringLength
|
-(unsigned int)cStringLength
|
||||||
{
|
{
|
||||||
return [_string cStringLength];
|
return [_string cStringLength];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)copyWithZone:(NSZone*)zone
|
-(id)copyWithZone:(NSZone*)zone
|
||||||
{
|
{
|
||||||
|
@ -188,6 +212,7 @@ RCS_ID("$Id$")
|
||||||
return obj;
|
return obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
-(BOOL)isSearchOverForSenderID:(NSString*)senderID
|
-(BOOL)isSearchOverForSenderID:(NSString*)senderID
|
||||||
{
|
{
|
||||||
BOOL over=NO;
|
BOOL over=NO;
|
||||||
|
@ -381,6 +406,7 @@ RCS_ID("$Id$")
|
||||||
[_id deleteLastElementIDComponent];
|
[_id deleteLastElementIDComponent];
|
||||||
return _id;
|
return _id;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
#ifndef NDEBBUG
|
#ifndef NDEBBUG
|
||||||
-(int)elementsNb
|
-(int)elementsNb
|
||||||
|
|
Loading…
Reference in a new issue