| 144 | class EventParser { |
| 145 | public: |
| 146 | explicit EventParser(std::string_view text) { |
| 147 | if (!yaml_parser_initialize(&parser_)) { |
| 148 | throw std::runtime_error("failed to initialize yaml parser"); |
| 149 | } |
| 150 | initialized_ = true; |
| 151 | yaml_parser_set_input_string( |
| 152 | &parser_, |
| 153 | reinterpret_cast<const unsigned char *>(text.data()), |
| 154 | text.size()); |
| 155 | } |
| 156 | |
| 157 | ~EventParser() { |
| 158 | if (initialized_) { |
nothing calls this directly
no test coverage detected