GClasses
GClasses::GFolderSerializer Class Reference

Detailed Description

This turns a file or a folder (and its contents recursively) into a stream of bytes.

#include <GDirList.h>

Public Member Functions

 GFolderSerializer (const char *szPath, bool compress)
 szPath can be a filename or a foldername More...
 
 ~GFolderSerializer ()
 
size_t bytesOut ()
 Returns the number of bytes that have been sent out so far. More...
 
char * next (size_t *pOutSize)
 Returns a pointer to the next chunk of bytes. Returns NULL if it is done. More...
 

Protected Member Functions

void addName (const char *szName)
 
void continueDir ()
 
void continueFile ()
 
char * nextPiece (size_t *pOutSize)
 
void startDir (const char *szDirName)
 
void startFile (const char *szFilename)
 

Protected Attributes

size_t m_bytesOut
 
bool m_compressedBufReady
 
unsigned int m_compressedSize
 
std::stack< GDirList * > m_dirStack
 
char * m_pBuf
 
unsigned char * m_pCompressedBuf
 
std::ifstream * m_pInStream
 
char * m_pPos
 
char * m_pUncompressedBuf
 
size_t m_remaining
 
size_t m_size
 
size_t m_state
 
char * m_szOrigPath
 
const char * m_szPath
 
size_t m_uncompressedPos
 

Constructor & Destructor Documentation

GClasses::GFolderSerializer::GFolderSerializer ( const char *  szPath,
bool  compress 
)

szPath can be a filename or a foldername

GClasses::GFolderSerializer::~GFolderSerializer ( )

Member Function Documentation

void GClasses::GFolderSerializer::addName ( const char *  szName)
protected
size_t GClasses::GFolderSerializer::bytesOut ( )
inline

Returns the number of bytes that have been sent out so far.

void GClasses::GFolderSerializer::continueDir ( )
protected
void GClasses::GFolderSerializer::continueFile ( )
protected
char* GClasses::GFolderSerializer::next ( size_t *  pOutSize)

Returns a pointer to the next chunk of bytes. Returns NULL if it is done.

char* GClasses::GFolderSerializer::nextPiece ( size_t *  pOutSize)
protected
void GClasses::GFolderSerializer::startDir ( const char *  szDirName)
protected
void GClasses::GFolderSerializer::startFile ( const char *  szFilename)
protected

Member Data Documentation

size_t GClasses::GFolderSerializer::m_bytesOut
protected
bool GClasses::GFolderSerializer::m_compressedBufReady
protected
unsigned int GClasses::GFolderSerializer::m_compressedSize
protected
std::stack<GDirList*> GClasses::GFolderSerializer::m_dirStack
protected
char* GClasses::GFolderSerializer::m_pBuf
protected
unsigned char* GClasses::GFolderSerializer::m_pCompressedBuf
protected
std::ifstream* GClasses::GFolderSerializer::m_pInStream
protected
char* GClasses::GFolderSerializer::m_pPos
protected
char* GClasses::GFolderSerializer::m_pUncompressedBuf
protected
size_t GClasses::GFolderSerializer::m_remaining
protected
size_t GClasses::GFolderSerializer::m_size
protected
size_t GClasses::GFolderSerializer::m_state
protected
char* GClasses::GFolderSerializer::m_szOrigPath
protected
const char* GClasses::GFolderSerializer::m_szPath
protected
size_t GClasses::GFolderSerializer::m_uncompressedPos
protected