Up
Authors
- Andrew Kachites McCallum (
mccallum@gnu.ai.mit.edu
)
-
- Adam Fedor (
fedor@boulder.colorado.edu
)
-
Date: 2006-05-15 06:07:35 -0600 (Mon, 15 May 2006)
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
should 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
should override this method.
Returns a class indicating whether an encoded value corresponding to aKey exists.
- (void)
decodeArrayOfObjCType: (const char*)type
count: (unsigned)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
should 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: (unsigned*)alength;
Availability: MacOS-X 10.0.0
Subclasses
should 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: (unsigned*)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
should override this method.
- (float)
decodeFloatForKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
should override this method.
- (int32_t)
decodeInt32ForKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
should override this method.
- (int64_t)
decodeInt64ForKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
should override this method.
- (int)
decodeIntForKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
should override this method.
- (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
should 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: (unsigned)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
should 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: (unsigned)l;
Availability: OpenStep
Stores bytes directly into archive.
- (void)
encodeBytes: (const uint8_t*)aPointer
length: (unsigned)length
forKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
should 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
should 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
should 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
should 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
should override this method.
Encodes anInteger and associates the encoded value with aKey.
- (void)
encodeInt64: (int64_t)anInteger
forKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
should override this method.
Encodes anInteger and associates the encoded value with aKey.
- (void)
encodeInt: (int)anInteger
forKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
should override this method.
Encodes anInteger and associates the encoded value with aKey.
- (void)
encodeObject: (id)anObject;
Availability: OpenStep
- (void)
encodeObject: (id)anObject
forKey: (
NSString*)aKey;
Availability: MacOS-X 10.0.0
Subclasses
should 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.
- (unsigned int)
versionForClassName: (
NSString*)className;
Availability: OpenStep
Returns current version of class (when encoding) or version of decoded class (decoded). Version comes from [NSObject -getVersion].
- Declared in:
- Foundation/NSCoder.h
Availability: Base 0.0.0
GNUstep extensions to
NSCoder
, supporting compatibility with libObjects. DEPRECATED
Method summary
- (void)
decodeArrayOfObjCType: (const char*)type
count: (unsigned)count
at: (void*)buf
withName: (id*)name;
Availability: Base 0.0.0
Description forthcoming.
- (void)
decodeIndent;
Availability: Base 0.0.0
An empty method provided for subclasses to override.
decodes indentation
- (void)
decodeObjectAt: (id*)anObject
withName: (id*)name;
Availability: Base 0.0.0
Description forthcoming.
- (void)
decodeValueOfCType: (const char*)type
at: (void*)buf
withName: (id*)name;
Availability: Base 0.0.0
Description forthcoming.
- (void)
decodeValueOfObjCType: (const char*)type
at: (void*)buf
withName: (id*)name;
Availability: Base 0.0.0
Description forthcoming.
- (void)
encodeArrayOfObjCType: (const char*)type
count: (unsigned)count
at: (const void*)buf
withName: (id)name;
Availability: Base 0.0.0
Description forthcoming.
- (void)
encodeIndent;
Availability: Base 0.0.0
An empty method provided for subclasses to override.
encodes indentation
- (void)
encodeObjectAt: (id*)anObject
withName: (id)name;
Availability: Base 0.0.0
Description forthcoming.
- (void)
encodeValueOfCType: (const char*)type
at: (const void*)buf
withName: (id)name;
Availability: Base 0.0.0
Description forthcoming.
- (void)
encodeValueOfObjCType: (const char*)type
at: (const void*)buf
withName: (id)name;
Availability: Base 0.0.0
Description forthcoming.
Up