MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / applyOperation

Function applyOperation

source/core/StarJsonPatch.cpp:47–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 };
46
47 Json applyOperation(Json const& base, Json const& op, Maybe<Json> const&) {
48 try {
49 auto operation = op.getString("op");
50 return JsonPatching::functionMap.get(operation)(base, op);
51 } catch (JsonException const& e) {
52 throw JsonPatchException(strf("Could not apply operation to base. {}", e.what()), false);
53 } catch (MapException const&) {
54 throw JsonPatchException(strf("Invalid operation: {}", op.getString("op")), false);
55 }
56 }
57
58 Json applyTestOperation(Json const& base, Json const& op) {
59 String path = op.getString("path");

Callers 2

jsonPatchFunction · 0.85
checkPatchArrayMethod · 0.85

Calls 4

strfFunction · 0.85
getStringMethod · 0.80
getMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected