1 #ifndef JSON_SPIRIT_VALUE 2 #define JSON_SPIRIT_VALUE 9 #if defined(_MSC_VER) && (_MSC_VER >= 1020) 19 #include <boost/config.hpp> 20 #include <boost/cstdint.hpp> 21 #include <boost/shared_ptr.hpp> 22 #include <boost/variant.hpp> 28 template<
class Config >
62 const String_type&
get_str()
const;
84 boost::recursive_wrapper< Object >, boost::recursive_wrapper< Array >,
94 template<
class Config >
100 Pair_impl(
const String_type&
name,
const Value_type& value );
108 template<
class String >
117 static Value_type&
add( Object_type& obj,
const String_type&
name,
const Value_type& value )
119 obj.push_back( Pair_type( name , value ) );
121 return obj.back().value_;
124 static String_type
get_name(
const Pair_type& pair )
146 #ifndef BOOST_NO_STD_WSTRING 158 template<
class String >
167 static Value_type&
add( Object_type& obj,
const String_type&
name,
const Value_type& value )
169 return obj[
name ] = value;
172 static String_type
get_name(
const Pair_type& pair )
193 #ifndef BOOST_NO_STD_WSTRING 207 template<
class Config >
210 template<
class Config >
217 template<
class Config >
225 template<
class Config >
233 template<
class Config >
241 template<
class Config >
249 template<
class Config >
257 template<
class Config >
260 ,
v_( static_cast<
boost::int64_t >( value ) )
265 template<
class Config >
273 template<
class Config >
276 ,
v_( static_cast<
boost::int64_t >( value ) )
281 template<
class Config >
289 template<
class Config >
297 template<
class Config >
309 template<
class Config >
312 if(
this == &lhs )
return true;
314 if(
type() != lhs.
type() )
return false;
319 template<
class Config >
325 template<
class Config >
331 template<
class Config >
337 template<
class Config >
340 if(
type() != vtype )
342 std::ostringstream os;
344 os <<
"value type is " <<
type() <<
" not " << vtype;
346 throw std::runtime_error( os.str() );
350 template<
class Config >
355 return *boost::get< String_type >( &
v_ );
358 template<
class Config >
363 return *boost::get< Object >( &
v_ );
366 template<
class Config >
371 return *boost::get< Array >( &
v_ );
374 template<
class Config >
379 return boost::get< bool >(
v_ );
382 template<
class Config >
387 return static_cast< int >(
get_int64() );
390 template<
class Config >
395 return boost::get< boost::int64_t >(
v_ );
398 template<
class Config >
403 return static_cast< boost::uint64_t
>(
get_int64() );
406 template<
class Config >
417 return boost::get< double >(
v_ );
420 template<
class Config >
425 return *boost::get< Object >( &
v_ );
428 template<
class Config >
433 return *boost::get< Array >( &
v_ );
436 template<
class Config >
443 template<
class Config >
446 if(
this == &lhs )
return true;
453 template <
class String_type >
458 for(
const char* p = c_str; *p != 0; ++p )
470 template<
typename T >
475 template<
class Value >
481 template<
class Value >
487 template<
class Value >
493 template<
class Value >
499 template<
class Value >
505 template<
class Value >
511 template<
class Value >
517 template<
class Value >
524 template<
class Config >
525 template<
typename T >
Config::Value_type Value_type
const Object & get_obj() const
wmConfig::Array_type wmArray
bool get_value(const Value &value, Type_to_type< bool >)
void swap(dev::eth::Watch &_a, dev::eth::Watch &_b)
std::vector< Pair_type > Object_type
std::map< String_type, Value_type > Object_type
static Value_type get_value(const Pair_type &pair)
Config::Object_type Object
Config_vector< std::string > Config
Pair_impl< Config_vector > Pair_type
bool operator==(const Pair_impl &lhs) const
std::vector< Value_type > Array_type
boost::uint64_t get_uint64() const
wConfig::Value_type wValue
Config_map< std::wstring > wmConfig
Config::String_type String_type
static String_type get_name(const Pair_type &pair)
Value_impl< Config_map > Value_type
Value_impl< Config_vector > Value_type
Object_type::value_type Pair_type
Value_impl & operator=(const Value_impl &lhs)
Pair_impl(const String_type &name, const Value_type &value)
static String_type get_name(const Pair_type &pair)
const Array & get_array() const
mConfig::Value_type mValue
Config::String_type String_type
wmConfig::Object_type wmObject
void check_type(const Value_type vtype) const
mConfig::Array_type mArray
static Value_type get_value(const Pair_type &pair)
wmConfig::Value_type wmValue
static const Value_impl null
int get_value(const Value &value, Type_to_type< int >)
const String_type & get_str() const
Config_map< std::string > mConfig
String_type to_str(const char *c_str)
mConfig::Object_type mObject
Config_vector< std::wstring > wConfig
wConfig::Array_type wArray
wConfig::Object_type wObject
boost::int64_t get_int64() const
boost::variant< String_type, boost::recursive_wrapper< Object >, boost::recursive_wrapper< Array >, bool, boost::int64_t, double > Variant
String_type::const_pointer Const_str_ptr
bool operator==(const Value_impl &lhs) const
static Value_type & add(Object_type &obj, const String_type &name, const Value_type &value)
std::vector< Value_type > Array_type
static Value_type & add(Object_type &obj, const String_type &name, const Value_type &value)