#include <Value.hpp>
Public Member Functions | |
enum ejson::valueType | getType () const |
virtual | ~Value () |
virtual bool | iParse (const std::string &_data, size_t &_pos, ejson::FilePos &_filePos, ejson::internal::Document &_doc)=0 |
virtual bool | iGenerate (std::string &_data, size_t _indent) const =0 |
virtual void | iMachineGenerate (std::string &_data) const =0 |
void | display () const |
virtual void | clear () |
virtual bool | transfertIn (ememory::SharedPtr< ejson::internal::Value > _obj) |
virtual ememory::SharedPtr< ejson::internal::Value > | clone () const |
Public Member Functions inherited from ememory::EnableSharedFromThis< Value > | |
ememory::SharedPtr< EMEMORY_TYPE > | sharedFromThis () |
const ememory::SharedPtr< EMEMORY_TYPE > | sharedFromThis () const |
ememory::WeakPtr< EMEMORY_TYPE > | weakFromThis () |
const ememory::WeakPtr< EMEMORY_TYPE > | weakFromThis () const |
Protected Member Functions | |
Value () | |
void | addIndent (std::string &_data, int32_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 |
Static Protected Member Functions | |
static bool | isWhiteChar (char32_t _val) |
Protected Attributes | |
enum ejson::valueType | m_type |
Detailed Description
Basic main object of all json data.
Constructor & Destructor Documentation
§ Value()
|
inlineprotected |
basic element of a xml structure
§ ~Value()
|
virtual |
Virtualize destructor.
Member Function Documentation
§ addIndent()
|
protected |
§ checkNumber()
|
protected |
check if an number -+.0123456789e).
- Parameters
-
[in] _val Value to check the conformity.
- Returns
- true The element char is considerable as a number
- false The element char is NOT considerable as a number
§ checkString()
|
protected |
check if an name (for object named) (not : !"#$%&'()*+,/;<=>?@[]^`{|}~ \n\t\r).
- Parameters
-
[in] _val Value to check the conformity.
- Returns
- true The element char is considerable as a string
- false The element char is NOT considerable as a string
§ clear()
|
virtual |
clear the Node
Reimplemented in ejson::internal::Object, and ejson::internal::Array.
§ clone()
|
virtual |
Copy the curent node and all the child in the curent one.
- Returns
- nullptr in an error occured, the pointer on the element otherwise
Reimplemented in ejson::internal::Object, ejson::internal::Number, ejson::internal::Array, ejson::internal::Boolean, ejson::internal::String, and ejson::internal::Null.
§ countWhiteChar()
|
protected |
count the number of white char in the string from the specify position (stop at the first element that is not a white char)
- Parameters
-
[in] _data Data to parse. [in] _pos Start position in the string. [out] _filePos new poistion of te file to add.
- Returns
- number of white element.
§ display()
void ejson::internal::Value::display | ( | ) | const |
Display the Document on console.
§ drawElementParsed()
|
protected |
Display the cuurent element that is curently parse.
- Parameters
-
[in] _val Char that is parsed. [in] _filePos Position of the char in the file.
§ getType()
enum ejson::valueType ejson::internal::Value::getType | ( | ) | const |
Get Value type.
- Returns
- Type of the object
§ iGenerate()
|
pure virtual |
generate a string with the tree of the json
- Parameters
-
[in,out] _data string where to add the elements [in] _indent current indentation of the file
- Returns
- false if an error occured.
Implemented in ejson::internal::Object, ejson::internal::Document, ejson::internal::Number, ejson::internal::Array, ejson::internal::Boolean, ejson::internal::String, and ejson::internal::Null.
§ iMachineGenerate()
|
pure virtual |
generate a string with the tree of the json (not human readable ==> for computer transfer)
- Parameters
-
[in,out] _data string where to add the elements
- Returns
- false if an error occured.
Implemented in ejson::internal::Object, ejson::internal::Number, ejson::internal::Array, ejson::internal::Boolean, ejson::internal::String, and ejson::internal::Null.
§ iParse()
|
pure virtual |
parse the Current node [pure VIRUAL]
- Parameters
-
[in] _data data string to parse. [in,out] _pos position in the string to start parse, return the position end of parsing. [in,out] _filePos Position in the file (in X/Y) [in,out] _doc Reference on the main document
- Returns
- false if an error occured.
Implemented in ejson::internal::Object, ejson::internal::Document, ejson::internal::Number, ejson::internal::Array, ejson::internal::Boolean, ejson::internal::String, and ejson::internal::Null.
§ isWhiteChar()
|
staticprotected |
check if the current element is white or not : '\t' '\n' '\r' ' '
- Parameters
-
[in] _val Char value to check
- Returns
- tue if it is white char
§ transfertIn()
|
virtual |
Tranfert all element in the element set in parameter.
- Parameters
-
[in,out] _obj move all parameter in the selected element
- Returns
- true if transfer is done corectly
- Note
- all element is remove from the curent element.
Reimplemented in ejson::internal::Object, ejson::internal::Number, ejson::internal::Array, ejson::internal::Boolean, ejson::internal::String, and ejson::internal::Null.
Member Data Documentation
§ m_type
|
protected |
Type of the element.
The documentation for this class was generated from the following file:
- framework/atria-soft/ejson/ejson/internal/Value.hpp