mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-12-24 18:21:04 +00:00
restore old parse function
This commit is contained in:
parent
b67fcf79bc
commit
d77ec7dc88
@ -6,7 +6,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <locale>
|
|
||||||
|
|
||||||
namespace toml
|
namespace toml
|
||||||
{
|
{
|
||||||
@ -1059,8 +1058,6 @@ struct parse_data
|
|||||||
template<typename traits = std::char_traits<toml::character>>
|
template<typename traits = std::char_traits<toml::character>>
|
||||||
toml::Table parse(std::basic_istream<toml::character, traits>& is)
|
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();
|
const auto initial = is.tellg();
|
||||||
is.seekg(0, std::ios::end);
|
is.seekg(0, std::ios::end);
|
||||||
const auto eofpos = is.tellg();
|
const auto eofpos = is.tellg();
|
||||||
@ -1068,7 +1065,6 @@ toml::Table parse(std::basic_istream<toml::character, traits>& is)
|
|||||||
is.seekg(initial);
|
is.seekg(initial);
|
||||||
std::vector<toml::character> contents(size);
|
std::vector<toml::character> contents(size);
|
||||||
is.read(contents.data(), size);
|
is.read(contents.data(), size);
|
||||||
is.imbue(curloc);
|
|
||||||
return parse_data::invoke(contents.cbegin(), contents.cend());
|
return parse_data::invoke(contents.cbegin(), contents.cend());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user