MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / serializeRequires

Function serializeRequires

launcher/meta/JsonFormat.cpp:192–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190 }
191}
192void serializeRequires(QJsonObject& obj, RequireSet* ptr, const char * keyName)
193{
194 if(!ptr || ptr->empty())
195 {
196 return;
197 }
198 QJsonArray arrOut;
199 for(auto &iter: *ptr)
200 {
201 QJsonObject reqOut;
202 reqOut.insert("uid", iter.uid);
203 if(!iter.equalsVersion.isEmpty())
204 {
205 reqOut.insert("equals", iter.equalsVersion);
206 }
207 if(!iter.suggests.isEmpty())
208 {
209 reqOut.insert("suggests", iter.suggests);
210 }
211 arrOut.append(reqOut);
212 }
213 obj.insert(keyName, arrOut);
214}
215
216}
217

Callers 2

versionFileToJsonMethod · 0.85
componentToJsonV1Function · 0.85

Calls 4

insertMethod · 0.80
isEmptyMethod · 0.80
appendMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected