| 373 | } |
| 374 | |
| 375 | static vector<string> _database_find_keys(DBM *database, |
| 376 | const string ®ex, |
| 377 | bool ignore_case, |
| 378 | db_find_filter filter = nullptr) |
| 379 | { |
| 380 | text_pattern tpat(regex, ignore_case); |
| 381 | vector<string> matches; |
| 382 | |
| 383 | datum dbKey = dbm_firstkey(database); |
| 384 | |
| 385 | while (dbKey.dptr != nullptr) |
| 386 | { |
| 387 | string key((const char *)dbKey.dptr, dbKey.dsize); |
| 388 | |
| 389 | if (tpat.matches(key) |
| 390 | && key.find("__") == string::npos |
| 391 | && (filter == nullptr || !(*filter)(key, ""))) |
| 392 | { |
| 393 | matches.push_back(key); |
| 394 | } |
| 395 | |
| 396 | dbKey = dbm_nextkey(database); |
| 397 | } |
| 398 | |
| 399 | return matches; |
| 400 | } |
| 401 | |
| 402 | static vector<string> _database_find_bodies(DBM *database, |
| 403 | const string ®ex, |
no test coverage detected