Update of /cvsroot/foo/foo/libfoo/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19397/src
Modified Files:
FOOContext.m
Log Message:
added switch for archiving in binary/xml format
Index: FOOContext.m
===================================================================
RCS file: /cvsroot/foo/foo/libfoo/src/FOOContext.m,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** FOOContext.m 14 Aug 2004 06:12:34 -0000 1.5
--- FOOContext.m 15 Aug 2004 20:30:16 -0000 1.6
***************
*** 35,38 ****
--- 35,42 ----
/* $Id$ */
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+
#include <signal.h>
***************
*** 113,116 ****
--- 117,126 ----
- (BOOL) archiveToFile: (NSString *)path
{
+ return [self archiveToFile: path xmlFormat: NO];
+ }
+
+
+ - (BOOL) archiveToFile: (NSString *)path xmlFormat: (BOOL)xml
+ {
NSMutableData *data;
NSKeyedArchiver *archiver;
***************
*** 119,124 ****
data = [NSMutableData data];
archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData: data];
! // use XML format
! [archiver setOutputFormat: NSPropertyListXMLFormat_v1_0];
[archiver encodeObject: self forKey: @"FOOContext"];
[archiver finishEncoding];
--- 129,148 ----
data = [NSMutableData data];
archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData: data];
!
! if (xml == YES)
! {
! [archiver setOutputFormat: NSPropertyListXMLFormat_v1_0];
! }
! else
! {
! #ifdef FOO_GNUSTEP
! [archiver setOutputFormat: NSPropertyListGNUstepBinaryFormat];
! #elif FOO_COCOA
! [archiver setOutputFormat: NSPropertyListBinaryFormat_v1_0];
! #else
! #error Neither GNUSTEP nor COCOA Foundation present.
! #endif
! }
!
[archiver encodeObject: self forKey: @"FOOContext"];
[archiver finishEncoding];
|