mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 15:19:55 +00:00
38 lines
969 B
C++
38 lines
969 B
C++
|
|
#include "collections.hpp"
|
|
|
|
namespace Files
|
|
{
|
|
Collections::Collections()
|
|
: mDirectories()
|
|
, mFoldCase(false)
|
|
, mCollections()
|
|
{
|
|
}
|
|
|
|
Collections::Collections(const Files::PathContainer& directories, bool foldCase)
|
|
: mDirectories(directories)
|
|
, mFoldCase(foldCase)
|
|
, mCollections()
|
|
{
|
|
}
|
|
|
|
const MultiDirCollection& Collections::getCollection(const std::string& extension) const
|
|
{
|
|
MultiDirCollectionContainer::iterator iter = mCollections.find(extension);
|
|
if (iter==mCollections.end())
|
|
{
|
|
std::pair<MultiDirCollectionContainer::iterator, bool> result =
|
|
mCollections.insert(std::make_pair(extension, MultiDirCollection(mDirectories, extension, mFoldCase)));
|
|
|
|
iter = result.first;
|
|
}
|
|
|
|
return iter->second;
|
|
}
|
|
|
|
const Files::PathContainer& Collections::getPaths() const
|
|
{
|
|
return mDirectories;
|
|
}
|
|
}
|