Fix inlined string dump/undump.

SVN revision: 34570
This commit is contained in:
Cedric BAIL 2008-05-14 20:54:15 +00:00
parent 4cf13d10eb
commit 86ffe2e502
1 changed files with 24 additions and 0 deletions

View File

@ -1654,6 +1654,13 @@ _eet_data_dump_encode(Eet_Dictionary *ed,
}
break;
case EET_T_INLINED_STRING:
data = eet_data_put_type(ed, node->type, &(node->data.str), &size);
if (data)
{
eet_data_stream_write(ds, data, size);
free(data);
}
break;
case EET_T_STRING:
data = eet_data_put_type(ed, node->type, &(node->data.str), &size);
if (data)
@ -1870,6 +1877,11 @@ _eet_data_dump_parse(Eet_Dictionary *ed,
n->type = EET_T_STRING;
n->data.str = strdup(tok4);
}
else if (!strcmp(tok3, "inlined:"))
{
n->type = EET_T_INLINED_STRING;
n->data.str = strdup(tok4);
}
else
{
printf("ERROR: value type '%s' invalid.\n", tok4);
@ -2295,6 +2307,18 @@ _eet_data_descriptor_decode(const Eet_Dictionary *ed,
snprintf(tbuf, sizeof(tbuf), "%llu", *((unsigned long long *)dd));
dumpfunc(dumpdata, tbuf); break;
case EET_T_INLINED_STRING:
{
char *s;
s = *((char **)dd);
if (s)
{
dumpfunc(dumpdata, "inlined: \"");
_eet_data_dump_string_escape(dumpdata, dumpfunc, s);
dumpfunc(dumpdata, "\"");
}
}
break;
case EET_T_STRING:
{
char *s;