13 for (
const auto it : *
this)
15 if (it->name() == lower)
16 return it->fullname();
24 for (
auto file : *
this)
26 const auto& fn = file->fullname();
30 fileNames.push_back(file);
40 regex = std::regex(filter, std::regex_constants::icase);
42 catch (
const std::regex_error& e)
48 const int total =
static_cast<int>(nbChildren());
51 if (std::regex_search(it->name(), regex))
55 if (m_progressCallback && ++count % 500 == 0)
56 m_progressCallback(count, total);
63 std::replace(lower.begin(), lower.end(),
'\\',
'/');
67 const auto it = m_nameMap.find(lower);
68 if (it != m_nameMap.end())
76 m_nameMap[child->
fullname()] = child;
Abstract base class representing a file within the game data archive.
const std::string & fullname() const
void getFilteredFiles(std::set< GameFile * > &dest, const std::string &filter)
GameFile * getFile(const std::string &filename)
virtual void onChildRemoved(GameFile *) override
virtual void onChildAdded(GameFile *) override
void getFilesForFolder(std::vector< GameFile * > &fileNames, const std::string &folderPath, const std::string &extension="")
std::string getFullPathForFile(const std::string &file)
GameFolder(std::string path)
bool startsWithIgnoreCase(const std::string &s, const std::string &prefix)
bool endsWithIgnoreCase(const std::string &s, const std::string &suffix)
std::string toLower(const std::string &s)