* Find text from current search anchor: Must call @c SearchAnchor first. * Used for next text and previous text requests. * @return The position of the found text, -1 if not found. */
| 5997 | * @return The position of the found text, -1 if not found. |
| 5998 | */ |
| 5999 | long Editor::SearchText ( |
| 6000 | unsigned int iMessage, ///< Accepts both @c SCI_SEARCHNEXT and @c SCI_SEARCHPREV. |
| 6001 | uptr_t wParam, ///< Search modes : @c SCFIND_MATCHCASE, @c SCFIND_WHOLEWORD, |
| 6002 | ///< @c SCFIND_WORDSTART, @c SCFIND_REGEXP or @c SCFIND_POSIX. |
| 6003 | sptr_t lParam ) ///< The text to search for. |
| 6004 | { |
| 6005 | const char *txt = reinterpret_cast<char *> ( lParam ); |
| 6006 | int pos; |
| 6007 | int lengthFound = istrlen ( txt ); |
| 6008 | if ( !pdoc->HasCaseFolder() ) { |
| 6009 | pdoc->SetCaseFolder ( CaseFolderForEncoding() ); |
| 6010 | } |
| 6011 | if ( iMessage == SCI_SEARCHNEXT ) { |
| 6012 | pos = pdoc->FindText ( searchAnchor, pdoc->Length(), txt, |
| 6013 | ( wParam & SCFIND_MATCHCASE ) != 0, |
| 6014 | ( wParam & SCFIND_WHOLEWORD ) != 0, |
| 6015 | ( wParam & SCFIND_WORDSTART ) != 0, |
| 6016 | ( wParam & SCFIND_REGEXP ) != 0, |
| 6017 | wParam, |
| 6018 | &lengthFound ); |
| 6019 | } else { |
| 6020 | pos = pdoc->FindText ( searchAnchor, 0, txt, |
| 6021 | ( wParam & SCFIND_MATCHCASE ) != 0, |
| 6022 | ( wParam & SCFIND_WHOLEWORD ) != 0, |
| 6023 | ( wParam & SCFIND_WORDSTART ) != 0, |
| 6024 | ( wParam & SCFIND_REGEXP ) != 0, |
| 6025 | wParam, |
| 6026 | &lengthFound ); |
| 6027 | } |
| 6028 | if ( pos != -1 ) { |
| 6029 | SetSelection ( pos, pos + lengthFound ); |
| 6030 | } |
| 6031 | return pos; |
| 6032 | } |
| 6033 | |
| 6034 | std::string Editor::CaseMapString ( const std::string &s, int caseMapping ) |
| 6035 | { |
nothing calls this directly
no test coverage detected