(pos !=
NPOS&& !found) {
50 boolwhole_at_start =
false;
51 if(pos == 0 || !
isalpha(
str.c_str()[pos - 1])) {
52whole_at_start =
true;
54 boolwhole_at_end =
false;
55 if(pos + pattern.length() ==
str.length() || !
isalpha(
str.c_str()[pos + pattern.length()])) {
58 if(whole_at_start && whole_at_end) {
86 boolcase_insensitive,
boolwhole_word)
const 93 if(start_search != 0)
125 stringsubstr =
str.substr(start_search);
126 const char*cp = substr.c_str();
127 while(*cp != 0 && !
isdigit(*cp)) {
134 while(*cp != 0 &&
isdigit(*cp)) {
145 stringsubstr =
str.substr(start_search);
146 const char*cp = substr.c_str();
147 while(*cp != 0 && !
isalpha(*cp)) {
154 while(*cp != 0 &&
isalpha(*cp)) {
170 size_tstart_pos(0), start_len(0), stop_pos(0), stop_len(0);
173 size_tsel_start = start_pos;
174 size_tsel_stop = stop_pos;
176sel_start += start_len;
179sel_stop += stop_len;
181 if(sel_start == 0 && sel_stop == 0) {
184rval =
input.substr(sel_start, sel_stop - sel_start);
194 size_tstart_pos = 0;
198 size_tstart_len(0), stop_pos(0), stop_len(0);
201 size_tsel_start = start_pos;
202 size_tsel_stop = stop_pos;
204sel_start += start_len;
207sel_stop += stop_len;
211new_val =
input.substr(0, sel_start);
213 if(sel_stop > 0 && sel_stop <
input.length() - 1) {
214new_val +=
input.substr(sel_stop);
216 if(new_val !=
input)
222 if(remove_first_only)
void SetText(const string &val)
static void s_GetLettersPosition(const string &str, size_t &pos, size_t &len, size_t start_search)
static void s_GetDigitsPosition(const string &str, size_t &pos, size_t &len, size_t start_search)
bool FindInText(const string &val, size_t &pos, size_t &len, size_t start_search, bool case_insensitive, bool whole_word) const
CParseTextMarker m_StartMarker
void RemoveSelectedText(string &input, bool remove_first_only=true) const
CParseTextMarker m_StopMarker
bool m_RemoveAfterPattern
string GetSelectedText(const string &input) const
bool m_RemoveBeforePattern
bool m_IncludeStartMarker
static const char * str(char *buf, int n)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
NCBI_NS_STD::string::size_type SIZE_TYPE
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string (in-place)
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
ECase
Which type of string comparison.
@ eFirst
First occurrence.
@ eNocase
Case insensitive compare.
@ eCase
Case sensitive compare.
SIZE_TYPE FindWithOptions(const string &str, const string &pattern, SIZE_TYPE start_search, bool case_insensitive, bool whole_word)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4