libzypp  17.23.8
zypp::json::Object Class Reference

JSON object. More...

#include <Json.h>

Public Member Functions

 Object ()
template<class Iterator >
 Object (Iterator begin, Iterator end)
 Construct from map-iterator. More...
 Object (const std::initializer_list< std::pair< String, Value >> &contents_r)
 Construct from map-initializer list { {k1,v1}, {k2,v2},... More...
void add (const String &key_r, const Value &val_r)
 Add key/value pair. More...
void add (const std::initializer_list< std::pair< String, Value >> &contents_r)
std::string asJSON () const
 JSON representation. More...
std::string asString () const
 String representation. More...
std::ostream & dumpOn (std::ostream &str) const
 Stream output. More...

Private Member Functions

std::ostream & dumpOn (std::ostream &str, std::map< std::string, std::string >::const_iterator val_r) const

Private Attributes

std::map< std::string, std::string > _data

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const Object &obj)

Detailed Description

JSON object.

Definition at line 321 of file Json.h.

Constructor & Destructor Documentation

◆ Object() [1/3]

zypp::json::Object::Object ( )

Definition at line 323 of file Json.h.

◆ Object() [2/3]

template<class Iterator >
zypp::json::Object::Object ( Iterator  begin,
Iterator  end 

Construct from map-iterator.

Definition at line 327 of file Json.h.

◆ Object() [3/3]

zypp::json::Object::Object ( const std::initializer_list< std::pair< String, Value >> &  contents_r)

Construct from map-initializer list { {k1,v1}, {k2,v2},...


Definition at line 331 of file Json.h.

Member Function Documentation

◆ add() [1/2]

void zypp::json::Object::add ( const String key_r,
const Value val_r 

Add key/value pair.

Definition at line 336 of file Json.h.

◆ add() [2/2]

void zypp::json::Object::add ( const std::initializer_list< std::pair< String, Value >> &  contents_r)

Definition at line 340 of file Json.h.

◆ asJSON()

std::string zypp::json::Object::asJSON ( ) const

JSON representation.

Definition at line 344 of file Json.h.

◆ asString()

std::string zypp::json::Object::asString ( ) const

String representation.

Definition at line 348 of file Json.h.

◆ dumpOn() [1/2]

std::ostream& zypp::json::Object::dumpOn ( std::ostream &  str) const

Stream output.

Definition at line 352 of file Json.h.

◆ dumpOn() [2/2]

std::ostream& zypp::json::Object::dumpOn ( std::ostream &  str,
std::map< std::string, std::string >::const_iterator  val_r 
) const

Definition at line 364 of file Json.h.

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  str,
const Object obj 

Stream output

Definition at line 371 of file Json.h.

Member Data Documentation

◆ _data

std::map<std::string,std::string> zypp::json::Object::_data

Definition at line 367 of file Json.h.

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