Up

EOKeyValueArchiver Class

Authors

Manuel Guesdon (mguesdon@orange-concept.com)

Version: 25994

Date: 2008-01-22 14:57:07 +0100 (Die, 22 Jän 2008)

EOKeyValueArchiver object is used to archive a tree of objects into a key/value propertyList. EOKeyValueUnarchiver object is used to unarchive from a propertyList a tree of objects archived with a EOKeyValueArchiver. Example: // Archiving: EOKeyValueArchiver* archive=AUTORELEASE([EOKeyValueArchiver new]); [archive setDelegate:MyArchivingDelegate]; [archiver encodeObject:anObject forKey:@"anObjectKey"]; [archiver encodeInt:125 forKey:@"aKey"];... NSDictionary* archivePropertyList=[archiver dictionary]; // Now unarchive archivePropertyList EOKeyValueUnarchiver* unarchiver=AUTORELEASE([[EOKeyValueUnarchiver alloc]initWith:archivePropertyList]); [archive setDelegate:MyUnarchivingDelegate]; id anObject=[unarchiver decodeObjectForKey:@"anObjectKey"]; int anInt=[unarchiver decodeIntForKey:@"anKey"]; [unarchiver finishInitializationOfObjects]; [unarchiver awakeObjects]

Copyright: (C) 2000-2002,2003,2004,2005 Free Software Foundation, Inc.


Contents -

  1. Software documentation for the EOKeyValueArchiver class
  2. Software documentation for the EOKeyValueUnarchiver class
  3. Software documentation for the NSObject(EOKeyValueArchiverDelegation) category
  4. Software documentation for the NSObject(EOKeyValueArchivingAwakeMethods) category
  5. Software documentation for the NSObject(EOKeyValueUnarchiverDelegation) category
  6. Software documentation for the EOKeyValueArchiving protocol

Software documentation for the EOKeyValueArchiver class

EOKeyValueArchiver : NSObject

Declared in:
EOControl/EOKeyValueArchiver.h
Description forthcoming.

Instance Variables

Method summary

delegate 

- (id) delegate;
Returns receiver's delegate

dictionary 

- (NSDictionary*) dictionary;
Returns archived object/tree as propertList

encodeBool: forKey: 

- (void) encodeBool: (BOOL)yn forKey: (NSString*)key;
Archives boolean 'yn' as 'key'

encodeInt: forKey: 

- (void) encodeInt: (int)intValue forKey: (NSString*)key;
Archives integer 'intValue' as 'key'

encodeObject: forKey: 

- (void) encodeObject: (id)object forKey: (NSString*)key;
Archives the object 'object' as 'key'. 'object' should be a NSString, a NSData, NSArray or NSDictionary or conforms to EOKeyValueArchiving protocol. Raise an exception otherwise.

encodeReferenceToObject: forKey: 

- (void) encodeReferenceToObject: (id)object forKey: (NSString*)key;
Archives the object 'object' reference as 'key' The receiver gets the reference object by calling its delegate method -archiver:referenceToEncodeForObject:

setDelegate: 

- (void) setDelegate: (id)delegate;
Set receiver's delegate



Instance Variables for EOKeyValueArchiver Class

_delegate

@protected id _delegate;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

_propertyList

@protected NSMutableDictionary* _propertyList;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.




Software documentation for the EOKeyValueUnarchiver class

EOKeyValueUnarchiver : NSObject

Declared in:
EOControl/EOKeyValueArchiver.h
Description forthcoming.

Instance Variables

Method summary

_dictionaryForPropertyList: 

- (id) _dictionaryForPropertyList: (NSDictionary*)propList;
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.

_findTypeForPropertyListDecoding: 

- (id) _findTypeForPropertyListDecoding: (id)obj;
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.

_objectForPropertyList: 

- (id) _objectForPropertyList: (NSDictionary*)propList;
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.

_objectsForPropertyList: 

- (id) _objectsForPropertyList: (NSArray*)propList;
Warning the underscore at the start of the name of this method indicates that it is private, for internal use only, and you should not use the method in your code.

awakeObjects 

- (void) awakeObjects;
Finalize unarchiving by calling awakeFromKeyValueUnarchiver: on all unarchived objects

decodeBoolForKey: 

- (BOOL) decodeBoolForKey: (NSString*)key;
Returns unarchived boolean which was archived as 'key'. NO if no object is found

decodeIntForKey: 

- (int) decodeIntForKey: (NSString*)key;
Returns unarchived integer which was archived as 'key'. 0 if no object is found

decodeObjectForKey: 

- (id) decodeObjectForKey: (NSString*)key;
Returns unarchived object for key. The object should be a NSString, NSData, NSArray or NSDictionary or its class instances should implements -initWithKeyValueUnarchiver:

decodeObjectReferenceForKey: 

- (id) decodeObjectReferenceForKey: (NSString*)key;
Returns unarchived object for the reference archived as 'key'. The receiver gets the object for reference by calling its delegate method -unarchiver:objectForReference:

delegate 

- (id) delegate;
Returns receiver's delegate

ensureObjectAwake: 

- (void) ensureObjectAwake: (id)object;
ensure 'object' is awake (has received -awakeFromKeyValueUnarchiver: message)

finishInitializationOfObjects 

- (void) finishInitializationOfObjects;
Finalize unarchiving by calling finishInitializationWithKeyValueUnarchiver: on all unarchived objects

initWithDictionary: 

- (id) initWithDictionary: (NSDictionary*)dictionary;
Inits unarchiver with propertyList 'dictionary'

isThereValueForKey: 

- (BOOL) isThereValueForKey: (NSString*)key;
Returns YES if there's a value for key 'key'

parent 

- (id) parent;
Returns the parent object for the currently unarchiving object.

setDelegate: 

- (void) setDelegate: (id)delegate;
Set the receiver's delegate



Instance Variables for EOKeyValueUnarchiver Class

_allUnarchivedObjects

@protected NSMutableArray* _allUnarchivedObjects;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

_awakenedObjects

@protected NSHashTable* _awakenedObjects;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

_delegate

@protected id _delegate;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

_nextParent

@protected id _nextParent;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

_parent

@protected id _parent;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

_propertyList

@protected NSDictionary* _propertyList;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.




Software documentation for the NSObject(EOKeyValueArchiverDelegation) category

NSObject(EOKeyValueArchiverDelegation)

Declared in:
EOControl/EOKeyValueArchiver.h
Description forthcoming.
Method summary

archiver: referenceToEncodeForObject: 

- (id) archiver: (EOKeyValueArchiver*)archiver referenceToEncodeForObject: (id)object;
Returns an object to be used as reference for 'archiver' to archive 'object'. Should be overriden by EOKeyValueArchiver's delegates

Software documentation for the NSObject(EOKeyValueArchivingAwakeMethods) category

NSObject(EOKeyValueArchivingAwakeMethods)

Declared in:
EOControl/EOKeyValueArchiver.h
Description forthcoming.
Method summary

awakeFromKeyValueUnarchiver: 

- (void) awakeFromKeyValueUnarchiver: (EOKeyValueUnarchiver*)unarchiver;
Description forthcoming.

finishInitializationWithKeyValueUnarchiver: 

- (void) finishInitializationWithKeyValueUnarchiver: (EOKeyValueUnarchiver*)unarchiver;
Description forthcoming.

Software documentation for the NSObject(EOKeyValueUnarchiverDelegation) category

NSObject(EOKeyValueUnarchiverDelegation)

Declared in:
EOControl/EOKeyValueArchiver.h
Description forthcoming.
Method summary

unarchiver: objectForReference: 

- (id) unarchiver: (EOKeyValueUnarchiver*)archiver objectForReference: (id)keyPath;
Returns an object for archived 'reference'. Implemented by EOKeyValueUnarchiver's delegate.

Software documentation for the EOKeyValueArchiving protocol

EOKeyValueArchiving

Declared in:
EOControl/EOKeyValueArchiver.h
Description forthcoming.
Method summary

encodeWithKeyValueArchiver: 

- (void) encodeWithKeyValueArchiver: (EOKeyValueArchiver*)archiver;
Description forthcoming.

initWithKeyValueUnarchiver: 

- (id) initWithKeyValueUnarchiver: (EOKeyValueUnarchiver*)unarchiver;
Description forthcoming.


Up