MCPcopy Create free account
hub / github.com/AimRT/AimRT / FormatJson

Method FormatJson

src/plugins/echo_plugin/echo_plugin.cc:234–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234void EchoPlugin::FormatJson(std::string& json_str) {
235 Json::Value root;
236 bool success = Json::Reader().parse(json_str, root);
237 if (success) {
238 json_str = Json::StyledWriter().write(root);
239 } else [[unlikely]] {
240 AIMRT_WARN("Invalid json string, will keep original string.");
241 }
242}
243
244void EchoPlugin::Shutdown() noexcept {
245 try {

Callers

nothing calls this directly

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected