Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Manages multiple VirtualDirectory objects. More...
#include <FileSystem.hpp>
Public Member Functions | |
FileSystem () | |
virtual ref< VirtualFile > | locateFile (const String &full_path, const String &alternate_path=String()) const |
Looks for a VirtualFile on the disk and in the currently active FileSystem. More... | |
virtual ref< VirtualDirectory > | locateDirectory (const String &name) const |
virtual void | listFilesRecursive (std::vector< String > &file_list) const |
Returns the names of all the files contained in the previously added Directories. More... | |
virtual void | listFilesRecursive (std::vector< String > &file_list, const String &match) const |
Returns the names of all the files matching the given filter. More... | |
std::vector< ref< VirtualDirectory > > & | directories () |
Returns the list of VirtualDirectory objects added to a FileSystem. More... | |
const std::vector< ref< VirtualDirectory > > & | directories () const |
Returns the list of VirtualDirectory objects added to a FileSystem. 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 Attributes | |
std::vector< ref< VirtualDirectory > > | mDirectories |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Manages multiple VirtualDirectory objects.
Useful when you want to query more than one VirtualDirectory from a single point.
Definition at line 58 of file FileSystem.hpp.
|
inline |
Definition at line 63 of file FileSystem.hpp.
References vl::locateFile().
|
inline |
Returns the list of VirtualDirectory objects added to a FileSystem.
Definition at line 84 of file FileSystem.hpp.
Referenced by vl::VisualizationLibrary::isCoreInitialized(), listFilesRecursive(), locateDirectory(), and locateFile().
|
inline |
Returns the list of VirtualDirectory objects added to a FileSystem.
Definition at line 87 of file FileSystem.hpp.
|
virtual |
Returns the names of all the files contained in the previously added Directories.
Files from different Directories but with the same name appear more than once in 'file_list'. Use carefully this function as it enumerates recursively all the files in the directory trees.
Definition at line 115 of file FileSystem.cpp.
References directories().
|
virtual |
Returns the names of all the files matching the given filter.
Use carefully this function since it enumerates recursively all the files in the directory trees. The match
parameter must be of the type "*abc"
or "*abc*"
or "abc*"
.
Definition at line 129 of file FileSystem.cpp.
References directories().
|
virtual |
Definition at line 96 of file FileSystem.cpp.
References directories(), vl::DiskDirectory::exists(), and NULL.
Referenced by vl::loadImagesFromDir().
|
virtual |
Looks for a VirtualFile on the disk and in the currently active FileSystem.
If more than a file exists with the same name the VirtualFile returned is the one found in the VirtualDirectory added the latest.
This means that a VirtualDirectory overrides the ones added before if duplicate file name exists. If a file with the given name exists in the "." directory it will be located and returned immediately.
Visualization Library locates a file scanning the following paths (in the specified order):
full_path
into file_path
and file_name
"/fs"
stays for Visualization Library currently mounted FileSystems.
Definition at line 61 of file FileSystem.cpp.
References directories(), vl::String::empty(), vl::DiskFile::exists(), vl::String::extractFileName(), and NULL.
Referenced by vl::LoadWriterDae::load(), vl::load3DS(), vl::loadAC3D(), vl::loadBMP(), vl::loadDAT(), vl::loadDDS(), vl::loadDICOM(), vl::loadImage(), vl::loadJPG(), vl::loadMD2(), vl::loadMHD(), vl::loadOBJ(), vl::ObjLoader::loadOBJ(), vl::loadPLY(), vl::loadPNG(), vl::loadSTL(), vl::String::loadText(), vl::loadTGA(), vl::loadTIFF(), vl::locateFile(), vl::A3DSLoader::readMapChunk(), and vl::ZippedDirectory::ZippedDirectory().
|
protected |
Definition at line 90 of file FileSystem.hpp.
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:50.
© Copyright Michele Bosi. All rights reserved.