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 Member Functions | Protected Attributes

vl::ZippedDirectory Class Reference

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

#include <ZippedDirectory.hpp>

Inheritance diagram for vl::ZippedDirectory:
vl::VirtualDirectory vl::Object

List of all members.

Public Member Functions

 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.
const VirtualFilesourceZipFile () const
VirtualFilesourceZipFile ()
void setSourceZipFile (VirtualFile *file)
void reset ()
 Sets the source zip file to NULL and disposes all the files contained in this directory.
ref< VirtualFilefile (const String &name) const
 Returns the VirtualFile with the given name if any, NULL otherwise.
ref< ZippedFilezippedFile (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
const ZippedFilezippedFile (int index) const
ZippedFilezippedFile (int index)
void listSubDirs (std::vector< String > &dirs, bool append=false) const
ref< ZippedDirectoryzippedSubDir (const String &subdir_name) const
ref< VirtualDirectorysubDir (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< VirtualFilemSourceZipFile

Detailed Description

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

See also:

Definition at line 58 of file ZippedDirectory.hpp.


Constructor & Destructor Documentation

ZippedDirectory::ZippedDirectory (  )

Definition at line 39 of file ZippedDirectory.cpp.

Referenced by zippedSubDir().

ZippedDirectory::ZippedDirectory ( const String zip_file )
ZippedDirectory::ZippedDirectory ( VirtualFile zip_file )

Definition at line 50 of file ZippedDirectory.cpp.

References setSourceZipFile().


Member Function Documentation

bool ZippedDirectory::setPath ( const String path ) [virtual]
const VirtualFile * ZippedDirectory::sourceZipFile (  ) const

Definition at line 90 of file ZippedDirectory.cpp.

References vl::ref< T >::get(), and mSourceZipFile.

Referenced by init().

VirtualFile * ZippedDirectory::sourceZipFile (  )

Definition at line 95 of file ZippedDirectory.cpp.

References vl::ref< T >::get(), and mSourceZipFile.

void ZippedDirectory::setSourceZipFile ( VirtualFile file )

Definition at line 100 of file ZippedDirectory.cpp.

References file(), init(), mSourceZipFile, and reset().

Referenced by ZippedDirectory().

void ZippedDirectory::reset (  )

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

Definition at line 108 of file ZippedDirectory.cpp.

References mFiles, mSourceZipFile, and NULL.

Referenced by setSourceZipFile().

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

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

Implements vl::VirtualDirectory.

Definition at line 248 of file ZippedDirectory.cpp.

References zippedFile().

Referenced by setSourceZipFile().

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

Accepts absolute and relative paths.

Definition at line 280 of file ZippedDirectory.cpp.

References vl::ref< T >::get(), mFiles, NULL, and vl::VirtualDirectory::translatePath().

Referenced by file(), and isCorrupted().

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.

Definition at line 294 of file ZippedDirectory.cpp.

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

int ZippedDirectory::zippedFileCount (  ) const

Definition at line 253 of file ZippedDirectory.cpp.

References mFiles.

Referenced by isCorrupted().

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

Definition at line 258 of file ZippedDirectory.cpp.

References mFiles, and NULL.

ZippedFile * ZippedDirectory::zippedFile ( int  index )

Definition at line 269 of file ZippedDirectory.cpp.

References mFiles, and NULL.

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

Implements vl::VirtualDirectory.

Definition at line 95 of file ZippedDirectory.hpp.

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

Implements vl::VirtualDirectory.

Definition at line 370 of file ZippedDirectory.cpp.

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

bool ZippedDirectory::isCorrupted (  )

Definition at line 386 of file ZippedDirectory.cpp.

References init(), zippedFile(), and zippedFileCount().

bool ZippedDirectory::init (  ) [protected]

Member Data Documentation

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

Definition at line 106 of file ZippedDirectory.hpp.

Referenced by reset(), setSourceZipFile(), and sourceZipFile().


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:08.
Permission is granted to use this page to write and publish articles regarding Visualization Library.