HOG2
Public Member Functions | Private Attributes | Friends | List of all members
Json::Node Class Reference

#include <Json.h>

Inheritance diagram for Json::Node:
Inheritance graph
[legend]
Collaboration diagram for Json::Node:
Collaboration graph
[legend]

Public Member Functions

 Node (std::string)
 
 Node (std::string, std::unique_ptr< NodeValue >)
 
 ~Node ()
 
std::shared_ptr< NodegetPtr ()
 
std::shared_ptr< NodeaddChild (std::string)
 
template<typename T >
std::shared_ptr< NodeaddChild (std::string, T)
 
template<typename T >
void addData (T)
 
template<typename T >
std::shared_ptr< Json::NodeaddChild (std::string name, T val)
 

Private Attributes

std::string name
 
std::unique_ptr< Json::NodeValuevalue
 

Friends

std::ostream & operator<< (std::ostream &, Node const &)
 
std::ostream & operator<< (std::ostream &, Json::NodeValue const &)
 
std::ostream & operator<< (std::ostream &, Json const &)
 

Detailed Description

Definition at line 103 of file Json.h.

Constructor & Destructor Documentation

◆ Node() [1/2]

Json::Node::Node ( std::string  name)

Definition at line 156 of file Json.cpp.

◆ Node() [2/2]

Json::Node::Node ( std::string  name,
std::unique_ptr< NodeValue val 
)

Definition at line 159 of file Json.cpp.

◆ ~Node()

Json::Node::~Node ( )

Definition at line 162 of file Json.cpp.

Member Function Documentation

◆ addChild() [1/3]

template<typename T >
std::shared_ptr<Json::Node> Json::Node::addChild ( std::string  name,
val 
)

Definition at line 150 of file Json.h.

References name, Json::NodeValue::NIL, value, and Json::NodeValue::VECTOR.

◆ addChild() [2/3]

std::shared_ptr< Json::Node > Json::Node::addChild ( std::string  name)

Definition at line 171 of file Json.cpp.

References Json::NodeValue::NIL, and Json::NodeValue::VECTOR.

◆ addChild() [3/3]

template<typename T >
std::shared_ptr<Node> Json::Node::addChild ( std::string  ,
 
)

◆ addData()

template<typename T >
void Json::Node::addData ( data)

Definition at line 197 of file Json.h.

References Json::NodeValue::NIL, and Json::NodeValue::VECTOR.

◆ getPtr()

std::shared_ptr< Json::Node > Json::Node::getPtr ( )

Definition at line 165 of file Json.cpp.

Friends And Related Function Documentation

◆ operator<< [1/3]

std::ostream& operator<< ( std::ostream &  os,
Json const &  json 
)
friend

Definition at line 238 of file Json.cpp.

◆ operator<< [2/3]

std::ostream& operator<< ( std::ostream &  os,
Json::NodeValue const &  nodeValue 
)
friend

Definition at line 86 of file Json.cpp.

◆ operator<< [3/3]

std::ostream& operator<< ( std::ostream &  os,
Json::Node const &  node 
)
friend

Definition at line 212 of file Json.cpp.

Member Data Documentation

◆ name

std::string Json::Node::name
private

Definition at line 119 of file Json.h.

Referenced by addChild().

◆ value

std::unique_ptr<Json::NodeValue> Json::Node::value
private

Definition at line 120 of file Json.h.

Referenced by addChild().


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