Adonthell  0.4
igzstream Class Reference

Class to read data from a Gzip compressed file. More...

#include <fileops.h>

Inheritance diagram for igzstream:
Collaboration diagram for igzstream:

Public Member Functions

 igzstream ()
 Default constructor. More...
 
 igzstream (const string &fname)
 Opens a file for read access. More...
 
 ~igzstream ()
 Destructor. More...
 
bool open (const string &fname)
 Opens a file for read access. More...
 
void get_block (void *to, u_int32 size)
 Reads a block of bytes from the file. More...
 
bool get_bool ()
 Reads a boolean. More...
 
u_int8 get_uint8 ()
 Reads a u_int8. More...
 
s_int8 get_sint8 ()
 Reads a s_int8. More...
 
u_int16 get_uint16 ()
 Reads a u_int16. More...
 
s_int16 get_sint16 ()
 Reads a s_int16. More...
 
u_int32 get_uint32 ()
 Reads a u_int32. More...
 
s_int32 get_sint32 ()
 Reads a s_int32. More...
 
string get_string ()
 Reads a string. More...
 
float get_float ()
 Reads a float. More...
 
- Public Member Functions inherited from gz_file
 gz_file ()
 Default constructor. More...
 
 gz_file (const string &fname, gz_type t)
 
virtual ~gz_file ()
 Destructor. More...
 
bool open (const string &fname, gz_type t)
 Opens a file. More...
 
void close ()
 Close the file that was opened. More...
 
bool is_open ()
 Returns whether the file is opened or not. More...
 
bool eof ()
 Returns whether the file is at it's end or not. More...
 

Friends

bool & operator<< (bool &n, igzstream &gfile)
 Reads a boolean. More...
 
char & operator<< (char &n, igzstream &gfile)
 Reads a char. More...
 
u_int8operator<< (u_int8 &n, igzstream &gfile)
 Reads a u_int8. More...
 
s_int8operator<< (s_int8 &n, igzstream &gfile)
 Reads a s_int8. More...
 
u_int16operator<< (u_int16 &n, igzstream &gfile)
 Reads a u_int16. More...
 
s_int16operator<< (s_int16 &n, igzstream &gfile)
 Reads a s_int16. More...
 
u_int32operator<< (u_int32 &n, igzstream &gfile)
 Reads a u_int32. More...
 
s_int32operator<< (s_int32 &n, igzstream &gfile)
 Reads a s_int32. More...
 
string & operator<< (string &s, igzstream &gfile)
 Reads a string. More...
 
float & operator<< (float &s, igzstream &gfile)
 Reads a float. More...
 

Additional Inherited Members

- Protected Attributes inherited from gz_file
gzFile file
 The actual gzFile. More...
 

Detailed Description

Class to read data from a Gzip compressed file.

Definition at line 135 of file fileops.h.

Constructor & Destructor Documentation

§ igzstream() [1/2]

igzstream::igzstream ( )

Default constructor.

Definition at line 69 of file fileops.cc.

§ igzstream() [2/2]

igzstream::igzstream ( const string &  fname)

Opens a file for read access.

Parameters
fnamename of the file to open.

Definition at line 73 of file fileops.cc.

§ ~igzstream()

igzstream::~igzstream ( )

Destructor.

Definition at line 77 of file fileops.cc.

Member Function Documentation

§ open()

bool igzstream::open ( const string &  fname)

Opens a file for read access.

Parameters
fnamename of the file to open.
Returns
true if succeed, false otherwise.

Definition at line 81 of file fileops.cc.

§ get_block()

void igzstream::get_block ( void *  to,
u_int32  size 
)

Reads a block of bytes from the file.

Read a block of size chars.

Parameters
topointer to the buffer where to read.
sizenumber of bytes to read.

Definition at line 110 of file fileops.cc.

§ get_bool()

bool igzstream::get_bool ( )

Reads a boolean.

Definition at line 95 of file fileops.cc.

§ get_uint8()

u_int8 igzstream::get_uint8 ( )

Reads a u_int8.

Definition at line 123 of file fileops.cc.

§ get_sint8()

s_int8 igzstream::get_sint8 ( )

Reads a s_int8.

Definition at line 138 of file fileops.cc.

§ get_uint16()

u_int16 igzstream::get_uint16 ( )

Reads a u_int16.

Definition at line 154 of file fileops.cc.

§ get_sint16()

s_int16 igzstream::get_sint16 ( )

Reads a s_int16.

Definition at line 170 of file fileops.cc.

§ get_uint32()

u_int32 igzstream::get_uint32 ( )

Reads a u_int32.

Definition at line 186 of file fileops.cc.

§ get_sint32()

s_int32 igzstream::get_sint32 ( )

Reads a s_int32.

Definition at line 202 of file fileops.cc.

§ get_string()

string igzstream::get_string ( )

Reads a string.

Definition at line 226 of file fileops.cc.

§ get_float()

float igzstream::get_float ( )

Reads a float.

Definition at line 246 of file fileops.cc.

Friends And Related Function Documentation

§ operator<< [1/10]

bool& operator<< ( bool &  n,
igzstream gfile 
)
friend

Reads a boolean.

Definition at line 87 of file fileops.cc.

§ operator<< [2/10]

char& operator<< ( char &  n,
igzstream gfile 
)
friend

Reads a char.

Definition at line 103 of file fileops.cc.

§ operator<< [3/10]

u_int8& operator<< ( u_int8 n,
igzstream gfile 
)
friend

Reads a u_int8.

Definition at line 116 of file fileops.cc.

§ operator<< [4/10]

s_int8& operator<< ( s_int8 n,
igzstream gfile 
)
friend

Reads a s_int8.

Definition at line 131 of file fileops.cc.

§ operator<< [5/10]

u_int16& operator<< ( u_int16 n,
igzstream gfile 
)
friend

Reads a u_int16.

Definition at line 146 of file fileops.cc.

§ operator<< [6/10]

s_int16& operator<< ( s_int16 n,
igzstream gfile 
)
friend

Reads a s_int16.

Definition at line 162 of file fileops.cc.

§ operator<< [7/10]

u_int32& operator<< ( u_int32 n,
igzstream gfile 
)
friend

Reads a u_int32.

Definition at line 178 of file fileops.cc.

§ operator<< [8/10]

s_int32& operator<< ( s_int32 n,
igzstream gfile 
)
friend

Reads a s_int32.

Definition at line 194 of file fileops.cc.

§ operator<< [9/10]

string& operator<< ( string &  s,
igzstream gfile 
)
friend

Reads a string.

Definition at line 210 of file fileops.cc.

§ operator<< [10/10]

float& operator<< ( float &  s,
igzstream gfile 
)
friend

Reads a float.

Definition at line 234 of file fileops.cc.


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