libzypp 17.37.17
zypp::json::Object Class Reference

#include <zypp-core/parser/json/JsonValue.h>

Public Types

using iterator = std::multimap<String, Value>::iterator
using const_iterator = std::multimap<String, Value>::const_iterator
using size_type = std::multimap<String, Value>::size_type

Public Member Functions

 Object ()
template<class Iterator>
 Object (Iterator begin, Iterator end)
 Construct from map-iterator.
 Object (const std::initializer_list< std::pair< String, Value > > &contents_r)
 Construct from map-initializer list { {k1,v1}, {k2,v2},... }.
template<typename K, typename V>
 Object (std::multimap< K, V > values)
template<typename K, typename V>
 Object (std::map< K, V > values)
void add (String key_r, Value val_r)
 Add key/value pair.
void add (std::initializer_list< std::pair< String, Value > > contents_r)
std::string asJSON () const
 JSON representation.
std::ostream & dumpOn (std::ostream &str) const
 Stream output.
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
bool contains (const String &key) const
size_type size () const
std::pair< iterator, iteratorequal_range (const String &key)
std::pair< const_iterator, const_iteratorequal_range (const String &key) const
std::vector< Valuevalues (const String &key) const
const Valuevalue (const String &key) const
bool operator== (const Object &other) const

Private Member Functions

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

Private Attributes

std::multimap< String, Value_values

(Note that these are not member symbols.)

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

Detailed Description

Definition at line 99 of file JsonValue.h.

Member Typedef Documentation

◆ iterator

using zypp::json::Object::iterator = std::multimap<String, Value>::iterator

Definition at line 102 of file JsonValue.h.

◆ const_iterator

using zypp::json::Object::const_iterator = std::multimap<String, Value>::const_iterator

Definition at line 103 of file JsonValue.h.

◆ size_type

using zypp::json::Object::size_type = std::multimap<String, Value>::size_type

Definition at line 104 of file JsonValue.h.

Constructor & Destructor Documentation

◆ Object() [1/5]

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

Definition at line 42 of file JsonValue.cc.

◆ Object() [2/5]

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

Construct from map-iterator.

Definition at line 110 of file JsonValue.h.

◆ Object() [3/5]

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 44 of file JsonValue.cc.

◆ Object() [4/5]

template<typename K, typename V>
zypp::json::Object::Object ( std::multimap< K, V > values)
inline

Definition at line 117 of file JsonValue.h.

◆ Object() [5/5]

template<typename K, typename V>
zypp::json::Object::Object ( std::map< K, V > values)
inline

Definition at line 120 of file JsonValue.h.

Member Function Documentation

◆ add() [1/2]

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

Add key/value pair.

Definition at line 48 of file JsonValue.cc.

◆ add() [2/2]

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

Definition at line 51 of file JsonValue.cc.

◆ asJSON()

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

JSON representation.

Definition at line 57 of file JsonValue.cc.

◆ dumpOn() [1/2]

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

Stream output.

Definition at line 60 of file JsonValue.cc.

◆ begin() [1/2]

iterator zypp::json::Object::begin ( )
inline

Definition at line 134 of file JsonValue.h.

◆ end() [1/2]

iterator zypp::json::Object::end ( )
inline

Definition at line 135 of file JsonValue.h.

◆ begin() [2/2]

const_iterator zypp::json::Object::begin ( ) const
inline

Definition at line 137 of file JsonValue.h.

◆ end() [2/2]

const_iterator zypp::json::Object::end ( ) const
inline

Definition at line 138 of file JsonValue.h.

◆ contains()

bool zypp::json::Object::contains ( const String & key) const

Definition at line 71 of file JsonValue.cc.

◆ size()

size_type zypp::json::Object::size ( ) const
inline

Definition at line 142 of file JsonValue.h.

◆ equal_range() [1/2]

std::pair< iterator, iterator > zypp::json::Object::equal_range ( const String & key)
inline

Definition at line 146 of file JsonValue.h.

◆ equal_range() [2/2]

std::pair< const_iterator, const_iterator > zypp::json::Object::equal_range ( const String & key) const
inline

Definition at line 150 of file JsonValue.h.

◆ values()

std::vector< Value > zypp::json::Object::values ( const String & key) const

Definition at line 75 of file JsonValue.cc.

◆ value()

const Value & zypp::json::Object::value ( const String & key) const

Definition at line 83 of file JsonValue.cc.

◆ operator==()

bool zypp::json::Object::operator== ( const Object & other) const

Definition at line 89 of file JsonValue.cc.

◆ dumpOn() [2/2]

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

Definition at line 93 of file JsonValue.cc.

◆ operator<<()

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

Stream output.

Definition at line 166 of file JsonValue.h.

Member Data Documentation

◆ _values

std::multimap<String, Value> zypp::json::Object::_values
private

Definition at line 162 of file JsonValue.h.


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