EvolvingObjects
eoserial::Object Class Reference

JSON Object. More...

#include <Object.h>

Inheritance diagram for eoserial::Object:
eoserial::Entity

List of all members.

Public Types

typedef std::map< std::string,
eoserial::Entity * > 
JsonValues

Public Member Functions

void add (const std::string &key, eoserial::Entity *json)
 Adds a pair into the JSON object.
void add (const std::string &key, const eoserial::Printable *obj)
 Adds a pair into the JSON object.
void deserialize (eoserial::Persistent &obj)
 Deserializes a Serializable class instance from this JSON object.
 ~Object ()
 Dtor.
virtual std::ostream & print (std::ostream &out) const
 Prints the content of a JSON object into a stream.

Detailed Description

JSON Object.

This class represents a JSON object, which is basically a dictionnary of keys (strings) and values (JSON entities).

Definition at line 41 of file Object.h.


Member Function Documentation

void eoserial::Object::add ( const std::string &  key,
eoserial::Entity json 
) [inline]

Adds a pair into the JSON object.

Parameters:
keyThe key associated with the eoserial object
jsonThe JSON object as created with framework.

Definition at line 51 of file Object.h.

void eoserial::Object::add ( const std::string &  key,
const eoserial::Printable obj 
) [inline]

Adds a pair into the JSON object.

Parameters:
keyThe key associated with the eoserial object
objA JSON-serializable object

Definition at line 61 of file Object.h.

References eoserial::Printable::pack().

Deserializes a Serializable class instance from this JSON object.

Parameters:
objThe object we want to rebuild.

Definition at line 70 of file Object.h.

References eoserial::Persistent::unpack().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends