Visualization Library 2.1.0
A 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. More... | |
VirtualDirectory (const String &path) | |
Constructor. More... | |
virtual bool | setPath (const String &path) |
Changes the path name of a VirtualDirectory. Must not be an empty string. More... | |
virtual const String & | path () const |
bool | fileExists (const String &name) const |
Checks the existence of a file in the directory. More... | |
virtual ref< VirtualFile > | file (const String &name) const =0 |
Returns the VirtualFile with the given name if any, NULL otherwise. More... | |
virtual void | listFilesRecursive (std::vector< String > &file_list) const =0 |
Returns the list of files contained in the VirtualDirectory. More... | |
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'. More... | |
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 |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
Protected Member Functions | |
String | translatePath (const String &p) const |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Protected Attributes | |
String | mPath |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Abstact class representing a directory of files.
Definition at line 57 of file VirtualDirectory.hpp.
|
inline |
Constructor.
Definition at line 63 of file VirtualDirectory.hpp.
|
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.
|
pure virtual |
Returns the VirtualFile with the given name if any, NULL otherwise.
Implemented in vl::QtDirectory, vl::QtDirectory, vl::QtDirectory, vl::ZippedDirectory, vl::DiskDirectory, and vl::MemoryDirectory.
Referenced by vl::MemoryDirectory::clone().
|
inline |
Checks the existence of a file in the directory.
Definition at line 75 of file VirtualDirectory.hpp.
References NULL.
|
pure virtual |
Implemented in vl::ZippedDirectory, vl::MemoryDirectory, vl::QtDirectory, vl::QtDirectory, vl::QtDirectory, and vl::DiskDirectory.
Referenced by vl::loadImagesFromDir().
|
pure virtual |
Returns the list of files contained in the VirtualDirectory.
If there are subdirectories the files will be searched recursively.
Implemented in vl::ZippedDirectory, vl::MemoryDirectory, vl::QtDirectory, vl::QtDirectory, vl::QtDirectory, and vl::DiskDirectory.
Referenced by vl::MemoryDirectory::clone().
|
inlinevirtual |
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().
|
pure virtual |
Implemented in vl::ZippedDirectory, vl::MemoryDirectory, vl::QtDirectory, vl::QtDirectory, vl::QtDirectory, and vl::DiskDirectory.
|
inlinevirtual |
Definition at line 72 of file VirtualDirectory.hpp.
Referenced by vl::MemoryDirectory::addFile(), vl::MemoryDirectory::clone(), vl::DiskDirectory::diskSubDir(), vl::DiskDirectory::exists(), vl::QtDirectory::exists(), vl::ZippedDirectory::init(), vl::DiskDirectory::listFiles(), vl::QtDirectory::listFiles(), vl::MemoryDirectory::listFiles(), vl::ZippedDirectory::listFiles(), vl::MemoryDirectory::listFilesRecursive(), vl::ZippedDirectory::listFilesRecursive(), vl::DiskDirectory::listSubDirs(), vl::QtDirectory::listSubDirs(), vl::MemoryDirectory::listSubDirs(), vl::ZippedDirectory::listSubDirs(), vl::MemoryDirectory::memorySubDir(), vl::QtDirectory::qtSubDir(), vl::MemoryDirectory::setPath(), vl::ZippedDirectory::setPath(), translatePath(), and vl::ZippedDirectory::zippedSubDir().
|
virtual |
Changes the path
name
of a VirtualDirectory. Must not be an empty string.
Reimplemented in vl::ZippedDirectory, and vl::MemoryDirectory.
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(), and vl::QtDirectory::QtDirectory().
|
pure virtual |
Implemented in vl::ZippedDirectory, vl::MemoryDirectory, vl::QtDirectory, vl::QtDirectory, vl::QtDirectory, and vl::DiskDirectory.
Definition at line 57 of file VirtualDirectory.cpp.
References vl::String::normalizeSlashes(), path(), vl::String::right(), and vl::String::startsWith().
Referenced by vl::DiskDirectory::diskFile(), vl::DiskDirectory::diskSubDir(), vl::QtDirectory::listFiles(), vl::MemoryDirectory::memoryFile(), vl::MemoryDirectory::memorySubDir(), vl::QtDirectory::qtFile(), vl::QtDirectory::qtSubDir(), vl::ZippedDirectory::zippedFile(), and vl::ZippedDirectory::zippedSubDir().
|
protected |
Definition at line 103 of file VirtualDirectory.hpp.
Referenced by vl::MemoryDirectory::setPath(), vl::ZippedDirectory::setPath(), and setPath().
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:55.
© Copyright Michele Bosi. All rights reserved.