nlib
|
Class to create JSON Patch (RFC-6902). More...
#include "nn/nlib/msgpack/JsonPatch.h"
Public Member Functions | |
errno_t | Add (const nlib_utf8_t *path, MpObject *value) noexcept |
Adds an "add" operation to the array that serves as the JSON Patch document. More... | |
errno_t | Add (const nlib_utf8_t *path, MpObject &&value) noexcept |
Adds an "add" operation to the array that serves as the JSON Patch document. More... | |
errno_t | Remove (const nlib_utf8_t *path) noexcept |
Adds a "remove" operation to the array that serves as the JSON Patch document. More... | |
errno_t | Replace (const nlib_utf8_t *path, MpObject *value) noexcept |
Adds an "replace" operation to the array that serves as the JSON Patch document. More... | |
errno_t | Replace (const nlib_utf8_t *path, MpObject &&value) noexcept |
Adds an "replace" operation to the array that serves as the JSON Patch document. More... | |
errno_t | Move (const nlib_utf8_t *path, const nlib_utf8_t *from) noexcept |
Adds a "move" operation to the array that serves as the JSON Patch document. More... | |
errno_t | Copy (const nlib_utf8_t *path, const nlib_utf8_t *from) noexcept |
Adds a "copy" operation to the array that serves as the JSON Patch document. More... | |
errno_t | Test (const nlib_utf8_t *path, MpObject *value) noexcept |
Adds a "test" operation to the array that serves as the JSON Patch document. More... | |
errno_t | Test (const nlib_utf8_t *path, MpObject &&value) noexcept |
Adds a "test" operation to the array that serves as the JSON Patch document. More... | |
errno_t | Export (MpObject *patch) noexcept |
Retrieves a JSON document that serves as JSON Patch. More... | |
std::pair< errno_t, std::unique_ptr< MpObject > > | Export () noexcept |
Retrieves a JSON document that serves as JSON Patch in the MpObject format. More... | |
Constructor, Destructor, and Initialization | |
JsonPatchBuilder () noexcept | |
Instantiates the object with default parameters (default constructor). | |
~JsonPatchBuilder () noexcept | |
Destructor. | |
JsonPatchBuilder (JsonPatchBuilder &&rhs)=default | |
Instantiates the object (move constructor). | |
JsonPatchBuilder & | operator= (JsonPatchBuilder &&rhs)=default |
Move assignment operator. | |
Class to create JSON Patch (RFC-6902).
Add()
, Remove()
, Replace()
, Move()
, Copy()
, or Test()
. Each of these member functions corresponds to the "add," "remove," "replace," "move," "copy," or "test" operation defined in RFC-6902. When the JSON Patch document has been constructed, it is output as MpObject
using Export()
. The output JSON Patch document can be applied using JsonPatch::Apply()
. Definition at line 30 of file JsonPatch.h.
|
inlinenoexcept |
Adds an "add" operation to the array that serves as the JSON Patch document.
[in] | path | A JSON Pointer string that indicates a location where value is set in the JSON document. |
[in] | value | The value being set. |
0 | Success. |
ENOMEM | Indicates that the memory allocation has failed. |
Definition at line 52 of file JsonPatch.h.
|
inlinenoexcept |
Adds an "add" operation to the array that serves as the JSON Patch document.
[in] | path | A JSON Pointer string that indicates a location where value is set in the JSON document. |
[in] | value | The value being set. |
0 | Success. |
ENOMEM | Indicates that the memory allocation has failed. |
Definition at line 56 of file JsonPatch.h.
|
inlinenoexcept |
Adds a "copy" operation to the array that serves as the JSON Patch document.
[in] | path | A JSON Pointer string that indicates a location to copy to in the JSON document. |
[in] | from | A JSON Pointer string that indicates a location to copy from in the JSON document. |
0 | Success. |
ENOMEM | Indicates that the memory allocation has failed. |
Definition at line 73 of file JsonPatch.h.
|
noexcept |
Retrieves a JSON document that serves as JSON Patch.
[in] | patch | MpObject that contains the JSON document that serves as JSON Patch. |
0 | Success. |
ENOMEM | Indicates that the memory allocation has failed. |
JsonPatchBuilder
is set to the same state as when immediately after the constructor was executed. ENOMEM
may be returned only when no operation has been added.
|
noexcept |
Retrieves a JSON document that serves as JSON Patch in the MpObject
format.
MpObject
is stored in the unique pointer. When allocating memory fails inside, ENOMEM
is set as the error value.
|
inlinenoexcept |
Adds a "move" operation to the array that serves as the JSON Patch document.
[in] | path | A JSON Pointer string that indicates a location to move to in the JSON document. |
[in] | from | A JSON Pointer string that indicates a location to move from in the JSON document. |
0 | Success. |
ENOMEM | Indicates that the memory allocation has failed. |
Definition at line 69 of file JsonPatch.h.
|
noexcept |
Adds a "remove" operation to the array that serves as the JSON Patch document.
[in] | path | A JSON Pointer string that indicates a location to be deleted in the JSON document. |
0 | Success. |
ENOMEM | Indicates that the memory allocation has failed. |
|
inlinenoexcept |
Adds an "replace" operation to the array that serves as the JSON Patch document.
[in] | path | A JSON Pointer string that indicates a location where value is set in the JSON document. |
[in] | value | The value being set. |
0 | Success. |
ENOMEM | Indicates that the memory allocation has failed. |
Definition at line 61 of file JsonPatch.h.
|
inlinenoexcept |
Adds an "replace" operation to the array that serves as the JSON Patch document.
[in] | path | A JSON Pointer string that indicates a location where value is set in the JSON document. |
[in] | value | The value being set. |
0 | Success. |
ENOMEM | Indicates that the memory allocation has failed. |
Definition at line 65 of file JsonPatch.h.
|
inlinenoexcept |
Adds a "test" operation to the array that serves as the JSON Patch document.
[in] | path | A JSON Pointer string that indicates a location where an operation is performed in the JSON document. |
[in] | value | A value to be compared. |
0 | Success. |
ENOMEM | Indicates that the memory allocation has failed. |
Definition at line 77 of file JsonPatch.h.
|
inlinenoexcept |
Adds a "test" operation to the array that serves as the JSON Patch document.
[in] | path | A JSON Pointer string that indicates a location where an operation is performed in the JSON document. |
[in] | value | A value to be compared. |
0 | Success. |
ENOMEM | Indicates that the memory allocation has failed. |
Definition at line 81 of file JsonPatch.h.
© Nintendo Co., Ltd. All rights reserved.