libzypp  17.14.0
zypp::json::Array Class Reference

JSON array. More...

#include <Json.h>

Public Member Functions

 Array ()
 
template<class Iterator >
 Array (Iterator begin, Iterator end)
 Construct from container iterator. More...
 
 Array (const std::initializer_list< Value > &contents_r)
 Construct from container initializer list { v1, v2,... More...
 
void add (const Value &val_r)
 Push JSON Value to Array. More...
 
void add (const std::initializer_list< 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 Attributes

std::list< std::string > _data
 

Related Functions

(Note that these are not member functions.)

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

Detailed Description

JSON array.

Definition at line 256 of file Json.h.

Constructor & Destructor Documentation

◆ Array() [1/3]

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

Definition at line 258 of file Json.h.

◆ Array() [2/3]

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

Construct from container iterator.

Definition at line 262 of file Json.h.

◆ Array() [3/3]

zypp::json::Array::Array ( const std::initializer_list< Value > &  contents_r)
inline

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

}

Definition at line 266 of file Json.h.

Member Function Documentation

◆ add() [1/2]

void zypp::json::Array::add ( const Value val_r)
inline

Push JSON Value to Array.

Definition at line 271 of file Json.h.

◆ add() [2/2]

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 275 of file Json.h.

◆ asJSON()

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

JSON representation.

Definition at line 279 of file Json.h.

◆ asString()

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

String representation.

Definition at line 283 of file Json.h.

◆ dumpOn()

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

Stream output.

Definition at line 287 of file Json.h.

Friends And Related Function Documentation

◆ operator<<()

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

Stream output

Definition at line 302 of file Json.h.

Member Data Documentation

◆ _data

std::list<std::string> zypp::json::Array::_data
private

Definition at line 298 of file Json.h.


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