CPKeyedArchiver Class Reference
[Foundation]

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

List of all members.

Public Member Functions

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

Static Public Member Functions

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

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:
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 102 of file CPKeyedArchiver.j.


Member Function Documentation

+ (BOOL) allowsKeyedCoding   [implementation]

Definition at line 138 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 148 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 432 of file CPKeyedArchiver.j.

- (id) delegate   [implementation]

Returns the keyed archiver's delegate

Definition at line 316 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 253 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 358 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 263 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 273 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 283 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 368 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 378 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 326 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 336 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 346 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 194 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 165 of file CPKeyedArchiver.j.

+ (void) initialize   [implementation]

Definition at line 127 of file CPKeyedArchiver.j.

- (CPPropertyListFormat) outputFormat   [implementation]

Returns the property list format used to archive objects.

Definition at line 234 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 417 of file CPKeyedArchiver.j.

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

Sets the keyed archiver's delegate

Definition at line 292 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 243 of file CPKeyedArchiver.j.


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

Generated on Fri Apr 9 11:04:21 2010 for Cappuccino API by  doxygen 1.6.1