libzypp 17.37.10

zypp::json::Array Class Reference

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

## Public Types
using | iterator = std::vector<Value>::iterator
using | const_iterator = std::vector<Value>::const_iterator
using | size_type = std::vector<Value>::size_type

## Public Member Functions
| Array ()
template<class Iterator>
| Array (Iterator begin, Iterator end)
| Construct from container iterator.
template<class V>
| Array (const std::vector< V > &cont_r)
template<class V>
| Array (const std::list< V > &cont_r)
template<class V>
| Array (const std::set< V > &cont_r)
| Array (std::initializer_list< Value > contents_r)
| Construct from container initializer list { v1, v2,... }.
void | add (Value val_r)
| Push JSON Value to Array.
void | add (const std::initializer_list< Value > &contents_r)
std::string | asJSON () const
| JSON representation.
std::string | asString () const
| String representation.
std::ostream & | dumpOn (std::ostream &str) const
| Stream output.
iterator | begin ()
iterator | end ()
const_iterator | begin () const
const_iterator | end () const
const Value & | operator[] (size_type n) const
Value & | operator[] (size_type n)
size_type | size () const
bool | operator== (const Array &other) const

## Private Attributes
std::vector< Value > | _values

## Related Symbols
(Note that these are not member symbols.)
std::ostream & | operator<< (std::ostream &str, const Array &obj)
| Stream output.

## Detailed Description

Definition at line 32 of file JsonValue.h.

## Member Typedef Documentation

## ◆ iterator

using zypp::json::Array::iterator = std::vector<Value>::iterator

Definition at line 36 of file JsonValue.h.

## ◆ const_iterator

using zypp::json::Array::const_iterator = std::vector<Value>::const_iterator

Definition at line 37 of file JsonValue.h.

## ◆ size_type

using zypp::json::Array::size_type = std::vector<Value>::size_type

Definition at line 38 of file JsonValue.h.

## Constructor & Destructor Documentation

## ◆ Array() [1/6]

zypp::json::Array::Array | ( |  | ) |
| inline

Definition at line 40 of file JsonValue.h.

## ◆ Array() [2/6]

template<class Iterator>

zypp::json::Array::Array | ( | Iterator | begin,
|  | Iterator | end )

Construct from container iterator.

Definition at line 312 of file JsonValue.h.

## ◆ Array() [3/6]

template<class V>

zypp::json::Array::Array | ( | const std::vector< V > & | cont_r | ) |
| inline

Definition at line 47 of file JsonValue.h.

## ◆ Array() [4/6]

template<class V>

zypp::json::Array::Array | ( | const std::list< V > & | cont_r | ) |
| inline

Definition at line 50 of file JsonValue.h.

## ◆ Array() [5/6]

template<class V>

zypp::json::Array::Array | ( | const std::set< V > & | cont_r | ) |
| inline

Definition at line 53 of file JsonValue.h.

## ◆ Array() [6/6]

zypp::json::Array::Array | ( | std::initializer_list< Value > | contents_r | ) |

Construct from container initializer list { v1, v2,... }.

Definition at line 14 of file JsonValue.cc.

## Member Function Documentation

## ◆ add() [1/2]

void zypp::json::Array::add | ( | Value | val_r | ) |

Push JSON Value to Array.

Definition at line 18 of file JsonValue.cc.

## ◆ add() [2/2]

void zypp::json::Array::add | ( | const std::initializer_list< Value > & | contents_r | ) |

Definition at line 21 of file JsonValue.cc.

## ◆ asJSON()

std::string zypp::json::Array::asJSON | ( |  | ) | const
| inline

JSON representation.

Definition at line 65 of file JsonValue.h.

## ◆ asString()

std::string zypp::json::Array::asString | ( |  | ) | const
| inline

String representation.

Definition at line 69 of file JsonValue.h.

## ◆ dumpOn()

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

Stream output.

Definition at line 27 of file JsonValue.cc.

## ◆ begin() [1/2]

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

Definition at line 75 of file JsonValue.h.

## ◆ end() [1/2]

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

Definition at line 76 of file JsonValue.h.

## ◆ begin() [2/2]

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

Definition at line 78 of file JsonValue.h.

## ◆ end() [2/2]

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

Definition at line 79 of file JsonValue.h.

## ◆ operator[]() [1/2]

const Value & zypp::json::Array::operator[] | ( | size_type | n | ) | const
| inline

Definition at line 81 of file JsonValue.h.

## ◆ operator[]() [2/2]

Value & zypp::json::Array::operator[] | ( | size_type | n | ) |
| inline

Definition at line 82 of file JsonValue.h.

## ◆ size()

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

Definition at line 84 of file JsonValue.h.

## ◆ operator==()

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

Definition at line 37 of file JsonValue.cc.

## Friends And Related Symbol Documentation

## ◆ operator<<()

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

Stream output.

Definition at line 93 of file JsonValue.h.

## Member Data Documentation

## ◆ _values

std::vector<Value> zypp::json::Array::_values
| private

Definition at line 89 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