Class: ejson::Object
Synopsis:
+ Object (void);
+ ~Object (void);
+ bool exist (const std::string & _name);
+ ejson::Value * get (const std::string & _name);
+ ejson::Object * getObject (const std::string & _name);
+ ejson::Array * getArray (const std::string & _name);
+ ejson::Null * getNull (const std::string & _name);
+ ejson::String * getString (const std::string & _name);
+ const std::string & getStringValue (const std::string & _name);
+ std::string getStringValue (const std::string & _name,
const std::string & _errorValue);
+ ejson::Boolean * getBoolean (const std::string & _name);
+ bool getBooleanValue (const std::string & _name,
bool _errorValue);
+ ejson::Number * getNumber (const std::string & _name);
+ double getNumberValue (const std::string & _name,
double _errorValue);
+ 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);
+ bool iParse (const std::string & _data,
size_t & _pos,
ejson::filePos & _filePos,
ejson::Document & _doc);
+ bool iGenerate (std::string & _data,
size_t _indent);
+ enum nodeType getType (void);
+ ejson::Object * toObject (void);
+ const ejson::Object * toObject (void);
+ void clear (void);
+ bool transfertIn (ejson::Value * _obj);
+ ejson::Value * duplicate (void);
Object Hierarchy:
ejson::Value +--> ejson::Object +--> ejson::Document
Detail:
ejson::Object ()
Object(void);
basic element of a xml structure
ejson::~Object ()
~Object(void);
destructor
exist ()
bool exist(const std::string & _name);
check if an element exist.
Parameter [input]: _name name of the object.
Return: The existance of the element.
get ()
ejson::Value * get(const std::string & _name);
get the sub element with his name (no cast check)
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getObject ()
ejson::Object * getObject(const std::string & _name);
get the sub element with his name (Casted as Object if it is possible)
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getArray ()
ejson::Array * getArray(const std::string & _name);
get the sub element with his name (Casted as Array if it is possible)
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getNull ()
ejson::Null * getNull(const std::string & _name);
get the sub element with his name (Casted as Null if it is possible)
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getString ()
ejson::String * getString(const std::string & _name);
get the sub element with his name (Casted as String if it is possible)
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getStringValue ()
const std::string & getStringValue(const std::string & _name);
get the sub string value of the requested element
Parameter [input]: _name name of the object
Return: Value of the string or an error string (empty)
getStringValue ()
std::string getStringValue(const std::string & _name,
const std::string & _errorValue);
get the sub string value of the requested element (with error return value)
Parameter [input]: _name name of the object
Parameter [input]: _errorValue The return value if the element does not exist.
Return: Value of the string or an error string (empty)
getBoolean ()
ejson::Boolean * getBoolean(const std::string & _name);
get the sub element with his name (Casted as Boolean if it is possible)
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getBooleanValue ()
bool getBooleanValue(const std::string & _name,
bool _errorValue);
get the sub boolean value of the requested element.
Parameter [input]: _name name of the object.
Parameter [input]: _errorValue The return value if the element does not exist.
Return: Value of the Boolean or the _errorValue;
getNumber ()
ejson::Number * getNumber(const std::string & _name);
get the sub element with his name (Casted as Number if it is possible)
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getNumberValue ()
double getNumberValue(const std::string & _name,
double _errorValue);
get the sub Number value of the requested element.
Parameter [input]: _name name of the object.
Parameter [input]: _errorValue The return value if the element does not exist.
Return: Value of the Number or the _errorValue;
add ()
bool add(const std::string & _name,
ejson::Value * _value);
add an element in the Object
Parameter [input]: _name name of the object
Parameter [input]: _value Element to add
Return: false if an error occured
addString ()
bool addString(const std::string & _name,
const std::string & _value);
add a string element in the Object (automatic creation)
Parameter [input]: _name name of the object
Parameter [input]: _value string value to add
Return: false if an error occured
addNull ()
bool addNull(const std::string & _name);
add a "null" element in the Object (automatic creation)
Parameter [input]: _name name of the object
Return: false if an error occured
addBoolean ()
bool addBoolean(const std::string & _name,
bool _value);
add a boolean element in the Object (automatic creation)
Parameter [input]: _name name of the object
Parameter [input]: _value boolean value to add
Return: false if an error occured
addNumber ()
bool addNumber(const std::string & _name,
double _value);
add a double element in the Object (automatic creation)
Parameter [input]: _name name of the object
Parameter [input]: _value double value to add
Return: false if an error occured
iParse ()
bool iParse(const std::string & _data,
size_t & _pos,
ejson::filePos & _filePos,
ejson::Document & _doc);
iGenerate ()
bool iGenerate(std::string & _data,
size_t _indent);
getType ()
enum nodeType getType(void);
toObject ()
ejson::Object * toObject(void);
toObject ()
const ejson::Object * toObject(void);
clear ()
void clear(void);
transfertIn ()
bool transfertIn(ejson::Value * _obj);
duplicate ()
ejson::Value * duplicate(void);
ejson::Object ()
Object(void);
basic element of a xml structure
ejson::~Object ()
~Object(void);
destructor
exist ()
bool exist(const std::string & _name);
check if an element exist.
-
Parameter [input]: _name name of the object.
Return: The existance of the element.
get ()
ejson::Value * get(const std::string & _name);
get the sub element with his name (no cast check)
-
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getObject ()
ejson::Object * getObject(const std::string & _name);
get the sub element with his name (Casted as Object if it is possible)
-
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getArray ()
ejson::Array * getArray(const std::string & _name);
get the sub element with his name (Casted as Array if it is possible)
-
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getNull ()
ejson::Null * getNull(const std::string & _name);
get the sub element with his name (Casted as Null if it is possible)
-
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getString ()
ejson::String * getString(const std::string & _name);
get the sub element with his name (Casted as String if it is possible)
-
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getStringValue ()
const std::string & getStringValue(const std::string & _name);
get the sub string value of the requested element
-
Parameter [input]: _name name of the object
Return: Value of the string or an error string (empty)
getStringValue ()
std::string getStringValue(const std::string & _name, const std::string & _errorValue);
get the sub string value of the requested element (with error return value)
-
Parameter [input]: _name name of the object
Parameter [input]: _errorValue The return value if the element does not exist.
Return: Value of the string or an error string (empty)
getBoolean ()
ejson::Boolean * getBoolean(const std::string & _name);
get the sub element with his name (Casted as Boolean if it is possible)
-
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getBooleanValue ()
bool getBooleanValue(const std::string & _name, bool _errorValue);
get the sub boolean value of the requested element.
-
Parameter [input]: _name name of the object.
Parameter [input]: _errorValue The return value if the element does not exist.
Return: Value of the Boolean or the _errorValue;
getNumber ()
ejson::Number * getNumber(const std::string & _name);
get the sub element with his name (Casted as Number if it is possible)
-
Parameter [input]: _name name of the object
Return: pointer on the element requested or NULL if it not the corect type or does not existed
getNumberValue ()
double getNumberValue(const std::string & _name, double _errorValue);
get the sub Number value of the requested element.
-
Parameter [input]: _name name of the object.
Parameter [input]: _errorValue The return value if the element does not exist.
Return: Value of the Number or the _errorValue;
add ()
bool add(const std::string & _name, ejson::Value * _value);
add an element in the Object
-
Parameter [input]: _name name of the object
Parameter [input]: _value Element to add
Return: false if an error occured
addString ()
bool addString(const std::string & _name, const std::string & _value);
add a string element in the Object (automatic creation)
-
Parameter [input]: _name name of the object
Parameter [input]: _value string value to add
Return: false if an error occured
addNull ()
bool addNull(const std::string & _name);
add a "null" element in the Object (automatic creation)
-
Parameter [input]: _name name of the object
Return: false if an error occured
addBoolean ()
bool addBoolean(const std::string & _name, bool _value);
add a boolean element in the Object (automatic creation)
-
Parameter [input]: _name name of the object
Parameter [input]: _value boolean value to add
Return: false if an error occured
addNumber ()
bool addNumber(const std::string & _name, double _value);
add a double element in the Object (automatic creation)
-
Parameter [input]: _name name of the object
Parameter [input]: _value double value to add
Return: false if an error occured
iParse ()
bool iParse(const std::string & _data, size_t & _pos, ejson::filePos & _filePos, ejson::Document & _doc);
iGenerate ()
bool iGenerate(std::string & _data, size_t _indent);
getType ()
enum nodeType getType(void);
toObject ()
ejson::Object * toObject(void);
toObject ()
const ejson::Object * toObject(void);
clear ()
void clear(void);
transfertIn ()
bool transfertIn(ejson::Value * _obj);
duplicate ()
ejson::Value * duplicate(void);