LLVM  9.0.0svn
Public Types | Public Member Functions | Friends | List of all members
llvm::json::Array Class Reference

An Array is a JSON array, which contains heterogeneous JSON values. More...

#include "llvm/Support/JSON.h"

Public Types

using value_type = Value
 
using iterator = std::vector< Value >::iterator
 
using const_iterator = std::vector< Value >::const_iterator
 

Public Member Functions

 Array ()=default
 
 Array (std::initializer_list< Value > Elements)
 
template<typename Collection >
 Array (const Collection &C)
 
Valueoperator[] (size_t I)
 
const Valueoperator[] (size_t I) const
 
Valuefront ()
 
const Valuefront () const
 
Valueback ()
 
const Valueback () const
 
Valuedata ()
 
const Valuedata () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
bool empty () const
 
size_t size () const
 
void reserve (size_t S)
 
void clear ()
 
void push_back (const Value &E)
 
void push_back (Value &&E)
 
template<typename... Args>
void emplace_back (Args &&... A)
 
void pop_back ()
 
iterator insert (iterator P, const Value &E)
 
iterator insert (iterator P, Value &&E)
 
template<typename It >
iterator insert (iterator P, It A, It Z)
 
template<typename... Args>
iterator emplace (const_iterator P, Args &&... A)
 

Friends

bool operator== (const Array &L, const Array &R)
 

Detailed Description

An Array is a JSON array, which contains heterogeneous JSON values.

It simulates std::vector<Value>.

Definition at line 154 of file JSON.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 160 of file JSON.h.

◆ iterator

Definition at line 159 of file JSON.h.

◆ value_type

Definition at line 158 of file JSON.h.

Constructor & Destructor Documentation

◆ Array() [1/3]

llvm::json::Array::Array ( )
default

◆ Array() [2/3]

llvm::json::Array::Array ( std::initializer_list< Value Elements)
explicit

Definition at line 91 of file JSON.cpp.

◆ Array() [3/3]

template<typename Collection >
llvm::json::Array::Array ( const Collection &  C)
inlineexplicit

Definition at line 164 of file JSON.h.

Member Function Documentation

◆ back() [1/2]

Value& llvm::json::Array::back ( )
inline

Definition at line 173 of file JSON.h.

◆ back() [2/2]

const Value& llvm::json::Array::back ( ) const
inline

Definition at line 174 of file JSON.h.

◆ begin() [1/2]

iterator llvm::json::Array::begin ( )
inline

Definition at line 178 of file JSON.h.

◆ begin() [2/2]

const_iterator llvm::json::Array::begin ( ) const
inline

Definition at line 179 of file JSON.h.

◆ clear()

void llvm::json::Array::clear ( )
inline

Definition at line 187 of file JSON.h.

◆ data() [1/2]

Value* llvm::json::Array::data ( )
inline

Definition at line 175 of file JSON.h.

◆ data() [2/2]

const Value* llvm::json::Array::data ( ) const
inline

Definition at line 176 of file JSON.h.

◆ emplace()

template<typename... Args>
iterator llvm::json::Array::emplace ( const_iterator  P,
Args &&...  A 
)
inline

Definition at line 202 of file JSON.h.

◆ emplace_back()

template<typename... Args>
void llvm::json::Array::emplace_back ( Args &&...  A)
inline

Definition at line 190 of file JSON.h.

◆ empty()

bool llvm::json::Array::empty ( ) const
inline

Definition at line 183 of file JSON.h.

◆ end() [1/2]

iterator llvm::json::Array::end ( )
inline

Definition at line 180 of file JSON.h.

◆ end() [2/2]

const_iterator llvm::json::Array::end ( ) const
inline

Definition at line 181 of file JSON.h.

◆ front() [1/2]

Value& llvm::json::Array::front ( )
inline

Definition at line 171 of file JSON.h.

◆ front() [2/2]

const Value& llvm::json::Array::front ( ) const
inline

Definition at line 172 of file JSON.h.

◆ insert() [1/3]

iterator llvm::json::Array::insert ( iterator  P,
const Value E 
)
inline

Definition at line 195 of file JSON.h.

◆ insert() [2/3]

iterator llvm::json::Array::insert ( iterator  P,
Value &&  E 
)
inline

Definition at line 196 of file JSON.h.

References E.

◆ insert() [3/3]

template<typename It >
iterator llvm::json::Array::insert ( iterator  P,
It  A,
It  Z 
)
inline

Definition at line 199 of file JSON.h.

◆ operator[]() [1/2]

Value& llvm::json::Array::operator[] ( size_t  I)
inline

Definition at line 169 of file JSON.h.

References I.

◆ operator[]() [2/2]

const Value& llvm::json::Array::operator[] ( size_t  I) const
inline

Definition at line 170 of file JSON.h.

References I.

◆ pop_back()

void llvm::json::Array::pop_back ( )
inline

Definition at line 193 of file JSON.h.

◆ push_back() [1/2]

void llvm::json::Array::push_back ( const Value E)
inline

Definition at line 188 of file JSON.h.

◆ push_back() [2/2]

void llvm::json::Array::push_back ( Value &&  E)
inline

Definition at line 189 of file JSON.h.

References E.

◆ reserve()

void llvm::json::Array::reserve ( size_t  S)
inline

Definition at line 185 of file JSON.h.

◆ size()

size_t llvm::json::Array::size ( ) const
inline

Definition at line 184 of file JSON.h.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const Array L,
const Array R 
)
friend

Definition at line 206 of file JSON.h.


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