Fixed from_file
This commit is contained in:
parent
72e96e3c1d
commit
52f6810735
1 changed files with 3 additions and 17 deletions
|
|
@ -798,23 +798,9 @@ namespace fc
|
||||||
}
|
}
|
||||||
variant json::from_file( const fc::path& p, parse_type ptype )
|
variant json::from_file( const fc::path& p, parse_type ptype )
|
||||||
{
|
{
|
||||||
//auto tmp = std::make_shared<fc::ifstream>( p, ifstream::binary );
|
fc::istream_ptr in( new fc::ifstream( p ) );
|
||||||
//auto tmp = std::make_shared<std::ifstream>( p.generic_string().c_str(), std::ios::binary );
|
fc::buffered_istream bin( in );
|
||||||
//buffered_istream bi( tmp );
|
return from_stream( bin, ptype );
|
||||||
boost::filesystem::ifstream bi( p, std::ios::binary );
|
|
||||||
switch( ptype )
|
|
||||||
{
|
|
||||||
case legacy_parser:
|
|
||||||
return variant_from_stream<boost::filesystem::ifstream, legacy_parser>( bi );
|
|
||||||
case legacy_parser_with_string_doubles:
|
|
||||||
return variant_from_stream<boost::filesystem::ifstream, legacy_parser_with_string_doubles>( bi );
|
|
||||||
case strict_parser:
|
|
||||||
return json_relaxed::variant_from_stream<boost::filesystem::ifstream, true>( bi );
|
|
||||||
case relaxed_parser:
|
|
||||||
return json_relaxed::variant_from_stream<boost::filesystem::ifstream, false>( bi );
|
|
||||||
default:
|
|
||||||
FC_ASSERT( false, "Unknown JSON parser type {ptype}", ("ptype", ptype) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
variant json::from_stream( buffered_istream& in, parse_type ptype )
|
variant json::from_stream( buffered_istream& in, parse_type ptype )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue