| 240 | } |
| 241 | |
| 242 | bool common_chat_msg_parser::try_consume_literal(const std::string & literal) { |
| 243 | auto pos = pos_; |
| 244 | for (auto i = 0u; i < literal.size(); ++i) { |
| 245 | if (pos >= input_.size()) { |
| 246 | return false; |
| 247 | } |
| 248 | if (input_[pos] != literal[i]) { |
| 249 | return false; |
| 250 | } |
| 251 | ++pos; |
| 252 | } |
| 253 | pos_ = pos; |
| 254 | return true; |
| 255 | } |
| 256 | |
| 257 | std::optional<common_chat_msg_parser::find_regex_result> common_chat_msg_parser::try_find_literal(const std::string & literal) { |
| 258 | auto idx = input_.find(literal, pos_); |