X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fjson%2Fjson_spirit_reader_template.h;fp=src%2Fjson%2Fjson_spirit_reader_template.h;h=aa6fc614f1ba2f40f39d1ddad01b227b42236dda;hp=46f5892f62dd122843698de8b3ab1ac11ff523ba;hb=3fa5baa680a6c95f62454e421b02f91247164d9d;hpb=1dce23761237d85c2cfafd0757f1bef87b0087c4 diff --git a/src/json/json_spirit_reader_template.h b/src/json/json_spirit_reader_template.h index 46f5892..aa6fc61 100644 --- a/src/json/json_spirit_reader_template.h +++ b/src/json/json_spirit_reader_template.h @@ -11,10 +11,11 @@ //#define BOOST_SPIRIT_THREADSAFE // uncomment for multithreaded use, requires linking to boost.thread -#include -#include #include +#include + + #if BOOST_VERSION >= 103800 #include #include @@ -31,6 +32,7 @@ #define spirit_namespace boost::spirit #endif + namespace json_spirit { const spirit_namespace::int_parser < int64_t > int64_p = spirit_namespace::int_parser < int64_t >(); @@ -422,24 +424,26 @@ namespace json_spirit // first we convert the semantic action class methods to functors with the // parameter signature expected by spirit - typedef boost::function< void( Char_type ) > Char_action; - typedef boost::function< void( Iter_type, Iter_type ) > Str_action; - typedef boost::function< void( double ) > Real_action; - typedef boost::function< void( int64_t ) > Int_action; - typedef boost::function< void( uint64_t ) > Uint64_action; - - Char_action begin_obj ( boost::bind( &Semantic_actions_t::begin_obj, &self.actions_, _1 ) ); - Char_action end_obj ( boost::bind( &Semantic_actions_t::end_obj, &self.actions_, _1 ) ); - Char_action begin_array( boost::bind( &Semantic_actions_t::begin_array, &self.actions_, _1 ) ); - Char_action end_array ( boost::bind( &Semantic_actions_t::end_array, &self.actions_, _1 ) ); - Str_action new_name ( boost::bind( &Semantic_actions_t::new_name, &self.actions_, _1, _2 ) ); - Str_action new_str ( boost::bind( &Semantic_actions_t::new_str, &self.actions_, _1, _2 ) ); - Str_action new_true ( boost::bind( &Semantic_actions_t::new_true, &self.actions_, _1, _2 ) ); - Str_action new_false ( boost::bind( &Semantic_actions_t::new_false, &self.actions_, _1, _2 ) ); - Str_action new_null ( boost::bind( &Semantic_actions_t::new_null, &self.actions_, _1, _2 ) ); - Real_action new_real ( boost::bind( &Semantic_actions_t::new_real, &self.actions_, _1 ) ); - Int_action new_int ( boost::bind( &Semantic_actions_t::new_int, &self.actions_, _1 ) ); - Uint64_action new_uint64 ( boost::bind( &Semantic_actions_t::new_uint64, &self.actions_, _1 ) ); + typedef std::function< void( Char_type ) > Char_action; + typedef std::function< void( Iter_type, Iter_type ) > Str_action; + typedef std::function< void( double ) > Real_action; + typedef std::function< void( int64_t ) > Int_action; + typedef std::function< void( uint64_t ) > Uint64_action; + + namespace stdp = std::placeholders; + Char_action begin_obj ( std::bind( &Semantic_actions_t::begin_obj, &self.actions_, stdp::_1 ) ); + Char_action end_obj ( std::bind( &Semantic_actions_t::end_obj, &self.actions_, stdp::_1 ) ); + Char_action begin_array( std::bind( &Semantic_actions_t::begin_array, &self.actions_, stdp::_1 ) ); + Char_action end_array ( std::bind( &Semantic_actions_t::end_array, &self.actions_, stdp::_1 ) ); + Str_action new_name ( std::bind( &Semantic_actions_t::new_name, &self.actions_, stdp::_1, stdp::_2 ) ); + Str_action new_str ( std::bind( &Semantic_actions_t::new_str, &self.actions_, stdp::_1, stdp::_2 ) ); + Str_action new_true ( std::bind( &Semantic_actions_t::new_true, &self.actions_, stdp::_1, stdp::_2 ) ); + Str_action new_false ( std::bind( &Semantic_actions_t::new_false, &self.actions_, stdp::_1, stdp::_2 ) ); + Str_action new_null ( std::bind( &Semantic_actions_t::new_null, &self.actions_, stdp::_1, stdp::_2 ) ); + Real_action new_real ( std::bind( &Semantic_actions_t::new_real, &self.actions_, stdp::_1 ) ); + Int_action new_int ( std::bind( &Semantic_actions_t::new_int, &self.actions_, stdp::_1 ) ); + Uint64_action new_uint64 ( std::bind( &Semantic_actions_t::new_uint64, &self.actions_, stdp::_1 ) ); + // actual grammer