Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
A VirtualDirectory that operates on reguar disk directories. More...
#include <DiskDirectory.hpp>
Public Member Functions | |
DiskDirectory () | |
DiskDirectory (const String &path) | |
void | listFilesRecursive (std::vector< String > &file_list) const |
Use carefully this function, since this search the whole given file system tree. More... | |
void | listFiles (std::vector< String > &file_list, bool append=false) const |
void | listFiles (std::vector< ref< DiskFile > > &file_list, bool append=false) const |
void | listSubDirs (std::vector< String > &dirs, bool append=false) const |
ref< DiskDirectory > | diskSubDir (const String &subdir_name) const |
ref< VirtualDirectory > | subDir (const String &subdir_name) const |
virtual ref< VirtualFile > | file (const String &name) const |
Returns the VirtualFile with the given name if any, NULL otherwise. More... | |
virtual ref< DiskFile > | diskFile (const String &name) const |
bool | exists () const |
Public Member Functions inherited from vl::VirtualDirectory | |
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 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... | |
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 | |
void | listFilesRecursive_internal (std::vector< String > &file_list) const |
Protected Member Functions inherited from vl::VirtualDirectory | |
String | translatePath (const String &p) const |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Additional Inherited Members | |
Protected Attributes inherited from vl::VirtualDirectory | |
String | mPath |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
A VirtualDirectory that operates on reguar disk directories.
Definition at line 56 of file DiskDirectory.hpp.
DiskDirectory::DiskDirectory | ( | ) |
Definition at line 55 of file DiskDirectory.cpp.
Referenced by diskSubDir().
DiskDirectory::DiskDirectory | ( | const String & | path | ) |
Definition at line 50 of file DiskDirectory.cpp.
References vl::VirtualDirectory::setPath().
Definition at line 296 of file DiskDirectory.cpp.
References vl::DiskFile::exists(), file(), NULL, and vl::VirtualDirectory::translatePath().
Referenced by file().
ref< DiskDirectory > DiskDirectory::diskSubDir | ( | const String & | subdir_name | ) | const |
Definition at line 65 of file DiskDirectory.cpp.
References DiskDirectory(), vl::String::empty(), vl::Log::error(), vl::String::length(), vl::length(), listSubDirs(), NULL, vl::VirtualDirectory::path(), vl::String::right(), vl::String::startsWith(), and vl::VirtualDirectory::translatePath().
bool DiskDirectory::exists | ( | ) | const |
Definition at line 96 of file DiskDirectory.cpp.
References vl::Log::error(), NULL, vl::VirtualDirectory::path(), vl::String::ptr(), and vl::String::toUTF8().
Referenced by vl::FileSystem::locateDirectory().
|
virtual |
Returns the VirtualFile with the given name if any, NULL otherwise.
Implements vl::VirtualDirectory.
Definition at line 291 of file DiskDirectory.cpp.
References diskFile().
Referenced by diskFile(), and listFiles().
|
virtual |
Implements vl::VirtualDirectory.
Definition at line 217 of file DiskDirectory.cpp.
References vl::Log::error(), NULL, vl::VirtualDirectory::path(), vl::String::ptr(), and vl::String::toUTF8().
Referenced by listFiles(), and listFilesRecursive_internal().
void DiskDirectory::listFiles | ( | std::vector< ref< DiskFile > > & | file_list, |
bool | append = false |
||
) | const |
Definition at line 201 of file DiskDirectory.cpp.
References file(), listFiles(), and vl::VirtualFile::setPath().
|
virtual |
Use carefully this function, since this search the whole given file system tree.
Implements vl::VirtualDirectory.
Definition at line 59 of file DiskDirectory.cpp.
References listFilesRecursive_internal().
|
protected |
Definition at line 306 of file DiskDirectory.cpp.
References listFiles(), listFilesRecursive_internal(), listSubDirs(), and VL_CHECK.
Referenced by listFilesRecursive(), and listFilesRecursive_internal().
|
virtual |
Implements vl::VirtualDirectory.
Definition at line 129 of file DiskDirectory.cpp.
References vl::Log::error(), NULL, vl::VirtualDirectory::path(), vl::String::ptr(), and vl::String::toUTF8().
Referenced by diskSubDir(), and listFilesRecursive_internal().
|
inlinevirtual |
Implements vl::VirtualDirectory.
Definition at line 76 of file DiskDirectory.hpp.
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:49.
© Copyright Michele Bosi. All rights reserved.