OpenMW
|
File collection across several directories. More...
#include <multidircollection.hpp>
Public Types | |
typedef std::map< std::string, boost::filesystem::path, NameLess > | TContainer |
typedef TContainer::const_iterator | TIter |
Public Member Functions | |
MultiDirCollection (const Files::PathContainer &directories, const std::string &extension, bool foldCase) | |
boost::filesystem::path | getPath (const std::string &file) const |
bool | doesExist (const std::string &file) const |
TIter | begin () const |
Return iterator pointing to the first file. | |
TIter | end () const |
Return iterator pointing past the last file. | |
Private Attributes | |
TContainer | mFiles |
File collection across several directories.
This class lists all files with one specific extensions within one or more directories. If the same file appears more than once, the file in the directory with the higher priority is used.
typedef std::map<std::string, boost::filesystem::path, NameLess> Files::MultiDirCollection::TContainer |
typedef TContainer::const_iterator Files::MultiDirCollection::TIter |
Files::MultiDirCollection::MultiDirCollection | ( | const Files::PathContainer & | directories, |
const std::string & | extension, | ||
bool | foldCase | ||
) |
Directories are listed with increasing priority.
extension | The extension that should be listed in this collection. Must contain the leading dot. |
foldCase | Ignore filename case |
Return iterator pointing to the first file.
bool Files::MultiDirCollection::doesExist | ( | const std::string & | file | ) | const |
Return iterator pointing past the last file.
boost::filesystem::path Files::MultiDirCollection::getPath | ( | const std::string & | file | ) | const |
Return full path (including filename) of file.
If the file does not exist, an exception is thrown. file must include the extension.
TContainer Files::MultiDirCollection::mFiles [private] |