Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Abstact class representing a directory of files. More...
#include <VirtualDirectory.hpp>
Public Member Functions | |
VirtualDirectory () | |
Constructor. | |
VirtualDirectory (const String &path) | |
Constructor. | |
virtual bool | setPath (const String &path) |
Changes the path name of a VirtualDirectory. Must not be an empty string. | |
virtual const String & | path () const |
bool | fileExists (const String &name) const |
Checks the existence of a file in the directory. | |
virtual ref< VirtualFile > | file (const String &name) const =0 |
Returns the VirtualFile with the given name if any, NULL otherwise. | |
virtual void | listFilesRecursive (std::vector< String > &file_list) const =0 |
Returns the list of files contained in the VirtualDirectory. | |
virtual void | listFilesRecursive (std::vector< String > &file_list, const String &match) const |
Returns the list of files contained in the VirtualDirectory that match the expression 'match'. | |
virtual void | listFiles (std::vector< String > &file_list, bool append=false) const =0 |
virtual void | listSubDirs (std::vector< String > &dirs, bool append=false) const =0 |
virtual ref< VirtualDirectory > | subDir (const String &subdir_name) const =0 |
Protected Member Functions | |
String | translatePath (const String &p) const |
Protected Attributes | |
String | mPath |
Abstact class representing a directory of files.
Definition at line 57 of file VirtualDirectory.hpp.
vl::VirtualDirectory::VirtualDirectory | ( | ) | [inline] |
Constructor.
Definition at line 63 of file VirtualDirectory.hpp.
vl::VirtualDirectory::VirtualDirectory | ( | const String & | path ) | [inline] |
Constructor.
path | Defines the path name of the virtual dirctory, must be a non empty string. |
Definition at line 67 of file VirtualDirectory.hpp.
bool VirtualDirectory::setPath | ( | const String & | path ) | [virtual] |
Changes the path
name
of a VirtualDirectory. Must not be an empty string.
Reimplemented in vl::MemoryDirectory, and vl::ZippedDirectory.
Definition at line 37 of file VirtualDirectory.cpp.
References vl::String::empty(), vl::String::endsWith(), vl::Log::error(), mPath, vl::String::normalizeSlashes(), and vl::String::trim().
Referenced by vl::DiskDirectory::DiskDirectory().
virtual const String& vl::VirtualDirectory::path | ( | ) | const [inline, virtual] |
Definition at line 72 of file VirtualDirectory.hpp.
Referenced by vl::MemoryDirectory::addFile(), vl::MemoryDirectory::clone(), vl::DiskDirectory::diskSubDir(), vl::DiskDirectory::exists(), vl::ZippedDirectory::init(), vl::ZippedDirectory::listFiles(), vl::MemoryDirectory::listFiles(), vl::DiskDirectory::listFiles(), vl::ZippedDirectory::listFilesRecursive(), vl::MemoryDirectory::listFilesRecursive(), vl::ZippedDirectory::listSubDirs(), vl::MemoryDirectory::listSubDirs(), vl::DiskDirectory::listSubDirs(), vl::MemoryDirectory::memorySubDir(), vl::ZippedDirectory::setPath(), vl::MemoryDirectory::setPath(), translatePath(), and vl::ZippedDirectory::zippedSubDir().
bool vl::VirtualDirectory::fileExists | ( | const String & | name ) | const [inline] |
Checks the existence of a file in the directory.
Definition at line 75 of file VirtualDirectory.hpp.
References NULL.
virtual ref<VirtualFile> vl::VirtualDirectory::file | ( | const String & | name ) | const [pure virtual] |
Returns the VirtualFile with the given name if any, NULL otherwise.
Implemented in vl::DiskDirectory, vl::MemoryDirectory, and vl::ZippedDirectory.
Referenced by vl::MemoryDirectory::clone().
virtual void vl::VirtualDirectory::listFilesRecursive | ( | std::vector< String > & | file_list ) | const [pure virtual] |
Returns the list of files contained in the VirtualDirectory.
If there are subdirectories the files will be searched recursively.
Implemented in vl::DiskDirectory, vl::MemoryDirectory, and vl::ZippedDirectory.
Referenced by vl::MemoryDirectory::clone().
virtual void vl::VirtualDirectory::listFilesRecursive | ( | std::vector< String > & | file_list, |
const String & | match | ||
) | const [inline, virtual] |
Returns the list of files contained in the VirtualDirectory that match the expression 'match'.
The match
parameter must be of the type "*abc"
or "*abc*"
or "abc*"
or "*"
.
Definition at line 86 of file VirtualDirectory.hpp.
References vl::String::filterStrings().
virtual void vl::VirtualDirectory::listFiles | ( | std::vector< String > & | file_list, |
bool | append = false |
||
) | const [pure virtual] |
Implemented in vl::DiskDirectory, vl::MemoryDirectory, and vl::ZippedDirectory.
virtual void vl::VirtualDirectory::listSubDirs | ( | std::vector< String > & | dirs, |
bool | append = false |
||
) | const [pure virtual] |
Implemented in vl::DiskDirectory, vl::MemoryDirectory, and vl::ZippedDirectory.
virtual ref<VirtualDirectory> vl::VirtualDirectory::subDir | ( | const String & | subdir_name ) | const [pure virtual] |
Implemented in vl::DiskDirectory, vl::MemoryDirectory, and vl::ZippedDirectory.
Definition at line 57 of file VirtualDirectory.cpp.
References vl::String::normalizeSlashes(), path(), vl::String::right(), and vl::String::startsWith().
Referenced by vl::DiskDirectory::diskSubDir(), vl::MemoryDirectory::memoryFile(), vl::MemoryDirectory::memorySubDir(), vl::ZippedDirectory::zippedFile(), and vl::ZippedDirectory::zippedSubDir().
String vl::VirtualDirectory::mPath [protected] |
Definition at line 102 of file VirtualDirectory.hpp.
Referenced by vl::ZippedDirectory::setPath(), setPath(), and vl::MemoryDirectory::setPath().