| 243 | } |
| 244 | |
| 245 | void PluginInfo::LoadFilterString() |
| 246 | { |
| 247 | m_filters.clear(); |
| 248 | |
| 249 | String sLine(m_filtersText); |
| 250 | String sPiece; |
| 251 | |
| 252 | while(1) |
| 253 | { |
| 254 | String::size_type pos = sLine.rfind(';'); |
| 255 | sPiece = sLine.substr(pos+1); |
| 256 | if (pos == String::npos) |
| 257 | pos = 0; |
| 258 | sLine.resize(pos); |
| 259 | if (sPiece.empty()) |
| 260 | break; |
| 261 | |
| 262 | sPiece = strutils::makeupper(strutils::trim_ws_begin(sPiece)); |
| 263 | |
| 264 | int re_opts = 0; |
| 265 | std::string regexString = ucr::toUTF8(sPiece); |
| 266 | re_opts |= RegularExpression::RE_UTF8; |
| 267 | try |
| 268 | { |
| 269 | m_filters.emplace_back(std::make_shared<FileFilterElement>(regexString, re_opts, true)); |
| 270 | } |
| 271 | catch (...) |
| 272 | { |
| 273 | // TODO: |
| 274 | } |
| 275 | }; |
| 276 | } |
| 277 | |
| 278 | |
| 279 | bool PluginInfo::TestAgainstRegList(const String& szTest) const |