Rosetta
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
utility::json_spirit Namespace Reference

Namespaces

 internal_
 

Classes

struct  Error_position
 
class  Semantic_actions
 
class  Json_grammer
 
struct  Multi_pass_iters
 
class  Stream_reader
 
class  Stream_reader_thrower
 
struct  Null
 
class  Value_impl
 
struct  Pair_impl
 
struct  Config_vector
 
struct  Config_map
 
class  Generator
 

Typedefs

typedef Config_vector< std::string > Config
 
typedef Config::Value_type Value
 
typedef Config::Pair_type Pair
 
typedef Config::Object_type Object
 
typedef Config::Array_type Array
 
typedef Config_vector< std::wstring > wConfig
 
typedef wConfig::Value_type wValue
 
typedef wConfig::Pair_type wPair
 
typedef wConfig::Object_type wObject
 
typedef wConfig::Array_type wArray
 
typedef Config_map< std::string > mConfig
 
typedef mConfig::Value_type mValue
 
typedef mConfig::Object_type mObject
 
typedef mConfig::Array_type mArray
 
typedef Config_map< std::wstring > wmConfig
 
typedef wmConfig::Value_type wmValue
 
typedef wmConfig::Object_type wmObject
 
typedef wmConfig::Array_type wmArray
 

Enumerations

enum  Value_type {
  obj_type , array_type , str_type , bool_type ,
  int_type , real_type , null_type
}
 
enum  Output_options { pretty_print = 0x01 , raw_utf8 = 0x02 , remove_trailing_zeros = 0x04 , single_line_arrays = 0x08 }
 

Functions

template<class Iter_type >
bool is_eq (Iter_type first, Iter_type last, const char *c_str)
 
template<class Char_type >
Char_type hex_to_num (const Char_type c)
 
template<class Char_type , class Iter_type >
Char_type hex_str_to_char (Iter_type &begin)
 
template<class Char_type , class Iter_type >
Char_type unicode_str_to_char (Iter_type &begin)
 
template<class String_type >
void append_esc_char_and_incr_iter (String_type &s, typename String_type::const_iterator &begin, typename String_type::const_iterator end)
 
template<class String_type >
String_type substitute_esc_chars (typename String_type::const_iterator begin, typename String_type::const_iterator end)
 
template<class String_type >
String_type get_str_ (typename String_type::const_iterator begin, typename String_type::const_iterator end)
 
std::string get_str (std::string::const_iterator begin, std::string::const_iterator end)
 
std::wstring get_str (std::wstring::const_iterator begin, std::wstring::const_iterator end)
 
template<class String_type , class Iter_type >
String_type get_str (Iter_type begin, Iter_type end)
 
template<typename Iter_type >
void throw_error (spirit_namespace::position_iterator< Iter_type > i, const std::string &reason)
 
template<typename Iter_type >
void throw_error (Iter_type, const std::string &reason)
 
template<class Iter_type , class Value_type >
void add_posn_iter_and_read_range_or_throw (Iter_type begin, Iter_type end, Value_type &value)
 
template<class Iter_type , class Value_type >
Iter_type read_range_or_throw (Iter_type begin, Iter_type end, Value_type &value)
 
template<class Iter_type , class Value_type >
bool read_range (Iter_type &begin, Iter_type end, Value_type &value)
 
template<class String_type , class Value_type >
bool read_string (const String_type &s, Value_type &value)
 
template<class String_type , class Value_type >
void read_string_or_throw (const String_type &s, Value_type &value)
 
template<class Istream_type , class Value_type >
bool read_stream (Istream_type &is, Value_type &value)
 
template<class Istream_type , class Value_type >
void read_stream_or_throw (Istream_type &is, Value_type &value)
 
bool has_value (const mObject &obj, const std::string &name)
 
mValue get_value (const mObject &obj, const std::string &name)
 
mObject get_mObject (const mObject &obj, const std::string &name)
 
mArray get_mArray (const mObject &obj, const std::string &name)
 
mArray read_mArray (const std::string &json_string)
 
mObject read_mObject (const std::string &json_string)
 
std::string get_string (const mObject &obj, const std::string &name)
 
std::string get_string_or_empty (const mObject &obj, const std::string &name)
 
double get_real (const mObject &obj, const std::string &name)
 
double get_real_or_zero (const mObject &obj, const std::string &name)
 
int get_int (const mObject &obj, const std::string &name)
 
int get_int_or_zero (const mObject &obj, const std::string &name)
 
template<class Obj_t , class Map_t >
void obj_to_map (const Obj_t &obj, Map_t &mp_obj)
 
template<class Obj_t , class Map_t >
void map_to_obj (const Map_t &mp_obj, Obj_t &obj)
 
template<class Object_type , class String_type >
const Object_type::value_type::Value_type & find_value (const Object_type &obj, const String_type &name)
 
bool operator== (const Null &, const Null &)
 
template<class String_type >
String_type to_str (const char *c_str)
 
char to_hex_char (unsigned int c)
 
template<class String_type >
String_type non_printable_to_string (unsigned int c)
 
template<typename Char_type , class String_type >
bool add_esc_char (Char_type c, String_type &s)
 
template<class String_type >
String_type add_esc_chars (const String_type &s, bool raw_utf8)
 
template<class Ostream >
void append_double (Ostream &os, const double d, const int precision)
 
template<class String_type >
void erase_and_extract_exponent (String_type &str, String_type &exp)
 
template<class String_type >
String_type::size_type find_first_non_zero (const String_type &str)
 
template<class String_type >
void remove_trailing (String_type &str)
 
template<class Value_type , class Ostream_type >
void write_stream (const Value_type &value, Ostream_type &os, unsigned int options=0)
 
template<class Value_type >
Value_type::String_type write_string (const Value_type &value, unsigned int options=0)
 

Variables

const spirit_namespace::int_parser< boost::int64_tint64_p = spirit_namespace::int_parser < boost::int64_t >()
 
const spirit_namespace::uint_parser< boost::uint64_tuint64_p = spirit_namespace::uint_parser< boost::uint64_t >()
 

Typedef Documentation

◆ Array

◆ Config

◆ mArray

◆ mConfig

typedef Config_map< std::string > utility::json_spirit::mConfig

◆ mObject

◆ mValue

◆ Object

◆ Pair

◆ Value

◆ wArray

◆ wConfig

◆ wmArray

◆ wmConfig

typedef Config_map< std::wstring > utility::json_spirit::wmConfig

◆ wmObject

◆ wmValue

◆ wObject

◆ wPair

◆ wValue

Enumeration Type Documentation

◆ Output_options

Enumerator
pretty_print 
raw_utf8 
remove_trailing_zeros 
single_line_arrays 

◆ Value_type

Enumerator
obj_type 
array_type 
str_type 
bool_type 
int_type 
real_type 
null_type 

Function Documentation

◆ add_esc_char()

template<typename Char_type , class String_type >
bool utility::json_spirit::add_esc_char ( Char_type  c,
String_type &  s 
)

◆ add_esc_chars()

template<class String_type >
String_type utility::json_spirit::add_esc_chars ( const String_type &  s,
bool  raw_utf8 
)

◆ add_posn_iter_and_read_range_or_throw()

template<class Iter_type , class Value_type >
void utility::json_spirit::add_posn_iter_and_read_range_or_throw ( Iter_type  begin,
Iter_type  end,
Value_type value 
)

◆ append_double()

template<class Ostream >
void utility::json_spirit::append_double ( Ostream &  os,
const double  d,
const int  precision 
)

◆ append_esc_char_and_incr_iter()

template<class String_type >
void utility::json_spirit::append_esc_char_and_incr_iter ( String_type &  s,
typename String_type::const_iterator begin,
typename String_type::const_iterator  end 
)

References begin, end, and docking::s.

Referenced by substitute_esc_chars().

◆ erase_and_extract_exponent()

template<class String_type >
void utility::json_spirit::erase_and_extract_exponent ( String_type &  str,
String_type &  exp 
)

References str().

Referenced by remove_trailing().

◆ find_first_non_zero()

template<class String_type >
String_type::size_type utility::json_spirit::find_first_non_zero ( const String_type &  str)

References str().

Referenced by remove_trailing().

◆ find_value()

template<class Object_type , class String_type >
const Object_type::value_type::Value_type& utility::json_spirit::find_value ( const Object_type &  obj,
const String_type &  name 
)

References create_a3b_hbs::i.

◆ get_int()

int utility::json_spirit::get_int ( const mObject obj,
const std::string &  name 
)

References CREATE_EXCEPTION, get_value(), int_type, and value.

Referenced by get_real().

◆ get_int_or_zero()

int utility::json_spirit::get_int_or_zero ( const mObject obj,
const std::string &  name 
)

References get_real(), and has_value().

◆ get_mArray()

mArray utility::json_spirit::get_mArray ( const mObject obj,
const std::string &  name 
)

◆ get_mObject()

mObject utility::json_spirit::get_mObject ( const mObject obj,
const std::string &  name 
)

◆ get_real()

double utility::json_spirit::get_real ( const mObject obj,
const std::string &  name 
)

◆ get_real_or_zero()

double utility::json_spirit::get_real_or_zero ( const mObject obj,
const std::string &  name 
)

References get_real(), and has_value().

◆ get_str() [1/3]

template<class String_type , class Iter_type >
String_type utility::json_spirit::get_str ( Iter_type  begin,
Iter_type  end 
)

References begin, end, and get_str().

◆ get_str() [2/3]

std::string utility::json_spirit::get_str ( std::string::const_iterator  begin,
std::string::const_iterator  end 
)
inline

References begin, and end.

Referenced by get_str().

◆ get_str() [3/3]

std::wstring utility::json_spirit::get_str ( std::wstring::const_iterator  begin,
std::wstring::const_iterator  end 
)
inline

References begin, and end.

◆ get_str_()

template<class String_type >
String_type utility::json_spirit::get_str_ ( typename String_type::const_iterator  begin,
typename String_type::const_iterator  end 
)

References begin, and end.

◆ get_string()

std::string utility::json_spirit::get_string ( const mObject obj,
const std::string &  name 
)

◆ get_string_or_empty()

std::string utility::json_spirit::get_string_or_empty ( const mObject obj,
const std::string &  name 
)

◆ get_value()

mValue utility::json_spirit::get_value ( const mObject obj,
const std::string &  name 
)

◆ has_value()

bool utility::json_spirit::has_value ( const mObject obj,
const std::string &  name 
)

◆ hex_str_to_char()

template<class Char_type , class Iter_type >
Char_type utility::json_spirit::hex_str_to_char ( Iter_type &  begin)

References begin, and hex_to_num().

◆ hex_to_num()

template<class Char_type >
Char_type utility::json_spirit::hex_to_num ( const Char_type  c)

◆ is_eq()

template<class Iter_type >
bool utility::json_spirit::is_eq ( Iter_type  first,
Iter_type  last,
const char *  c_str 
)

◆ map_to_obj()

template<class Obj_t , class Map_t >
void utility::json_spirit::map_to_obj ( const Map_t &  mp_obj,
Obj_t &  obj 
)

References create_a3b_hbs::i.

◆ non_printable_to_string()

template<class String_type >
String_type utility::json_spirit::non_printable_to_string ( unsigned int  c)

◆ obj_to_map()

template<class Obj_t , class Map_t >
void utility::json_spirit::obj_to_map ( const Obj_t &  obj,
Map_t &  mp_obj 
)

References create_a3b_hbs::i.

◆ operator==()

bool utility::json_spirit::operator== ( const Null ,
const Null  
)
inline

◆ read_mArray()

mArray utility::json_spirit::read_mArray ( const std::string &  json_string)

◆ read_mObject()

mObject utility::json_spirit::read_mObject ( const std::string &  json_string)

◆ read_range()

template<class Iter_type , class Value_type >
bool utility::json_spirit::read_range ( Iter_type &  begin,
Iter_type  end,
Value_type value 
)

◆ read_range_or_throw()

template<class Iter_type , class Value_type >
Iter_type utility::json_spirit::read_range_or_throw ( Iter_type  begin,
Iter_type  end,
Value_type value 
)

◆ read_stream()

template<class Istream_type , class Value_type >
bool utility::json_spirit::read_stream ( Istream_type &  is,
Value_type value 
)

◆ read_stream_or_throw()

template<class Istream_type , class Value_type >
void utility::json_spirit::read_stream_or_throw ( Istream_type &  is,
Value_type value 
)

◆ read_string()

template<class String_type , class Value_type >
bool utility::json_spirit::read_string ( const String_type &  s,
Value_type value 
)

References begin, read_range(), docking::s, and value.

◆ read_string_or_throw()

template<class String_type , class Value_type >
void utility::json_spirit::read_string_or_throw ( const String_type &  s,
Value_type value 
)

◆ remove_trailing()

template<class String_type >
void utility::json_spirit::remove_trailing ( String_type &  str)

◆ substitute_esc_chars()

template<class String_type >
String_type utility::json_spirit::substitute_esc_chars ( typename String_type::const_iterator  begin,
typename String_type::const_iterator  end 
)

◆ throw_error() [1/2]

template<typename Iter_type >
void utility::json_spirit::throw_error ( Iter_type  ,
const std::string &  reason 
)

◆ throw_error() [2/2]

template<typename Iter_type >
void utility::json_spirit::throw_error ( spirit_namespace::position_iterator< Iter_type >  i,
const std::string &  reason 
)

◆ to_hex_char()

char utility::json_spirit::to_hex_char ( unsigned int  c)
inline

◆ to_str()

template<class String_type >
String_type utility::json_spirit::to_str ( const char *  c_str)

◆ unicode_str_to_char()

template<class Char_type , class Iter_type >
Char_type utility::json_spirit::unicode_str_to_char ( Iter_type &  begin)

References begin, and hex_to_num().

◆ write_stream()

template<class Value_type , class Ostream_type >
void utility::json_spirit::write_stream ( const Value_type value,
Ostream_type &  os,
unsigned int  options = 0 
)

References value.

Referenced by write_string().

◆ write_string()

template<class Value_type >
Value_type::String_type utility::json_spirit::write_string ( const Value_type value,
unsigned int  options = 0 
)

References value, and write_stream().

Variable Documentation

◆ int64_p

const spirit_namespace::int_parser< boost::int64_t > utility::json_spirit::int64_p = spirit_namespace::int_parser < boost::int64_t >()

◆ uint64_p

const spirit_namespace::uint_parser< boost::uint64_t > utility::json_spirit::uint64_p = spirit_namespace::uint_parser< boost::uint64_t >()