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

Represents an array of values. More...

#include <Json.hpp>

Inheritance diagram for tdc::json::Array:
tdc::json::Value

Public Member Functions

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

Detailed Description

Represents an array of values.

Definition at line 103 of file Json.hpp.

Member Function Documentation

◆ add() [1/4]

template<typename T >
void tdc::json::Array::add ( const T &  value)
inline

Adds a value to the array.

Template Parameters
Tthe value type
Parameters
valuethe value to add

Definition at line 113 of file Json.hpp.

◆ add() [2/4]

void tdc::json::Array::add ( const char *  value)
inline

Adds a C string value to the array.

Parameters
valuethe C string value to add

Definition at line 120 of file Json.hpp.

◆ add() [3/4]

void tdc::json::Array::add ( const Array value)
inline

Adds an array object to the array.

Parameters
valuevalue the array object to add

Definition at line 127 of file Json.hpp.

◆ add() [4/4]

void tdc::json::Array::add ( const Object obj)

Adds an object to the array.

Parameters
objthe object to add

◆ str()

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

Writes the array'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 141 of file Json.hpp.


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