# Visualization Library

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

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions | Protected Member Functions | Protected Attributes

# vl::VirtualDirectory Class Reference

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

`#include <VirtualDirectory.hpp>`

Inheritance diagram for vl::VirtualDirectory:

List of all members.

## Public Member Functions

| VirtualDirectory ()
| Constructor.
| VirtualDirectory (const String &path)
| Constructor.
virtual bool | setPath (const String &path)
| Changes the `path` `name` of a VirtualDirectory. Must not be an empty string.
virtual const String & | path () const
bool | fileExists (const String &name) const
| Checks the existence of a file in the directory.
virtual ref< VirtualFile > | file (const String &name) const =0
| Returns the VirtualFile with the given name if any, NULL otherwise.
virtual void | listFilesRecursive (std::vector< String > &file_list) const =0
| Returns the list of files contained in the VirtualDirectory.
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'.
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< VirtualDirectory > | subDir (const String &subdir_name) const =0

## Protected Member Functions

String | translatePath (const String &p) const

## Protected Attributes

String | mPath

## Detailed Description

Abstact class representing a directory of files.

See also:
  - DiskDirectory
  - MemoryDirectory
  - ZippedDirectory
  - FileSystem
  - VirtualFile
  - DiskFile
  - MemoryFile
  - ZippedFile

Definition at line 57 of file VirtualDirectory.hpp.

## Constructor & Destructor Documentation

vl::VirtualDirectory::VirtualDirectory | ( | ) | `[inline]`

Constructor.

Definition at line 63 of file VirtualDirectory.hpp.

vl::VirtualDirectory::VirtualDirectory | ( | const String & | path ) | `[inline]`

Constructor.

Parameters:

  path | Defines the path name of the virtual dirctory, must be a non empty string.

Definition at line 67 of file VirtualDirectory.hpp.

## Member Function Documentation

bool VirtualDirectory::setPath | ( | const String & | path ) | `[virtual]`

Changes the `path` `name` of a VirtualDirectory. Must not be an empty string.

Reimplemented in vl::MemoryDirectory, and vl::ZippedDirectory.

Definition at line 37 of file VirtualDirectory.cpp.

References vl::String::empty(), vl::String::endsWith(), vl::Log::error(), mPath, vl::String::normalizeSlashes(), and vl::String::trim().

Referenced by vl::DiskDirectory::DiskDirectory().

virtual const String& vl::VirtualDirectory::path | ( | ) | const`[inline, virtual]`

Definition at line 72 of file VirtualDirectory.hpp.

Referenced by vl::MemoryDirectory::addFile(), vl::MemoryDirectory::clone(), vl::DiskDirectory::diskSubDir(), vl::DiskDirectory::exists(), vl::ZippedDirectory::init(), vl::ZippedDirectory::listFiles(), vl::MemoryDirectory::listFiles(), vl::DiskDirectory::listFiles(), vl::ZippedDirectory::listFilesRecursive(), vl::MemoryDirectory::listFilesRecursive(), vl::ZippedDirectory::listSubDirs(), vl::MemoryDirectory::listSubDirs(), vl::DiskDirectory::listSubDirs(), vl::MemoryDirectory::memorySubDir(), vl::ZippedDirectory::setPath(), vl::MemoryDirectory::setPath(), translatePath(), and vl::ZippedDirectory::zippedSubDir().

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.

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

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

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

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

virtual void vl::VirtualDirectory::listFilesRecursive | ( | std::vector< String > & | file_list,
|  | const String & | match
| ) |  | const`[inline, virtual]`

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

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

Implemented in vl::DiskDirectory, vl::MemoryDirectory, and vl::ZippedDirectory.

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

Implemented in vl::DiskDirectory, vl::MemoryDirectory, and vl::ZippedDirectory.

virtual ref<VirtualDirectory> vl::VirtualDirectory::subDir | ( | const String & | subdir_name ) | const`[pure virtual]`

Implemented in vl::DiskDirectory, vl::MemoryDirectory, and vl::ZippedDirectory.

String VirtualDirectory::translatePath | ( | const String & | p ) | const`[protected]`

Definition at line 57 of file VirtualDirectory.cpp.

References vl::String::normalizeSlashes(), path(), vl::String::right(), and vl::String::startsWith().

Referenced by vl::DiskDirectory::diskSubDir(), vl::MemoryDirectory::memoryFile(), vl::MemoryDirectory::memorySubDir(), vl::ZippedDirectory::zippedFile(), and vl::ZippedDirectory::zippedSubDir().

## Member Data Documentation

String vl::VirtualDirectory::mPath`[protected]`

Definition at line 102 of file VirtualDirectory.hpp.

Referenced by vl::ZippedDirectory::setPath(), setPath(), and vl::MemoryDirectory::setPath().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlCore/VirtualDirectory.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlCore/VirtualDirectory.cpp

Visualization Library v2011.09.1162 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu Jan 26 2012 00:44:16.
Permission is granted to use this page to write and publish articles regarding Visualization Library.