ejson::Array Class Reference

#include <Array.hpp>

Inheritance diagram for ejson::Array:
ejson::Value

Public Types

using iterator = ejson::iterator< ejson::Array >
 

Public Member Functions

 Array (ememory::SharedPtr< ejson::internal::Value > _internalValue)
 
 Array (const ejson::Array &_obj)
 
 Array ()
 
ejson::Arrayoperator= (const ejson::Array &_obj)
 
size_t size () const
 
ejson::Value operator[] (size_t _id)
 
const ejson::Value operator[] (size_t _id) const
 
bool add (const ejson::Value &_element)
 
void remove (size_t _id)
 
iterator begin ()
 
iterator end ()
 
const iterator begin () const
 
const iterator end () const
 
iterator remove (const iterator &_it)
 
- Public Member Functions inherited from ejson::Value
enum ejson::valueType getType () const
 
 Value (const ememory::SharedPtr< ejson::internal::Value > &_internalValue)
 
 Value ()
 
virtual ~Value ()=default
 
void display () const
 
bool exist () 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
 
void clear ()
 
bool transfertIn (ejson::Value &_obj)
 
ejson::Value clone () const
 
std::string generateHumanString () const
 
std::string generateMachineString () const
 

Additional Inherited Members

- Protected Attributes inherited from ejson::Value
ememory::SharedPtr< ejson::internal::Valuem_data
 

Detailed Description

ejson Array interface [ ... ].

Member Typedef Documentation

§ iterator

Specify iterator of the Array methode.

Constructor & Destructor Documentation

§ Array() [1/3]

ejson::Array::Array ( ememory::SharedPtr< ejson::internal::Value _internalValue)

Constructor.

Parameters
[in]_internalValueInternal Value to set data

§ Array() [2/3]

ejson::Array::Array ( const ejson::Array _obj)

Copy constructor.

Parameters
[in]_objObject to copy

§ Array() [3/3]

ejson::Array::Array ( )

Constructor.

Member Function Documentation

§ add()

bool ejson::Array::add ( const ejson::Value _element)

add an element on the array.

Parameters
[in]_elementelement to add.
Returns
false if an error occured.

§ begin() [1/2]

iterator ejson::Array::begin ( )

Get iterator of the first Value.

Returns
iterator on the begin position of the Value

§ begin() [2/2]

const iterator ejson::Array::begin ( ) const

Get const iterator of the first Value.

Returns
const iterator on the begin position of the Value

§ end() [1/2]

iterator ejson::Array::end ( )

Get iterator of the next of the last Value.

Returns
iterator on the next of the last position of the Value

§ end() [2/2]

const iterator ejson::Array::end ( ) const

Get const iterator of the next of the last Value.

Returns
const iterator on the next of the last position of the Value

§ operator=()

ejson::Array& ejson::Array::operator= ( const ejson::Array _obj)

Copy constructor.

Parameters
[in]_objObject to copy
Returns
Local reference on this object

§ operator[]() [1/2]

ejson::Value ejson::Array::operator[] ( 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.

§ operator[]() [2/2]

const ejson::Value ejson::Array::operator[] ( 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.

§ remove() [1/2]

void ejson::Array::remove ( size_t  _id)

Remove Value with his Id.

Parameters
[in]_idId of the element.

§ remove() [2/2]

iterator ejson::Array::remove ( const iterator _it)

Remove Value with his iterator.

Parameters
[in]_itIterator on the Value.
Returns
New valid iterator on the next element or this.end()

§ size()

size_t ejson::Array::size ( ) const

get the number of sub element in the current one

Returns
the Number of stored element

The documentation for this class was generated from the following file: