| 205 | } |
| 206 | |
| 207 | void 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 | |
| 242 | QVector<QString> StructTreeNode::getStructNames(bool includeGroups, QString prefix) |
| 243 | { |
nothing calls this directly
no outgoing calls
no test coverage detected