From e9aff2a6efbca9492b28d36499d405966c3f1bd1 Mon Sep 17 00:00:00 2001 From: mccallum Date: Sun, 12 May 1996 23:57:50 +0000 Subject: [PATCH] Remove many methods from (Coder NSCoderCompatibility), they are now included by adding the behavior from NSCoderNonCore. ([Coder +initialize]): Add behavior from NSCoderNonCore. ([Coder -encodeArrayOfObjCType:count:at:]): Method removed. ([Coder -decodeArrayOfObjCType:count:at:]): Method removed. ([Coder -encodeProperyList:]): Method removed. ([Coder -decodeProperyList:]): Method removed. ([Coder -encodePoint:]): Method removed. ([Coder -decodePoint:]): Method removed. ([Coder -encodeSize:]): Method removed. ([Coder -decodeSize:]): Method removed. ([Coder -encodeRect:]): Method removed. ([Coder -decodeRect:]): Method removed. ([Coder -encodeValuesOfObjCTypes:]): Method removed. ([Coder -decodeValuesOfObjCTypes:]): Method removed. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1522 72102866-910b-0410-8b05-ffd578937521 --- Source/Coder.m | 136 +++++++++++-------------------------------------- 1 file changed, 30 insertions(+), 106 deletions(-) diff --git a/Source/Coder.m b/Source/Coder.m index 67e73b0ca..bebc83f0c 100644 --- a/Source/Coder.m +++ b/Source/Coder.m @@ -44,6 +44,7 @@ #include #include #include +#include #include @@ -63,6 +64,12 @@ static BOOL debug_coder = NO; @implementation Coder ++ (void) initialize +{ + if (self == [Coder class]) + behavior_class_add_class (self, [NSCoderNonCore class]); +} + + setDebugging: (BOOL)f { debug_coder = f; @@ -142,7 +149,7 @@ static BOOL debug_coder = NO; @implementation Coder (NSCoderCompatibility) -/* Encoding Data */ +/* The core methods */ - (void) encodeValueOfObjCType: (const char*)type at: (const void*)address; @@ -150,13 +157,31 @@ static BOOL debug_coder = NO; [self encodeValueOfObjCType: type at: address withName: NULL]; } -- (void) encodeArrayOfObjCType: (const char*)type - count: (unsigned)count - at: (const void*)array +- (void) decodeValueOfObjCType: (const char*)type + at: (void*)address { - [self encodeArrayOfObjCType: type count: count at: array withName: NULL]; + [self decodeValueOfObjCType: type at: address withName: NULL]; } +- (void) encodeDataObject: (NSData*)data +{ + [self notImplemented:_cmd]; +} + +- (NSData*) decodeDataObject +{ + [self notImplemented:_cmd]; + return nil; +} + +- (unsigned int) versionForClassName: (NSString*)className +{ + [self notImplemented:_cmd]; + return 0; +} + +/* Override some methods in NSCoderNonCore */ + - (void) encodeObject: (id)anObject { [self encodeObject: anObject withName: NULL]; @@ -188,65 +213,11 @@ static BOOL debug_coder = NO; #endif } -- (void) encodeDataObject: (NSData*)data -{ - [self notImplemented:_cmd]; -} - -- (void) encodePropertyList: (id)plist -{ - [self notImplemented:_cmd]; -} - -- (void) encodePoint: (NSPoint)point -{ - [self encodeValueOfObjCType:@encode(NSPoint) - at:&point - withName: NULL]; -} - -- (void) encodeRect: (NSRect)rect -{ - [self encodeValueOfObjCType:@encode(NSRect) at:&rect withName: NULL]; -} - - (void) encodeRootObject: (id)rootObject { [self encodeRootObject: rootObject withName: NULL]; } -- (void) encodeSize: (NSSize)size -{ - [self encodeValueOfObjCType:@encode(NSSize) at:&size withName: NULL]; -} - -- (void) encodeValuesOfObjCTypes: (const char*)types,... -{ - [self notImplemented:_cmd]; -} - - -/* Decoding Data */ - -- (void) decodeValueOfObjCType: (const char*)type - at: (void*)address -{ - [self decodeValueOfObjCType: type at: address withName: NULL]; -} - -- (void) decodeArrayOfObjCType: (const char*)type - count: (unsigned)count - at: (void*)address -{ - [self decodeArrayOfObjCType: type count: count at: address withName: NULL]; -} - -- (NSData*) decodeDataObject -{ - [self notImplemented:_cmd]; - return nil; -} - - (id) decodeObject { /* xxx This won't work for decoding forward references!!! */ @@ -255,58 +226,11 @@ static BOOL debug_coder = NO; return o; } -- (id) decodePropertyList -{ - [self notImplemented:_cmd]; - return nil; -} - -- (NSPoint) decodePoint -{ - NSPoint point; - [self decodeValueOfObjCType:@encode(NSPoint) - at:&point - withName: NULL]; - return point; -} - -- (NSRect) decodeRect -{ - NSRect rect; - [self decodeValueOfObjCType:@encode(NSRect) - at:&rect - withName: NULL]; - return rect; -} - -- (NSSize) decodeSize -{ - NSSize size; - [self decodeValueOfObjCType:@encode(NSSize) - at:&size - withName: NULL]; - return size; -} - -- (void) decodeValuesOfObjCTypes: (const char*)types,... -{ - [self notImplemented:_cmd]; -} - - -/* Getting a Version */ - - (unsigned int) systemVersion { return format_version; /* xxx Is this right? */ } -- (unsigned int) versionForClassName: (NSString*)className -{ - [self notImplemented:_cmd]; - return 0; -} - @end /* of (NSCoderCompatibility) */