class: ejson::Array
Description:
Constructor and Destructor:
+ Array ();
+ virtual ~Array ();
Synopsis:
+ 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;
+ ejson::Object* getObject (size_t _id);
+ const ejson::Object* getObject (size_t _id) const;
+ ejson::String* getString (size_t _id);
+ const ejson::String* getString (size_t _id) const;
+ std::string getStringValue (size_t _id);
+ const std::string & getStringValue (size_t _id) const;
+ std::string getStringValue (size_t _id,
const std::string & _errorValue) const;
+ ejson::Array* getArray (size_t _id);
+ const ejson::Array* getArray (size_t _id) const;
+ ejson::Null* getNull (size_t _id);
+ const ejson::Null* getNull (size_t _id) const;
+ ejson::Number* getNumber (size_t _id);
+ const ejson::Number* getNumber (size_t _id) const;
+ double getNumberValue (size_t _id,
double _errorValue) const;
+ ejson::Boolean* getBoolean (size_t _id);
+ const ejson::Boolean* getBoolean (size_t _id) const;
+ bool getBooleanValue (size_t _id,
bool _errorValue) const;
+ bool add (ejson::Value* _element);
+ bool addString (const std::string & _value);
+ bool addNull ();
+ bool addBoolean (bool _value);
+ bool addNumber (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::Array
Detail:
Array
+ Array ();
basic element of a xml structure
~Array
+ virtual ~Array ();
destructor
size
+ size_t size () const;
get the number of sub element in the current one
Return: the Number of stored element
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.
Parameter [input]: _id Id of the element.
Return: NULL if the element does not exist.
getObject
+ ejson::Object* getObject (size_t _id);
+ const ejson::Object* getObject (size_t _id) const;
get the pointer on an element reference with his ID (casted in Object if it is an object).
Parameter [input]: _id Id of the element.
Return: NULL if the element does not exist.
getString
+ ejson::String* getString (size_t _id);
+ const ejson::String* getString (size_t _id) const;
get the pointer on an element reference with his ID (casted in String if it is an String).
Parameter [input]: _id Id of the element.
Return: NULL if the element does not exist.
getStringValue
+ std::string getStringValue (size_t _id);
+ const std::string & getStringValue (size_t _id) const;
get the value of the string element (if not a string return "")
Parameter [input]: _id Id of the element.
Return: value of the element.
getStringValue
+ std::string getStringValue (size_t _id,
const std::string & _errorValue) const;
get the value of the string element
Parameter [input]: _id Id of the element.
Parameter [input]: _errorValue The return value if an error occured.
Return: value of the element, or the _errorValue.
getArray
+ ejson::Array* getArray (size_t _id);
+ const ejson::Array* getArray (size_t _id) const;
get the pointer on an element reference with his ID (casted in Array if it is an Array).
Parameter [input]: _id Id of the element.
Return: NULL if the element does not exist.
getNull
+ ejson::Null* getNull (size_t _id);
+ const ejson::Null* getNull (size_t _id) const;
get the pointer on an element reference with his ID (casted in Null if it is an Null).
Parameter [input]: _id Id of the element.
Return: NULL if the element does not exist.
getNumber
+ ejson::Number* getNumber (size_t _id);
+ const ejson::Number* getNumber (size_t _id) const;
get the pointer on an element reference with his ID (casted in Number if it is an Number).
Parameter [input]: _id Id of the element.
Return: NULL if the element does not exist.
getNumberValue
+ double getNumberValue (size_t _id,
double _errorValue) const;
get the value of the Number element
Parameter [input]: _id Id of the element.
Parameter [input]: _errorValue The return value if an error occured.
Return: value of the element, or the _errorValue.
getBoolean
+ ejson::Boolean* getBoolean (size_t _id);
+ const ejson::Boolean* getBoolean (size_t _id) const;
get the pointer on an element reference with his ID (casted in Boolean if it is an Boolean).
Parameter [input]: _id Id of the element.
Return: NULL if the element does not exist.
getBooleanValue
+ bool getBooleanValue (size_t _id,
bool _errorValue) const;
get the value of the Boolean element
Parameter [input]: _id Id of the element.
Parameter [input]: _errorValue The return value if an error occured.
Return: value of the element, or the _errorValue.
add
+ bool add (ejson::Value* _element);
add an element on the array.
Parameter [input]: _element element to add.
Return: false if an error occured.
addString
+ bool addString (const std::string & _value);
add a string element in the Object (automatic creation)
Parameter [input]: _value string value to add
Return: false if an error occured
addNull
+ bool addNull ();
add a "null" element in the Object (automatic creation)
Return: false if an error occured
addBoolean
+ bool addBoolean (bool _value);
add a boolean element in the Object (automatic creation)
Parameter [input]: _value boolean value to add
Return: false if an error occured
addNumber
+ bool addNumber (double _value);
add a double element in the Object (automatic creation)
Parameter [input]: _value double value to add
Return: false if an error occured
iParse
+ virtual bool iParse (const std::string & _data,
size_t & _pos,
ejson::filePos & _filePos,
ejson::Document & _doc);
parse the Current node [pure VIRUAL]
Parameter [input]: _data data string to parse.
Parameter [input] [output]: _pos position in the string to start parse, return the position end of parsing.
Parameter [input]: _caseSensitive Request a parsion of element that is not case sensitive (all element is in low case)
Parameter [input] [output]: file parsing position (line x col x)
Return: false if an error occured.
iGenerate
+ virtual bool iGenerate (std::string & _data,
size_t _indent) const;
generate a string with the tree of the xml
Parameter [input] [output]: _data string where to add the elements
Parameter [input]: current indentation of the file
Return: false if an error occured.
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.
Parameter [input] [output]: _obj move all parameter in the selected element
Return: true if transfer is done corectly
duplicate
+ virtual ejson::Value* duplicate () const;
Copy the curent node and all the child in the curent one.
Return: NULL in an error occured, the pointer on the element otherwise
+ejson::Value
+--> ejson::Array
Detail:
Array
+ Array ();basic element of a xml structure
~Array
+ virtual ~Array ();destructor
size
+ size_t size () const;get the number of sub element in the current one
Return: | the Number of stored element |
get
+ ejson::Value* get (size_t _id);get the pointer on an element reference with his ID.
+ const ejson::Value* get (size_t _id) const;
+ ejson::Value* operator [ ] (size_t _id);
+ const ejson::Value* operator [ ] (size_t _id) const;
Parameter [input]: | _id | Id of the element. |
Return: | NULL if the element does not exist. |
getObject
+ ejson::Object* getObject (size_t _id);get the pointer on an element reference with his ID (casted in Object if it is an object).
+ const ejson::Object* getObject (size_t _id) const;
Parameter [input]: | _id | Id of the element. |
Return: | NULL if the element does not exist. |
getString
+ ejson::String* getString (size_t _id);get the pointer on an element reference with his ID (casted in String if it is an String).
+ const ejson::String* getString (size_t _id) const;
Parameter [input]: | _id | Id of the element. |
Return: | NULL if the element does not exist. |
getStringValue
+ std::string getStringValue (size_t _id);get the value of the string element (if not a string return "")
+ const std::string & getStringValue (size_t _id) const;
Parameter [input]: | _id | Id of the element. |
Return: | value of the element. |
getStringValue
+ std::string getStringValue (size_t _id,get the value of the string element
const std::string & _errorValue) const;
Parameter [input]: | _id | Id of the element. | Parameter [input]: | _errorValue | The return value if an error occured. |
Return: | value of the element, or the _errorValue. |
getArray
+ ejson::Array* getArray (size_t _id);get the pointer on an element reference with his ID (casted in Array if it is an Array).
+ const ejson::Array* getArray (size_t _id) const;
Parameter [input]: | _id | Id of the element. |
Return: | NULL if the element does not exist. |
getNull
+ ejson::Null* getNull (size_t _id);get the pointer on an element reference with his ID (casted in Null if it is an Null).
+ const ejson::Null* getNull (size_t _id) const;
Parameter [input]: | _id | Id of the element. |
Return: | NULL if the element does not exist. |
getNumber
+ ejson::Number* getNumber (size_t _id);get the pointer on an element reference with his ID (casted in Number if it is an Number).
+ const ejson::Number* getNumber (size_t _id) const;
Parameter [input]: | _id | Id of the element. |
Return: | NULL if the element does not exist. |
getNumberValue
+ double getNumberValue (size_t _id,get the value of the Number element
double _errorValue) const;
Parameter [input]: | _id | Id of the element. | Parameter [input]: | _errorValue | The return value if an error occured. |
Return: | value of the element, or the _errorValue. |
getBoolean
+ ejson::Boolean* getBoolean (size_t _id);get the pointer on an element reference with his ID (casted in Boolean if it is an Boolean).
+ const ejson::Boolean* getBoolean (size_t _id) const;
Parameter [input]: | _id | Id of the element. |
Return: | NULL if the element does not exist. |
getBooleanValue
+ bool getBooleanValue (size_t _id,get the value of the Boolean element
bool _errorValue) const;
Parameter [input]: | _id | Id of the element. | Parameter [input]: | _errorValue | The return value if an error occured. |
Return: | value of the element, or the _errorValue. |
add
+ bool add (ejson::Value* _element);add an element on the array.
Parameter [input]: | _element | element to add. |
Return: | false if an error occured. |
addString
+ bool addString (const std::string & _value);add a string element in the Object (automatic creation)
Parameter [input]: | _value | string value to add |
Return: | false if an error occured |
addNull
+ bool addNull ();add a "null" element in the Object (automatic creation)
Return: | false if an error occured |
addBoolean
+ bool addBoolean (bool _value);add a boolean element in the Object (automatic creation)
Parameter [input]: | _value | boolean value to add |
Return: | false if an error occured |
addNumber
+ bool addNumber (double _value);add a double element in the Object (automatic creation)
Parameter [input]: | _value | double value to add |
Return: | false if an error occured |
iParse
+ virtual bool iParse (const std::string & _data,parse the Current node [pure VIRUAL]
size_t & _pos,
ejson::filePos & _filePos,
ejson::Document & _doc);
Parameter [input]: | _data | data string to parse. | Parameter [input] [output]: | _pos | position in the string to start parse, return the position end of parsing. | Parameter [input]: | _caseSensitive | Request a parsion of element that is not case sensitive (all element is in low case) | Parameter [input] [output]: | file | parsing position (line x col x) |
Return: | false if an error occured. |
iGenerate
+ virtual bool iGenerate (std::string & _data,generate a string with the tree of the xml
size_t _indent) const;
Parameter [input] [output]: | _data | string where to add the elements | Parameter [input]: | current | indentation of the file |
Return: | false if an error occured. |
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.
Parameter [input] [output]: | _obj | move all parameter in the selected element |
Return: | true if transfer is done corectly |
duplicate
+ virtual ejson::Value* duplicate () const;Copy the curent node and all the child in the curent one.
Return: | NULL in an error occured, the pointer on the element otherwise |