mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 17:12:03 +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
6a54c84a72
commit
32cd99926f
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>
|
2011-10-22 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/NSProcessInfo.m: Add includes needed for the HAVE_PROCFS
|
* Source/NSProcessInfo.m: Add includes needed for the HAVE_PROCFS
|
||||||
|
|
|
@ -591,9 +591,26 @@ static NSAffineTransformStruct identityTransform = {
|
||||||
{
|
{
|
||||||
NSAffineTransformStruct replace;
|
NSAffineTransformStruct 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)
|
[aCoder decodeArrayOfObjCType: @encode(CGFloat)
|
||||||
count: 6
|
count: 6
|
||||||
at: (CGFloat*)&replace];
|
at: (CGFloat*)&replace];
|
||||||
|
}
|
||||||
[self setTransformStruct: replace];
|
[self setTransformStruct: replace];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -603,9 +620,16 @@ static NSAffineTransformStruct identityTransform = {
|
||||||
NSAffineTransformStruct replace;
|
NSAffineTransformStruct replace;
|
||||||
|
|
||||||
replace = [self transformStruct];
|
replace = [self transformStruct];
|
||||||
|
if ([aCoder allowsKeyedCoding])
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
[aCoder encodeArrayOfObjCType: @encode(CGFloat)
|
[aCoder encodeArrayOfObjCType: @encode(CGFloat)
|
||||||
count: 6
|
count: 6
|
||||||
at: (CGFloat*)&replace];
|
at: (CGFloat*)&replace];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSAffineTransform */
|
@end /* NSAffineTransform */
|
||||||
|
|
|
@ -315,13 +315,22 @@ static SEL appSel;
|
||||||
{
|
{
|
||||||
if ([aCoder allowsKeyedCoding])
|
if ([aCoder allowsKeyedCoding])
|
||||||
{
|
{
|
||||||
id keys;
|
id keys = nil;
|
||||||
id objects;
|
id objects = nil;
|
||||||
|
|
||||||
|
if ([aCoder containsValueForKey: @"NS.keys"])
|
||||||
|
{
|
||||||
keys = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey:
|
keys = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey:
|
||||||
@"NS.keys"];
|
@"NS.keys"];
|
||||||
objects = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey:
|
objects = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey:
|
||||||
@"NS.objects"];
|
@"NS.objects"];
|
||||||
|
}
|
||||||
|
else if ([aCoder containsValueForKey: @"dict.sortedKeys"])
|
||||||
|
{
|
||||||
|
keys = [aCoder decodeObjectForKey: @"dict.sortedKeys"];
|
||||||
|
objects = [aCoder decodeObjectForKey: @"dict.values"];
|
||||||
|
}
|
||||||
|
|
||||||
if (keys == nil)
|
if (keys == nil)
|
||||||
{
|
{
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue