class: ejson::Value
Description:
Constructor and Destructor:
+ Value ();
+ virtual ~Value ();
Synopsis:
+ virtual bool iParse (const std::string & _data,
size_t & _pos,
ejson::filePos & _filePos,
ejson::Document & _doc) = 0;
+ virtual bool iGenerate (std::string & _data,
size_t _indent) = 0 const;
# void addIndent (std::string & _data,
size_t _indent) const;
# void drawElementParsed (char32_t _val,
const ejson::filePos & _filePos) const;
# bool checkString (char32_t _val) const;
# bool checkNumber (char32_t _val) const;
# int32_t countWhiteChar (const std::string & _data,
size_t _pos,
ejson::filePos & _filePos) const;
+ ejson::Value* toValue ();
+ const ejson::Value* toValue () const;
+ ejson::Document* toDocument ();
+ const ejson::Document* toDocument () const;
+ ejson::Array* toArray ();
+ const ejson::Array* toArray () const;
+ ejson::Object* toObject ();
+ const ejson::Object* toObject () const;
+ ejson::String* toString ();
+ const ejson::String* toString () const;
+ ejson::Number* toNumber ();
+ const ejson::Number* toNumber () const;
+ ejson::Boolean* toBoolean ();
+ const ejson::Boolean* toBoolean () const;
+ ejson::Null* toNull ();
+ const ejson::Null* toNull () const;
+ bool isDocument () const;
+ bool isArray () const;
+ bool isObject () const;
+ bool isString () const;
+ bool isNumber () const;
+ bool isBoolean () const;
+ bool isNull () const;
+ virtual void clear ();
+ virtual bool transfertIn (ejson::Value* _obj);
+ virtual ejson::Value* duplicate () const;
# bool isWhiteChar (char32_t _val);
Object Hierarchy:
ejson::Value
+--> ejson::String
+--> ejson::Null
+--> ejson::Object
+--> ejson::Boolean
+--> ejson::Number
+--> ejson::Array
Detail:
Value
+ Value ();
basic element of a xml structure
~Value
+ virtual ~Value ();
destructor
iParse
+ virtual bool iParse (const std::string & _data,
size_t & _pos,
ejson::filePos & _filePos,
ejson::Document & _doc) = 0;
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) = 0 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.
addIndent
# void addIndent (std::string & _data,
size_t _indent) const;
add indentation of the string input.
Parameter [input] [output]: _data String where the indentation is done.
Parameter [input]: _indent Number of tab to add at the string.
drawElementParsed
# void drawElementParsed (char32_t _val,
const ejson::filePos & _filePos) const;
Display the cuurent element that is curently parse.
Parameter [input]: _val Char that is parsed.
Parameter [input]: _filePos Position of the char in the file.
checkString
# bool checkString (char32_t _val) const;
check if an name (for object named) (not : !"#$%&'()+,/;<=>?@[\]^`{|}~ \n\t\r).
Parameter [input]: _val Value to check the conformity.
checkNumber
# bool checkNumber (char32_t _val) const;
check if an number -+.0123456789e).
Parameter [input]: _val Value to check the conformity.
countWhiteChar
# int32_t countWhiteChar (const std::string & _data,
size_t _pos,
ejson::filePos & _filePos) const;
count the number of white char in the string from the specify position (stop at the first element that is not a white char)
Parameter [input]: _data Data to parse.
Parameter [input]: _pos Start position in the string.
Parameter [output]: _filePos new poistion of te file to add.
Return: number of white element.
toValue
+ ejson::Value* toValue ();
+ const ejson::Value* toValue () const;
Cast the element in a Value if it is possible.
Return: pointer on the class or NULL.
toDocument
+ ejson::Document* toDocument ();
+ const ejson::Document* toDocument () const;
Cast the element in a Document if it is possible.
Return: pointer on the class or NULL.
toArray
+ ejson::Array* toArray ();
+ const ejson::Array* toArray () const;
Cast the element in a Array if it is possible.
Return: pointer on the class or NULL.
toObject
+ ejson::Object* toObject ();
+ const ejson::Object* toObject () const;
Cast the element in a Object if it is possible.
Return: pointer on the class or NULL.
toString
+ ejson::String* toString ();
+ const ejson::String* toString () const;
Cast the element in a String if it is possible.
Return: pointer on the class or NULL.
toNumber
+ ejson::Number* toNumber ();
+ const ejson::Number* toNumber () const;
Cast the element in a Number if it is possible.
Return: pointer on the class or NULL.
toBoolean
+ ejson::Boolean* toBoolean ();
+ const ejson::Boolean* toBoolean () const;
Cast the element in a Boolean if it is possible.
Return: pointer on the class or NULL.
toNull
+ ejson::Null* toNull ();
+ const ejson::Null* toNull () const;
Cast the element in a Null if it is possible.
Return: pointer on the class or NULL.
isDocument
+ bool isDocument () const;
check if the node is a ejson::Document
Return: true if the node is a ejson::Document
isArray
+ bool isArray () const;
check if the node is a ejson::Array
Return: true if the node is a ejson::Array
isObject
+ bool isObject () const;
check if the node is a ejson::Object
Return: true if the node is a ejson::Object
isString
+ bool isString () const;
check if the node is a ejson::String
Return: true if the node is a ejson::String
isNumber
+ bool isNumber () const;
check if the node is a ejson::Number
Return: true if the node is a ejson::Number
isBoolean
+ bool isBoolean () const;
check if the node is a ejson::Boolean
Return: true if the node is a ejson::Boolean
isNull
+ bool isNull () const;
check if the node is a ejson::Null
Return: true if the node is a ejson::Null
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
isWhiteChar
# bool isWhiteChar (char32_t _val);
check if the current element is white or not : '\t' '\n' '\r' ' '
Return: tue if it is white char
ejson::Value
+--> ejson::String
+--> ejson::Null
+--> ejson::Object
+--> ejson::Boolean
+--> ejson::Number
+--> ejson::Array
Detail:
Value
+ Value ();basic element of a xml structure
~Value
+ virtual ~Value ();destructor
iParse
+ virtual bool iParse (const std::string & _data,parse the Current node [pure VIRUAL]
size_t & _pos,
ejson::filePos & _filePos,
ejson::Document & _doc) = 0;
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) = 0 const;
Parameter [input] [output]: | _data | string where to add the elements | Parameter [input]: | current | indentation of the file |
Return: | false if an error occured. |
addIndent
# void addIndent (std::string & _data,add indentation of the string input.
size_t _indent) const;
Parameter [input] [output]: | _data | String where the indentation is done. | Parameter [input]: | _indent | Number of tab to add at the string. |
drawElementParsed
# void drawElementParsed (char32_t _val,Display the cuurent element that is curently parse.
const ejson::filePos & _filePos) const;
Parameter [input]: | _val | Char that is parsed. | Parameter [input]: | _filePos | Position of the char in the file. |
checkString
# bool checkString (char32_t _val) const;check if an name (for object named) (not : !"#$%&'()+,/;<=>?@[\]^`{|}~ \n\t\r).
Parameter [input]: | _val | Value to check the conformity. |
checkNumber
# bool checkNumber (char32_t _val) const;check if an number -+.0123456789e).
Parameter [input]: | _val | Value to check the conformity. |
countWhiteChar
# int32_t countWhiteChar (const std::string & _data,count the number of white char in the string from the specify position (stop at the first element that is not a white char)
size_t _pos,
ejson::filePos & _filePos) const;
Parameter [input]: | _data | Data to parse. | Parameter [input]: | _pos | Start position in the string. | Parameter [output]: | _filePos | new poistion of te file to add. |
Return: | number of white element. |
toValue
+ ejson::Value* toValue ();Cast the element in a Value if it is possible.
+ const ejson::Value* toValue () const;
Return: | pointer on the class or NULL. |
toDocument
+ ejson::Document* toDocument ();Cast the element in a Document if it is possible.
+ const ejson::Document* toDocument () const;
Return: | pointer on the class or NULL. |
toArray
+ ejson::Array* toArray ();Cast the element in a Array if it is possible.
+ const ejson::Array* toArray () const;
Return: | pointer on the class or NULL. |
toObject
+ ejson::Object* toObject ();Cast the element in a Object if it is possible.
+ const ejson::Object* toObject () const;
Return: | pointer on the class or NULL. |
toString
+ ejson::String* toString ();Cast the element in a String if it is possible.
+ const ejson::String* toString () const;
Return: | pointer on the class or NULL. |
toNumber
+ ejson::Number* toNumber ();Cast the element in a Number if it is possible.
+ const ejson::Number* toNumber () const;
Return: | pointer on the class or NULL. |
toBoolean
+ ejson::Boolean* toBoolean ();Cast the element in a Boolean if it is possible.
+ const ejson::Boolean* toBoolean () const;
Return: | pointer on the class or NULL. |
toNull
+ ejson::Null* toNull ();Cast the element in a Null if it is possible.
+ const ejson::Null* toNull () const;
Return: | pointer on the class or NULL. |
isDocument
+ bool isDocument () const;check if the node is a ejson::Document
Return: | true if the node is a ejson::Document |
isArray
+ bool isArray () const;check if the node is a ejson::Array
Return: | true if the node is a ejson::Array |
isObject
+ bool isObject () const;check if the node is a ejson::Object
Return: | true if the node is a ejson::Object |
isString
+ bool isString () const;check if the node is a ejson::String
Return: | true if the node is a ejson::String |
isNumber
+ bool isNumber () const;check if the node is a ejson::Number
Return: | true if the node is a ejson::Number |
isBoolean
+ bool isBoolean () const;check if the node is a ejson::Boolean
Return: | true if the node is a ejson::Boolean |
isNull
+ bool isNull () const;check if the node is a ejson::Null
Return: | true if the node is a ejson::Null |
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 |
isWhiteChar
# bool isWhiteChar (char32_t _val);check if the current element is white or not : '\t' '\n' '\r' ' '
Return: | tue if it is white char |