# Visualization Library

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

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

# vl::ZippedFile Class Reference

A VirtualFile used to read a file contained in a .zip archive. More...

`#include <ZippedFile.hpp>`

Inheritance diagram for vl::ZippedFile:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| ZippedFile ()
| ~ZippedFile ()
ZippedFileInfo * | zippedFileInfo () const
void | setZippedFileInfo (ZippedFileInfo *info)
virtual bool | exists () const
| This returns true if zippedFileInfo() has been properly set up but does not check the existence of this file in the source zip file.
virtual bool | open (EOpenMode mode)
virtual bool | isOpen () const
virtual void | close ()
virtual long long | size () const
bool | extract (char *destination, bool check_sum=true)
ZippedFile & | operator= (const ZippedFile &other)
virtual ref< VirtualFile > | clone () const
void | resetStream ()

## Protected Member Functions

virtual long long | read_Implementation (void *buffer, long long bytes_to_read)
virtual long long | write_Implementation (const void *buffer, long long byte_count)
virtual bool | fillUncompressedBuffer ()
virtual long long | position_Implementation () const
virtual bool | seekSet_Implementation (long long)

## Protected Attributes

ref< ZippedFileInfo > | mZippedFileInfo
long long | mReadBytes
z_stream_s * | mZStream
unsigned char | mZipBufferIn [CHUNK_SIZE]
unsigned char | mZipBufferOut [CHUNK_SIZE]
std::vector< char > | mUncompressedBuffer
int | mUncompressedBufferPtr

## Static Protected Attributes

static const int | CHUNK_SIZE = 128*1024

## Detailed Description

A VirtualFile used to read a file contained in a .zip archive.

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

## Constructor & Destructor Documentation

ZippedFile::ZippedFile | ( |  | ) |

ZippedFile::~ZippedFile | ( |  | ) |

## Member Function Documentation

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

Returns the name of the class.

Reimplemented from vl::VirtualFile.

ZippedFileInfo * ZippedFile::zippedFileInfo | ( |  | ) | const

void ZippedFile::setZippedFileInfo | ( | ZippedFileInfo * | info | ) |

bool ZippedFile::exists | ( |  | ) | const`[virtual]`

This returns true if zippedFileInfo() has been properly set up but does not check the existence of this file in the source zip file.

To do so call ZippedDirectory::exists().

Implements vl::VirtualFile.

bool ZippedFile::open | ( | EOpenMode | mode | ) | `[virtual]`

Implements vl::VirtualFile.

bool ZippedFile::isOpen | ( |  | ) | const`[virtual]`

Implements vl::VirtualFile.

void ZippedFile::close | ( |  | ) | `[virtual]`

Implements vl::VirtualFile.

long long ZippedFile::size | ( |  | ) | const`[virtual]`

Implements vl::VirtualFile.

bool ZippedFile::extract | ( | char * | destination,
|  | bool | check_sum = `true` |
| ) |  |  |

ZippedFile& vl::ZippedFile::operator= | ( | const ZippedFile & | other | ) | `[inline]`

ref< VirtualFile > ZippedFile::clone | ( |  | ) | const`[virtual]`

Implements vl::VirtualFile.

void ZippedFile::resetStream | ( |  | ) |

long long ZippedFile::read_Implementation | ( | void * | buffer,
|  | long long | bytes_to_read |
| ) |  |  | `[protected, virtual]`

Implements vl::VirtualFile.

virtual long long vl::ZippedFile::write_Implementation | ( | const void * | buffer,
|  | long long | byte_count |
| ) |  |  | `[inline, protected, virtual]`

Implements vl::VirtualFile.

bool ZippedFile::fillUncompressedBuffer | ( |  | ) | `[protected, virtual]`

virtual long long vl::ZippedFile::position_Implementation | ( |  | ) | const`[inline, protected, virtual]`

Implements vl::VirtualFile.

bool ZippedFile::seekSet_Implementation | ( | long long | pos | ) | `[protected, virtual]`

Implements vl::VirtualFile.

## Member Data Documentation

ref<ZippedFileInfo> vl::ZippedFile::mZippedFileInfo`[protected]`

long long vl::ZippedFile::mReadBytes`[protected]`

z_stream_s* vl::ZippedFile::mZStream`[protected]`

const int vl::ZippedFile::CHUNK_SIZE = 128*1024`[static, protected]`

unsigned char vl::ZippedFile::mZipBufferIn[CHUNK_SIZE]`[protected]`

unsigned char vl::ZippedFile::mZipBufferOut[CHUNK_SIZE]`[protected]`

std::vector<char> vl::ZippedFile::mUncompressedBuffer`[protected]`

int vl::ZippedFile::mUncompressedBufferPtr`[protected]`

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

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/ZippedFile.hpp
- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/ZippedFile.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.