| 33 | static const char* TIME_LABEL[] = {"ms", "s", "m", "h", "d"}; |
| 34 | |
| 35 | static inline void SplitString(const std::string& full, |
| 36 | const std::string& delim, |
| 37 | std::vector<std::string>& result) { // NOLINT |
| 38 | result.clear(); |
| 39 | if (full.empty()) { |
| 40 | return; |
| 41 | } |
| 42 | std::string tmp; |
| 43 | std::string::size_type pos_begin = full.find_first_not_of(delim); |
| 44 | std::string::size_type comma_pos = 0; |
| 45 | while (pos_begin != std::string::npos) { |
| 46 | comma_pos = full.find(delim, pos_begin); |
| 47 | if (comma_pos != std::string::npos) { |
| 48 | tmp = full.substr(pos_begin, comma_pos - pos_begin); |
| 49 | pos_begin = comma_pos + delim.length(); |
| 50 | } else { |
| 51 | tmp = full.substr(pos_begin); |
| 52 | pos_begin = comma_pos; |
| 53 | } |
| 54 | |
| 55 | if (!tmp.empty()) { |
| 56 | result.push_back(tmp); |
| 57 | tmp.clear(); |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | static inline bool IsVisible(char c) { return (c >= 0x20 && c <= 0x7E); } |
| 63 | |