For printing key - string pairs (necessary because of json)
| 554 | |
| 555 | // For printing key - string pairs (necessary because of json) |
| 556 | void PrintKeyString(std::string key, std::string value) { |
| 557 | switch (output_type) { |
| 558 | case (OutputType::text): |
| 559 | case (OutputType::html): |
| 560 | PrintKeyValue(key, value); |
| 561 | break; |
| 562 | case (OutputType::json): |
| 563 | case (OutputType::vkconfig_output): |
| 564 | if (!value_description.empty()) { |
| 565 | // PrintKeyValue adds the necessary quotes when printing with a value description set |
| 566 | PrintKeyValue(key, EscapeJSONCString(value)); |
| 567 | } else { |
| 568 | PrintKeyValue(key, std::string("\"") + EscapeJSONCString(value) + "\""); |
| 569 | } |
| 570 | break; |
| 571 | default: |
| 572 | break; |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | // For printing key - string pairs (necessary because of json) |
| 577 | void PrintKeyBool(std::string key, bool value) { PrintKeyValue(key, value ? "true" : "false"); } |
no outgoing calls
no test coverage detected