Skip to content

Commit

Permalink
Add ESPEG and TextWnd. ESPEG mirrored in Console project
Browse files Browse the repository at this point in the history
  • Loading branch information
g40 committed Jan 19, 2016
1 parent 05f4f79 commit d32d20d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions json_adapter.h
Expand Up @@ -20,6 +20,21 @@
JSON_T(adapter,c); // Note 'T' type
}
// another approach. eliminate confusing
// macros and problems with 'Class' and
//
void serialize(JSON::json_adapter& adapter)
{
JSON::Class2 root(adapter,"classname");
// JSON_I is adapter.insert(JSON::Container("member_name",member_name));
_JSON_I(adapter,a);
_JSON_I(adapter,b);
_JSON_I(adapter,c);
// pro+++: adapter now knows how many elements to expect
// con: could forget to commit. make it part of Class destructor?????
root.commit();
}
That's all that is required. The adapter can be a reader or writer, the
system is symmetric.
Expand Down

0 comments on commit d32d20d

Please sign in to comment.