| 169 | } |
| 170 | |
| 171 | string SnakeToCamelCase(const string& str, bool upper = false) { |
| 172 | string result; |
| 173 | bool cap = upper; |
| 174 | for (string::const_iterator it = str.begin(); it != str.end(); ++it) { |
| 175 | const char c = *it; |
| 176 | if (c == '_') { |
| 177 | cap = true; |
| 178 | } else if (cap) { |
| 179 | result += toupper(c); |
| 180 | cap = false; |
| 181 | } else { |
| 182 | result += c; |
| 183 | } |
| 184 | } |
| 185 | return result; |
| 186 | } |
| 187 | |
| 188 | bool FindAndCut(string* input, const RE2& expr, string* before_match, |
| 189 | string* ret_match = nullptr) { |
no test coverage detected