Visualization Library v1.0.3

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

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes

vl::MemoryDirectory Class Reference

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

#include <MemoryDirectory.hpp>

Inheritance diagram for vl::MemoryDirectory:
vl::VirtualDirectory vl::Object

List of all members.

Public Member Functions

 MemoryDirectory (const String &path=".")
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< VirtualFilefile (const String &name) const
 Returns the VirtualFile with the given name if any, NULL otherwise.
ref< MemoryFilememoryFile (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< MemoryDirectorymemorySubDir (const String &subdir_name) const
ref< VirtualDirectorysubDir (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:

Definition at line 56 of file MemoryDirectory.hpp.


Constructor & Destructor Documentation

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

Definition at line 61 of file MemoryDirectory.hpp.

Referenced by memorySubDir().


Member Function Documentation

bool MemoryDirectory::setPath ( const String path ) [virtual]
bool MemoryDirectory::addFile ( MemoryFile file )

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

Definition at line 71 of file MemoryDirectory.cpp.

References vl::Log::error(), file(), mFiles, vl::String::normalizeSlashes(), vl::VirtualFile::path(), vl::VirtualDirectory::path(), vl::VirtualFile::setPath(), and vl::String::startsWith().

Referenced by clone().

bool MemoryDirectory::removeFile ( MemoryFile file )

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

Definition at line 93 of file MemoryDirectory.cpp.

References vl::VirtualFile::path().

bool MemoryDirectory::removeFile ( const String name )

Definition at line 98 of file MemoryDirectory.cpp.

References mFiles.

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

Definition at line 73 of file MemoryDirectory.hpp.

Referenced by clone().

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.

Definition at line 75 of file MemoryDirectory.hpp.

Referenced by addFile(), and clone().

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.

Definition at line 119 of file MemoryDirectory.cpp.

References vl::Log::error(), mFiles, vl::VirtualDirectory::path(), and vl::Log::warning().

void MemoryDirectory::listSubDirs ( std::vector< String > &  dirs,
bool  append = false 
) const [virtual]
ref< MemoryDirectory > MemoryDirectory::memorySubDir ( const String subdir_name ) const
ref<VirtualDirectory> vl::MemoryDirectory::subDir ( const String subdir_name ) const [inline, virtual]

Implements vl::VirtualDirectory.

Definition at line 85 of file MemoryDirectory.hpp.

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

Implements vl::VirtualDirectory.

Definition at line 195 of file MemoryDirectory.cpp.

References vl::Log::error(), mFiles, and vl::VirtualDirectory::path().

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

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

Definition at line 211 of file MemoryDirectory.cpp.

References addFile(), eraseAllFiles(), vl::VirtualDirectory::file(), file(), vl::ref< T >::get(), vl::VirtualDirectory::listFilesRecursive(), vl::VirtualDirectory::path(), and setPath().


Member Data Documentation

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

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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:06.
Permission is granted to use this page to write and publish articles regarding Visualization Library.