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::ZippedFile Class Reference

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

#include <ZippedFile.hpp>

Inheritance diagram for vl::ZippedFile:
vl::VirtualFile vl::Object

List of all members.

Public Member Functions

 ZippedFile ()
 ~ZippedFile ()
const ZippedFileInfozippedFileInfo () const
ZippedFileInfozippedFileInfo ()
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)
 Opens the file in the specified mode.
virtual bool isOpen () const
 Returns true if the file has been opened.
virtual void close ()
 Closes the file.
virtual long long size () const
 Returns the size of the file in bytes.
bool extract (char *destination, bool check_sum=true)
ZippedFileoperator= (const ZippedFile &other)
virtual ref< VirtualFileclone () const
 Creates a clone of this class instance.
void resetStream ()

Protected Member Functions

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

Protected Attributes

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

Detailed Description

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

See also:

Definition at line 133 of file ZippedFile.hpp.


Constructor & Destructor Documentation

ZippedFile::ZippedFile (  )

Definition at line 341 of file ZippedFile.cpp.

References mReadBytes, and mZStream.

Referenced by clone().

ZippedFile::~ZippedFile (  )

Definition at line 348 of file ZippedFile.cpp.

References close(), mReadBytes, mZStream, and NULL.


Member Function Documentation

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

Definition at line 357 of file ZippedFile.cpp.

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

void ZippedFile::setZippedFileInfo ( ZippedFileInfo info )

Definition at line 359 of file ZippedFile.cpp.

References mZippedFileInfo.

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.

Definition at line 361 of file ZippedFile.cpp.

References vl::ZippedFileInfo::sourceZipFile(), zippedFileInfo(), and vl::ZippedFileInfo::zippedFileOffset().

bool ZippedFile::open ( EOpenMode  mode ) [virtual]
bool ZippedFile::isOpen (  ) const [virtual]

Returns true if the file has been opened.

Implements vl::VirtualFile.

Definition at line 442 of file ZippedFile.cpp.

References mReadBytes.

Referenced by extract(), fillUncompressedBuffer(), open(), and read_Implementation().

void ZippedFile::close (  ) [virtual]
long long ZippedFile::size (  ) const [virtual]

Returns the size of the file in bytes.

Implements vl::VirtualFile.

Definition at line 456 of file ZippedFile.cpp.

References mZippedFileInfo.

bool ZippedFile::extract ( char *  destination,
bool  check_sum = true 
)
ZippedFile& vl::ZippedFile::operator= ( const ZippedFile other ) [inline]

Definition at line 165 of file ZippedFile.hpp.

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

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

Creates a clone of this class instance.

Implements vl::VirtualFile.

Definition at line 682 of file ZippedFile.cpp.

References ZippedFile().

void ZippedFile::resetStream (  )

Definition at line 464 of file ZippedFile.cpp.

References close(), vl::OM_ReadOnly, and open().

Referenced by seekSet_Implementation().

long long ZippedFile::read_Implementation ( void *  buffer,
long long  bytes_to_read 
) [protected, virtual]
virtual long long vl::ZippedFile::write_Implementation ( const void *  ,
long long   
) [inline, protected, virtual]

Implements vl::VirtualFile.

Definition at line 185 of file ZippedFile.hpp.

bool ZippedFile::fillUncompressedBuffer (  ) [protected, virtual]
virtual long long vl::ZippedFile::position_Implementation (  ) const [inline, protected, virtual]

Implements vl::VirtualFile.

Definition at line 189 of file ZippedFile.hpp.

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

Implements vl::VirtualFile.

Definition at line 470 of file ZippedFile.cpp.

References vl::VirtualFile::position(), vl::VirtualFile::read(), and resetStream().


Member Data Documentation

Definition at line 194 of file ZippedFile.hpp.

Referenced by operator=(), setZippedFileInfo(), size(), and zippedFileInfo().

long long vl::ZippedFile::mReadBytes [protected]
z_stream_s* vl::ZippedFile::mZStream [protected]

Definition at line 197 of file ZippedFile.hpp.

Referenced by close(), fillUncompressedBuffer(), open(), ZippedFile(), and ~ZippedFile().

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

Definition at line 198 of file ZippedFile.hpp.

Referenced by fillUncompressedBuffer().

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

Definition at line 199 of file ZippedFile.hpp.

Referenced by fillUncompressedBuffer().

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

Definition at line 200 of file ZippedFile.hpp.

Referenced by close(), fillUncompressedBuffer(), open(), and read_Implementation().

Definition at line 201 of file ZippedFile.hpp.

Referenced by close(), fillUncompressedBuffer(), open(), and read_Implementation().


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.