mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Improved -description writing/reading. Bug fixes to NSString.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2429 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
21039e770f
commit
b6e22efb49
10 changed files with 139 additions and 44 deletions
|
@ -244,28 +244,14 @@ static Class NSMutableDictionary_concrete_class;
|
|||
|
||||
- (NSString*) description
|
||||
{
|
||||
id desc;
|
||||
id keyenum = [self keyEnumerator];
|
||||
id key;
|
||||
|
||||
desc = [NSMutableString stringWithCapacity: 2];
|
||||
[desc appendString: @"{"];
|
||||
while ((key = [keyenum nextObject]))
|
||||
{
|
||||
/* I wish appendString: returned self*/
|
||||
[desc appendString: [key description]];
|
||||
[desc appendString: @" = "];
|
||||
[desc appendString: [[self objectForKey: key] description]];
|
||||
[desc appendString: @"; "];
|
||||
}
|
||||
[desc appendString: @"}"];
|
||||
return desc;
|
||||
/* This method is overridden by [Dictionary -description] */
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSString*) descriptionWithIndent: (unsigned)level
|
||||
{
|
||||
return [NSString stringWithFormat:@"%*s%s",
|
||||
level, "", [[self description] cStringNoCopy]];
|
||||
/* This method is overridden by [Dictionary -descriptionWithIndent:] */
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSArray*) allKeys
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue