libzypp: zypp::json::Array Class Reference

libzypp 17.38.9

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

## 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 | ( |  | ) |

Definition at line 14 of file JsonValue.cc.

## ◆ 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 16 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 20 of file JsonValue.cc.

## ◆ add() [2/2]

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

Definition at line 23 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 29 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

Definition at line 39 of file JsonValue.cc.

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

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

Definition at line 46 of file JsonValue.cc.

## ◆ size()

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

Definition at line 44 of file JsonValue.cc.

## ◆ operator==()

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

Definition at line 51 of file JsonValue.cc.

## 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