mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-23 19:51:13 +00:00
o inherit from NSMutableString
o added primitives git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18350 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
dbd77afec1
commit
305bb7fce6
2 changed files with 37 additions and 12 deletions
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWDynamicURLString : NSObject <NSCoding,NSCopying/*,NSMutableString*/>
|
@interface GSWDynamicURLString : NSMutableString <NSCoding,NSCopying/*,NSMutableString*/>
|
||||||
{
|
{
|
||||||
NSMutableString* _url;
|
NSMutableString* _url;
|
||||||
NSString* _protocol;//NDFN
|
NSString* _protocol;//NDFN
|
||||||
|
|
|
@ -57,7 +57,7 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
//We are a primitive ! if ((self=[super init]))
|
||||||
{
|
{
|
||||||
_url=[[NSMutableString alloc]initWithCharactersNoCopy:chars
|
_url=[[NSMutableString alloc]initWithCharactersNoCopy:chars
|
||||||
length:length
|
length:length
|
||||||
|
@ -76,7 +76,7 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
//We are a primitive ! if ((self=[super init]))
|
||||||
{
|
{
|
||||||
_url=[[NSMutableString alloc]initWithCharacters:chars
|
_url=[[NSMutableString alloc]initWithCharacters:chars
|
||||||
length:length];
|
length:length];
|
||||||
|
@ -94,7 +94,7 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
//We are a primitive ! if ((self=[super init]))
|
||||||
{
|
{
|
||||||
_url=[[NSMutableString alloc]initWithCStringNoCopy:byteString
|
_url=[[NSMutableString alloc]initWithCStringNoCopy:byteString
|
||||||
length:length
|
length:length
|
||||||
|
@ -112,7 +112,7 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
//We are a primitive ! if ((self=[super init]))
|
||||||
{
|
{
|
||||||
_url=[[NSMutableString alloc]initWithCString:byteString
|
_url=[[NSMutableString alloc]initWithCString:byteString
|
||||||
length:length];
|
length:length];
|
||||||
|
@ -132,7 +132,7 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
//We are a primitive ! if ((self=[super init]))
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"low",@"byteString=%s",byteString);
|
NSDebugMLLog(@"low",@"byteString=%s",byteString);
|
||||||
_url=[[NSMutableString alloc]initWithCString:byteString];
|
_url=[[NSMutableString alloc]initWithCString:byteString];
|
||||||
|
@ -150,7 +150,7 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
//We are a primitive ! if ((self=[super init]))
|
||||||
{
|
{
|
||||||
_url=[[NSMutableString alloc]initWithString:string];
|
_url=[[NSMutableString alloc]initWithString:string];
|
||||||
if (string)
|
if (string)
|
||||||
|
@ -165,7 +165,7 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
//We are a primitive ! if ((self=[super init]))
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap,format);
|
va_start(ap,format);
|
||||||
|
@ -184,7 +184,7 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
//We are a primitive ! if ((self=[super init]))
|
||||||
{
|
{
|
||||||
_url=[[NSMutableString alloc]initWithFormat:format
|
_url=[[NSMutableString alloc]initWithFormat:format
|
||||||
arguments:argList];
|
arguments:argList];
|
||||||
|
@ -200,7 +200,7 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
//We are a primitive ! if ((self=[super init]))
|
||||||
{
|
{
|
||||||
_url=[[NSMutableString alloc]initWithData:data
|
_url=[[NSMutableString alloc]initWithData:data
|
||||||
encoding:encoding];
|
encoding:encoding];
|
||||||
|
@ -216,7 +216,7 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
//We are a primitive ! if ((self=[super init]))
|
||||||
{
|
{
|
||||||
_url=[[NSMutableString alloc]initWithContentsOfFile:path];
|
_url=[[NSMutableString alloc]initWithContentsOfFile:path];
|
||||||
[self _parse];
|
[self _parse];
|
||||||
|
@ -241,7 +241,7 @@ RCS_ID("$Id$")
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithCoder:(NSCoder*)coder
|
-(id)initWithCoder:(NSCoder*)coder
|
||||||
{
|
{
|
||||||
if ((self = [self init]))
|
//We are a primitive ! if ((self = [self init]))
|
||||||
{
|
{
|
||||||
[coder decodeValueOfObjCType:@encode(id)
|
[coder decodeValueOfObjCType:@encode(id)
|
||||||
at:&_url];
|
at:&_url];
|
||||||
|
@ -258,6 +258,31 @@ RCS_ID("$Id$")
|
||||||
[coder encodeObject:_url];
|
[coder encodeObject:_url];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
- (unsigned) length
|
||||||
|
{
|
||||||
|
[self _compose];
|
||||||
|
return [_url length];
|
||||||
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
- (unichar) characterAtIndex: (unsigned)index
|
||||||
|
{
|
||||||
|
[self _compose];
|
||||||
|
return [_url characterAtIndex:index];
|
||||||
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
- (void) replaceCharactersInRange: (NSRange)range
|
||||||
|
withString: (NSString*)aString
|
||||||
|
{
|
||||||
|
LOGObjectFnStart();
|
||||||
|
[self _compose];
|
||||||
|
[_url replaceCharactersInRange:range
|
||||||
|
withString:aString];
|
||||||
|
LOGObjectFnStop();
|
||||||
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)copyWithZone:(NSZone*)zone
|
-(id)copyWithZone:(NSZone*)zone
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue