MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / FilterMatches

Function FilterMatches

pcsx2/SIO/Memcard/MemoryCardFolder.cpp:424–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424static bool FilterMatches(const std::string_view fileName, const std::string_view filter)
425{
426 std::string_view::size_type start = 0;
427 std::string_view::size_type len = filter.length();
428 while (start < len)
429 {
430 std::string_view::size_type end = filter.find('/', start);
431 if (end == std::string_view::npos)
432 {
433 end = len;
434 }
435
436 std::string_view singleFilter(filter.substr(start, end - start));
437 if (fileName.find(singleFilter) != std::string_view::npos)
438 {
439 return true;
440 }
441
442 start = end + 1;
443 }
444
445 return false;
446}
447
448bool FolderMemoryCard::AddFolder(MemoryCardFileEntry* const dirEntry, const std::string& dirPath, MemoryCardFileMetadataReference* parent /* = nullptr */, const bool enableFiltering /* = false */, const std::string_view filter /* = "" */)
449{

Callers 1

AddFolderMethod · 0.85

Calls 3

substrMethod · 0.80
lengthMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected