Classes | Typedefs | Functions | Variables
stan::json Namespace Reference

Classes

class  json_data
 
class  json_data_handler
 
struct  json_error
 
class  json_handler
 
class  parser
 

Typedefs

typedef std::map< std::string, std::pair< std::vector< double >, std::vector< size_t > > > vars_map_r
 
typedef std::map< std::string, std::pair< std::vector< int >, std::vector< size_t > > > vars_map_i
 

Functions

bool is_high_surrogate (unsigned int cp)
 
bool is_low_surrogate (unsigned int cp)
 
bool is_whitespace (char c)
 
template<bool Validate_UTF_8, typename Handler >
void parse (std::istream &in, Handler &handler)
 
template<typename Handler >
void parse (std::istream &in, Handler &handler)
 

Variables

const unsigned int MIN_HIGH_SURROGATE = 0xD800
 
const unsigned int MAX_HIGH_SURROGATE = 0xDBFF
 
const unsigned int MIN_LOW_SURROGATE = 0xDC00
 
const unsigned int MAX_LOW_SURROGATE = 0xDFFF
 
const unsigned int MIN_SUPPLEMENTARY_CODE_POINT = 0x010000
 

Typedef Documentation

typedef std::map<std::string, std::pair<std::vector<int>, std::vector<size_t> > > stan::json::vars_map_i

Definition at line 33 of file json_data_handler.hpp.

typedef std::map<std::string, std::pair<std::vector<double>, std::vector<size_t> > > stan::json::vars_map_r

Definition at line 27 of file json_data_handler.hpp.

Function Documentation

bool stan::json::is_high_surrogate ( unsigned int  cp)
inline

Definition at line 25 of file json_parser.hpp.

Referenced by stan::json::parser< Handler, Validate_UTF_8 >::get_escaped_unicode().

25  {
26  return (cp >= MIN_HIGH_SURROGATE && cp <= MAX_HIGH_SURROGATE);
27  }
const unsigned int MIN_HIGH_SURROGATE
Definition: json_parser.hpp:19
const unsigned int MAX_HIGH_SURROGATE
Definition: json_parser.hpp:20
bool stan::json::is_low_surrogate ( unsigned int  cp)
inline

Definition at line 29 of file json_parser.hpp.

Referenced by stan::json::parser< Handler, Validate_UTF_8 >::get_escaped_unicode().

29  {
30  return (cp >= MIN_LOW_SURROGATE && cp <= MAX_LOW_SURROGATE);
31  }
const unsigned int MAX_LOW_SURROGATE
Definition: json_parser.hpp:22
const unsigned int MIN_LOW_SURROGATE
Definition: json_parser.hpp:21
bool stan::json::is_whitespace ( char  c)
inline

Definition at line 33 of file json_parser.hpp.

Referenced by stan::json::parser< Handler, Validate_UTF_8 >::get_non_ws_char().

33  {
34  return c == ' ' || c == '\n' || c == '\t' || c == '\r';
35  }
template<bool Validate_UTF_8, typename Handler >
void stan::json::parse ( std::istream &  in,
Handler &  handler 
)

Parse the JSON text represented by the specified input stream, sending events to the specified handler, and optionally validating the UTF-8 encoding.

Template Parameters
Validate_UTF_8
Handler
Parameters
inInput stream from which to parse
handlerHandler for events from parser

Definition at line 430 of file json_parser.hpp.

References in, and stan::json::parser< Handler, Validate_UTF_8 >::parse().

Referenced by stan::json::json_data::json_data(), test_exception(), and test_parser().

431  {
432  parser<Handler, Validate_UTF_8>(handler, in).parse();
433  }
void parse(std::istream &in, Handler &handler)
ifstream in
Definition: comparison.C:7
template<typename Handler >
void stan::json::parse ( std::istream &  in,
Handler &  handler 
)

Parse the JSON text represented by the specified input stream, sending events to the specified handler, and optionally validating the UTF-8 encoding.

Template Parameters
Handler
Parameters
inInput stream from which to parse
handlerHandler for events from parser

Definition at line 445 of file json_parser.hpp.

References in.

446  {
447  parse<false>(in, handler);
448  }
ifstream in
Definition: comparison.C:7

Variable Documentation

const unsigned int stan::json::MAX_HIGH_SURROGATE = 0xDBFF

Definition at line 20 of file json_parser.hpp.

const unsigned int stan::json::MAX_LOW_SURROGATE = 0xDFFF

Definition at line 22 of file json_parser.hpp.

const unsigned int stan::json::MIN_HIGH_SURROGATE = 0xD800
const unsigned int stan::json::MIN_LOW_SURROGATE = 0xDC00
const unsigned int stan::json::MIN_SUPPLEMENTARY_CODE_POINT = 0x010000

Definition at line 23 of file json_parser.hpp.