Finds how many spaces the given string has at one end. direction=+1 -> left end of the string, -1 for right end.
| 116 | // Finds how many spaces the given string has at one end. |
| 117 | // direction=+1 -> left end of the string, -1 for right end. |
| 118 | int 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. |
no test coverage detected