class: ejson::Object


Description:



Constructor and Destructor:

+                                  Object          ();
+ virtual ~Object ();

Synopsis:

#         etk::Hash<ejson::Value*> m_value;
+ bool exist (const std::string & _name) const;
+ ejson::Value* get (const std::string & _name);
+ const ejson::Value* get (const std::string & _name) const;
+ ejson::Value* operator [ ] (const std::string & _name);
+ const ejson::Value* operator [ ] (const std::string & _name) const;
+ std::vector<std::string> getKeys () const;
+ size_t size () const;
+ ejson::Value* get (size_t _id);
+ const ejson::Value* get (size_t _id) const;
+ ejson::Value* operator [ ] (size_t _id);
+ const ejson::Value* operator [ ] (size_t _id) const;
+ std::string getKey (size_t _id) const;
+ ejson::Object* getObject (const std::string & _name);
+ const ejson::Object* getObject (const std::string & _name) const;
+ ejson::Array* getArray (const std::string & _name);
+ const ejson::Array* getArray (const std::string & _name) const;
+ ejson::Null* getNull (const std::string & _name);
+ const ejson::Null* getNull (const std::string & _name) const;
+ ejson::String* getString (const std::string & _name);
+ const ejson::String* getString (const std::string & _name) const;
+ const std::string & getStringValue (const std::string & _name) const;
+ std::string getStringValue (const std::string & _name,
const std::string & _errorValue) const;
+ ejson::Boolean* getBoolean (const std::string & _name);
+ const ejson::Boolean* getBoolean (const std::string & _name) const;
+ bool getBooleanValue (const std::string & _name,
bool _errorValue) const;
+ ejson::Number* getNumber (const std::string & _name);
+ const ejson::Number* getNumber (const std::string & _name) const;
+ double getNumberValue (const std::string & _name,
double _errorValue) const;
+ bool add (const std::string & _name,
ejson::Value* _value);
+ bool addString (const std::string & _name,
const std::string & _value);
+ bool addNull (const std::string & _name);
+ bool addBoolean (const std::string & _name,
bool _value);
+ bool addNumber (const std::string & _name,
double _value);
+ virtual bool iParse (const std::string & _data,
size_t & _pos,
ejson::filePos & _filePos,
ejson::Document & _doc);
+ virtual bool iGenerate (std::string & _data,
size_t _indent) const;
+ virtual void clear ();
+ virtual bool transfertIn (ejson::Value* _obj);
+ virtual ejson::Value* duplicate () const;

Object Hierarchy:

+ejson::Value
+--> ejson::Object
+--> ejson::Document

Detail:

Object

+  Object ();
basic element of a xml structure


~Object

+ virtual  ~Object ();
destructor


m_value

# etk::Hash<ejson::Value*> m_value;
value of the node (for element this is the name, for text it is the inside text ...)


exist

+ bool exist (const std::string & _name) const;
check if an element exist.


get

+ ejson::Value* get (const std::string & _name);
+ const ejson::Value* get (const std::string & _name) const;
+ ejson::Value* operator [ ] (const std::string & _name);
+ const ejson::Value* operator [ ] (const std::string & _name) const;
get the sub element with his name (no cast check)


getKeys

+ std::vector<std::string> getKeys () const;
Get all the element name (keys).


size

+ size_t size () const;
get the number of sub element in the current one


get

+ ejson::Value* get (size_t _id);
+ const ejson::Value* get (size_t _id) const;
+ ejson::Value* operator [ ] (size_t _id);
+ const ejson::Value* operator [ ] (size_t _id) const;
get the pointer on an element reference with his ID.


getKey

+ std::string getKey (size_t _id) const;
Get the element name (key).


getObject

+ ejson::Object* getObject (const std::string & _name);
+ const ejson::Object* getObject (const std::string & _name) const;
get the sub element with his name (Casted as Object if it is possible)


getArray

+ ejson::Array* getArray (const std::string & _name);
+ const ejson::Array* getArray (const std::string & _name) const;
get the sub element with his name (Casted as Array if it is possible)


getNull

+ ejson::Null* getNull (const std::string & _name);
+ const ejson::Null* getNull (const std::string & _name) const;
get the sub element with his name (Casted as Null if it is possible)


getString

+ ejson::String* getString (const std::string & _name);
+ const ejson::String* getString (const std::string & _name) const;
get the sub element with his name (Casted as String if it is possible)


getStringValue

+ const std::string & getStringValue (const std::string & _name) const;
get the sub string value of the requested element


getStringValue

+ std::string getStringValue (const std::string & _name,
const std::string & _errorValue) const;
get the sub string value of the requested element (with error return value)


getBoolean

+ ejson::Boolean* getBoolean (const std::string & _name);
+ const ejson::Boolean* getBoolean (const std::string & _name) const;
get the sub element with his name (Casted as Boolean if it is possible)


getBooleanValue

+ bool getBooleanValue (const std::string & _name,
bool _errorValue) const;
get the sub boolean value of the requested element.


getNumber

+ ejson::Number* getNumber (const std::string & _name);
+ const ejson::Number* getNumber (const std::string & _name) const;
get the sub element with his name (Casted as Number if it is possible)


getNumberValue

+ double getNumberValue (const std::string & _name,
double _errorValue) const;
get the sub Number value of the requested element.


add

+ bool add (const std::string & _name,
ejson::Value* _value);
add an element in the Object


addString

+ bool addString (const std::string & _name,
const std::string & _value);
add a string element in the Object (automatic creation)


addNull

+ bool addNull (const std::string & _name);
add a "null" element in the Object (automatic creation)


addBoolean

+ bool addBoolean (const std::string & _name,
bool _value);
add a boolean element in the Object (automatic creation)


addNumber

+ bool addNumber (const std::string & _name,
double _value);
add a double element in the Object (automatic creation)


iParse

+ virtual bool iParse (const std::string & _data,
size_t & _pos,
ejson::filePos & _filePos,
ejson::Document & _doc);
parse the Current node [pure VIRUAL]


iGenerate

+ virtual bool iGenerate (std::string & _data,
size_t _indent) const;
generate a string with the tree of the xml


clear

+ virtual void clear ();
clear the Node


transfertIn

+ virtual bool transfertIn (ejson::Value* _obj);
Tranfert all element in the element set in parameter
Note: all element is remove from the curent element.


duplicate

+ virtual ejson::Value* duplicate () const;
Copy the curent node and all the child in the curent one.