- inline _Base& set_key(const std::string& key, const Value& value);
-
- // set an array index (converts value to object is not one already)
- inline _Base& set_at(unsigned int index, const Value& value);
-
- // delete an object key
- inline _Base& del_key(const char* key);
-
- inline _Base& del_key(const std::string& key);
-
- // delete an item from an array by index
- inline _Base& del_at(unsigned int index);
-
- // insert an item into an array at a given index
- inline _Base& insert_at(unsigned int index, const Value& value);
-
- // write the value to a file
- inline int save_file(const char* path, int flags = 0) const;
-
- // write the value to a string (caller must deallocate with free()!)
- inline char* save_string(int flags = 0) const;
- };
-
- // represents any JSON value, private base
- class Basic {
- public:
- // construct new Value with an undefined value
- Basic() : _value(0) {}
-
- // copy constructor
- Basic(const Basic& value) : _value(json_incref(value._value)) {}
-
- // make a reference to an existing json_t value
- explicit Basic(json_t* value) : _value(json_incref(value)) {}
-
- // free Value resources
- inline ~Basic();
-
- // copy an existing Value
- inline Basic& operator=(const Basic& e);
-
- // get the underlying json_t
- inline json_t* as_json() const;
+ inline _Base& set_key(const std::string& key, const Value& value);
+
+ // set an array index (converts value to object is not one already)
+ inline _Base& set_at(unsigned int index, const Value& value);
+
+ // delete an object key
+ inline _Base& del_key(const char* key);
+
+ inline _Base& del_key(const std::string& key);
+
+ // delete an item from an array by index
+ inline _Base& del_at(unsigned int index);
+
+ // insert an item into an array at a given index
+ inline _Base& insert_at(unsigned int index, const Value& value);
+
+ // write the value to a file
+ inline int save_file(const char* path, int flags = 0) const;
+
+ // write the value to a string (caller must deallocate with free()!)
+ inline char* save_string(int flags = 0) const;
+ };
+
+ // represents any JSON value, private base
+ class Basic {
+ public:
+ // construct new Value with an undefined value
+ Basic() : _value(0) {}
+
+ // copy constructor
+ Basic(const Basic& value) : _value(json_incref(value._value)) {}
+
+ // make a reference to an existing json_t value
+ explicit Basic(json_t* value) : _value(json_incref(value)) {}
+
+ // free Value resources
+ inline ~Basic();
+
+ // copy an existing Value
+ inline Basic& operator=(const Basic& e);