MCPcopy Create free account
hub / github.com/clangen/musikcube / jsonToPredicateList

Function jsonToPredicateList

src/plugins/server/WebSocketServer.cpp:97–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97static std::shared_ptr<IValue*> jsonToPredicateList(json& arr) {
98 size_t count = arr.is_array() ? arr.size() : 0;
99 IValue** valueArray = new IValue*[count];
100
101 for (size_t i = 0; i < count; i++) {
102 valueArray[i] = CreateValue(
103 arr[i]["category"],
104 arr[i]["id"],
105 "category");
106 }
107
108 return std::shared_ptr<IValue*>(valueArray, [count](IValue** del) {
109 for (size_t i = 0; i < count; i++) {
110 del[i]->Release();
111 }
112 delete[] del;
113 });
114}
115
116static json getEnvironment(Context& context) {
117 return {

Callers 2

QueryTracksByCategoryMethod · 0.85

Calls 3

CreateValueFunction · 0.85
sizeMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected