diff --git a/src/util/json/value.cpp b/src/util/json/value.cpp index f479d64..6020900 100644 --- a/src/util/json/value.cpp +++ b/src/util/json/value.cpp @@ -157,6 +157,13 @@ Value Value::parse(const std::string& input) return Job(input).fire(); } +Value Value::parse(std::ifstream& file) +{ + Value value; + file >> value; + return value; +} + std::string Value::dump(const uint32_t indent, const char indentCharacter) const { Serializer serializer(indent, indentCharacter); @@ -313,8 +320,7 @@ std::istream& operator>>(std::istream& input, Value& value) } inputString.append(buffer, input.gcount()); - Job job(inputString); - value = job.fire(); + value = Job(inputString).fire(); return input; } diff --git a/src/util/json/value.h b/src/util/json/value.h index 8576d15..bc97f7e 100644 --- a/src/util/json/value.h +++ b/src/util/json/value.h @@ -66,6 +66,7 @@ public: // -------------------------------------- static Value parse(const std::string& input); + static Value parse(std::ifstream& file); std::string dump(const uint32_t indent = 0, const char indentCharacter = ' ') const; void clear();