diff --git a/json.cpp.rl b/json.cpp.rl index 3435483f..eff3755d 100644 --- a/json.cpp.rl +++ b/json.cpp.rl @@ -29,7 +29,6 @@ #include #include -#include #include #include #include @@ -236,13 +235,14 @@ struct parse_context { namespace json { json::node * - parse (const boost::filesystem::path &path) { - mapped_file file(path); - return parse ((const char *)file.data (), - (const char *)file.data () + file.size ()); - } + parse (const boost::filesystem::path &path) + { return parse ((const char *)slurp (path)); } + json::node * + parse (const std::string &path) + { return parse (path.c_str (), path.c_str () + path.size ()); } + node * parse (const char *start, const char *stop) { diff --git a/json.hpp b/json.hpp index a2191a6e..061089e5 100644 --- a/json.hpp +++ b/json.hpp @@ -40,6 +40,7 @@ namespace json { extern node* parse (const boost::filesystem::path &path); extern node* parse (const char *start, const char *stop); extern node* parse (const char *start); + extern node* parse (const std::string&); /// Abstract base for all JSON values class node {