1 #ifndef COMPONENTS_FILES_MULTIDIRSOLLECTION_HPP
2 #define COMPONENTS_FILES_MULTIDIRSOLLECTION_HPP
9 #include <boost/filesystem/path.hpp>
23 bool operator() (
const std::string& left,
const std::string& right)
const
28 std::size_t min = std::min (left.length(), right.length());
30 for (std::size_t i=0; i<min; ++i)
41 return left.length()<right.length();
54 typedef std::map<std::string, boost::filesystem::path, NameLess>
TContainer;
55 typedef TContainer::const_iterator
TIter;
64 const std::string& extension,
bool foldCase);
70 boost::filesystem::path
getPath (
const std::string& file)
const;
76 bool doesExist (
const std::string& file)
const;
File collection across several directories.
Definition: multidircollection.hpp:50
static char toLower(char c)
Definition: stringops.hpp:24
NameLess(bool strict)
Definition: multidircollection.hpp:21
bool doesExist(const std::string &file) const
Definition: multidircollection.cpp:99
TIter begin() const
Return iterator pointing to the first file.
Definition: multidircollection.cpp:104
std::map< std::string, boost::filesystem::path, NameLess > TContainer
Definition: multidircollection.hpp:54
bool operator()(const std::string &left, const std::string &right) const
Definition: multidircollection.hpp:23
TIter end() const
Return iterator pointing past the last file.
Definition: multidircollection.cpp:109
bool mStrict
Definition: multidircollection.hpp:19
TContainer::const_iterator TIter
Definition: multidircollection.hpp:55
boost::filesystem::path getPath(const std::string &file) const
Definition: multidircollection.cpp:89
Definition: multidircollection.hpp:17
TContainer mFiles
Definition: multidircollection.hpp:59
MultiDirCollection(const Files::PathContainer &directories, const std::string &extension, bool foldCase)
Definition: multidircollection.cpp:44
std::vector< boost::filesystem::path > PathContainer
Definition: gamesettings.hpp:14