Property list output fixups.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10851 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2001-09-08 05:11:58 +00:00
parent 6580f6f86d
commit 898452270d
6 changed files with 62 additions and 60 deletions

View file

@ -1,3 +1,12 @@
2001-09-08 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSCompatibility.m: GSXMLPlMake() unused argument removed.
* Source/NSData.m: Unused and commented out XML plist code removed.
* Source/NSString.m: ditto
* Source/NSArray.m: Generate XML plists only when writing to file,
not for the -description... methods. This is what MacOS-X does.
* Source/NSDictionary.m: ditto
2001-09-05 Adam Fedor <fedor@gnu.org>
* configure.in: Define BROKEN_NESTED_FUNCTIONS if compiler sucks.

View file

@ -495,7 +495,7 @@ XMLPlObject(NSMutableString *dest, id obj, NSDictionary *loc, unsigned lev)
}
NSString*
GSXMLPlMake(id obj, NSDictionary *loc, unsigned lev)
GSXMLPlMake(id obj, NSDictionary *loc)
{
NSMutableString *dest;

View file

@ -728,25 +728,14 @@ static int compare(id elem1, id elem2, void* context)
- (NSString*) descriptionWithLocale: (NSDictionary*)locale
indent: (unsigned int)level
{
extern BOOL GSMacOSXCompatiblePropertyLists();
NSMutableString *result;
if (GSMacOSXCompatiblePropertyLists() == YES)
{
extern NSString *GSXMLPlMake(id obj, NSDictionary *loc, unsigned lev);
return GSXMLPlMake(self, locale, level);
}
else
{
NSMutableString *result;
result = [[NSMutableString alloc] initWithCapacity: 20*[self count]];
result = AUTORELEASE(result);
[self descriptionWithLocale: locale
indent: level
to: (id<GNUDescriptionDestination>)result];
return result;
}
result = [[NSMutableString alloc] initWithCapacity: 20*[self count]];
result = AUTORELEASE(result);
[self descriptionWithLocale: locale
indent: level
to: (id<GNUDescriptionDestination>)result];
return result;
}
static NSString *indentStrings[] = {
@ -841,11 +830,29 @@ static NSString *indentStrings[] = {
- (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile
{
extern BOOL GSMacOSXCompatiblePropertyLists();
NSDictionary *loc;
NSString *desc;
loc = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
desc = [self descriptionWithLocale: loc indent: 0];
if (GSMacOSXCompatiblePropertyLists() == YES)
{
extern NSString *GSXMLPlMake(id obj, NSDictionary *loc);
desc = GSXMLPlMake(self, loc);
}
else
{
NSMutableString *result;
result = [[NSMutableString alloc] initWithCapacity: 20*[self count]];
result = AUTORELEASE(result);
[self descriptionWithLocale: loc
indent: 0
to: (id<GNUDescriptionDestination>)result];
desc = result;
}
return [desc writeToFile: path atomically: useAuxiliaryFile];
}

View file

@ -571,15 +571,6 @@ failure:
NSZone *z;
extern BOOL GSMacOSXCompatiblePropertyLists();
/* Don't think we want this
if (GSMacOSXCompatiblePropertyLists() == YES)
{
extern NSString *GSXMLPlMake(id obj, NSDictionary *loc, unsigned lev);
return GSXMLPlMake(self, nil, 0);
}
*/
src = [self bytes];
length = [self length];
z = [self zone];

View file

@ -622,11 +622,29 @@ compareIt(id o1, id o2, void* context)
- (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile
{
extern BOOL GSMacOSXCompatiblePropertyLists();
NSDictionary *loc;
NSString *desc;
loc = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
desc = [self descriptionWithLocale: loc indent: 0];
if (GSMacOSXCompatiblePropertyLists() == YES)
{
extern NSString *GSXMLPlMake(id obj, NSDictionary *loc);
desc = GSXMLPlMake(self, loc);
}
else
{
NSMutableString *result;
result = AUTORELEASE([[NSMutableString alloc] initWithCapacity:
20*[self count]]);
[self descriptionWithLocale: loc
indent: 0
to: (id<GNUDescriptionDestination>)result];
desc = result;
}
return [desc writeToFile: path atomically: useAuxiliaryFile];
}
@ -686,25 +704,14 @@ compareIt(id o1, id o2, void* context)
- (NSString*) descriptionWithLocale: (NSDictionary*)locale
indent: (unsigned int)level
{
extern BOOL GSMacOSXCompatiblePropertyLists();
NSMutableString *result;
if (GSMacOSXCompatiblePropertyLists() == YES)
{
extern NSString *GSXMLPlMake(id obj, NSDictionary *loc, unsigned lev);
return GSXMLPlMake(self, locale, level);
}
else
{
NSMutableString *result;
result = AUTORELEASE([[NSMutableString alloc] initWithCapacity:
20*[self count]]);
[self descriptionWithLocale: locale
indent: level
to: (id<GNUDescriptionDestination>)result];
return result;
}
result = AUTORELEASE([[NSMutableString alloc] initWithCapacity:
20*[self count]]);
[self descriptionWithLocale: locale
indent: level
to: (id<GNUDescriptionDestination>)result];
return result;
}
static NSString *indentStrings[] = {

View file

@ -3172,18 +3172,6 @@ handle_printf_atsign (FILE *stream,
to: (id<GNUDescriptionDestination>)output
{
unsigned length;
/*
* Don't think the following should be there.
extern BOOL GSMacOSXCompatiblePropertyLists();
if (GSMacOSXCompatiblePropertyLists() == YES)
{
extern NSString *GSXMLPlMake(id obj, NSDictionary *loc, unsigned lev);
[output appendString: GSXMLPlMake(self, aLocale, level)];
return;
}
*/
if ((length = [self length]) == 0)
{