add a new method to insert a new value in an array at specific index. (#949)

* add a new method to insert a new value in an array at specific index.

* update: index > length, return false;

* fix clang-format
This commit is contained in:
dota17
2019-10-16 14:33:53 +08:00
committed by GitHub
parent c5f66ab816
commit bdacfd7bc0
3 changed files with 75 additions and 0 deletions

View File

@@ -464,6 +464,8 @@ public:
/// Equivalent to jsonvalue[jsonvalue.size()] = value;
Value& append(const Value& value);
Value& append(Value&& value);
/// \brief Insert value in array at specific index
bool insert(ArrayIndex index, Value newValue);
/// Access an object value by name, create a null member if it does not exist.
/// \note Because of our implementation, keys are limited to 2^30 -1 chars.