# Visualization Library A lightweight C++ OpenGL middleware for 2D/3D graphics | [Home] [Tutorials] [All Classes] [Grouped Classes]

# vl::MemoryDirectory Class Reference

A VirtualDirectory to manipulate directories stored in memory. More...

`#include <MemoryDirectory.hpp>`

Inheritance diagram for vl::MemoryDirectory:

List of all members.

## Public Member Functions
| MemoryDirectory (const String &path=".")
virtual const char * | className ()
| Returns the name of the class.
virtual bool | setPath (const String &name)
| Changes the `path` `name` of a VirtualDirectory. Must not be an empty string.
bool | addFile (MemoryFile *file)
| The string file->path() must contain the full path including the MemoryDirectory's path().
bool | removeFile (MemoryFile *file)
| The string file->path() must contain the full path including the MemoryDirectory's path().
bool | removeFile (const String &name)
void | eraseAllFiles ()
virtual ref< VirtualFile > | file (const String &name) const
| Returns the VirtualFile with the given name if any, NULL otherwise.
ref< MemoryFile > | memoryFile (const String &name) const
void | listFilesRecursive (std::vector< String > &file_list) const
| Returns the list of files contained in the VirtualDirectory.
void | listSubDirs (std::vector< String > &dirs, bool append=false) const
ref< MemoryDirectory > | memorySubDir (const String &subdir_name) const
ref< VirtualDirectory > | subDir (const String &subdir_name) const
void | listFiles (std::vector< String > &file_list, bool append=false) const
void | clone (VirtualDirectory *directory, const String &match="*")
| Clones the content of another directory (empty directories are never cloned).
## Protected Attributes
std::map< String, ref < MemoryFile > > | mFiles

## Detailed Description

A VirtualDirectory to manipulate directories stored in memory.

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

## Constructor & Destructor Documentation

vl::MemoryDirectory::MemoryDirectory | ( | const String & | path = `"."` | ) | `[inline]`

## Member Function Documentation

virtual const char* vl::MemoryDirectory::className | ( |  | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::VirtualDirectory.

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

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

Reimplemented from vl::VirtualDirectory.

bool MemoryDirectory::addFile | ( | MemoryFile * | file | ) |

The string file->path() must contain the full path including the MemoryDirectory's path().

bool MemoryDirectory::removeFile | ( | MemoryFile * | file | ) |

The string file->path() must contain the full path including the MemoryDirectory's path().

bool MemoryDirectory::removeFile | ( | const String & | name | ) |

void vl::MemoryDirectory::eraseAllFiles | ( |  | ) | `[inline]`

virtual ref<VirtualFile> vl::MemoryDirectory::file | ( | const String & | name | ) | const`[inline, virtual]`

Returns the VirtualFile with the given name if any, NULL otherwise.

Implements vl::VirtualDirectory.

ref< MemoryFile > MemoryDirectory::memoryFile | ( | const String & | name | ) | const

void MemoryDirectory::listFilesRecursive | ( | std::vector< String > & | file_list | ) | const`[virtual]`

Returns the list of files contained in the VirtualDirectory.

If there are subdirectories the files will be searched recursively.

Implements vl::VirtualDirectory.

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

Implements vl::VirtualDirectory.

ref< MemoryDirectory > MemoryDirectory::memorySubDir | ( | const String & | subdir_name | ) | const

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

Implements vl::VirtualDirectory.

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

Implements vl::VirtualDirectory.

void MemoryDirectory::clone | ( | VirtualDirectory * | directory,
|  | const String & | match = `"*"` |
| ) |  |  |

Clones the content of another directory (empty directories are never cloned).

## Member Data Documentation

std::map< String, ref<MemoryFile> > vl::MemoryDirectory::mFiles`[protected]`

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

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/MemoryDirectory.hpp
- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/MemoryDirectory.cpp

Visualization Library v2009.08 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Sun Nov 8 14:29:00 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.