1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00
OpenMW/components/files/collections.cpp
Lukasz Gromanowski ea7eb7a62d fixes #128 Configuration cleanup.
Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
2011-08-19 21:06:09 +02:00

34 lines
881 B
C++

#include "collections.hpp"
namespace Files
{
Collections::Collections()
: mDirectories()
, mFoldCase(false)
, mCollections()
{
}
Collections::Collections(const std::vector<boost::filesystem::path>& 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;
}
}