mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Imporve keyed decoding.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34049 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
eee46e56de
commit
d3a9215d05
3 changed files with 52 additions and 12 deletions
|
@ -1,3 +1,10 @@
|
|||
2011-10-24 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSAffineTransform.m (-initWithCoder:, encodeWithCoder:):
|
||||
Don't do anything for the keyed coding case.
|
||||
* Source/NSDictionary.m (-initWithCoder:): Add another keyed
|
||||
coding case.
|
||||
|
||||
2011-10-22 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSProcessInfo.m: Add includes needed for the HAVE_PROCFS
|
||||
|
|
|
@ -591,9 +591,26 @@ static NSAffineTransformStruct identityTransform = {
|
|||
{
|
||||
NSAffineTransformStruct replace;
|
||||
|
||||
[aCoder decodeArrayOfObjCType: @encode(CGFloat)
|
||||
count: 6
|
||||
at: (CGFloat*)&replace];
|
||||
if ([aCoder allowsKeyedCoding])
|
||||
{
|
||||
// FIXME
|
||||
/*
|
||||
NSData *data = [aCoder decodeObjectForKey: @"NSTransformStruct"];
|
||||
unsigned int cursor = 0;
|
||||
// We get lengths of 12 and 18
|
||||
NSLog(@"length %d data %@", [data length], data);
|
||||
[data deserializeDataAt: (CGFloat*)&replace
|
||||
ofObjCType: "[6f]"
|
||||
atCursor: &cursor
|
||||
context: nil];
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
[aCoder decodeArrayOfObjCType: @encode(CGFloat)
|
||||
count: 6
|
||||
at: (CGFloat*)&replace];
|
||||
}
|
||||
[self setTransformStruct: replace];
|
||||
return self;
|
||||
}
|
||||
|
@ -603,9 +620,16 @@ static NSAffineTransformStruct identityTransform = {
|
|||
NSAffineTransformStruct replace;
|
||||
|
||||
replace = [self transformStruct];
|
||||
[aCoder encodeArrayOfObjCType: @encode(CGFloat)
|
||||
count: 6
|
||||
at: (CGFloat*)&replace];
|
||||
if ([aCoder allowsKeyedCoding])
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
else
|
||||
{
|
||||
[aCoder encodeArrayOfObjCType: @encode(CGFloat)
|
||||
count: 6
|
||||
at: (CGFloat*)&replace];
|
||||
}
|
||||
}
|
||||
|
||||
@end /* NSAffineTransform */
|
||||
|
|
|
@ -315,13 +315,22 @@ static SEL appSel;
|
|||
{
|
||||
if ([aCoder allowsKeyedCoding])
|
||||
{
|
||||
id keys;
|
||||
id objects;
|
||||
id keys = nil;
|
||||
id objects = nil;
|
||||
|
||||
if ([aCoder containsValueForKey: @"NS.keys"])
|
||||
{
|
||||
keys = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey:
|
||||
@"NS.keys"];
|
||||
objects = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey:
|
||||
@"NS.objects"];
|
||||
}
|
||||
else if ([aCoder containsValueForKey: @"dict.sortedKeys"])
|
||||
{
|
||||
keys = [aCoder decodeObjectForKey: @"dict.sortedKeys"];
|
||||
objects = [aCoder decodeObjectForKey: @"dict.values"];
|
||||
}
|
||||
|
||||
keys = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey:
|
||||
@"NS.keys"];
|
||||
objects = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey:
|
||||
@"NS.objects"];
|
||||
if (keys == nil)
|
||||
{
|
||||
unsigned i = 0;
|
||||
|
|
Loading…
Reference in a new issue