| 483 | } |
| 484 | |
| 485 | std::vector<StringBox> Value::sortedMapKeys() const { |
| 486 | std::vector<StringBox> keys; |
| 487 | |
| 488 | const auto* map = getMap(); |
| 489 | if (map != nullptr) { |
| 490 | keys.reserve(map->size()); |
| 491 | |
| 492 | for (const auto& it : *map) { |
| 493 | keys.emplace_back(it.first); |
| 494 | } |
| 495 | |
| 496 | std::sort(keys.begin(), keys.end(), [](const StringBox& left, const StringBox& right) -> bool { |
| 497 | return left.toStringView() < right.toStringView(); |
| 498 | }); |
| 499 | } |
| 500 | |
| 501 | return keys; |
| 502 | } |
| 503 | |
| 504 | bool Value::toBool() const noexcept { |
| 505 | switch (getType()) { |
no test coverage detected