MCPcopy Create free account
hub / github.com/TankOs/SFGUI / GetLine

Function GetLine

src/SFGUI/Parsers/ThemeParser/Parse.cpp:14–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12static ThemeGrammar _grammar;
13
14std::string GetLine( std::string str, std::size_t line ) {
15 for( std::size_t current_line = 1; current_line < line; ++current_line ) {
16 auto position = str.find( '\n' );
17 if( ( position == std::string::npos ) || ( position == ( str.size() - 1 ) ) ) {
18 return std::string( "" );
19 }
20
21 str.erase( 0, position + 1 );
22 }
23
24 str.erase( str.find( '\n' ) );
25
26 return str;
27}
28
29std::size_t ColumnPosition( std::string str, std::size_t string_position ) {
30 std::size_t column_position = 0;

Callers 1

catchFunction · 0.85

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected