j/tree: add from_path function for clarity
This commit is contained in:
parent
226e212826
commit
ea1dbd253a
@ -203,6 +203,21 @@ json::tree::parse (const char *first, const char *last)
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
std::unique_ptr<json::tree::node>
|
||||
json::tree::from_path (const char *path)
|
||||
{
|
||||
return json::tree::parse (boost::filesystem::path (path));
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
std::unique_ptr<json::tree::node>
|
||||
json::tree::from_path (const std::string &path)
|
||||
{
|
||||
return json::tree::from_path (path.c_str ());
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Type conversion
|
||||
|
||||
|
@ -44,6 +44,9 @@ namespace json { namespace tree {
|
||||
extern std::unique_ptr<node> parse (const char *start, const char *stop);
|
||||
extern std::unique_ptr<node> parse (const std::string&);
|
||||
|
||||
extern std::unique_ptr<node> from_path (const char *path);
|
||||
extern std::unique_ptr<node> from_path (const std::string&);
|
||||
|
||||
extern void write (const json::tree::node&, std::ostream&);
|
||||
|
||||
/// Abstract base for all JSON values
|
||||
|
Loading…
Reference in New Issue
Block a user