mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 17:58:09 +08:00
add missing inline
specifier #7
This commit is contained in:
@@ -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);
|
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);
|
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
|
}// toml
|
||||||
#endif// TOML11_PARSER
|
#endif// TOML11_PARSER
|
||||||
|
Reference in New Issue
Block a user