OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
Files::MultiDirCollection Class Reference

File collection across several directories. More...

#include <multidircollection.hpp>

Collaboration diagram for Files::MultiDirCollection:

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. More...
 
TIter end () const
 Return iterator pointing past the last file. More...
 

Private Attributes

TContainer mFiles
 

Detailed Description

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.

Member Typedef Documentation

typedef std::map<std::string, boost::filesystem::path, NameLess> Files::MultiDirCollection::TContainer
typedef TContainer::const_iterator Files::MultiDirCollection::TIter

Constructor & Destructor Documentation

Files::MultiDirCollection::MultiDirCollection ( const Files::PathContainer directories,
const std::string &  extension,
bool  foldCase 
)

Directories are listed with increasing priority.

Parameters
extensionThe extension that should be listed in this collection. Must contain the leading dot.
foldCaseIgnore filename case

Member Function Documentation

MultiDirCollection::TIter Files::MultiDirCollection::begin ( ) const

Return iterator pointing to the first file.

bool Files::MultiDirCollection::doesExist ( const std::string &  file) const
Returns
Does a file with the given name exist?

Here is the caller graph for this function:

MultiDirCollection::TIter Files::MultiDirCollection::end ( ) 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.

Here is the caller graph for this function:

Member Data Documentation

TContainer Files::MultiDirCollection::mFiles
private

The documentation for this class was generated from the following files: