libzypp: zypp::json::Object Class Reference

libzypp 17.38.15

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, iterator > | equal_range (const String &key)
std::pair< const_iterator, const_iterator > | equal_range (const String &key) const
std::vector< Value > | values (const String &key) const
const Value & | value (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

## Detailed Description

Definition at line 101 of file JsonValue.h.

## Member Typedef Documentation

## ◆ iterator

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

Definition at line 104 of file JsonValue.h.

## ◆ const_iterator

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

Definition at line 105 of file JsonValue.h.

## ◆ size_type

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

Definition at line 106 of file JsonValue.h.

## Constructor & Destructor Documentation

## ◆ Object() [1/5]

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

Definition at line 56 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 112 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 58 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 119 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 122 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 62 of file JsonValue.cc.

## ◆ add() [2/2]

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

Definition at line 65 of file JsonValue.cc.

## ◆ asJSON()

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

JSON representation.

Definition at line 71 of file JsonValue.cc.

## ◆ dumpOn() [1/2]

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

Stream output.

Definition at line 74 of file JsonValue.cc.

## ◆ begin() [1/2]

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

Definition at line 136 of file JsonValue.h.

## ◆ end() [1/2]

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

Definition at line 137 of file JsonValue.h.

## ◆ begin() [2/2]

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

Definition at line 139 of file JsonValue.h.

## ◆ end() [2/2]

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

Definition at line 140 of file JsonValue.h.

## ◆ contains()

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

Definition at line 85 of file JsonValue.cc.

## ◆ size()

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

Definition at line 144 of file JsonValue.h.

## ◆ equal_range() [1/2]

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

Definition at line 148 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 152 of file JsonValue.h.

## ◆ values()

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

Definition at line 89 of file JsonValue.cc.

## ◆ value()

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

Definition at line 97 of file JsonValue.cc.

## ◆ operator==()

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

Definition at line 103 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 107 of file JsonValue.cc.

## Member Data Documentation

## ◆ _values

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

Definition at line 164 of file JsonValue.h.

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

- zypp-core/parser/json/JsonValue.h
- zypp-core/parser/json/JsonValue.cc