tudocomp
– The TU Dortmund Compression Framework
tdc::json::Object Class Reference

Represents a JSON object that behaves like a dictionary. More...

#include <Json.hpp>

Inheritance diagram for tdc::json::Object:
tdc::json::Value

Public Member Functions

template<typename T >
void set (const std::string &key, const T &value)
 Sets a member value of the object. More...
 
void set (const std::string &key, const char *value)
 Sets a member value of the object. More...
 
void set (const std::string &key, const Object &value)
 Sets a member value of the object. More...
 
void set (const std::string &key, const Array &value)
 Sets a member value of the object. More...
 
virtual void str (std::ostream &s, unsigned int level=0) const override
 Writes the object's JSON string representation into the given stream. More...
 
std::string str () const
 Returns the object's JSON string representation. More...
 
- Public Member Functions inherited from tdc::json::Value
std::string str () const
 Returns this value's JSON string representation. More...
 

Detailed Description

Represents a JSON object that behaves like a dictionary.

Definition at line 153 of file Json.hpp.

Member Function Documentation

◆ set() [1/4]

template<typename T >
void tdc::json::Object::set ( const std::string &  key,
const T &  value 
)
inline

Sets a member value of the object.

Template Parameters
thevalue type
Parameters
keythe member name
valuethe value

Definition at line 164 of file Json.hpp.

◆ set() [2/4]

void tdc::json::Object::set ( const std::string &  key,
const char *  value 
)
inline

Sets a member value of the object.

Parameters
keythe member name
valuethe C string value

Definition at line 172 of file Json.hpp.

◆ set() [3/4]

void tdc::json::Object::set ( const std::string &  key,
const Object value 
)
inline

Sets a member value of the object.

Parameters
keythe member name
valuethe object

Definition at line 180 of file Json.hpp.

◆ set() [4/4]

void tdc::json::Object::set ( const std::string &  key,
const Array value 
)
inline

Sets a member value of the object.

Parameters
keythe member name
valuethe array

Definition at line 188 of file Json.hpp.

◆ str() [1/2]

virtual void tdc::json::Object::str ( std::ostream &  s,
unsigned int  level = 0 
) const
inlineoverridevirtual

Writes the object's JSON string representation into the given stream.

Parameters
sthe output stream to write to
levelthe indentation level

Implements tdc::json::Value.

Definition at line 197 of file Json.hpp.

◆ str() [2/2]

std::string tdc::json::Object::str ( ) const
inline

Returns the object's JSON string representation.

Returns
the object's JSON string representation

Definition at line 218 of file Json.hpp.


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