mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
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:
parent
c3c10cf464
commit
ddd9a6e299
6 changed files with 62 additions and 60 deletions
|
@ -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>
|
2001-09-05 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* configure.in: Define BROKEN_NESTED_FUNCTIONS if compiler sucks.
|
* configure.in: Define BROKEN_NESTED_FUNCTIONS if compiler sucks.
|
||||||
|
|
|
@ -495,7 +495,7 @@ XMLPlObject(NSMutableString *dest, id obj, NSDictionary *loc, unsigned lev)
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString*
|
NSString*
|
||||||
GSXMLPlMake(id obj, NSDictionary *loc, unsigned lev)
|
GSXMLPlMake(id obj, NSDictionary *loc)
|
||||||
{
|
{
|
||||||
NSMutableString *dest;
|
NSMutableString *dest;
|
||||||
|
|
||||||
|
|
|
@ -728,25 +728,14 @@ static int compare(id elem1, id elem2, void* context)
|
||||||
- (NSString*) descriptionWithLocale: (NSDictionary*)locale
|
- (NSString*) descriptionWithLocale: (NSDictionary*)locale
|
||||||
indent: (unsigned int)level
|
indent: (unsigned int)level
|
||||||
{
|
{
|
||||||
extern BOOL GSMacOSXCompatiblePropertyLists();
|
NSMutableString *result;
|
||||||
|
|
||||||
if (GSMacOSXCompatiblePropertyLists() == YES)
|
result = [[NSMutableString alloc] initWithCapacity: 20*[self count]];
|
||||||
{
|
result = AUTORELEASE(result);
|
||||||
extern NSString *GSXMLPlMake(id obj, NSDictionary *loc, unsigned lev);
|
[self descriptionWithLocale: locale
|
||||||
|
indent: level
|
||||||
return GSXMLPlMake(self, locale, level);
|
to: (id<GNUDescriptionDestination>)result];
|
||||||
}
|
return result;
|
||||||
else
|
|
||||||
{
|
|
||||||
NSMutableString *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[] = {
|
static NSString *indentStrings[] = {
|
||||||
|
@ -841,11 +830,29 @@ static NSString *indentStrings[] = {
|
||||||
|
|
||||||
- (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile
|
- (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile
|
||||||
{
|
{
|
||||||
|
extern BOOL GSMacOSXCompatiblePropertyLists();
|
||||||
NSDictionary *loc;
|
NSDictionary *loc;
|
||||||
NSString *desc;
|
NSString *desc;
|
||||||
|
|
||||||
loc = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
|
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];
|
return [desc writeToFile: path atomically: useAuxiliaryFile];
|
||||||
}
|
}
|
||||||
|
|
|
@ -571,15 +571,6 @@ failure:
|
||||||
NSZone *z;
|
NSZone *z;
|
||||||
extern BOOL GSMacOSXCompatiblePropertyLists();
|
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];
|
src = [self bytes];
|
||||||
length = [self length];
|
length = [self length];
|
||||||
z = [self zone];
|
z = [self zone];
|
||||||
|
|
|
@ -622,11 +622,29 @@ compareIt(id o1, id o2, void* context)
|
||||||
|
|
||||||
- (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile
|
- (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile
|
||||||
{
|
{
|
||||||
|
extern BOOL GSMacOSXCompatiblePropertyLists();
|
||||||
NSDictionary *loc;
|
NSDictionary *loc;
|
||||||
NSString *desc;
|
NSString *desc;
|
||||||
|
|
||||||
loc = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
|
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];
|
return [desc writeToFile: path atomically: useAuxiliaryFile];
|
||||||
}
|
}
|
||||||
|
@ -686,25 +704,14 @@ compareIt(id o1, id o2, void* context)
|
||||||
- (NSString*) descriptionWithLocale: (NSDictionary*)locale
|
- (NSString*) descriptionWithLocale: (NSDictionary*)locale
|
||||||
indent: (unsigned int)level
|
indent: (unsigned int)level
|
||||||
{
|
{
|
||||||
extern BOOL GSMacOSXCompatiblePropertyLists();
|
NSMutableString *result;
|
||||||
|
|
||||||
if (GSMacOSXCompatiblePropertyLists() == YES)
|
result = AUTORELEASE([[NSMutableString alloc] initWithCapacity:
|
||||||
{
|
20*[self count]]);
|
||||||
extern NSString *GSXMLPlMake(id obj, NSDictionary *loc, unsigned lev);
|
[self descriptionWithLocale: locale
|
||||||
|
indent: level
|
||||||
return GSXMLPlMake(self, locale, level);
|
to: (id<GNUDescriptionDestination>)result];
|
||||||
}
|
return result;
|
||||||
else
|
|
||||||
{
|
|
||||||
NSMutableString *result;
|
|
||||||
|
|
||||||
result = AUTORELEASE([[NSMutableString alloc] initWithCapacity:
|
|
||||||
20*[self count]]);
|
|
||||||
[self descriptionWithLocale: locale
|
|
||||||
indent: level
|
|
||||||
to: (id<GNUDescriptionDestination>)result];
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static NSString *indentStrings[] = {
|
static NSString *indentStrings[] = {
|
||||||
|
|
|
@ -3172,18 +3172,6 @@ handle_printf_atsign (FILE *stream,
|
||||||
to: (id<GNUDescriptionDestination>)output
|
to: (id<GNUDescriptionDestination>)output
|
||||||
{
|
{
|
||||||
unsigned length;
|
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)
|
if ((length = [self length]) == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue