diff --git a/toml/parser.hpp b/toml/parser.hpp index 10cc683..628498b 100644 --- a/toml/parser.hpp +++ b/toml/parser.hpp @@ -1102,12 +1102,28 @@ toml::Table parse(std::basic_istream& 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> +inline toml::Table parse(const std::basic_string& 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