MCPcopy Create free account
hub / github.com/cxasm/notepad-- / buildSearchFlags

Function buildSearchFlags

src/findwin.cpp:2207–2232  ·  view source on GitHub ↗

Find the first occurrence of a string.

Source from the content-addressed store, hash-verified

2205
2206// Find the first occurrence of a string.
2207int buildSearchFlags(bool re, bool cs, bool wo, bool wrap, bool forward, FindNextType findNextType, bool posix, bool cxx11)
2208{
2209 int flags = 0;
2210
2211 flags = (cs ? SCFIND_MATCHCASE : 0) |
2212 (wo ? SCFIND_WHOLEWORD : 0) |
2213 (re ? SCFIND_REGEXP : 0) |
2214 (posix ? SCFIND_POSIX : 0) |
2215 (cxx11 ? SCFIND_CXX11REGEX : 0);
2216
2217 switch (findNextType)
2218 {
2219 case FINDNEXTTYPE_FINDNEXT:
2220 flags |= SCFIND_REGEXP_EMPTYMATCH_ALL | SCFIND_REGEXP_SKIPCRLFASONE;
2221 break;
2222
2223 case FINDNEXTTYPE_REPLACENEXT:
2224 flags |= SCFIND_REGEXP_EMPTYMATCH_NOTAFTERMATCH | SCFIND_REGEXP_SKIPCRLFASONE;
2225 break;
2226
2227 case FINDNEXTTYPE_FINDNEXTFORREPLACE:
2228 flags |= SCFIND_REGEXP_EMPTYMATCH_ALL | SCFIND_REGEXP_EMPTYMATCH_ALLOWATSTART | SCFIND_REGEXP_SKIPCRLFASONE;
2229 break;
2230 }
2231 return flags;
2232}
2233
2234struct FindReplaceInfo
2235{

Callers 1

doReplaceAllMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected