Inherits from JSON::Object, specialized in JSON Node. A Node owns a vector of Object. The Node's children can either be Leaf or other Node objects. This allows to store the tree structure of a .json file.
More...
#include <jsonObject.h>
|
|
static std::unique_ptr< Node > | make (std::string const &specifier) |
| |
|
static std::unique_ptr< Node > | make (std::string const &specifier) |
| |
|
|
std::vector< Child > | children |
| | std::vector of Child owned by the Node. Each child is in the form of a unique_ptr to an Object, and can be either a Leaf or another Node.
|
| |
|
|
std::string | specifier |
| | String that represents the specifier of the object. For example: "name": "electron" is an object of which the specifier is the string "name".
|
| |
Inherits from JSON::Object, specialized in JSON Node. A Node owns a vector of Object. The Node's children can either be Leaf or other Node objects. This allows to store the tree structure of a .json file.
◆ Node() [1/2]
| JSON::Node::Node |
( |
std::string const & |
specifier | ) |
|
|
inlineexplicit |
Construtor with one paramter that initializes specifier.
- Parameters
-
| t_specifier | Name of the Node's specifier. |
◆ Node() [2/2]
| JSON::Node::Node |
( |
std::string const & |
specifier | ) |
|
|
inlineexplicit |
Construtor with one paramter that initializes specifier.
- Parameters
-
| t_specifier | Name of the Node's specifier. |
◆ addChild() [1/8]
| virtual void JSON::Node::addChild |
( |
Child & |
child | ) |
|
|
inlinevirtual |
◆ addChild() [2/8]
| virtual void JSON::Node::addChild |
( |
Child & |
child | ) |
|
|
inlinevirtual |
◆ addChild() [3/8]
template<class T >
| void JSON::Node::addChild |
( |
std::unique_ptr< T > & |
child | ) |
|
|
inline |
Adds a child in the Node.
- Parameters
-
| child | New child added in children. |
◆ addChild() [4/8]
template<class T >
| void JSON::Node::addChild |
( |
std::unique_ptr< T > & |
child | ) |
|
|
inline |
Adds a child in the Node.
- Parameters
-
| child | New child added in children. |
◆ addChild() [5/8]
| virtual void JSON::Node::addChild |
( |
Child && |
child | ) |
|
|
inlinevirtual |
◆ addChild() [6/8]
| virtual void JSON::Node::addChild |
( |
Child && |
child | ) |
|
|
inlinevirtual |
◆ addChild() [7/8]
template<class T >
| void JSON::Node::addChild |
( |
std::unique_ptr< T > && |
child | ) |
|
|
inline |
Adds a child in the Node.
- Parameters
-
| child | New child added in children. |
◆ addChild() [8/8]
template<class T >
| void JSON::Node::addChild |
( |
std::unique_ptr< T > && |
child | ) |
|
|
inline |
Adds a child in the Node.
- Parameters
-
| child | New child added in children. |
◆ begin() [1/4]
| std::vector<Child>::const_iterator JSON::Node::begin |
( |
| ) |
const |
|
inline |
- Returns
- A const_iterator to the begining of children.
◆ begin() [2/4]
| std::vector<Child>::const_iterator JSON::Node::begin |
( |
| ) |
const |
|
inline |
- Returns
- A const_iterator to the begining of children.
◆ begin() [3/4]
| std::vector<Child>::iterator JSON::Node::begin |
( |
| ) |
|
|
inline |
- Returns
- An iterator to the begining of children.
◆ begin() [4/4]
| std::vector<Child>::iterator JSON::Node::begin |
( |
| ) |
|
|
inline |
- Returns
- An iterator to the begining of children.
◆ empty() [1/2]
| bool JSON::Node::empty |
( |
| ) |
const |
|
inline |
Tells if the Node is empty.
- Returns
- True if the node has no child.
-
False else.
◆ empty() [2/2]
| bool JSON::Node::empty |
( |
| ) |
const |
|
inline |
Tells if the Node is empty.
- Returns
- True if the node has no child.
-
False else.
◆ end() [1/4]
| std::vector<Child>::const_iterator JSON::Node::end |
( |
| ) |
const |
|
inline |
- Returns
- A const_iterator to the end of children.
◆ end() [2/4]
| std::vector<Child>::const_iterator JSON::Node::end |
( |
| ) |
const |
|
inline |
- Returns
- A const_iterator to the end of children.
◆ end() [3/4]
| std::vector<Child>::iterator JSON::Node::end |
( |
| ) |
|
|
inline |
- Returns
- An iterator to the end of children.
◆ end() [4/4]
| std::vector<Child>::iterator JSON::Node::end |
( |
| ) |
|
|
inline |
- Returns
- An iterator to the end of children.
◆ getChild() [1/2]
| Object* JSON::Node::getChild |
( |
std::string const & |
spec | ) |
const |
|
inline |
Returns the first child that has a given specifier.
- Parameters
-
| spec | String of the specifier to search. |
- Returns
- An Object* pointing to the first child specified by spec in children.
-
nullptr if no child has been found.
◆ getChild() [2/2]
| Object* JSON::Node::getChild |
( |
std::string const & |
spec | ) |
const |
|
inline |
Returns the first child that has a given specifier.
- Parameters
-
| spec | String of the specifier to search. |
- Returns
- An Object* pointing to the first child specified by spec in children.
-
nullptr if no child has been found.
◆ isNode() [1/2]
| bool JSON::Node::isNode |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ isNode() [2/2]
| bool JSON::Node::isNode |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ size() [1/2]
| size_t JSON::Node::size |
( |
| ) |
const |
|
inline |
- Returns
- children.size(), the number of children.
◆ size() [2/2]
| size_t JSON::Node::size |
( |
| ) |
const |
|
inline |
- Returns
- children.size(), the number of children.
The documentation for this class was generated from the following file:
- /home/uhlrich/Bureau/MARTY/newlife/marty-dev/jsonparser/include/jsonObject.h