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

Method findNextWord

Engine/source/gui/controls/guiTextEditCtrl.cpp:1653–1675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1651}
1652
1653S32 GuiTextEditCtrl::findNextWord()
1654{
1655 // First the first word to the right of the current cursor position
1656 // and return the positional index of its starting character.
1657
1658 // We define the first character of a word as any non-whitespace
1659 // character which has a non-alpha-numeric character to its immediate left.
1660
1661 const UTF8* text = mTextBuffer.getPtr8();
1662
1663 for ( S32 i = mCursorPos + 1; i < mTextBuffer.length(); i++ )
1664 {
1665 if ( !dIsspace( text[i] ) )
1666 {
1667 if ( !dIsalnum( text[i-1] ) )
1668 {
1669 return i;
1670 }
1671 }
1672 }
1673
1674 return mTextBuffer.length();
1675}
1676
1677DefineEngineMethod( GuiTextEditCtrl, getText, const char*, (),,
1678 "@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