Removes leading and trailing whitespaces */
| 192 | Removes leading and trailing whitespaces |
| 193 | */ |
| 194 | inline std::string trim(const std::string &str) { |
| 195 | const std::string whitespace = " \t"; |
| 196 | auto begin = str.find_first_not_of(whitespace); |
| 197 | |
| 198 | if (begin == std::string::npos) |
| 199 | return ""; |
| 200 | |
| 201 | auto end = str.find_last_not_of(whitespace); |
| 202 | |
| 203 | return str.substr(begin, end - begin + 1); |
| 204 | } |
| 205 | |
| 206 | |
| 207 | inline std::string get_value_from_map(const std::string &mapstr) { |
no outgoing calls
no test coverage detected