#include <Object.hpp>

Inheritance diagram for ejson::internal::Object:
ejson::internal::Value ememory::EnableSharedFromThis< Value > ememory::EnableSharedFromThisBase ejson::internal::Document

Public Member Functions

bool exist (const std::string &_name) const
 
ememory::SharedPtr< ejson::internal::Valueget (const std::string &_name)
 
const ememory::SharedPtr< ejson::internal::Valueget (const std::string &_name) const
 
std::vector< std::stringgetKeys () const
 
size_t size () const
 
ememory::SharedPtr< ejson::internal::Valueget (size_t _id)
 
const ememory::SharedPtr< ejson::internal::Valueget (size_t _id) const
 
std::string getKey (size_t _id) const
 
bool add (const std::string &_name, ememory::SharedPtr< ejson::internal::Value > _value)
 
void remove (const std::string &_name)
 
void remove (size_t _id)
 
bool cloneIn (ememory::SharedPtr< ejson::internal::Object > &_obj) const
 
ememory::SharedPtr< ejson::internal::ObjectcloneObj () const
 
bool iParse (const std::string &_data, size_t &_pos, ejson::FilePos &_filePos, ejson::internal::Document &_doc) override
 
bool iGenerate (std::string &_data, size_t _indent) const override
 
void iMachineGenerate (std::string &_data) const override
 
void clear () override
 
bool transfertIn (ememory::SharedPtr< ejson::internal::Value > _obj) override
 
ememory::SharedPtr< ejson::internal::Valueclone () const override
 
- Public Member Functions inherited from ejson::internal::Value
enum ejson::valueType getType () const
 
virtual ~Value ()
 
void display () 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
 

Static Public Member Functions

static ememory::SharedPtr< Objectcreate ()
 
static ememory::SharedPtr< Objectcreate (const std::string &_data)
 

Protected Member Functions

 Object ()
 
- Protected Member Functions inherited from ejson::internal::Value
 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
 

Protected Attributes

etk::Hash< ememory::SharedPtr< ejson::internal::Value > > m_value
 
- Protected Attributes inherited from ejson::internal::Value
enum ejson::valueType m_type
 

Additional Inherited Members

- Static Protected Member Functions inherited from ejson::internal::Value
static bool isWhiteChar (char32_t _val)
 

Detailed Description

ejson Object internal data implementation.

Constructor & Destructor Documentation

§ Object()

ejson::internal::Object::Object ( )
inlineprotected

basic element of a xml structure

Member Function Documentation

§ add()

bool ejson::internal::Object::add ( const std::string _name,
ememory::SharedPtr< ejson::internal::Value _value 
)

add an element in the Object

Parameters
[in]_namename of the object
[in]_valueElement to add
Returns
false if an error occured

§ clear()

void ejson::internal::Object::clear ( )
overridevirtual

clear the Node

Reimplemented from ejson::internal::Value.

§ clone()

ememory::SharedPtr<ejson::internal::Value> ejson::internal::Object::clone ( ) const
overridevirtual

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 from ejson::internal::Value.

§ cloneIn()

bool ejson::internal::Object::cloneIn ( ememory::SharedPtr< ejson::internal::Object > &  _obj) const

Clone the current object in an other Object.

Parameters
[in]_objOther object ot overwride
Returns
true The clone has been corectly done, false otherwise

§ cloneObj()

ememory::SharedPtr<ejson::internal::Object> ejson::internal::Object::cloneObj ( ) const

Clone the current object.

Returns
A new object that has been clone

§ create() [1/2]

static ememory::SharedPtr<Object> ejson::internal::Object::create ( )
static

Create factory on the ejson::internal::Object.

Returns
A SharedPtr on the Object value

§ create() [2/2]

static ememory::SharedPtr<Object> ejson::internal::Object::create ( const std::string _data)
static

Create factory on the ejson::internal::Object.

Parameters
[in]_dataJson stream to parse and interprete
Returns
A SharedPtr on the Object value

§ exist()

bool ejson::internal::Object::exist ( const std::string _name) const

check if an element exist.

Parameters
[in]_namename of the object.
Returns
The existance of the element.

§ get() [1/4]

ememory::SharedPtr<ejson::internal::Value> ejson::internal::Object::get ( const std::string _name)

get the sub element with his name (no cast check)

Parameters
[in]_namename of the object
Returns
pointer on the element requested or nullptr if it not the corect type or does not existed

§ get() [2/4]

const ememory::SharedPtr<ejson::internal::Value> ejson::internal::Object::get ( const std::string _name) const

get the sub element with his name (no cast check)

Parameters
[in]_namename of the object
Returns
pointer on the element requested or nullptr if it not the corect type or does not existed

§ get() [3/4]

ememory::SharedPtr<ejson::internal::Value> ejson::internal::Object::get ( size_t  _id)

get the pointer on an element reference with his ID.

Parameters
[in]_idId of the element.
Returns
nullptr if the element does not exist.

§ get() [4/4]

const ememory::SharedPtr<ejson::internal::Value> ejson::internal::Object::get ( size_t  _id) const

get the pointer on an element reference with his ID.

Parameters
[in]_idId of the element.
Returns
nullptr if the element does not exist.

§ getKey()

std::string ejson::internal::Object::getKey ( size_t  _id) const

Get the element name (key).

Parameters
[in]_idId of the element.
Returns
The name (key).

§ getKeys()

std::vector<std::string> ejson::internal::Object::getKeys ( ) const

Get all the element name (keys).

Returns
a vector of all name (key).

§ iGenerate()

bool ejson::internal::Object::iGenerate ( std::string _data,
size_t  _indent 
) const
overridevirtual

generate a string with the tree of the json

Parameters
[in,out]_datastring where to add the elements
[in]_indentcurrent indentation of the file
Returns
false if an error occured.

Implements ejson::internal::Value.

§ iMachineGenerate()

void ejson::internal::Object::iMachineGenerate ( std::string _data) const
overridevirtual

generate a string with the tree of the json (not human readable ==> for computer transfer)

Parameters
[in,out]_datastring where to add the elements
Returns
false if an error occured.

Implements ejson::internal::Value.

§ iParse()

bool ejson::internal::Object::iParse ( const std::string _data,
size_t &  _pos,
ejson::FilePos _filePos,
ejson::internal::Document _doc 
)
overridevirtual

parse the Current node [pure VIRUAL]

Parameters
[in]_datadata string to parse.
[in,out]_posposition in the string to start parse, return the position end of parsing.
[in,out]_filePosPosition in the file (in X/Y)
[in,out]_docReference on the main document
Returns
false if an error occured.

Implements ejson::internal::Value.

§ remove() [1/2]

void ejson::internal::Object::remove ( const std::string _name)

Remove Value with his name.

Parameters
[in]_nameName of the object

§ remove() [2/2]

void ejson::internal::Object::remove ( size_t  _id)

Remove Value with his id.

Parameters
[in]_idId of the element.

§ size()

size_t ejson::internal::Object::size ( ) const

get the number of sub element in the current one

Returns
the Number of stored element

§ transfertIn()

bool ejson::internal::Object::transfertIn ( ememory::SharedPtr< ejson::internal::Value _obj)
overridevirtual

Tranfert all element in the element set in parameter.

Parameters
[in,out]_objmove all parameter in the selected element
Returns
true if transfer is done corectly
Note
all element is remove from the curent element.

Reimplemented from ejson::internal::Value.

Member Data Documentation

§ m_value

etk::Hash<ememory::SharedPtr<ejson::internal::Value> > ejson::internal::Object::m_value
protected

value of the node (for element this is the name, for text it is the inside text ...)


The documentation for this class was generated from the following file:
  • framework/atria-soft/ejson/ejson/internal/Object.hpp