Array.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
10 
11 namespace ejson {
12  namespace internal {
16  class Array : public ejson::internal::Value {
17  protected:
21  Array() {
23  }
24  public:
30  private:
31  std::vector<ememory::SharedPtr<ejson::internal::Value> > m_value;
32  public:
37  size_t size() const;
49  const ememory::SharedPtr<ejson::internal::Value> get(size_t _id) const;
60  void remove(size_t _id);
61  public:
62  bool iParse(const std::string& _data, size_t& _pos, ejson::FilePos& _filePos, ejson::internal::Document& _doc) override;
63  bool iGenerate(std::string& _data, size_t _indent) const override;
64  void iMachineGenerate(std::string& _data) const override;
65  void clear() override;
68  };
69  }
70 }
71 
te element [ ... ]
bool iGenerate(std::string &_data, size_t _indent) const override
generate a string with the tree of the json
the element "..."
ejson namespace containing all function for JSON interpretor
Definition: Array.hpp:12
void clear() override
clear the Node
Position in the file of the original data.
Definition: FilePos.hpp:14
bool transfertIn(ememory::SharedPtr< ejson::internal::Value > _obj) override
Tranfert all element in the element set in parameter.
bool add(ememory::SharedPtr< ejson::internal::Value > _element)
add an element on the array.
bool iParse(const std::string &_data, size_t &_pos, ejson::FilePos &_filePos, ejson::internal::Document &_doc) override
parse the Current node [pure VIRUAL]
ememory::SharedPtr< ejson::internal::Value > clone() const override
Copy the curent node and all the child in the curent one.
static ememory::SharedPtr< Array > create()
Create factory on the ejson::internal::Array.
size_t size() const
get the number of sub element in the current one
ejson Document internal data implementation.
Definition: Document.hpp:20
enum ejson::valueType m_type
Type of the element.
Definition: Value.hpp:44
Array()
basic element of a xml structure
Definition: Array.hpp:21
void iMachineGenerate(std::string &_data) const override
generate a string with the tree of the json (not human readable ==> for computer transfer) ...
Basic main object of all json data.
Definition: Value.hpp:42
ejson Array internal data implementation.
Definition: Array.hpp:16