diff --git a/src/io/json.cpp b/src/io/json.cpp index 288f40d..2c453cf 100644 --- a/src/io/json.cpp +++ b/src/io/json.cpp @@ -798,23 +798,9 @@ namespace fc } variant json::from_file( const fc::path& p, parse_type ptype ) { - //auto tmp = std::make_shared( p, ifstream::binary ); - //auto tmp = std::make_shared( p.generic_string().c_str(), std::ios::binary ); - //buffered_istream bi( tmp ); - boost::filesystem::ifstream bi( p, std::ios::binary ); - switch( ptype ) - { - case legacy_parser: - return variant_from_stream( bi ); - case legacy_parser_with_string_doubles: - return variant_from_stream( bi ); - case strict_parser: - return json_relaxed::variant_from_stream( bi ); - case relaxed_parser: - return json_relaxed::variant_from_stream( bi ); - default: - FC_ASSERT( false, "Unknown JSON parser type {ptype}", ("ptype", ptype) ); - } + fc::istream_ptr in( new fc::ifstream( p ) ); + fc::buffered_istream bin( in ); + return from_stream( bin, ptype ); } variant json::from_stream( buffered_istream& in, parse_type ptype ) {