mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
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
This commit is contained in:
parent
49d43a44aa
commit
e9aff2a6ef
1 changed files with 30 additions and 106 deletions
136
Source/Coder.m
136
Source/Coder.m
|
@ -44,6 +44,7 @@
|
||||||
#include <Foundation/NSArchiver.h>
|
#include <Foundation/NSArchiver.h>
|
||||||
#include <Foundation/NSMapTable.h>
|
#include <Foundation/NSMapTable.h>
|
||||||
#include <Foundation/NSHashTable.h>
|
#include <Foundation/NSHashTable.h>
|
||||||
|
#include <Foundation/NSCoder.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,6 +64,12 @@ static BOOL debug_coder = NO;
|
||||||
|
|
||||||
@implementation Coder
|
@implementation Coder
|
||||||
|
|
||||||
|
+ (void) initialize
|
||||||
|
{
|
||||||
|
if (self == [Coder class])
|
||||||
|
behavior_class_add_class (self, [NSCoderNonCore class]);
|
||||||
|
}
|
||||||
|
|
||||||
+ setDebugging: (BOOL)f
|
+ setDebugging: (BOOL)f
|
||||||
{
|
{
|
||||||
debug_coder = f;
|
debug_coder = f;
|
||||||
|
@ -142,7 +149,7 @@ static BOOL debug_coder = NO;
|
||||||
@implementation Coder (NSCoderCompatibility)
|
@implementation Coder (NSCoderCompatibility)
|
||||||
|
|
||||||
|
|
||||||
/* Encoding Data */
|
/* The core methods */
|
||||||
|
|
||||||
- (void) encodeValueOfObjCType: (const char*)type
|
- (void) encodeValueOfObjCType: (const char*)type
|
||||||
at: (const void*)address;
|
at: (const void*)address;
|
||||||
|
@ -150,13 +157,31 @@ static BOOL debug_coder = NO;
|
||||||
[self encodeValueOfObjCType: type at: address withName: NULL];
|
[self encodeValueOfObjCType: type at: address withName: NULL];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) encodeArrayOfObjCType: (const char*)type
|
- (void) decodeValueOfObjCType: (const char*)type
|
||||||
count: (unsigned)count
|
at: (void*)address
|
||||||
at: (const void*)array
|
|
||||||
{
|
{
|
||||||
[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
|
- (void) encodeObject: (id)anObject
|
||||||
{
|
{
|
||||||
[self encodeObject: anObject withName: NULL];
|
[self encodeObject: anObject withName: NULL];
|
||||||
|
@ -188,65 +213,11 @@ static BOOL debug_coder = NO;
|
||||||
#endif
|
#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
|
- (void) encodeRootObject: (id)rootObject
|
||||||
{
|
{
|
||||||
[self encodeRootObject: rootObject withName: NULL];
|
[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
|
- (id) decodeObject
|
||||||
{
|
{
|
||||||
/* xxx This won't work for decoding forward references!!! */
|
/* xxx This won't work for decoding forward references!!! */
|
||||||
|
@ -255,58 +226,11 @@ static BOOL debug_coder = NO;
|
||||||
return o;
|
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
|
- (unsigned int) systemVersion
|
||||||
{
|
{
|
||||||
return format_version; /* xxx Is this right? */
|
return format_version; /* xxx Is this right? */
|
||||||
}
|
}
|
||||||
|
|
||||||
- (unsigned int) versionForClassName: (NSString*)className
|
|
||||||
{
|
|
||||||
[self notImplemented:_cmd];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end /* of (NSCoderCompatibility) */
|
@end /* of (NSCoderCompatibility) */
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue