MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / findNextWord

Method findNextWord

Engine/source/gui/controls/guiTextEditCtrl.cpp:1599–1621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1597}
1598
1599S32 GuiTextEditCtrl::findNextWord()
1600{
1601 // First the first word to the right of the current cursor position
1602 // and return the positional index of its starting character.
1603
1604 // We define the first character of a word as any non-whitespace
1605 // character which has a non-alpha-numeric character to its immediate left.
1606
1607 const UTF8* text = mTextBuffer.getPtr8();
1608
1609 for ( S32 i = mCursorPos + 1; i < mTextBuffer.length(); i++ )
1610 {
1611 if ( !dIsspace( text[i] ) )
1612 {
1613 if ( !dIsalnum( text[i-1] ) )
1614 {
1615 return i;
1616 }
1617 }
1618 }
1619
1620 return mTextBuffer.length();
1621}
1622
1623DefineEngineMethod( GuiTextEditCtrl, getText, const char*, (),,
1624 "@brief Acquires the current text displayed in this control.\n\n"

Callers

nothing calls this directly

Calls 4

dIsspaceFunction · 0.85
dIsalnumFunction · 0.85
getPtr8Method · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected