| 1270 | // --------------------------------------------------------------------------- |
| 1271 | |
| 1272 | void ObjectUsage::baseExportToJSON(JSONFormatter *formatter) const { |
| 1273 | |
| 1274 | auto writer = formatter->writer(); |
| 1275 | if (formatter->outputUsage()) { |
| 1276 | const auto &l_domains = domains(); |
| 1277 | if (l_domains.size() == 1) { |
| 1278 | l_domains[0]->_exportToJSON(formatter); |
| 1279 | } else if (!l_domains.empty()) { |
| 1280 | writer->AddObjKey("usages"); |
| 1281 | auto arrayContext(writer->MakeArrayContext(false)); |
| 1282 | for (const auto &domain : l_domains) { |
| 1283 | auto objContext(writer->MakeObjectContext()); |
| 1284 | domain->_exportToJSON(formatter); |
| 1285 | } |
| 1286 | } |
| 1287 | } |
| 1288 | |
| 1289 | if (formatter->outputId()) { |
| 1290 | formatID(formatter); |
| 1291 | } |
| 1292 | formatRemarks(formatter); |
| 1293 | } |
| 1294 | |
| 1295 | // --------------------------------------------------------------------------- |
| 1296 |
nothing calls this directly
no test coverage detected