22 #ifndef FIFE_VFS_VFS_H 23 #define FIFE_VFS_VFS_H 31 #include <boost/shared_ptr.hpp> 44 class VFSSourceProvider;
104 bool exists(
const std::string& file)
const;
126 std::set<std::string>
listFiles(
const std::string& path)
const;
137 std::set<std::string>
listFiles(
const std::string& path,
const std::string& filterregex)
const;
152 std::set<std::string>
listDirectories(
const std::string& path,
const std::string& filterregex)
const;
159 bool hasSource(
const std::string& path)
const;
169 std::set<std::string>
filterList(
const std::set<std::string>& list,
const std::string& fregex)
const;
void addProvider(VFSSourceProvider *provider)
add new VFSSourceProvider
bool exists(const std::string &file) const
Check if the given file exists.
VFSSource abstract baseclass.
RawData * open(const std::string &path)
Open a file.
VFSSource * getSourceForFile(const std::string &file) const
std::set< std::string > listFiles(const std::string &path) const
Get a filelist of the given directory.
void removeSource(VFSSource *source)
remove a VFSSource
VFSSourceProvider abstract baseclass.
void addSource(VFSSource *source)
Add a new VFSSource.
virtual ~VFS()
Destructor.
VFS()
Constructor Called by the Engine on startup.
std::set< std::string > listDirectories(const std::string &path) const
Get a directorylist of the given directory.
the main VFS (virtual file system) class
std::vector< VFSSourceProvider * > type_providers
void addNewSource(const std::string &path)
create a new Source and add it to VFS
VFSSource * createSource(const std::string &path)
tries to create a new VFSSource for the given file
bool hasSource(const std::string &path) const
Checks if a source is already present in a provider.
bool isDirectory(const std::string &path) const
Check if the given path is a directory.
type_providers m_providers
std::set< std::string > filterList(const std::set< std::string > &list, const std::string &fregex) const
Used to access diffrent kinds of data.
std::vector< VFSSource * > type_sources