inline std::basic_istream<charT>& operator>>(std::basic_istream<charT>& is, date& d) { std::istream_iterator<std::basic_string<charT>, charT> beg(is), eos; d = from_stream(beg, eos); return is; }
bool json::is_valid( const std::string& utf8_str, parse_type ptype, uint32_t max_depth ) { if( utf8_str.size() == 0 ) return false; fc::istream_ptr in( new fc::stringstream( utf8_str ) ); fc::buffered_istream bin( in ); from_stream( bin, ptype, max_depth ); try { bin.peek(); } catch ( const eof_exception& e ) { return true; } return false; }
inline std::basic_istream<charT>& operator>>(std::basic_istream<charT>& is, date& d) { std::istream_iterator<std::basic_string<charT>, charT> beg(is), eos; typedef boost::date_time::all_date_names_put<greg_facet_config, charT> facet_def; d = from_stream(beg, eos); return is; }
variant json::from_file( const fc::path& p, parse_type ptype, uint32_t max_depth ) { fc::istream_ptr in( new fc::ifstream( p ) ); fc::buffered_istream bin( in ); return from_stream( bin, ptype, max_depth ); }
variant json::from_string( const std::string& utf8_str, parse_type ptype, uint32_t max_depth ) { try { fc::istream_ptr in( new fc::stringstream( utf8_str ) ); fc::buffered_istream bin( in ); return from_stream( bin, ptype, max_depth ); } FC_RETHROW_EXCEPTIONS( warn, "", ("str",utf8_str) ) }
Value Parser::from_string(std::string const& str, bool use_arrays) { std::istringstream is(str); return from_stream(is); }