MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / GetLineNumber

Function GetLineNumber

Source/Scripting/scriptfile.cpp:80–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80unsigned GetLineNumber(std::string& script, unsigned char_pos) {
81 unsigned line_number = 1;
82 for (unsigned i = 0; i < char_pos; i++) {
83 if (script[i] == '\n') {
84 line_number++;
85 }
86 }
87 return line_number;
88}
89
90unsigned GetNumLines(std::string& script) {
91 unsigned line_number = 1;

Callers 3

ConfigEngineFromStreamFunction · 0.85
ExpandIncludePathsMethod · 0.85
ConfigEngineFromStreamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected