Up
Authors
- Andrew Kachites McCallum (
mccallum@gnu.ai.mit.edu
)
-
- Adam Fedor (
fedor@boulder.colorado.edu
)
-
Version: 37003
Date: 2013-08-22 09:44:54 -0600 (Thu, 22 Aug 2013)
Copyright: (C) 1995, 1996 Free Software Foundation, Inc.
- Declared in:
- Foundation/NSCoder.h
Availability: OpenStep
Top-level class defining methods for use when
archiving (encoding) objects to a byte array or
file, and when restoring (decoding) objects.
Generally only subclasses of this class are used
directly -
NSArchiver
,
NSUnarchiver
,
NSKeyedArchiver
,
NSKeyedUnarchiver
, or
NSPortCoder
.
NSPortCoder
is used within
the distributed objects framework. For
archiving to/from disk, the
Keyed... classes are preferred for
new implementations, since they provide
greater forward/backward compatibility in
the face of class changes.
Method summary
- (BOOL)
allowsKeyedCoding;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
Returns a flag indicating whether the receiver
supported keyed coding. the default
implementation returns NO
.
Subclasses supporting keyed coding must override
this to return YES
.
- (BOOL)
containsValueForKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
Returns a class indicating whether an encoded value
corresponding to aKey exists.
- (void)
decodeArrayOfObjCType: (const char*)type
count: (
NSUInteger)count
at: (void*)address;
Availability: OpenStep
Decodes array of count structures or
objects of given type, which may be
obtained through the ' @encode(...)
'
compile-time operator. Usually this is used
for primitives though it can be used for objects as
well. Objects will be retained and you must release
them.
- (BOOL)
decodeBoolForKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
Returns a boolean value associated with
aKey. This value must previously have been
encoded using
-encodeBool:forKey:
- (const uint8_t*)
decodeBytesForKey: (
NSString*)aKey
returnedLength: (
NSUInteger*)alength;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
Returns a pointer to a byte array associated with
aKey.
Returns the length of the
data in aLength.
This value must previously
have been encoded using
-encodeBytes:length:forKey:
- (void*)
decodeBytesWithReturnedLength: (
NSUInteger*)l;
Availability: OpenStep
Retrieve bytes directly from archive.
- (
NSData*)
decodeDataObject;
Availability: OpenStep
Decode an instance of
NSData
.
- (double)
decodeDoubleForKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
- (float)
decodeFloatForKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
- (int32_t)
decodeInt32ForKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
- (int64_t)
decodeInt64ForKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
- (int)
decodeIntForKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
- (
NSInteger)
decodeIntegerForKey: (
NSString*)key;
Availability: MacOS-X 10.5.0
Subclasses
must override this method.
Decodes an NSInteger associated with the
key.
- (id)
decodeObject;
Availability: OpenStep
Decodes a generic object. Usually the class will be
read from the archive, an object will be created
through an
alloc
call, then that class
will be sent an
[<NSCoding>-initWithCoder:]
message.
- (id)
decodeObjectForKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
- (
NSPoint)
decodePoint;
Availability: OpenStep
Decodes a point structure.
- (id)
decodePropertyList;
Availability: OpenStep
- (
NSRect)
decodeRect;
Availability: OpenStep
Decodes a rectangle structure.
- (
NSSize)
decodeSize;
Availability: OpenStep
Decodes a size structure.
- (void)
decodeValueOfObjCType: (const char*)type
at: (void*)address;
Availability: OpenStep
Decodes structure or object of given
type, which may be obtained through the '
@encode(...)
' compile-time operator.
Usually this is used for primitives though it can
be used for objects as well, in which case you are
responsible for releasing them.
- (void)
decodeValuesOfObjCTypes: (const char*)types
,...;
Availability: OpenStep
- (void)
encodeArrayOfObjCType: (const char*)type
count: (
NSUInteger)count
at: (const void*)array;
Availability: OpenStep
Encodes array of count
structures or objects of given type,
which may be obtained through the '
@encode(...)
' compile-time operator.
Usually this is used for primitives though it can
be used for objects as well.
- (void)
encodeBool: (BOOL)aBool
forKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
Encodes aBool and associates the encoded
value with aKey.
- (void)
encodeBycopyObject: (id)anObject;
Availability: OpenStep
Can be ignored.
- (void)
encodeByrefObject: (id)anObject;
Availability: OpenStep
Can be ignored.
- (void)
encodeBytes: (void*)d
length: (
NSUInteger)l;
Availability: OpenStep
Stores bytes directly into archive.
- (void)
encodeBytes: (const uint8_t*)aPointer
length: (
NSUInteger)length
forKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
Encodes the data of the specified length
and pointed to by aPointer, and associates
the encoded value with aKey.
- (void)
encodeConditionalObject: (id)anObject;
Availability: OpenStep
Encode object if it is/will be encoded
unconditionally by this coder, otherwise
store a nil
.
- (void)
encodeConditionalObject: (id)anObject
forKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
Encodes
anObject and associates the
encoded value with
aKey, but only if
anObject has already been encoded using
-encodeObject:forKey:
- (void)
encodeDataObject: (
NSData*)data;
Availability: OpenStep
Encode an instance of
NSData
.
- (void)
encodeDouble: (double)aDouble
forKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
Encodes aDouble and associates the
encoded value with aKey.
- (void)
encodeFloat: (float)aFloat
forKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
Encodes aFloat and associates the
encoded value with aKey.
- (void)
encodeInt32: (int32_t)anInteger
forKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
Encodes 32 bit integer and associates the encoded
value with aKey.
- (void)
encodeInt64: (int64_t)anInteger
forKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
Encodes a 64 bit integer and associates the encoded
value with aKey.
- (void)
encodeInt: (int)anInteger
forKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
Encodes an int and associates the
encoded value with aKey.
- (void)
encodeInteger: (
NSInteger)anInteger
forKey: (
NSString*)key;
Availability: MacOS-X 10.5.0
Subclasses
must override this method.
Encodes an NSInteger and associates the encoded
value with key.
- (void)
encodeObject: (id)anObject;
Availability: OpenStep
- (void)
encodeObject: (id)anObject
forKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
must override this method.
Encodes anObject and associates the
encoded value with aKey.
- (void)
encodePoint: (
NSPoint)point;
Availability: OpenStep
Encodes a point structure.
- (void)
encodePropertyList: (id)plist;
Availability: OpenStep
Encodes a property list by calling [NSSerializer
-serializePropertyList:], then
encoding the resulting
NSData
object.
- (void)
encodeRect: (
NSRect)rect;
Availability: OpenStep
Encodes a rectangle structure.
- (void)
encodeRootObject: (id)rootObject;
Availability: OpenStep
Store object and objects it refers to in archive
(i.e., complete object graph).
- (void)
encodeSize: (
NSSize)size;
Availability: OpenStep
Encodes a size structure.
- (void)
encodeValueOfObjCType: (const char*)type
at: (const void*)address;
Availability: OpenStep
Encodes structure or object of given
type, which may be obtained through the '
@encode(...)
' compile-time operator.
Usually this is used for primitives though it can
be used for objects as well.
- (void)
encodeValuesOfObjCTypes: (const char*)types
,...;
Availability: OpenStep
- (
NSZone*)
objectZone;
Availability: OpenStep
Returns zone being used to allocate memory for
decoded objects.
- (void)
setObjectZone: (
NSZone*)zone;
Availability: OpenStep
Sets zone to use for allocating memory for
decoded objects.
- (unsigned int)
systemVersion;
Availability: OpenStep
Returns *Step version, which is not the release
version, but a large number, by specification
<1000 for pre-OpenStep. This implementation
returns a number based on the GNUstep major, minor,
and subminor versions.
- (
NSInteger)
versionForClassName: (
NSString*)className;
Availability: OpenStep
Returns current version of class (when encoding) or
version of decoded class (decoded). Version comes
from [NSObject -getVersion].
Up