MCPcopy Create free account
hub / github.com/Selectively11/CloudRedirect / JsonObject

Function JsonObject

src/common/cli.cpp:114–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114static std::string JsonObject(std::initializer_list<std::pair<std::string, std::string>> fields) {
115 std::ostringstream out;
116 out << "{";
117 bool first = true;
118 for (const auto& [key, value] : fields) {
119 if (!first) out << ",";
120 out << "\"" << key << "\":" << value;
121 first = false;
122 }
123 out << "}";
124 return out.str();
125}
126
127static std::string JsonString(const std::string& s) {
128 return "\"" + JsonEscape(s) + "\"";

Callers 15

JsonErrorFunction · 0.85
JsonSuccessFunction · 0.85
CmdAuthStatusFunction · 0.85
CmdListRemoteAppsFunction · 0.85
CmdListRemoteAppIdsFunction · 0.85
CmdListRemoteAppFilesFunction · 0.85
CmdDeleteRemoteAppFunction · 0.85
CmdListBlobsFunction · 0.85
CmdListAllStatsFunction · 0.85
CmdDownloadBlobFunction · 0.85
CmdDeleteBlobsFunction · 0.85
CmdSyncRemoteAppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected