@cond Doxygen_Suppress
| 397 | |
| 398 | //! @cond Doxygen_Suppress |
| 399 | void PrimeMeridian::_exportToJSON( |
| 400 | io::JSONFormatter *formatter) const // throw(FormattingException) |
| 401 | { |
| 402 | auto writer = formatter->writer(); |
| 403 | auto objectContext( |
| 404 | formatter->MakeObjectContext("PrimeMeridian", !identifiers().empty())); |
| 405 | |
| 406 | writer->AddObjKey("name"); |
| 407 | std::string l_name = |
| 408 | name()->description().has_value() ? nameStr() : "Greenwich"; |
| 409 | writer->Add(l_name); |
| 410 | |
| 411 | const auto &l_long = longitude(); |
| 412 | writer->AddObjKey("longitude"); |
| 413 | const auto &unit = l_long.unit(); |
| 414 | if (unit == common::UnitOfMeasure::DEGREE) { |
| 415 | writer->Add(l_long.value(), 15); |
| 416 | } else { |
| 417 | auto longitudeContext(formatter->MakeObjectContext(nullptr, false)); |
| 418 | writer->AddObjKey("value"); |
| 419 | writer->Add(l_long.value(), 15); |
| 420 | writer->AddObjKey("unit"); |
| 421 | unit._exportToJSON(formatter); |
| 422 | } |
| 423 | |
| 424 | if (formatter->outputId()) { |
| 425 | formatID(formatter); |
| 426 | } |
| 427 | } |
| 428 | //! @endcond |
| 429 | |
| 430 | // --------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected