2011-05-05 17:00:00 +00:00
|
|
|
#ifndef COMPONENTS_FILES_COLLECTION_HPP
|
|
|
|
#define COMPONENTS_FILES_COLLECTION_HPP
|
|
|
|
|
2011-08-19 19:06:09 +00:00
|
|
|
#include <string>
|
|
|
|
#include <map>
|
|
|
|
#include <boost/filesystem.hpp>
|
|
|
|
|
2011-05-05 17:00:00 +00:00
|
|
|
#include "multidircollection.hpp"
|
|
|
|
|
|
|
|
namespace Files
|
|
|
|
{
|
|
|
|
class Collections
|
|
|
|
{
|
|
|
|
public:
|
2011-05-05 17:32:42 +00:00
|
|
|
Collections();
|
|
|
|
|
2011-05-05 17:00:00 +00:00
|
|
|
///< Directories are listed with increasing priority.
|
2011-09-02 20:45:21 +00:00
|
|
|
Collections(const Files::PathContainer& directories, bool foldCase);
|
2011-05-05 17:00:00 +00:00
|
|
|
|
|
|
|
///< Return a file collection for the given extension. Extension must contain the
|
|
|
|
/// leading dot and must be all lower-case.
|
2011-08-19 19:06:09 +00:00
|
|
|
const MultiDirCollection& getCollection(const std::string& extension) const;
|
2011-05-05 17:00:00 +00:00
|
|
|
|
2011-08-19 19:06:09 +00:00
|
|
|
private:
|
|
|
|
typedef std::map<std::string, MultiDirCollection> MultiDirCollectionContainer;
|
2011-09-02 20:45:21 +00:00
|
|
|
Files::PathContainer mDirectories;
|
2011-08-19 19:06:09 +00:00
|
|
|
|
|
|
|
bool mFoldCase;
|
|
|
|
mutable MultiDirCollectionContainer mCollections;
|
2011-05-05 17:00:00 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|