get the current word on a line index must point to the beginning of the word
| 549 | // get the current word on a line |
| 550 | // index must point to the beginning of the word |
| 551 | string ASBase::getCurrentWord(const string& line, size_t index) const |
| 552 | { |
| 553 | assert(isCharPotentialHeader(line, index)); |
| 554 | size_t lineLength = line.length(); |
| 555 | size_t i; |
| 556 | for (i = index; i < lineLength; i++) |
| 557 | { |
| 558 | if (!isLegalNameChar(line[i])) |
| 559 | break; |
| 560 | } |
| 561 | return line.substr(index, i - index); |
| 562 | } |
| 563 | |
| 564 | } // end namespace astyle |