mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 00:38:08 +08:00
set binary flag..
This commit is contained in:
@@ -1059,8 +1059,6 @@ struct parse_data
|
||||
template<typename traits = std::char_traits<toml::character>>
|
||||
toml::Table parse(std::basic_istream<toml::character, traits>& is)
|
||||
{
|
||||
const auto curloc = is.getloc();
|
||||
is.imbue(std::locale("en_US.utf-8"));
|
||||
const auto initial = is.tellg();
|
||||
is.seekg(0, std::ios::end);
|
||||
const auto eofpos = is.tellg();
|
||||
@@ -1068,13 +1066,12 @@ toml::Table parse(std::basic_istream<toml::character, traits>& is)
|
||||
is.seekg(initial);
|
||||
std::vector<toml::character> contents(size);
|
||||
is.read(contents.data(), size);
|
||||
is.imbue(curloc);
|
||||
return parse_data::invoke(contents.cbegin(), contents.cend());
|
||||
}
|
||||
|
||||
toml::Table parse(const std::string& filename)
|
||||
{
|
||||
std::ifstream ifs(filename);
|
||||
std::ifstream ifs(filename, std::ios::binary);
|
||||
if(!ifs.good()) throw std::runtime_error("file open error: " + filename);
|
||||
return parse(ifs);
|
||||
}
|
||||
|
Reference in New Issue
Block a user