MCPcopy Create free account
hub / github.com/KDE/kdevelop / spacesAtCorner

Function spacesAtCorner

plugins/qmljs/kdevqmljsplugin.cpp:118–126  ·  view source on GitHub ↗

Finds how many spaces the given string has at one end. direction=+1 -> left end of the string, -1 for right end.

Source from the content-addressed store, hash-verified

116// Finds how many spaces the given string has at one end.
117// direction=+1 -> left end of the string, -1 for right end.
118int spacesAtCorner(const QString& string, int direction = +1) {
119 int spaces = 0;
120 QString::const_iterator it;
121 for ( it = direction == 1 ? string.begin() : string.end()-1 ; it != string.end(); it += direction ) {
122 if ( ! it->isSpace() ) break;
123 spaces += 1;
124 }
125 return spaces;
126}
127
128// Take the given QML line and check if it's a line of the form foo.bar: value.
129// Return ranges for the key and the value.

Callers 1

parsePropertyFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected