mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-10 08:10:49 +00:00
plutil: make it build
This commit is contained in:
parent
8b46d8d042
commit
ce4b65a26d
2 changed files with 4 additions and 22 deletions
|
@ -31,23 +31,6 @@
|
||||||
static IMP originalRead = 0;
|
static IMP originalRead = 0;
|
||||||
static IMP originalWrite = 0;
|
static IMP originalWrite = 0;
|
||||||
|
|
||||||
// The whole PAppend and indent table thing again. Later?
|
|
||||||
static void
|
|
||||||
OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
|
||||||
NSPropertyListFormat x, NSMutableData *dest)
|
|
||||||
{
|
|
||||||
// Generate declaration w/ type
|
|
||||||
if (lev == 0)
|
|
||||||
;
|
|
||||||
|
|
||||||
// Main loop
|
|
||||||
|
|
||||||
// Add semicolon
|
|
||||||
if (lev == 0 && x == NSPropertyListObjectiveCFormat)
|
|
||||||
[dest appendBytes:";" length:1];
|
|
||||||
[dest appendBytes:"\n" length:1];
|
|
||||||
}
|
|
||||||
|
|
||||||
@implementation NSPropertyListSerialization (PLUtilAdditions)
|
@implementation NSPropertyListSerialization (PLUtilAdditions)
|
||||||
+ (NSData *)_pdataFromPropertyList:(id)aPropertyList
|
+ (NSData *)_pdataFromPropertyList:(id)aPropertyList
|
||||||
format:(NSPropertyListFormat)aFormat
|
format:(NSPropertyListFormat)aFormat
|
||||||
|
@ -71,9 +54,8 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
||||||
return dest;
|
return dest;
|
||||||
case NSPropertyListObjectiveCFormat:
|
case NSPropertyListObjectiveCFormat:
|
||||||
case NSPropertyListSwiftFormat:
|
case NSPropertyListSwiftFormat:
|
||||||
dest = [NSMutableData dataWithCapacity:1024];
|
*anErrorString = @"Not implemented";
|
||||||
OAppend(aPropertyList, loc, 0, 2, aFormat, dest);
|
return nil;
|
||||||
return dest;
|
|
||||||
default:
|
default:
|
||||||
return (*originalWrite)(self, _cmd, aPropertyList, aFormat, anErrorString);
|
return (*originalWrite)(self, _cmd, aPropertyList, aFormat, anErrorString);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#import "Foundation/NSString.h"
|
#import "Foundation/NSString.h"
|
||||||
#import "Foundation/NSUserDefaults.h"
|
#import "Foundation/NSUserDefaults.h"
|
||||||
#import "Foundation/NSValue.h"
|
#import "Foundation/NSValue.h"
|
||||||
#import "NSPropertyList+PLutil.h"
|
#import "NSPropertyList+PLUtil.h"
|
||||||
|
|
||||||
// From NSPropertyList.m
|
// From NSPropertyList.m
|
||||||
extern void
|
extern void
|
||||||
|
@ -325,7 +325,7 @@ dumpToFile(id obj, NSPropertyListFormat fmt, NSString *outfile)
|
||||||
format:fmt
|
format:fmt
|
||||||
options:0
|
options:0
|
||||||
errorDescription:&errorString];
|
errorDescription:&errorString];
|
||||||
if (anError)
|
if (errorString)
|
||||||
{
|
{
|
||||||
GSPrintf(stderr, @"Dumping %@ as format %@ - %@\n", obj, fmt,
|
GSPrintf(stderr, @"Dumping %@ as format %@ - %@\n", obj, fmt,
|
||||||
errorString);
|
errorString);
|
||||||
|
|
Loading…
Reference in a new issue