Make Value copy constructor simplier

Helper private methods Value::dupPayload() and Value::dupMeta() are added.
Value copy constructor doesn't attempt to delete its data first.
* Value::dupPayload() duplicates a payload.
* Value::dupMeta() duplicates comments and an offset position with a limit.
This commit is contained in:
Andrey Okoshkin
2018-01-12 15:59:20 +03:00
parent 392e3a5b49
commit 9b569c8ce3
2 changed files with 54 additions and 46 deletions

View File

@@ -606,7 +606,9 @@ Json::Value obj_value(Json::objectValue); // {}
private:
void initBasic(ValueType type, bool allocated = false);
void dupPayload(const Value& other);
void releasePayload();
void dupMeta(const Value& other);
Value& resolveReference(const char* key);
Value& resolveReference(const char* key, const char* end);