Util: Add more ways of accessing and creating Json::Value objects
This commit is contained in:
+12
-2
@@ -7,7 +7,9 @@
|
||||
#ifndef JSON_VALUE_H
|
||||
#define JSON_VALUE_H
|
||||
|
||||
#include <cstddef> // nullptr_t
|
||||
#include <cstdint> // uint32_t
|
||||
#include <initializer_list>
|
||||
#include <iostream> // istream, ostream
|
||||
#include <string>
|
||||
|
||||
@@ -36,20 +38,28 @@ public:
|
||||
Value& operator=(const Value& other);
|
||||
|
||||
Value(bool value);
|
||||
Value(int value);
|
||||
Value(double value);
|
||||
Value(const char* value);
|
||||
Value(const std::string& value);
|
||||
Value(const Array& value);
|
||||
Value(const Object& value);
|
||||
Value(const std::initializer_list<Value>& values);
|
||||
|
||||
// ------------------------------------------
|
||||
|
||||
static Value parse(const std::string& input);
|
||||
std::string dump(const uint32_t indent = 0, const char indentCharacter = ' ') const;
|
||||
|
||||
// ------------------------------------------
|
||||
|
||||
// Array index operator
|
||||
Value operator[](size_t index);
|
||||
Value operator[](const std::string& key);
|
||||
Value& operator[](size_t index);
|
||||
Value& operator[](const std::string& key);
|
||||
const Value& operator[](size_t index) const;
|
||||
const Value& operator[](const std::string& key) const;
|
||||
|
||||
// ------------------------------------------
|
||||
|
||||
Type type() const { return m_type; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user