MCPcopy Create free account
hub / github.com/aldelaro5/dolphin-memory-engine / writeToJson

Method writeToJson

Source/Structs/StructTreeNode.cpp:207–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207void StructTreeNode::writeToJson(QJsonObject& json) const
208{
209 if (isGroup())
210 {
211 json["groupName"] = m_nodeName;
212 json["expanded"] = m_expanded;
213 QJsonArray entries;
214 for (StructTreeNode* const child : m_children)
215 {
216 QJsonObject nextNode;
217 child->writeToJson(nextNode);
218 entries.append(nextNode);
219 }
220 json["groupChildren"] = entries;
221 }
222 else if (m_parent == nullptr)
223 {
224 QJsonArray rootNode;
225 for (StructTreeNode* const child : m_children)
226 {
227 QJsonObject nextNode;
228 child->writeToJson(nextNode);
229 rootNode.append(nextNode);
230 }
231 json["rootNode"] = rootNode;
232 }
233 else
234 {
235 json["structName"] = m_nodeName;
236 QJsonObject structDefJson;
237 m_structDef->writeToJson(structDefJson);
238 json["struct"] = structDefJson;
239 }
240}
241
242QVector<QString> StructTreeNode::getStructNames(bool includeGroups, QString prefix)
243{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected