Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Types | Public Member Functions | Protected Attributes | List of all members
cGZipFile Class Reference

#include <GZipFile.h>

Public Types

enum  eMode { fmRead, fmWrite }
 

Public Member Functions

 cGZipFile (void)
 
void Close (void)
 Closes the file, flushing all buffers. More...
 
bool Open (const AString &a_FileName, eMode a_Mode)
 Opens the file. More...
 
int ReadRestOfFile (AString &a_Contents)
 Reads the rest of the file and decompresses it into a_Contents. More...
 
bool Write (const AString &a_Contents)
 Writes a_Contents into file, compressing it along the way. More...
 
bool Write (const char *a_Data, int a_Size)
 
 ~cGZipFile ()
 

Protected Attributes

gzFile m_File
 
eMode m_Mode
 

Detailed Description

Definition at line 18 of file GZipFile.h.

Member Enumeration Documentation

Enumerator
fmRead 
fmWrite 

Definition at line 21 of file GZipFile.h.

Constructor & Destructor Documentation

cGZipFile::cGZipFile ( void  )

Definition at line 13 of file GZipFile.cpp.

cGZipFile::~cGZipFile ( )

Definition at line 22 of file GZipFile.cpp.

Member Function Documentation

void cGZipFile::Close ( void  )

Closes the file, flushing all buffers.

This object may be then reused for a different file and / or mode

Definition at line 47 of file GZipFile.cpp.

bool cGZipFile::Open ( const AString a_FileName,
eMode  a_Mode 
)

Opens the file.

Returns true if successful. Fails if a file has already been opened through this object.

Definition at line 31 of file GZipFile.cpp.

int cGZipFile::ReadRestOfFile ( AString a_Contents)

Reads the rest of the file and decompresses it into a_Contents.

Returns the number of decompressed bytes, <0 for error

Definition at line 60 of file GZipFile.cpp.

bool cGZipFile::Write ( const AString a_Contents)
inline

Writes a_Contents into file, compressing it along the way.

Returns true if successful. Multiple writes are supported.

Definition at line 40 of file GZipFile.h.

bool cGZipFile::Write ( const char *  a_Data,
int  a_Size 
)

Definition at line 91 of file GZipFile.cpp.

Member Data Documentation

gzFile cGZipFile::m_File
protected

Definition at line 45 of file GZipFile.h.

eMode cGZipFile::m_Mode
protected

Definition at line 46 of file GZipFile.h.


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