Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
Manages multiple VirtualDirectory objects. More...
#include <FileSystem.hpp>
Public Member Functions | |
| virtual const char * | className () |
| Returns the name of the class. | |
| 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. | |
| 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. | |
| virtual void | listFilesRecursive (std::vector< String > &file_list, const String &match) const |
| Returns the names of all the files matching the given filter. | |
| Collection< VirtualDirectory > * | directories () |
| Returns the list of VirtualDirectory objects added to a FileSystem. | |
| const Collection < VirtualDirectory > * | directories () const |
| Returns the list of VirtualDirectory objects added to a FileSystem. | |
Protected Attributes | |
| Collection< VirtualDirectory > | mDirectories |
Manages multiple VirtualDirectory objects.
Useful when you want to query more than one VirtualDirectory from a single point.
Definition at line 59 of file FileSystem.hpp.
| vl::FileSystem::FileSystem | ( | ) | [inline] |
Definition at line 64 of file FileSystem.hpp.
| virtual const char* vl::FileSystem::className | ( | ) | [inline, virtual] |
Returns the name of the class.
Reimplemented from vl::Object.
Definition at line 62 of file FileSystem.hpp.
| ref< VirtualFile > FileSystem::locateFile | ( | const String & | full_path, |
| const String & | alternate_path = String() |
||
| ) | const [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 vl::Collection< T >::at(), directories(), vl::String::empty(), vl::String::extractFileName(), vl::VirtualDirectory::file(), and vl::Collection< T >::size().
Referenced by vl::load3DS(), vl::loadAC3D(), vl::loadBMP(), vl::loadDAT(), vl::loadDDS(), vl::loadDICOM(), vl::loadImage(), vl::loadJPG(), vl::loadMD2(), 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().
| ref< VirtualDirectory > FileSystem::locateDirectory | ( | const String & | name ) | const [virtual] |
Definition at line 96 of file FileSystem.cpp.
References vl::Collection< T >::at(), directories(), vl::Collection< T >::size(), and vl::VirtualDirectory::subDir().
Referenced by vl::loadImagesFromDir().
| void FileSystem::listFilesRecursive | ( | std::vector< String > & | file_list ) | const [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 vl::Collection< T >::at(), directories(), and vl::VirtualDirectory::listFilesRecursive().
| void FileSystem::listFilesRecursive | ( | std::vector< String > & | file_list, |
| const String & | match | ||
| ) | const [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 vl::Collection< T >::at(), directories(), and vl::VirtualDirectory::listFilesRecursive().
| Collection<VirtualDirectory>* vl::FileSystem::directories | ( | ) | [inline] |
Returns the list of VirtualDirectory objects added to a FileSystem.
Definition at line 82 of file FileSystem.hpp.
Referenced by vl::VisualizationLibrary::initCore(), listFilesRecursive(), locateDirectory(), and locateFile().
| const Collection<VirtualDirectory>* vl::FileSystem::directories | ( | ) | const [inline] |
Returns the list of VirtualDirectory objects added to a FileSystem.
Definition at line 85 of file FileSystem.hpp.
Collection<VirtualDirectory> vl::FileSystem::mDirectories [protected] |
Definition at line 88 of file FileSystem.hpp.