Implements keyed archiving of object graphs (e.g. for storing data). More...
#import <CPKeyedArchiver.h>
Class Methods | |
(BOOL) | + allowsKeyedCoding |
(CPData) | + archivedDataWithRootObject: |
(CPString) | + classNameForClass: |
(void) | + initialize |
(void) | + setClassName:forClass: |
Class Methods inherited from CPObject | |
(BOOL) | + accessInstanceVariablesDirectly |
(id) | + alloc |
(id) | + allocWithCoder: |
(BOOL) | + automaticallyNotifiesObserversForKey: |
(void) | + cancelPreviousPerformRequestsWithTarget: |
(void) | + cancelPreviousPerformRequestsWithTarget:selector:object: |
(Class) | + class |
(BOOL) | + conformsToProtocol: |
(void) | + exposeBinding: |
(IMP) | + instanceMethodForSelector: |
(BOOL) | + instancesImplementSelector: |
(BOOL) | + instancesRespondToSelector: |
(BOOL) | + isBindingExclusive: |
(BOOL) | + isSubclassOfClass: |
(CPSet) | + keyPathsForValuesAffectingValueForKey: |
(void) | + load |
(id) | + new |
(void) | + object:performSelector:withObject:afterDelay:inModes: |
(void) | + setVersion: |
(Class) | + superclass |
(int) | + version |
Implements keyed archiving of object graphs (e.g. for storing data).
Implements keyed archiving of object graphs. Archiving means to write data out in a format that be read in again later, or possibly stored in a file. To read the data back in, use a CPKeyedUnarchiver
.
-(void)archiverWillFinish:(CPKeyedArchiver)archiver; Called when the encoding is about to finish.
archiver | the archiver that's about to finish |
-(void)archiver:(CPKeyedArchiver)archiver didEncodeObject:(id)object; Called when an object is encoded into the archiver.
archiver | the archiver that encoded the object |
object | the object that was encoded |
-(void)archiverDidFinish:(CPKeyedArchiver)archiver; Called when the archiver finishes encoding.
archiver | the archiver that finished encoding |
-(id)archiver:(CPKeyedArchiver)archiver willEncodeObject:(id)object; Called when an object is about to be encoded. Allows the delegate to replace the object that gets encoded with a substitute or nil
.
archiver | the archiver encoding the object |
object | the candidate object for encoding |
-(void)archiver:(CPKeyedArchiver)archiver willReplaceObject:(id)object withObject:(id)newObject; Called when an object is being replaced in the archiver.
archiver | the archiver encoding the object |
object | the object to be replaced |
newObject | the replacement object |
Definition at line 2 of file CPKeyedArchiver.h.
|
implementation |
Returns a flag indicating whether the receiver supports keyed coding. The default implementation returns NO
. Subclasses supporting keyed coding must override this to return YES
.
Reimplemented from CPCoder.
Definition at line 130 of file CPKeyedArchiver.j.
|
implementation |
Archives the specified object.
anObject | the object to archive |
Definition at line 140 of file CPKeyedArchiver.j.
|
implementation |
Returns the name of the substitute class used for encoding aClass
by all keyed archivers.
aClass | the class to substitute |
nil
if there is no substitute classReturns the name of the substitute class used for encoding aClass
by this keyed archiver.
aClass | the class to substitute |
nil
if there is no substitute class Definition at line 419 of file CPKeyedArchiver.j.
|
implementation |
Returns the keyed archiver's delegate
Definition at line 305 of file CPKeyedArchiver.j.
|
implementation |
Encodes a BOOL
value
aBool | the BOOL value |
aKey | the key to associate with the BOOL |
Definition at line 242 of file CPKeyedArchiver.j.
|
implementation |
Encodes an conditionally. The method checks if the object has already been coded into this data stream before. If so, it will only encode a reference to that first object to save memory.
anObject | the object to to conditionally encode |
aKey | the key to associate with the object |
Definition at line 347 of file CPKeyedArchiver.j.
|
implementation |
Encodes a double
value
aDouble | the double value |
aKey | the key to associate with the double |
Definition at line 252 of file CPKeyedArchiver.j.
|
implementation |
Encodes a float
value
aFloat | the float value |
aKey | the key to associate with the float |
Definition at line 262 of file CPKeyedArchiver.j.
|
implementation |
Encodes a int
value
anInt | the int value |
aKey | the key to associate with the int |
Definition at line 272 of file CPKeyedArchiver.j.
Encodes a number
aNumber | the number to encode |
aKey | the key to associate with the object |
Definition at line 357 of file CPKeyedArchiver.j.
|
implementation |
Encodes an object
anObject | the object to encode |
aKey | the key to associate with the object |
Definition at line 367 of file CPKeyedArchiver.j.
|
implementation |
Encodes a CGPoint
aPoint | the point to encode |
aKey | the key to associate with the point |
Definition at line 315 of file CPKeyedArchiver.j.
|
implementation |
Encodes a CGRect
aRect | the rectangle to encode |
aKey | the key to associate with the rectangle |
Definition at line 325 of file CPKeyedArchiver.j.
|
implementation |
Encodes a CGSize
aSize | the size to encode |
aKey | the key to associate with the size |
Definition at line 335 of file CPKeyedArchiver.j.
|
implementation |
Finishes up writing any left over data, and notifies delegates. After calling this method, the archiver can not encode anymore objects.
Definition at line 184 of file CPKeyedArchiver.j.
|
implementation |
Initializes the keyed archiver with the specified CPMutableData
for writing.
data | the object to archive to |
Definition at line 157 of file CPKeyedArchiver.j.
|
implementation |
Reimplemented from CPObject.
Definition at line 119 of file CPKeyedArchiver.j.
|
implementation |
Returns the property list format used to archive objects.
Definition at line 223 of file CPKeyedArchiver.j.
|
implementation |
Allows substitution of class types for encoding. Specifically classes of type aClass
encountered by all keyed archivers will instead be archived as a class of type aClassName
.
aClassName | the substitute class name |
aClass | the class to substitute |
Allows substitution of class types for encoding. Specifically classes of type aClass
encountered by this keyed archiver will instead be archived as a class of type aClassName
.
aClassName | the substitute class name |
aClass | the class to substitute |
Definition at line 404 of file CPKeyedArchiver.j.
|
implementation |
Sets the keyed archiver's delegate
Definition at line 281 of file CPKeyedArchiver.j.
|
implementation |
Sets the property list format the archiver should use to archive objects.
aPropertyListFormat | the format to use |
Definition at line 232 of file CPKeyedArchiver.j.