MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / parseAnnotatedValue

Function parseAnnotatedValue

libminifi/src/c2/protocols/RESTProtocol.cpp:43–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41#endif
42
43AnnotatedValue parseAnnotatedValue(const rapidjson::Value& jsonValue) {
44 AnnotatedValue result;
45 if (jsonValue.IsObject() && jsonValue.HasMember("value")) {
46 result = jsonValue["value"].GetString();
47 for (const auto& annotation : jsonValue.GetObject()) {
48 if (annotation.name.GetString() == std::string("value")) {
49 continue;
50 }
51 result.annotations[annotation.name.GetString()] = parseAnnotatedValue(annotation.value);
52 }
53 } else if (jsonValue.IsBool()) {
54 result = jsonValue.GetBool();
55 } else {
56 result = jsonValue.GetString();
57 }
58 return result;
59}
60
61const C2Payload RESTProtocol::parseJsonResponse(const C2Payload &payload, const std::vector<char> &response) {
62 rapidjson::Document root;

Callers 1

parseJsonResponseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected