v1.4.4
This commit is contained in:
commit
9c94d113d3
10260 changed files with 1237388 additions and 0 deletions
41
source/core/StarJsonPatch.hpp
Normal file
41
source/core/StarJsonPatch.hpp
Normal file
|
@ -0,0 +1,41 @@
|
|||
#ifndef STAR_JSON_PATCH_HPP
|
||||
#define STAR_JSON_PATCH_HPP
|
||||
|
||||
#include "StarJson.hpp"
|
||||
|
||||
namespace Star {
|
||||
|
||||
STAR_EXCEPTION(JsonPatchException, JsonException);
|
||||
STAR_EXCEPTION(JsonPatchTestFail, StarException);
|
||||
|
||||
// Applies the given RFC6902 compliant patch to the base and returns the result
|
||||
// Throws JsonPatchException on patch failure.
|
||||
Json jsonPatch(Json const& base, JsonArray const& patch);
|
||||
|
||||
namespace JsonPatching {
|
||||
// Applies the given single operation
|
||||
Json applyOperation(Json const& base, Json const& op);
|
||||
|
||||
// Tests for "value" at "path"
|
||||
// Returns base or throws JsonPatchException
|
||||
Json applyTestOperation(Json const& base, Json const& op);
|
||||
|
||||
// Removes the value at "path"
|
||||
Json applyRemoveOperation(Json const& base, Json const& op);
|
||||
|
||||
// Adds "value" at "path"
|
||||
Json applyAddOperation(Json const& base, Json const& op);
|
||||
|
||||
// Replaces "path" with "value"
|
||||
Json applyReplaceOperation(Json const& base, Json const& op);
|
||||
|
||||
// Moves "from" to "path"
|
||||
Json applyMoveOperation(Json const& base, Json const& op);
|
||||
|
||||
// Copies "from" to "path"
|
||||
Json applyCopyOperation(Json const& base, Json const& op);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue