Visualization Library 2.0.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 | Protected Attributes | List of all members
vl::VirtualDirectory Class Referenceabstract

Abstact class representing a directory of files. More...

#include <VirtualDirectory.hpp>

+ Inheritance diagram for vl::VirtualDirectory:

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 Stringpath () const
 
bool fileExists (const String &name) const
 Checks the existence of a file in the directory. More...
 
virtual ref< VirtualFilefile (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< VirtualDirectorysubDir (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...
 
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

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
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Detailed Description

Abstact class representing a directory of files.

See also

Definition at line 57 of file VirtualDirectory.hpp.

Constructor & Destructor Documentation

◆ VirtualDirectory() [1/2]

vl::VirtualDirectory::VirtualDirectory ( )
inline

Constructor.

Definition at line 63 of file VirtualDirectory.hpp.

◆ VirtualDirectory() [2/2]

vl::VirtualDirectory::VirtualDirectory ( const String path)
inline

Constructor.

Parameters
pathDefines the path name of the virtual dirctory, must be a non empty string.

Definition at line 67 of file VirtualDirectory.hpp.

Member Function Documentation

◆ file()

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::QtDirectory, vl::QtDirectory, vl::ZippedDirectory, vl::DiskDirectory, and vl::MemoryDirectory.

Referenced by vl::MemoryDirectory::clone().

◆ fileExists()

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.

◆ listFiles()

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

◆ listFilesRecursive() [1/2]

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::ZippedDirectory, vl::MemoryDirectory, vl::QtDirectory, vl::QtDirectory, and vl::DiskDirectory.

Referenced by vl::MemoryDirectory::clone().

◆ listFilesRecursive() [2/2]

virtual void vl::VirtualDirectory::listFilesRecursive ( std::vector< String > &  file_list,
const String match 
) const
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().

◆ listSubDirs()

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

◆ path()

virtual const String& vl::VirtualDirectory::path ( ) const
inlinevirtual

◆ setPath()

bool VirtualDirectory::setPath ( const String path)
virtual

◆ subDir()

virtual ref<VirtualDirectory> vl::VirtualDirectory::subDir ( const String subdir_name) const
pure virtual

◆ translatePath()

String VirtualDirectory::translatePath ( const String p) const
protected

Member Data Documentation

◆ mPath

String vl::VirtualDirectory::mPath
protected

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