MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / next_keyword_if_it_exists

Function next_keyword_if_it_exists

src/geode/basic/file.cpp:112–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110 }
111
112 std::optional< std::string > next_keyword_if_it_exists(
113 std::ifstream& file, std::string_view word )
114 {
115 std::optional< std::string > line{ std::in_place };
116 const auto previous_position = file.tellg();
117 std::getline( file, line.value() );
118 if( string_starts_with( line.value(), word ) )
119 {
120 return line;
121 }
122 file.seekg( previous_position );
123 return std::nullopt;
124 }
125} // namespace geode

Callers

nothing calls this directly

Calls 2

string_starts_withFunction · 0.85
valueMethod · 0.45

Tested by

no test coverage detected