-------------------------------------------------------------------------
| 29 | |
| 30 | //------------------------------------------------------------------------- |
| 31 | Wildcards::Wildcards(std::wstring str, bool isRegexCaseSensitiv) |
| 32 | : originalStr_( str ) |
| 33 | { |
| 34 | auto flags = (isRegexCaseSensitiv) ? std::regex::basic : std::regex::icase; |
| 35 | // Do not escaped '*' |
| 36 | |
| 37 | for (auto c : EscapedChars) |
| 38 | { |
| 39 | std::wstring escapedString{ c }; |
| 40 | boost::replace_all(str, escapedString, L"\\" + escapedString); |
| 41 | } |
| 42 | |
| 43 | // remove useless * |
| 44 | boost::trim_if(str, [](wchar_t c){ return c == L'*';}); |
| 45 | boost::replace_all(str, L"*", L".*"); |
| 46 | wildcars_.assign(str, flags); |
| 47 | } |
| 48 | |
| 49 | //------------------------------------------------------------------------- |
| 50 | Wildcards::Wildcards(Wildcards&& wildcards) |
nothing calls this directly
no outgoing calls
no test coverage detected