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

Simple class that alows for building a tree of data that can be serialized into Json format. More...

#include <Json.h>

Classes

class  Node
 
class  NodeValue
 

Public Member Functions

 Json ()
 
 ~Json ()
 
std::shared_ptr< NodeaddChild (std::string)
 
template<typename T >
std::shared_ptr< NodeaddChild (std::string, T)
 

Private Attributes

std::unique_ptr< std::vector< std::shared_ptr< Node > > > root
 

Friends

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

Detailed Description

Simple class that alows for building a tree of data that can be serialized into Json format.

Definition at line 11 of file Json.h.

Constructor & Destructor Documentation

◆ Json()

Json::Json ( )

Definition at line 221 of file Json.cpp.

◆ ~Json()

Json::~Json ( )

Definition at line 224 of file Json.cpp.

Member Function Documentation

◆ addChild() [1/2]

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

Definition at line 227 of file Json.cpp.

References root.

◆ addChild() [2/2]

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

Definition at line 137 of file Json.h.

References root.

Friends And Related Function Documentation

◆ operator<< [1/2]

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

Definition at line 238 of file Json.cpp.

◆ operator<< [2/2]

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

Definition at line 86 of file Json.cpp.

Member Data Documentation

◆ root

std::unique_ptr<std::vector<std::shared_ptr<Node> > > Json::root
private

Definition at line 91 of file Json.h.

Referenced by addChild(), and operator<<().


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