| 179 | } |
| 180 | |
| 181 | void 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 | |
| 219 | QString MemWatchTreeNode::writeAsCSV() const |
| 220 | { |
nothing calls this directly
no outgoing calls
no test coverage detected