iterator.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <ememory/memory.hpp>
9 #include <etk/types.hpp>
10 
11 namespace ejson {
15  template<class EJSON_BASE_T>
16  class iterator {
17  private:
18  EJSON_BASE_T& m_data;
19  size_t m_id;
20  public:
26  iterator(EJSON_BASE_T& _obj, size_t _pos);
32  iterator(const EJSON_BASE_T& _obj, size_t _pos);
37  iterator(const iterator& _obj);
43  iterator& operator= (const iterator& _obj);
49  iterator& operator+= (int32_t _val);
55  iterator operator+ (int32_t _val) const;
61  iterator& operator-= (int32_t _val);
67  iterator operator- (int32_t _val) const;
77  iterator operator++(int);
87  iterator operator--(int);
94  bool operator== (const iterator& _obj) const;
101  bool operator!= (const iterator& _obj) const;
106  const ejson::Value operator *() const noexcept;
111  ejson::Value operator *() noexcept;
116  size_t getId() const noexcept;
121  std::string getKey() const noexcept;
122  };
123 }
bool operator==(const iterator &_obj) const
Equality compare operator with an other iterator.
iterator & operator--()
Operator++ Pre-decrementation of this iterator.
const ejson::Value operator*() const noexcept
Get the property Value.
std::string getKey() const noexcept
Get Key of an element.
iterator(EJSON_BASE_T &_obj, size_t _pos)
Constructor of the generic object class.
the element "..."
iterator & operator-=(int32_t _val)
Operator-= Decrement a value.
ejson namespace containing all function for JSON interpretor
Definition: Array.hpp:12
size_t getId() const noexcept
Get ID of an element.
bool operator!=(const iterator &_obj) const
In-Equality compare operator with an other iterator.
iterator & operator=(const iterator &_obj)
Operator+= Addition value.
iterator operator+(int32_t _val) const
Operator+ Addition a value.
iterator & operator++()
Operator++ Pre-incrementation of this iterator.
Basic main object of all json elements.
Definition: Value.hpp:31
Definition: iterator.hpp:16
iterator & operator+=(int32_t _val)
Operator+= Addition value.
iterator operator-(int32_t _val) const
Operator- Decrement a value.