CPKeyedArchiver Class Reference

List of all members.

Public Member Functions

(id) - initForWritingWithMutableData: [implementation]
(void) - finishEncoding [implementation]
(CPPropertyListFormat) - outputFormat [implementation]
(void) - setOutputFormat: [implementation]
(void) - encodeBool:forKey: [implementation]
(void) - encodeDouble:forKey: [implementation]
(void) - encodeFloat:forKey: [implementation]
(void) - encodeInt:forKey: [implementation]
(void) - setDelegate: [implementation]
(id) - delegate [implementation]
(void) - encodePoint:forKey: [implementation]
(void) - encodeRect:forKey: [implementation]
(void) - encodeSize:forKey: [implementation]
(void) - encodeConditionalObject:forKey: [implementation]
(void) - encodeNumber:forKey: [implementation]
(void) - encodeObject:forKey: [implementation]

Static Public Member Functions

(void) + initialize [implementation]
(BOOL) + allowsKeyedCoding [implementation]
(CPData+ archivedDataWithRootObject: [implementation]
(void) + setClassName:forClass: [implementation]
(CPString+ classNameForClass: [implementation]


Detailed Description

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:
archiver the archiver that's about to finish
-(void)archiver:(CPKeyedArchiver)archiver didEncodeObject:(id)object; Called when an object is encoded into the archiver.
Parameters:
archiver the archiver that encoded the object
object the object that was encoded
-(void)archiverDidFinish:(CPKeyedArchiver)archiver; Called when the archiver finishes encoding.
Parameters:
archiver the arhiver 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:
archiver the archiver encoding the object
object the 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:
archiver the archiver encoding the object
object the object to be replaced
newObject the replacement object

Definition at line 98 of file CPKeyedArchiver.j.


Member Function Documentation

+ (BOOL) allowsKeyedCoding   [implementation]

Definition at line 134 of file CPKeyedArchiver.j.

+ (CPData) archivedDataWithRootObject: (id)  anObject   [implementation]

Archives the specified object.

Parameters:
anObject the object to archive
Returns:
the archived object

Definition at line 144 of file CPKeyedArchiver.j.

+ (CPString) classNameForClass: (Class)  aClass   [implementation]

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

Parameters:
aClass the 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:
aClass the class to substitute
Returns:
the name of the substitute class, or nil if there is no substitute class

Definition at line 428 of file CPKeyedArchiver.j.

- (id) delegate   [implementation]

Returns the keyed archiver's delegate

Definition at line 312 of file CPKeyedArchiver.j.

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

Encodes a BOOL value

Parameters:
aBool the BOOL value
aKey the key to associate with the BOOL

Definition at line 249 of file CPKeyedArchiver.j.

- (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:
anObject the object to to conditionally encode
aKey the key to associate with the object

Definition at line 354 of file CPKeyedArchiver.j.

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

Encodes a double value

Parameters:
aDouble the double value
aKey the key to associate with the double

Definition at line 259 of file CPKeyedArchiver.j.

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

Encodes a float value

Parameters:
aFloat the float value
aKey the key to associate with the float

Definition at line 269 of file CPKeyedArchiver.j.

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

Encodes a int value

Parameters:
anInt the int value
aKey the key to associate with the int

Definition at line 279 of file CPKeyedArchiver.j.

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

Encodes a number

Parameters:
aNumber the number to encode
aKey the key to associate with the object

Definition at line 364 of file CPKeyedArchiver.j.

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

Encdoes an object

Parameters:
anObject the object to encode
aKey the key to associate with the object

Definition at line 374 of file CPKeyedArchiver.j.

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

Encodes a CGPoint

Parameters:
aPoint the point to encode
aKey the key to associate with the point

Definition at line 322 of file CPKeyedArchiver.j.

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

Encodes a CGRect

Parameters:
aRect the rectangle to encode
aKey the key to associate with the rectangle

Definition at line 332 of file CPKeyedArchiver.j.

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

Encodes a CGSize

Parameters:
aSize the size to encode
aKey the key to associate with the size

Definition at line 342 of file CPKeyedArchiver.j.

- (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 190 of file CPKeyedArchiver.j.

- (id) initForWritingWithMutableData: (CPMutableData)  data   [implementation]

Initializes the keyed archiver with the specified CPMutableData for writing.

Parameters:
data the object to archive to
Returns:
the initialized keyed archiver

Definition at line 161 of file CPKeyedArchiver.j.

+ (void) initialize   [implementation]

Definition at line 123 of file CPKeyedArchiver.j.

- (CPPropertyListFormat) outputFormat   [implementation]

Returns the property list format used to archive objects.

Definition at line 230 of file CPKeyedArchiver.j.

+ (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:
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.
Parameters:
aClassName the substitute class name
aClass the class to substitute

Definition at line 413 of file CPKeyedArchiver.j.

- (void) setDelegate: (id)  aDelegate   [implementation]

Sets the keyed archiver's delegate

Definition at line 288 of file CPKeyedArchiver.j.

- (void) setOutputFormat: (CPPropertyListFormat)  aPropertyListFormat   [implementation]

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

Parameters:
aPropertyListFormat the format to use

Definition at line 239 of file CPKeyedArchiver.j.


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

Generated on Thu Dec 11 01:55:50 2008 for Cappuccino by  doxygen 1.5.7.1