| 72 | } |
| 73 | |
| 74 | std::string goto_keywords( |
| 75 | std::ifstream& file, absl::Span< const std::string_view > words ) |
| 76 | { |
| 77 | std::string line; |
| 78 | while( std::getline( file, line ) ) |
| 79 | { |
| 80 | for( const auto word : words ) |
| 81 | { |
| 82 | if( string_starts_with( line, word ) ) |
| 83 | { |
| 84 | return line; |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | throw geode::OpenGeodeBasicException{ nullptr, |
| 89 | OpenGeodeException::TYPE::data, |
| 90 | "[goto_keywords] Cannot find one of the requested keywords" }; |
| 91 | return ""; |
| 92 | } |
| 93 | |
| 94 | std::optional< std::string > goto_keyword_if_it_exists( |
| 95 | std::ifstream& file, std::string_view word ) |
nothing calls this directly
no test coverage detected