API  1.0.0
CPKeyedArchiver Class Reference

Implements keyed archiving of object graphs (e.g. for storing data). More...

#import <CPKeyedArchiver.h>

+ Inheritance diagram for CPKeyedArchiver:

Instance Methods

(id) - delegate
 
(void) - encodeBool:forKey:
 
(void) - encodeConditionalObject:forKey:
 
(void) - encodeDouble:forKey:
 
(void) - encodeFloat:forKey:
 
(void) - encodeInt:forKey:
 
(void) - encodeNumber:forKey:
 
(void) - encodeObject:forKey:
 
(void) - encodePoint:forKey:
 
(void) - encodeRect:forKey:
 
(void) - encodeSize:forKey:
 
(void) - finishEncoding
 
(id) - initForWritingWithMutableData:
 
(CPPropertyListFormat) - outputFormat
 
(void) - setDelegate:
 
(void) - setOutputFormat:
 
- Instance Methods inherited from CPCoder
(void) - encodeBycopyObject:
 
(void) - encodeConditionalObject:
 
(void) - encodeDataObject:
 
(void) - encodeObject:
 
(void) - encodePoint:
 
(void) - encodePropertyList:
 
(void) - encodeRect:
 
(void) - encodeRootObject:
 
(void) - encodeSize:
 
(void) - encodeValueOfObjJType:at:
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray) - exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(id) - init
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

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
 

Detailed Description

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.

Delegate Methods

-(void)archiverWillFinish:(CPKeyedArchiver)archiver; Called when the encoding is about to finish.

Parameters
archiverthe archiver that's about to finish

-(void)archiver:(CPKeyedArchiver)archiver didEncodeObject:(id)object; Called when an object is encoded into the archiver.

Parameters
archiverthe archiver that encoded the object
objectthe object that was encoded

-(void)archiverDidFinish:(CPKeyedArchiver)archiver; Called when the archiver finishes encoding.

Parameters
archiverthe 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.

Parameters
archiverthe archiver encoding the object
objectthe candidate object for encoding
Returns
the object to encode

-(void)archiver:(CPKeyedArchiver)archiver willReplaceObject:(id)object withObject:(id)newObject; Called when an object is being replaced in the archiver.

Parameters
archiverthe archiver encoding the object
objectthe object to be replaced
newObjectthe replacement object

Definition at line 2 of file CPKeyedArchiver.h.

Method Documentation

◆ allowsKeyedCoding()

+ (BOOL) allowsKeyedCoding
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.

◆ archivedDataWithRootObject:()

+ (CPData) archivedDataWithRootObject: (id)  anObject
implementation

Archives the specified object.

Parameters
anObjectthe object to archive
Returns
the archived object

Definition at line 140 of file CPKeyedArchiver.j.

◆ classNameForClass:()

+ (CPString) classNameForClass: (Class)  aClass
implementation

Returns the name of the substitute class used for encoding aClass by all keyed archivers.

Parameters
aClassthe class to substitute
Returns
the name of the substitute class, or nil if there is no substitute class

Returns the name of the substitute class used for encoding aClass by this keyed archiver.

Parameters
aClassthe class to substitute
Returns
the name of the substitute class, or nil if there is no substitute class

Definition at line 419 of file CPKeyedArchiver.j.

◆ delegate()

- (id) delegate
implementation

Returns the keyed archiver's delegate

Definition at line 305 of file CPKeyedArchiver.j.

◆ encodeBool:forKey:()

- (void) encodeBool: (BOOL)  aBOOL
forKey: (CPString aKey 
implementation

Encodes a BOOL value

Parameters
aBoolthe BOOL value
aKeythe key to associate with the BOOL

Definition at line 242 of file CPKeyedArchiver.j.

◆ encodeConditionalObject:forKey:()

- (void) encodeConditionalObject: (id)  anObject
forKey: (CPString aKey 
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.

Parameters
anObjectthe object to to conditionally encode
aKeythe key to associate with the object

Definition at line 347 of file CPKeyedArchiver.j.

◆ encodeDouble:forKey:()

- (void) encodeDouble: (double)  aDouble
forKey: (CPString aKey 
implementation

Encodes a double value

Parameters
aDoublethe double value
aKeythe key to associate with the double

Definition at line 252 of file CPKeyedArchiver.j.

◆ encodeFloat:forKey:()

- (void) encodeFloat: (float)  aFloat
forKey: (CPString aKey 
implementation

Encodes a float value

Parameters
aFloatthe float value
aKeythe key to associate with the float

Definition at line 262 of file CPKeyedArchiver.j.

◆ encodeInt:forKey:()

- (void) encodeInt: (float)  anInt
forKey: (CPString aKey 
implementation

Encodes a int value

Parameters
anIntthe int value
aKeythe key to associate with the int

Definition at line 272 of file CPKeyedArchiver.j.

◆ encodeNumber:forKey:()

- (void) encodeNumber: (CPNumber aNumber
forKey: (CPString aKey 
implementation

Encodes a number

Parameters
aNumberthe number to encode
aKeythe key to associate with the object

Definition at line 357 of file CPKeyedArchiver.j.

◆ encodeObject:forKey:()

- (void) encodeObject: (id)  anObject
forKey: (CPString aKey 
implementation

Encodes an object

Parameters
anObjectthe object to encode
aKeythe key to associate with the object

Definition at line 367 of file CPKeyedArchiver.j.

◆ encodePoint:forKey:()

- (void) encodePoint: (CGPoint)  aPoint
forKey: (CPString aKey 
implementation

Encodes a CGPoint

Parameters
aPointthe point to encode
aKeythe key to associate with the point

Definition at line 315 of file CPKeyedArchiver.j.

◆ encodeRect:forKey:()

- (void) encodeRect: (CGRect)  aRect
forKey: (CPString aKey 
implementation

Encodes a CGRect

Parameters
aRectthe rectangle to encode
aKeythe key to associate with the rectangle

Definition at line 325 of file CPKeyedArchiver.j.

◆ encodeSize:forKey:()

- (void) encodeSize: (CGSize)  aSize
forKey: (CPString aKey 
implementation

Encodes a CGSize

Parameters
aSizethe size to encode
aKeythe key to associate with the size

Definition at line 335 of file CPKeyedArchiver.j.

◆ finishEncoding()

- (void) finishEncoding
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.

◆ initForWritingWithMutableData:()

- (id) initForWritingWithMutableData: (CPMutableData)  data
implementation

Initializes the keyed archiver with the specified CPMutableData for writing.

Parameters
datathe object to archive to
Returns
the initialized keyed archiver

Definition at line 157 of file CPKeyedArchiver.j.

◆ initialize()

+ (void) initialize
implementation

Reimplemented from CPObject.

Definition at line 119 of file CPKeyedArchiver.j.

◆ outputFormat()

- (CPPropertyListFormat) outputFormat
implementation

Returns the property list format used to archive objects.

Definition at line 223 of file CPKeyedArchiver.j.

◆ setClassName:forClass:()

+ (void) setClassName: (CPString aClassName
forClass: (Class)  aClass 
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.

Parameters
aClassNamethe substitute class name
aClassthe 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.

Parameters
aClassNamethe substitute class name
aClassthe class to substitute

Definition at line 404 of file CPKeyedArchiver.j.

◆ setDelegate:()

- (void) setDelegate: (id)  aDelegate
implementation

Sets the keyed archiver's delegate

Definition at line 281 of file CPKeyedArchiver.j.

◆ setOutputFormat:()

- (void) setOutputFormat: (CPPropertyListFormat)  aPropertyListFormat
implementation

Sets the property list format the archiver should use to archive objects.

Parameters
aPropertyListFormatthe format to use

Definition at line 232 of file CPKeyedArchiver.j.


The documentation for this class was generated from the following files: