LLVM 20.0.0git
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 (const_iterator P, const Value &E)
 
iterator insert (const_iterator P, Value &&E)
 
template<typename It >
iterator insert (const_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 164 of file JSON.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 170 of file JSON.h.

◆ iterator

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

Definition at line 169 of file JSON.h.

◆ value_type

Definition at line 168 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 98 of file JSON.cpp.

References back(), and emplace_back().

◆ Array() [3/3]

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

Definition at line 174 of file JSON.h.

References llvm::CallingConv::C, and emplace_back().

Member Function Documentation

◆ back() [1/2]

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

Definition at line 537 of file JSON.h.

Referenced by Array(), and llvm::json::toJSON().

◆ back() [2/2]

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

Definition at line 538 of file JSON.h.

◆ begin() [1/2]

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

Definition at line 542 of file JSON.h.

◆ begin() [2/2]

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

Definition at line 543 of file JSON.h.

◆ clear()

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

Definition at line 551 of file JSON.h.

◆ data() [1/2]

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

Definition at line 539 of file JSON.h.

◆ data() [2/2]

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

Definition at line 540 of file JSON.h.

◆ emplace()

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

Definition at line 569 of file JSON.h.

References A, and P.

◆ emplace_back()

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

Definition at line 554 of file JSON.h.

References A.

Referenced by Array().

◆ empty()

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

Definition at line 547 of file JSON.h.

Referenced by llvm::checkDebugInfoMetadata().

◆ end() [1/2]

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

Definition at line 544 of file JSON.h.

◆ end() [2/2]

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

Definition at line 545 of file JSON.h.

◆ front() [1/2]

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

Definition at line 535 of file JSON.h.

◆ front() [2/2]

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

Definition at line 536 of file JSON.h.

◆ insert() [1/3]

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

Definition at line 558 of file JSON.h.

References E, and P.

◆ insert() [2/3]

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

Definition at line 565 of file JSON.h.

References A, and P.

◆ insert() [3/3]

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

Definition at line 561 of file JSON.h.

References E, and P.

◆ operator[]() [1/2]

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

Definition at line 533 of file JSON.h.

References I.

◆ operator[]() [2/2]

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

Definition at line 534 of file JSON.h.

References I.

◆ pop_back()

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

Definition at line 557 of file JSON.h.

◆ push_back() [1/2]

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

◆ push_back() [2/2]

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

Definition at line 553 of file JSON.h.

References E.

◆ reserve()

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

Definition at line 549 of file JSON.h.

◆ size()

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

Definition at line 548 of file JSON.h.

Friends And Related Function Documentation

◆ operator==

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

Definition at line 572 of file JSON.h.


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