class: ejson::Value
Description:
Constructor and Destructor:
+ Value (void );
+ virtual ~Value (void );
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;
+ virtual enum nodeType getType (void ) 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;
+ virtual ejson::Value* toValue (void );
+ virtual const ejson::Value* toValue (void ) const;
+ virtual ejson::Document* toDocument (void );
+ virtual const ejson::Document* toDocument (void ) const;
+ virtual ejson::Array* toArray (void );
+ virtual const ejson::Array* toArray (void ) const;
+ virtual ejson::Object* toObject (void );
+ virtual const ejson::Object* toObject (void ) const;
+ virtual ejson::String* toString (void );
+ virtual const ejson::String* toString (void ) const;
+ virtual ejson::Number* toNumber (void );
+ virtual const ejson::Number* toNumber (void ) const;
+ virtual ejson::Boolean* toBoolean (void );
+ virtual const ejson::Boolean* toBoolean (void ) const;
+ virtual ejson::Null* toNull (void );
+ virtual const ejson::Null* toNull (void ) const;
+ bool isDocument (void ) const;
+ bool isArray (void ) const;
+ bool isObject (void ) const;
+ bool isString (void ) const;
+ bool isNumber (void ) const;
+ bool isBoolean (void ) const;
+ bool isNull (void ) const;
+ virtual void clear (void );
+ virtual bool transfertIn (ejson::Value* _obj);
+ virtual ejson::Value* duplicate (void ) 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 (void );
basic element of a xml structure
~Value
+ virtual ~Value (void );
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.
getType
+ virtual enum nodeType getType (void ) const;
get the node type.
Return: the type of the Node.
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
+ virtual ejson::Value* toValue (void );
Cast the element in a Value if it is possible.
Return: pointer on the class or NULL.
toValue
+ virtual const ejson::Value* toValue (void ) const;
toDocument
+ virtual ejson::Document* toDocument (void );
Cast the element in a Document if it is possible.
Return: pointer on the class or NULL.
toDocument
+ virtual const ejson::Document* toDocument (void ) const;
toArray
+ virtual ejson::Array* toArray (void );
Cast the element in a Array if it is possible.
Return: pointer on the class or NULL.
toArray
+ virtual const ejson::Array* toArray (void ) const;
toObject
+ virtual ejson::Object* toObject (void );
Cast the element in a Object if it is possible.
Return: pointer on the class or NULL.
toObject
+ virtual const ejson::Object* toObject (void ) const;
toString
+ virtual ejson::String* toString (void );
Cast the element in a String if it is possible.
Return: pointer on the class or NULL.
toString
+ virtual const ejson::String* toString (void ) const;
toNumber
+ virtual ejson::Number* toNumber (void );
Cast the element in a Number if it is possible.
Return: pointer on the class or NULL.
toNumber
+ virtual const ejson::Number* toNumber (void ) const;
toBoolean
+ virtual ejson::Boolean* toBoolean (void );
Cast the element in a Boolean if it is possible.
Return: pointer on the class or NULL.
toBoolean
+ virtual const ejson::Boolean* toBoolean (void ) const;
toNull
+ virtual ejson::Null* toNull (void );
Cast the element in a Null if it is possible.
Return: pointer on the class or NULL.
toNull
+ virtual const ejson::Null* toNull (void ) const;
isDocument
+ bool isDocument (void ) const;
check if the node is a ejson::Document
Return: true if the node is a ejson::Document
isArray
+ bool isArray (void ) const;
check if the node is a ejson::Array
Return: true if the node is a ejson::Array
isObject
+ bool isObject (void ) const;
check if the node is a ejson::Object
Return: true if the node is a ejson::Object
isString
+ bool isString (void ) const;
check if the node is a ejson::String
Return: true if the node is a ejson::String
isNumber
+ bool isNumber (void ) const;
check if the node is a ejson::Number
Return: true if the node is a ejson::Number
isBoolean
+ bool isBoolean (void ) const;
check if the node is a ejson::Boolean
Return: true if the node is a ejson::Boolean
isNull
+ bool isNull (void ) const;
check if the node is a ejson::Null
Return: true if the node is a ejson::Null
clear
+ virtual void clear (void );
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 (void ) 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 (void );basic element of a xml structure
~Value
+ virtual ~Value (void );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. |
getType
+ virtual enum nodeType getType (void ) const;get the node type.
Return: | the type of the Node. |
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
+ virtual ejson::Value* toValue (void );Cast the element in a Value if it is possible.
Return: | pointer on the class or NULL. |
toValue
+ virtual const ejson::Value* toValue (void ) const;
toDocument
+ virtual ejson::Document* toDocument (void );Cast the element in a Document if it is possible.
Return: | pointer on the class or NULL. |
toDocument
+ virtual const ejson::Document* toDocument (void ) const;
toArray
+ virtual ejson::Array* toArray (void );Cast the element in a Array if it is possible.
Return: | pointer on the class or NULL. |
toArray
+ virtual const ejson::Array* toArray (void ) const;
toObject
+ virtual ejson::Object* toObject (void );Cast the element in a Object if it is possible.
Return: | pointer on the class or NULL. |
toObject
+ virtual const ejson::Object* toObject (void ) const;
toString
+ virtual ejson::String* toString (void );Cast the element in a String if it is possible.
Return: | pointer on the class or NULL. |
toString
+ virtual const ejson::String* toString (void ) const;
toNumber
+ virtual ejson::Number* toNumber (void );Cast the element in a Number if it is possible.
Return: | pointer on the class or NULL. |
toNumber
+ virtual const ejson::Number* toNumber (void ) const;
toBoolean
+ virtual ejson::Boolean* toBoolean (void );Cast the element in a Boolean if it is possible.
Return: | pointer on the class or NULL. |
toBoolean
+ virtual const ejson::Boolean* toBoolean (void ) const;
toNull
+ virtual ejson::Null* toNull (void );Cast the element in a Null if it is possible.
Return: | pointer on the class or NULL. |
toNull
+ virtual const ejson::Null* toNull (void ) const;
isDocument
+ bool isDocument (void ) const;check if the node is a ejson::Document
Return: | true if the node is a ejson::Document |
isArray
+ bool isArray (void ) const;check if the node is a ejson::Array
Return: | true if the node is a ejson::Array |
isObject
+ bool isObject (void ) const;check if the node is a ejson::Object
Return: | true if the node is a ejson::Object |
isString
+ bool isString (void ) const;check if the node is a ejson::String
Return: | true if the node is a ejson::String |
isNumber
+ bool isNumber (void ) const;check if the node is a ejson::Number
Return: | true if the node is a ejson::Number |
isBoolean
+ bool isBoolean (void ) const;check if the node is a ejson::Boolean
Return: | true if the node is a ejson::Boolean |
isNull
+ bool isNull (void ) const;check if the node is a ejson::Null
Return: | true if the node is a ejson::Null |
clear
+ virtual void clear (void );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 (void ) 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 |