Inital commit of partial implementation of MacOS-X compatible keyed archiving.

Experimental ... archiving is implemented aand tested for xml format output.
Unarchiving is not yet implemented.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18450 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2004-01-22 09:37:07 +00:00
parent 2d361f1ad9
commit de07b9271b
12 changed files with 3927 additions and 30 deletions

View file

@ -436,39 +436,44 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
}
else if ([obj isKindOfClass: [NSNumber class]])
{
double val = [obj doubleValue];
const char *t = [obj objCType];
if (val == 1.0)
if (*t == 'c' || *t == 'C')
{
if (x == PLXML)
BOOL val = [obj boolValue];
if (val == YES)
{
Append(@"<true/>\n", dest);
}
else if (x == PLNEW)
{
Append(@"<*BY>", dest);
if (x == PLXML)
{
Append(@"<true/>\n", dest);
}
else if (x == PLNEW)
{
Append(@"<*BY>", dest);
}
else
{
PString([obj description], dest);
}
}
else
{
PString([obj description], dest);
if (x == PLXML)
{
Append(@"<false/>\n", dest);
}
else if (x == PLNEW)
{
Append(@"<*BN>", dest);
}
else
{
PString([obj description], dest);
}
}
}
else if (val == 0.0)
{
if (x == PLXML)
{
Append(@"<false/>\n", dest);
}
else if (x == PLNEW)
{
Append(@"<*BN>", dest);
}
else
{
PString([obj description], dest);
}
}
else if (rint(val) == val)
else if (strchr("sSiIlLqQ", *t) != 0)
{
if (x == PLXML)
{
@ -601,7 +606,7 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
{
NSEnumerator *e;
Append(@"<array>", dest);
Append(@"<array>\n", dest);
e = [obj objectEnumerator];
while ((obj = [e nextObject]))
{
@ -700,6 +705,7 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
Append(@"<key>", dest);
XString(key, dest);
Append(@"</key>\n", dest);
Append(iSizeString, dest);
OAppend(val, loc, level, step, x, dest);
}
Append(iBaseString, dest);