| 53 | ch = static_cast<char>(std::tolower(static_cast<unsigned char>(ch))); |
| 54 | } |
| 55 | return value; |
| 56 | } |
| 57 | |
| 58 | std::string trim(std::string value) { |
| 59 | auto is_space = [](unsigned char ch) { return std::isspace(ch) != 0; }; |
| 60 | value.erase(value.begin(), std::find_if(value.begin(), value.end(), [&](char ch) { return !is_space(ch); })); |
| 61 | value.erase(std::find_if(value.rbegin(), value.rend(), [&](char ch) { return !is_space(ch); }).base(), value.end()); |
| 62 | return value; |
| 63 | } |
| 64 | |
| 65 | std::string json_quote(std::string_view value) { |
| 66 | return engine::io::json::stringify_string(value); |
| 67 | } |
| 68 | |
| 69 | const char * status_text(int status) noexcept { |
| 70 | switch (status) { |
| 71 | case 200: |
| 72 | return "OK"; |
| 73 | case 204: |
no outgoing calls
no test coverage detected