mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-23 04:40:06 +00:00
add missing inline
specifier #7
This commit is contained in:
parent
7624f95e6d
commit
3f1b431ee2
@ -1102,12 +1102,28 @@ toml::Table parse(std::basic_istream<toml::character, traits>& is)
|
||||
}
|
||||
}
|
||||
|
||||
toml::Table parse(const std::string& filename)
|
||||
inline toml::Table parse(const char* filename)
|
||||
{
|
||||
std::ifstream ifs(filename, std::ios_base::in | std::ios_base::binary);
|
||||
if(!ifs.good()) throw std::runtime_error("file open error: " + filename);
|
||||
if(!ifs.good())
|
||||
{
|
||||
throw std::runtime_error("file open error: " + std::string(filename));
|
||||
}
|
||||
return parse(ifs);
|
||||
}
|
||||
|
||||
template<typename charT, typename traits = std::char_traits<charT>>
|
||||
inline toml::Table parse(const std::basic_string<charT, traits>& filename)
|
||||
{
|
||||
std::ifstream ifs(filename, std::ios_base::in | std::ios_base::binary);
|
||||
if(!ifs.good())
|
||||
{
|
||||
throw std::runtime_error("file open error: " + filename);
|
||||
}
|
||||
return parse(ifs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}// toml
|
||||
#endif// TOML11_PARSER
|
||||
|
Loading…
Reference in New Issue
Block a user