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

Method writeToJson

Source/MemoryWatch/MemWatchTreeNode.cpp:181–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181void MemWatchTreeNode::writeToJson(QJsonObject& json, const bool writeExpandedState) const
182{
183 if (isGroup())
184 {
185 json["groupName"] = m_groupName;
186 if (m_expanded && writeExpandedState)
187 {
188 json["expanded"] = m_expanded;
189 }
190 QJsonArray entries;
191 for (MemWatchTreeNode* const child : m_children)
192 {
193 QJsonObject theNode;
194 child->writeToJson(theNode, writeExpandedState);
195 entries.append(theNode);
196 }
197 json["groupEntries"] = entries;
198 }
199 else
200 {
201 if (m_parent == nullptr)
202 {
203 QJsonArray watchList;
204 for (MemWatchTreeNode* const child : m_children)
205 {
206 QJsonObject theNode;
207 child->writeToJson(theNode, writeExpandedState);
208 watchList.append(theNode);
209 }
210 json["watchList"] = watchList;
211 }
212 else
213 {
214 m_entry->writeToJson(json);
215 }
216 }
217}
218
219QString MemWatchTreeNode::writeAsCSV() const
220{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected