GCC Middle and Back End API Reference
json::array Class Reference

#include <json.h>

Inheritance diagram for json::array:
Collaboration diagram for json::array:

Public Member Functions

 ~array ()
 
enum kind get_kind () const final override
 
void print (pretty_printer *pp, bool formatted) const final override
 
void append (value *v)
 
void append_string (const char *utf8_value)
 
template<typename JsonType >
void append (std::unique_ptr< JsonType > v)
 
size_t size () const
 
valueoperator[] (size_t i) const
 
void dump (FILE *, bool formatted) const
 
void DEBUG_FUNCTION dump () const
 

Private Attributes

auto_vec< value * > m_elements
 

Detailed Description

Subclass of value for arrays.   

Constructor & Destructor Documentation

◆ ~array()

array::~array ( )
class json::array, a subclass of json::value, representing
an ordered collection of values.   
json::array's dtor.   

References FOR_EACH_VEC_ELT, i, and m_elements.

Member Function Documentation

◆ append() [1/2]

template<typename JsonType >
void json::array::append ( std::unique_ptr< JsonType > v)
inline

References append().

◆ append() [2/2]

◆ append_string()

void array::append_string ( const char * utf8_value)

◆ dump() [1/2]

void value::dump ( ) const
inherited
A convenience function for debugging.
Dump to stderr with formatting, and a trailing newline.  

References json::value::dump().

Referenced by json::value::dump().

◆ dump() [2/2]

void value::dump ( FILE * outf,
bool formatted ) const
inherited
class json::value.   
Dump this json::value tree to OUTF.

The key/value pairs of json::objects are printed in the order
in which the keys were originally inserted.   

References output_buffer::m_stream, pp_buffer(), pp_flush(), and json::value::print().

Referenced by generate_results().

◆ get_kind()

enum kind json::array::get_kind ( ) const
inlinefinaloverridevirtual

Implements json::value.

References json::JSON_ARRAY.

◆ operator[]()

value * json::array::operator[] ( size_t i) const
inline

References i, and m_elements.

◆ print()

void array::print ( pretty_printer * pp,
bool formatted ) const
finaloverridevirtual
Implementation of json::value::print for json::array.   

Implements json::value.

References FOR_EACH_VEC_ELT, i, m_elements, pp_character(), pp_indent(), pp_indentation(), pp_newline(), pp_space, pp_string(), and json::value::print().

Referenced by optrecord_json_writer::write().

◆ size()

size_t json::array::size ( ) const
inline

Field Documentation

◆ m_elements

auto_vec<value *> json::array::m_elements
private

Referenced by append(), operator[](), print(), size(), and ~array().


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