Removes leading and trailing whitespaces */
| 175 | Removes leading and trailing whitespaces |
| 176 | */ |
| 177 | inline std::string trim(const std::string& str) { |
| 178 | const std::string whitespace = " \t"; |
| 179 | auto begin = str.find_first_not_of(whitespace); |
| 180 | |
| 181 | if (begin == std::string::npos) |
| 182 | return ""; |
| 183 | |
| 184 | auto end = str.find_last_not_of(whitespace); |
| 185 | |
| 186 | return str.substr(begin, end - begin + 1); |
| 187 | } |
| 188 | |
| 189 | inline std::string get_value_from_map(const std::string& mapstr) { |
| 190 | size_t sep_pos = mapstr.find_first_of(":"); |
no outgoing calls
no test coverage detected