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 char * get_string () const
 
size_t get_length () const
 
void dump (FILE *, bool formatted) const
 
void DEBUG_FUNCTION dump () const
 

Private Attributes

char * m_utf8
 
size_t m_len
 

Detailed Description

Subclass of value for strings.   

Constructor & Destructor Documentation

◆ string() [1/2]

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

References gcc_assert, m_len, and m_utf8.

◆ string() [2/2]

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

References gcc_assert, m_len, and m_utf8.

◆ ~string()

json::string::~string ( )
inline

References free(), and m_utf8.

Member Function Documentation

◆ 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::string::get_kind ( ) const
inlinefinaloverridevirtual

Implements json::value.

References json::JSON_STRING.

◆ get_length()

size_t json::string::get_length ( ) const
inline

References m_len.

◆ get_string()

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

References m_utf8.

◆ print()

void string::print ( pretty_printer * pp,
bool formatted ) const
finaloverridevirtual
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
private

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

◆ m_utf8

char* json::string::m_utf8
private

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