CPObjectCPCoder
CPKeyedUnarchiver
@implementation CPKeyedUnarchiver : CPCoder
CPKeyedUnarchiver
is used for creating objects out of
coded files or CPData
objects that were created by
CPKeyedArchiver
. More specifically, this class unarchives
objects from a data stream or file and brings them back into
memory for programmatic usage.
Method Summary | |
---|---|
+(id) | unarchiveObjectWithData:(CPData)data Unarchives the object graph in the provided data object. |
+(id) | unarchiveObjectWithFile:(CPString)aFilePath Not implemented. |
+(id) | unarchiveObjectWithFile:(CPString)aFilePath asynchronously:(BOOL)aFlag Not implemented. |
-(id) | initForReadingWithData:(CPData)data Initializes the receiver to unarchive objects from the specified data object. |
-(BOOL) | allowsKeyedCoding Returns a flag indicating whether the receiver supports keyed coding. |
-(BOOL) | containsValueForKey:(CPString)aKey Returns YES if an object exists for aKey . |
-(BOOL) | decodeBoolForKey:(CPString)aKey Decodes a BOOL from the archive. |
-(double) | decodeDoubleForKey:(CPString)aKey Decodes a double from the archive. |
-(float) | decodeFloatForKey:(CPString)aKey Decodes a float from the archive. |
-(int) | decodeIntForKey:(CPString)aKey Decodes an int from the archive. |
-(id) | decodeObjectForKey:(CPString)aKey Decodes an object from the archive. |
-(CGPoint) | decodePointForKey:(CPString)aKey Decodes a CGPoint from the archive. |
-(CGRect) | decodeRectForKey:(CPString)aKey Decodes a CGRect from the archive. |
-(CGSize) | decodeSizeForKey:(CPString)aKey Decodes a CGSize from the archive. |
-(id) | delegate Returns the keyed unarchiver's delegate. |
-(void) | finishDecoding Notifies the delegates that decoding has finished. |
-(void) | setDelegate:(id)aDelegate Sets the unarchiver's delegate. |
Methods inherited from class CPCoder |
---|
allowsKeyedCoding, encodeBycopyObject, encodeConditionalObject, encodeDataObject, encodeObject, encodePoint, encodePropertyList, encodeRect, encodeRootObject, encodeSize, encodeValueOfObjCType |
Delegate Method Summary | |
---|---|
-(Class) | unarchiver:(CPKeyedUnarchiver)unarchiver cannotDecodeObjectOfClassName:(CPString)name originalClasses:(CPArray)classNames Called when the specified class is not available during decoding. |
-(id) | unarchiver:(CPKeyedUnarchiver)unarchiver didDecodeObject:(id)object Called when the unarchiver decodes an object. |
-(void) | unarchiver:(CPKeyedUnarchiver)unarchiver willReplaceObject:(id)object withObject:(id)newObject Called when a decoded object has been substituted with another. |
-(void) | unarchiverWillFinish:(CPKeyedUnarchiver)unarchiver Called when the unarchiver is about to finish decoding. |
-(void) | unarchiverDidFinish:(CPKeyedUnarchiver)unarchiver Called when the unarchiver has finished decoding. |
Method Detail |
---|
+(id)unarchiveObjectWithData:(CPData)data
data
- the data from which to read the graph+(id)unarchiveObjectWithFile:(CPString)aFilePath
aFilePath
+(id)unarchiveObjectWithFile:(CPString)aFilePath asynchronously:(BOOL)aFlag
aFilePath
aFlag
-(id)initForReadingWithData:(CPData)data
data
- the data stream from which to read objects-(BOOL)allowsKeyedCoding
NO
. Subclasses supporting keyed coding must override this to return YES
.-(BOOL)containsValueForKey:(CPString)aKey
YES
if an object exists for aKey
.aKey
- the object's associated key-(BOOL)decodeBoolForKey:(CPString)aKey
BOOL
from the archiveaKey
- the BOOL
's associated keyBOOL
-(double)decodeDoubleForKey:(CPString)aKey
double
from the archive.aKey
- the double
's associated keydouble
-(float)decodeFloatForKey:(CPString)aKey
float
from the archiveaKey
- the float
's associated keyfloat
-(int)decodeIntForKey:(CPString)aKey
int
from the archive.aKey
- the int
's associated keyint
-(id)decodeObjectForKey:(CPString)aKey
aKey
- the object's associated key-(CGPoint)decodePointForKey:(CPString)aKey
CGPoint
from the archive.aKey
- the point's associated key-(CGRect)decodeRectForKey:(CPString)aKey
CGRect
from the archive.aKey
- the rectangle's associated key-(CGSize)decodeSizeForKey:(CPString)aKey
CGSize
from the archive.aKey
- the size's associated key-(id)delegate
-(void)finishDecoding
-(void)setDelegate:(id)aDelegate
aDelegate
Delegate Method Detail |
---|
-(Class)unarchiver:(CPKeyedUnarchiver)unarchiver cannotDecodeObjectOfClassName:(CPString)name originalClasses:(CPArray)classNames
unarchiver
- the unarchiver performing the decodename
- the name of the class that can't be foundclassNames
Class
to use instead or nil
to abort the unarchiving operation
-(id)unarchiver:(CPKeyedUnarchiver)unarchiver didDecodeObject:(id)object
unarchiver
- the unarchiver doing the decodingobject
- the decoded objecnil
.
-(void)unarchiver:(CPKeyedUnarchiver)unarchiver willReplaceObject:(id)object withObject:(id)newObject
unarchiver:didDecodeObject:
.unarchiver
- the unarchiver that decoded the objectobject
- the original decoded objectnewObject
- the replacement object-(void)unarchiverWillFinish:(CPKeyedUnarchiver)unarchiver
unarchiver
- the unarchiver that's about to finish-(void)unarchiverDidFinish:(CPKeyedUnarchiver)unarchiver
unarchiver
- the unarchiver that finished decodingCreated on Sat Sep 13 14:15:43 PDT 2008