Visualization Library 2.1.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | List of all members
vl::DiskDirectory Class Reference

A VirtualDirectory that operates on reguar disk directories. More...

#include <DiskDirectory.hpp>

+ Inheritance diagram for vl::DiskDirectory:

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< DiskDirectorydiskSubDir (const String &subdir_name) const
 
ref< VirtualDirectorysubDir (const String &subdir_name) const
 
virtual ref< VirtualFilefile (const String &name) const
 Returns the VirtualFile with the given name if any, NULL otherwise. More...
 
virtual ref< DiskFilediskFile (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 Stringpath () 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...
 
Objectoperator= (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...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () 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
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Detailed Description

A VirtualDirectory that operates on reguar disk directories.

See also

Definition at line 56 of file DiskDirectory.hpp.

Constructor & Destructor Documentation

◆ DiskDirectory() [1/2]

DiskDirectory::DiskDirectory ( )

Definition at line 55 of file DiskDirectory.cpp.

Referenced by diskSubDir().

◆ DiskDirectory() [2/2]

DiskDirectory::DiskDirectory ( const String path)

Definition at line 50 of file DiskDirectory.cpp.

References vl::VirtualDirectory::setPath().

Member Function Documentation

◆ diskFile()

ref< DiskFile > DiskDirectory::diskFile ( const String name) const
virtual

Definition at line 296 of file DiskDirectory.cpp.

References vl::DiskFile::exists(), file(), NULL, and vl::VirtualDirectory::translatePath().

Referenced by file().

◆ diskSubDir()

ref< DiskDirectory > DiskDirectory::diskSubDir ( const String subdir_name) const

◆ exists()

bool DiskDirectory::exists ( ) const

◆ file()

ref< VirtualFile > DiskDirectory::file ( const String name) const
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().

◆ listFiles() [1/2]

void DiskDirectory::listFiles ( std::vector< String > &  file_list,
bool  append = false 
) const
virtual

◆ listFiles() [2/2]

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().

◆ listFilesRecursive()

void DiskDirectory::listFilesRecursive ( std::vector< String > &  file_list) const
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().

◆ listFilesRecursive_internal()

void DiskDirectory::listFilesRecursive_internal ( std::vector< String > &  file_list) const
protected

◆ listSubDirs()

void DiskDirectory::listSubDirs ( std::vector< String > &  dirs,
bool  append = false 
) const
virtual

◆ subDir()

ref<VirtualDirectory> vl::DiskDirectory::subDir ( const String subdir_name) const
inlinevirtual

Implements vl::VirtualDirectory.

Definition at line 76 of file DiskDirectory.hpp.


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