Guitar
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
jstream::Reader Class Reference

#include <jstream.h>

Collaboration diagram for jstream::Reader:
Collaboration graph
[legend]

Classes

struct  Error
 
struct  ParserData
 
struct  StateItem
 

Public Member Functions

 Reader (std::string_view const &sv)
 
 Reader (char const *begin, char const *end)
 
 Reader (char const *ptr, int len=-1)
 
void allow_comment (bool allow)
 
void allow_ambiguous_comma (bool allow)
 
void allow_unquoted_key (bool allow)
 
void allow_hexadicimal (bool allow)
 
void allow_special_constant (bool allow)
 
void reset ()
 
void hold ()
 
void nest ()
 
bool next ()
 
StateType state () const
 
bool has_error () const
 
std::vector< Error > const & errors () const
 
bool is_start_object () const
 
bool is_end_object () const
 
bool is_start_array () const
 
bool is_end_array () const
 
bool isobject () const
 
bool isvalue () const
 
std::string key () const
 
std::string string () const
 
StateType symbol () const
 
bool isnull () const
 
bool isfalse () const
 
bool istrue () const
 
bool isnumber () const
 
bool isstring () const
 
double number () const
 
bool isarray () const
 
int depth () const
 
std::string path () const
 
std::string_view raw ()
 
bool match (char const *path, std::vector< std::string > *vals=nullptr, bool clear=true) const
 
bool match_start_object (char const *path) const
 
bool match_end_object (char const *path) const
 
bool match_start_array (char const *path) const
 
bool match_end_array (char const *path) const
 

Private Member Functions

int scan_space (char const *begin, char const *end)
 
int parse_symbol (char const *begin, char const *end, std::string *out)
 
int parse_number (char const *begin, char const *end, double *out)
 
int parse_string (char const *begin, char const *end, std::string *out)
 
void push_error (std::string const &what)
 
void push_state (StateItem s)
 
bool pop_state ()
 
void parse (char const *begin, char const *end)
 
void parse (std::string_view const &sv)
 
void parse (char const *ptr, int len=-1)
 
bool _internal_next ()
 

Static Private Member Functions

static std::string to_stdstr (std::vector< char > const &vec)
 

Private Attributes

ParserData d
 

Constructor & Destructor Documentation

◆ Reader() [1/3]

jstream::Reader::Reader ( std::string_view const &  sv)
inline
Here is the call graph for this function:

◆ Reader() [2/3]

jstream::Reader::Reader ( char const *  begin,
char const *  end 
)
inline
Here is the call graph for this function:

◆ Reader() [3/3]

jstream::Reader::Reader ( char const *  ptr,
int  len = -1 
)
inline
Here is the call graph for this function:

Member Function Documentation

◆ _internal_next()

bool jstream::Reader::_internal_next ( )
inlineprivate
Here is the call graph for this function:

◆ allow_ambiguous_comma()

void jstream::Reader::allow_ambiguous_comma ( bool  allow)
inline

◆ allow_comment()

void jstream::Reader::allow_comment ( bool  allow)
inline

◆ allow_hexadicimal()

void jstream::Reader::allow_hexadicimal ( bool  allow)
inline

◆ allow_special_constant()

void jstream::Reader::allow_special_constant ( bool  allow)
inline

◆ allow_unquoted_key()

void jstream::Reader::allow_unquoted_key ( bool  allow)
inline

◆ depth()

int jstream::Reader::depth ( ) const
inline

◆ errors()

std::vector<Error> const& jstream::Reader::errors ( ) const
inline

◆ has_error()

bool jstream::Reader::has_error ( ) const
inline

◆ hold()

void jstream::Reader::hold ( )
inline

◆ is_end_array()

bool jstream::Reader::is_end_array ( ) const
inline
Here is the call graph for this function:

◆ is_end_object()

bool jstream::Reader::is_end_object ( ) const
inline
Here is the call graph for this function:

◆ is_start_array()

bool jstream::Reader::is_start_array ( ) const
inline
Here is the call graph for this function:

◆ is_start_object()

bool jstream::Reader::is_start_object ( ) const
inline
Here is the call graph for this function:

◆ isarray()

bool jstream::Reader::isarray ( ) const
inline

◆ isfalse()

bool jstream::Reader::isfalse ( ) const
inline
Here is the call graph for this function:

◆ isnull()

bool jstream::Reader::isnull ( ) const
inline
Here is the call graph for this function:

◆ isnumber()

bool jstream::Reader::isnumber ( ) const
inline
Here is the call graph for this function:

◆ isobject()

bool jstream::Reader::isobject ( ) const
inline
Here is the call graph for this function:

◆ isstring()

bool jstream::Reader::isstring ( ) const
inline
Here is the call graph for this function:

◆ istrue()

bool jstream::Reader::istrue ( ) const
inline
Here is the call graph for this function:

◆ isvalue()

bool jstream::Reader::isvalue ( ) const
inline
Here is the call graph for this function:

◆ key()

std::string jstream::Reader::key ( ) const
inline

◆ match()

bool jstream::Reader::match ( char const *  path,
std::vector< std::string > *  vals = nullptr,
bool  clear = true 
) const
inline
Here is the call graph for this function:

◆ match_end_array()

bool jstream::Reader::match_end_array ( char const *  path) const
inline
Here is the call graph for this function:

◆ match_end_object()

bool jstream::Reader::match_end_object ( char const *  path) const
inline
Here is the call graph for this function:

◆ match_start_array()

bool jstream::Reader::match_start_array ( char const *  path) const
inline
Here is the call graph for this function:

◆ match_start_object()

bool jstream::Reader::match_start_object ( char const *  path) const
inline
Here is the call graph for this function:

◆ nest()

void jstream::Reader::nest ( )
inline
Here is the call graph for this function:

◆ next()

bool jstream::Reader::next ( )
inline
Here is the call graph for this function:

◆ number()

double jstream::Reader::number ( ) const
inline

◆ parse() [1/3]

void jstream::Reader::parse ( char const *  begin,
char const *  end 
)
inlineprivate
Here is the call graph for this function:

◆ parse() [2/3]

void jstream::Reader::parse ( char const *  ptr,
int  len = -1 
)
inlineprivate
Here is the call graph for this function:

◆ parse() [3/3]

void jstream::Reader::parse ( std::string_view const &  sv)
inlineprivate
Here is the call graph for this function:

◆ parse_number()

int jstream::Reader::parse_number ( char const *  begin,
char const *  end,
double *  out 
)
inlineprivate
Here is the call graph for this function:

◆ parse_string()

int jstream::Reader::parse_string ( char const *  begin,
char const *  end,
std::string *  out 
)
inlineprivate
Here is the call graph for this function:

◆ parse_symbol()

int jstream::Reader::parse_symbol ( char const *  begin,
char const *  end,
std::string *  out 
)
inlineprivate
Here is the call graph for this function:

◆ path()

std::string jstream::Reader::path ( ) const
inline
Here is the call graph for this function:

◆ pop_state()

bool jstream::Reader::pop_state ( )
inlineprivate
Here is the call graph for this function:

◆ push_error()

void jstream::Reader::push_error ( std::string const &  what)
inlineprivate

◆ push_state()

void jstream::Reader::push_state ( StateItem  s)
inlineprivate
Here is the call graph for this function:

◆ raw()

std::string_view jstream::Reader::raw ( )
inline

◆ reset()

void jstream::Reader::reset ( )
inline

◆ scan_space()

int jstream::Reader::scan_space ( char const *  begin,
char const *  end 
)
inlineprivate

◆ state()

StateType jstream::Reader::state ( ) const
inline

◆ string()

std::string jstream::Reader::string ( ) const
inline

◆ symbol()

StateType jstream::Reader::symbol ( ) const
inline
Here is the call graph for this function:

◆ to_stdstr()

static std::string jstream::Reader::to_stdstr ( std::vector< char > const &  vec)
inlinestaticprivate

Member Data Documentation

◆ d

ParserData jstream::Reader::d
private

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