| 8 | namespace tinyrpc { |
| 9 | |
| 10 | class StringUtil { |
| 11 | |
| 12 | public: |
| 13 | // split a string to map |
| 14 | // for example: str is a=1&tt=2&cc=3 split_str = '&' joiner='=' |
| 15 | // get res is {"a":"1", "tt":"2", "cc", "3"} |
| 16 | static void SplitStrToMap(const std::string& str, const std::string& split_str, |
| 17 | const std::string& joiner, std::map<std::string, std::string>& res); |
| 18 | |
| 19 | // split a string to vector |
| 20 | // for example: str is a=1&tt=2&cc=3 split_str = '&' |
| 21 | // get res is {"a=1", "tt=2", "cc=3"} |
| 22 | static void SplitStrToVector(const std::string& str, const std::string& split_str, |
| 23 | std::vector<std::string>& res); |
| 24 | |
| 25 | }; |
| 26 | |
| 27 | |
| 28 | } |
nothing calls this directly
no outgoing calls
no test coverage detected