Array.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 #include <ejson/Value.hpp>
10 #include <ejson/iterator.hpp>
11 
12 namespace ejson {
16  class Array : public ejson::Value {
17  public:
27  Array(const ejson::Array& _obj);
31  Array();
37  ejson::Array& operator= (const ejson::Array& _obj);
38  public:
43  size_t size() const;
49  ejson::Value operator[] (size_t _id);
55  const ejson::Value operator[] (size_t _id) const;
61  bool add(const ejson::Value& _element);
66  void remove(size_t _id);
67  public:
69 
73  iterator begin();
78  iterator end();
83  const iterator begin() const;
88  const iterator end() const;
94  iterator remove(const iterator& _it);
95  };
96 }
97 
size_t size() const
get the number of sub element in the current one
bool add(const ejson::Value &_element)
add an element on the array.
ejson namespace containing all function for JSON interpretor
Definition: Array.hpp:12
ejson::Value operator[](size_t _id)
get the pointer on an element reference with his ID.
Array()
Constructor.
ejson Array interface [ ... ].
Definition: Array.hpp:16
Basic main object of all json elements.
Definition: Value.hpp:31
ejson::Array & operator=(const ejson::Array &_obj)
Copy constructor.
Definition: iterator.hpp:16
iterator begin()
Get iterator of the first Value.
iterator end()
Get iterator of the next of the last Value.