| 92 | } |
| 93 | |
| 94 | std::optional< std::string > goto_keyword_if_it_exists( |
| 95 | std::ifstream& file, std::string_view word ) |
| 96 | { |
| 97 | std::optional< std::string > line{ std::in_place }; |
| 98 | while( std::getline( file, line.value() ) ) |
| 99 | { |
| 100 | if( string_starts_with( line.value(), word ) ) |
| 101 | { |
| 102 | return line; |
| 103 | } |
| 104 | } |
| 105 | geode::Logger::debug( "[goto_keyword_if_it_exists] Couldn't find word ", |
| 106 | word, " in the file, returning to file begin." ); |
| 107 | file.clear(); |
| 108 | file.seekg( std::ios::beg ); |
| 109 | return std::nullopt; |
| 110 | } |
| 111 | |
| 112 | std::optional< std::string > next_keyword_if_it_exists( |
| 113 | std::ifstream& file, std::string_view word ) |
nothing calls this directly
no test coverage detected