2011-05-05 17:00:00 +00:00
|
|
|
|
|
|
|
#include "collections.hpp"
|
|
|
|
|
|
|
|
namespace Files
|
|
|
|
{
|
2011-08-19 19:06:09 +00:00
|
|
|
Collections::Collections()
|
|
|
|
: mDirectories()
|
|
|
|
, mFoldCase(false)
|
|
|
|
, mCollections()
|
|
|
|
{
|
|
|
|
}
|
2011-05-05 17:00:00 +00:00
|
|
|
|
2011-09-02 20:45:21 +00:00
|
|
|
Collections::Collections(const Files::PathContainer& directories, bool foldCase)
|
2011-08-19 19:06:09 +00:00
|
|
|
: mDirectories(directories)
|
|
|
|
, mFoldCase(foldCase)
|
|
|
|
, mCollections()
|
2011-05-05 17:00:00 +00:00
|
|
|
{
|
2011-08-19 19:06:09 +00:00
|
|
|
}
|
2011-05-05 17:00:00 +00:00
|
|
|
|
2011-08-19 19:06:09 +00:00
|
|
|
const MultiDirCollection& Collections::getCollection(const std::string& extension) const
|
|
|
|
{
|
|
|
|
MultiDirCollectionContainer::iterator iter = mCollections.find(extension);
|
2011-05-05 17:00:00 +00:00
|
|
|
if (iter==mCollections.end())
|
|
|
|
{
|
2011-08-19 19:06:09 +00:00
|
|
|
std::pair<MultiDirCollectionContainer::iterator, bool> result =
|
|
|
|
mCollections.insert(std::make_pair(extension, MultiDirCollection(mDirectories, extension, mFoldCase)));
|
2011-05-05 17:00:00 +00:00
|
|
|
|
|
|
|
iter = result.first;
|
|
|
|
}
|
|
|
|
|
|
|
|
return iter->second;
|
|
|
|
}
|
2012-03-30 12:45:32 +00:00
|
|
|
|
|
|
|
const Files::PathContainer& Collections::getPaths() const
|
|
|
|
{
|
|
|
|
return mDirectories;
|
|
|
|
}
|
2011-05-05 17:00:00 +00:00
|
|
|
}
|