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

#include <json.h>

Inheritance diagram for json::string:
Collaboration diagram for json::string:

Public Member Functions

 string (const char *utf8)
 string (const char *utf8, size_t len)
 ~string ()
enum kind get_kind () const final override
void print (pretty_printer *pp, bool formatted) const final override
const charget_string () const
size_t get_length () const
void dump (FILE *, bool formatted) const

Private Attributes

size_t m_len

Detailed Description

Subclass of value for strings.   

Constructor & Destructor Documentation

◆ string() [1/2]

string::string ( const char * utf8)
class json::string, a subclass of json::value.   
json::string's ctor.   

References gcc_assert, ggc_alloc(), m_len, and m_utf8.

◆ string() [2/2]

string::string ( const char * utf8,
size_t len )

References gcc_assert, ggc_alloc(), m_len, and m_utf8.

◆ ~string()

json::string::~string ( )

References free(), and m_utf8.

Member Function Documentation

◆ dump()

void value::dump ( FILE * outf,
bool formatted ) const
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 ggc_alloc(), pp_buffer, pp_flush(), and json::value::print().

Referenced by json_output_format::flush_to_file(), and generate_results().

◆ get_kind()

enum kind json::string::get_kind ( ) const

Implements json::value.

References json::JSON_STRING.

◆ get_length()

size_t json::string::get_length ( ) const

References m_len.

◆ get_string()

const char * json::string::get_string ( ) const

References m_utf8.

◆ print()

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

Implements json::value.

References m_len, m_utf8, and print_escaped_json_string().

Field Documentation

◆ m_len

size_t json::string::m_len

Referenced by get_length(), print(), string(), and string().

◆ m_utf8

char* json::string::m_utf8

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