# Visualization Library

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

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

# vl::ZippedDirectory Class Reference

A VirtualDirectory capable of reading files from a .zip file. More...

`#include <ZippedDirectory.hpp>`

Inheritance diagram for vl::ZippedDirectory:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| ZippedDirectory ()
| ZippedDirectory (const String &zip_file)
| ZippedDirectory (VirtualFile *zip_file)
bool | setPath (const String &name)
| Changes the `path` `name` of a VirtualDirectory. Must not be an empty string.
VirtualFile * | sourceZipFile () const
void | setSourceZipFile (VirtualFile *file)
void | reset ()
| Sets the source zip file to NULL and disposes all the files contained in this directory.
ref< VirtualFile > | file (const String &name) const
| Returns the VirtualFile with the given name if any, NULL otherwise.
ref< ZippedFile > | zippedFile (const String &name) const
| Accepts absolute and relative paths.
void | listFilesRecursive (std::vector< String > &file_list) const
| Returns the list of files contained in the VirtualDirectory.
int | zippedFileCount () const
ZippedFile * | zippedFile (int index) const
void | listSubDirs (std::vector< String > &dirs, bool append=false) const
ref< ZippedDirectory > | zippedSubDir (const String &subdir_name) const
ref< VirtualDirectory > | subDir (const String &subdir_name) const
void | listFiles (std::vector< String > &file_list, bool append=false) const
bool | isCorrupted ()

## Protected Member Functions

bool | init ()

## Protected Attributes

std::map< String, ref < ZippedFile > > | mFiles
ref< VirtualFile > | mSourceZipFile

## Detailed Description

A VirtualDirectory capable of reading files from a .zip file.

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

## Constructor & Destructor Documentation

ZippedDirectory::ZippedDirectory | ( |  | ) |

ZippedDirectory::ZippedDirectory | ( | const String & | zip_file | ) |

ZippedDirectory::ZippedDirectory | ( | VirtualFile * | zip_file | ) |

## Member Function Documentation

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

Returns the name of the class.

Reimplemented from vl::VirtualDirectory.

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

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

Reimplemented from vl::VirtualDirectory.

VirtualFile * ZippedDirectory::sourceZipFile | ( |  | ) | const

void ZippedDirectory::setSourceZipFile | ( | VirtualFile * | file | ) |

void ZippedDirectory::reset | ( |  | ) |

Sets the source zip file to NULL and disposes all the files contained in this directory.

ref< VirtualFile > ZippedDirectory::file | ( | const String & | name | ) | const`[virtual]`

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

Implements vl::VirtualDirectory.

ref< ZippedFile > ZippedDirectory::zippedFile | ( | const String & | name | ) | const

Accepts absolute and relative paths.

void ZippedDirectory::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.

int ZippedDirectory::zippedFileCount | ( |  | ) | const

ZippedFile * ZippedDirectory::zippedFile | ( | int | index | ) | const

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

Implements vl::VirtualDirectory.

ref< ZippedDirectory > ZippedDirectory::zippedSubDir | ( | const String & | subdir_name | ) | const

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

Implements vl::VirtualDirectory.

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

Implements vl::VirtualDirectory.

bool ZippedDirectory::isCorrupted | ( |  | ) |

bool ZippedDirectory::init | ( |  | ) | `[protected]`

## Member Data Documentation

std::map< String, ref<ZippedFile> > vl::ZippedDirectory::mFiles`[protected]`

ref<VirtualFile> vl::ZippedDirectory::mSourceZipFile`[protected]`

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

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

Visualization Library v2009.07 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Mon Aug 10 21:41:47 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.