Visualization Library 2.0.0-b5

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

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | List of all members
gzifstream Class Reference

Gzipped file input stream class. More...

#include <zfstream.h>

+ Inheritance diagram for gzifstream:

Public Member Functions

 gzifstream ()
 
 gzifstream (const char *name, int io_mode=ios::in)
 
 gzifstream (int fd, int io_mode=ios::in)
 
virtual ~gzifstream ()
 
 gzifstream ()
 
 gzifstream (const char *name, std::ios_base::openmode mode=std::ios_base::in)
 Construct stream on gzipped file to be opened. More...
 
 gzifstream (int fd, std::ios_base::openmode mode=std::ios_base::in)
 Construct stream on already open gzipped file. More...
 
gzfilebufrdbuf () const
 Obtain underlying stream buffer. More...
 
bool is_open ()
 Check if file is open. More...
 
void open (const char *name, std::ios_base::openmode mode=std::ios_base::in)
 Open gzipped file. More...
 
void attach (int fd, std::ios_base::openmode mode=std::ios_base::in)
 Attach to already open gzipped file. More...
 
void close ()
 Close gzipped file. More...
 
- Public Member Functions inherited from gzfilestream_common
virtual ~gzfilestream_common ()
 
void attach (int fd, int io_mode)
 
void open (const char *name, int io_mode)
 
void close ()
 

Additional Inherited Members

- Protected Member Functions inherited from gzfilestream_common
 gzfilestream_common ()
 

Detailed Description

Gzipped file input stream class.

This class implements ifstream for gzipped files. Seeking and putback is not supported yet.

Definition at line 68 of file zfstream.h.

Constructor & Destructor Documentation

◆ gzifstream() [1/6]

gzifstream::gzifstream ( )

Definition at line 291 of file zfstream.cpp.

Referenced by gzfilebuf::setbuf().

◆ gzifstream() [2/6]

gzifstream::gzifstream ( const char *  name,
int  io_mode = ios::in 
)

Definition at line 297 of file zfstream.cpp.

References gzfilestream_common::open().

◆ gzifstream() [3/6]

gzifstream::gzifstream ( int  fd,
int  io_mode = ios::in 
)

Definition at line 303 of file zfstream.cpp.

References gzfilestream_common::attach().

◆ ~gzifstream()

gzifstream::~gzifstream ( )
virtual

Definition at line 309 of file zfstream.cpp.

◆ gzifstream() [4/6]

gzifstream::gzifstream ( )

◆ gzifstream() [5/6]

gzifstream::gzifstream ( const char *  name,
std::ios_base::openmode  mode = std::ios_base::in 
)
explicit

Construct stream on gzipped file to be opened.

Parameters
nameFile name.
modeOpen mode flags (forced to contain ios::in).

Definition at line 379 of file zfstream.cc.

References open().

◆ gzifstream() [6/6]

gzifstream::gzifstream ( int  fd,
std::ios_base::openmode  mode = std::ios_base::in 
)
explicit

Construct stream on already open gzipped file.

Parameters
fdFile descriptor.
modeOpen mode flags (forced to contain ios::in).

Definition at line 388 of file zfstream.cc.

References attach().

Member Function Documentation

◆ attach()

void gzifstream::attach ( int  fd,
std::ios_base::openmode  mode = std::ios_base::in 
)

Attach to already open gzipped file.

Parameters
fdFile descriptor.
modeOpen mode flags (forced to contain ios::in).

Stream will be in state good() if attach succeeded; otherwise in state fail().

Definition at line 409 of file zfstream.cc.

References gzfilebuf::attach().

Referenced by gzifstream().

◆ close()

void gzifstream::close ( )

Close gzipped file.

Stream will be in state fail() if close failed.

Definition at line 420 of file zfstream.cc.

References gzfilebuf::close(), gzofstream::gzofstream(), and NULL.

Referenced by main().

◆ is_open()

bool gzifstream::is_open ( )
inline

Check if file is open.

Returns
True if file is open.

Definition at line 270 of file zfstream.h.

References gzfilebuf::attach(), gzfilebuf::close(), gzfilebuf::open(), and out().

◆ open()

void gzifstream::open ( const char *  name,
std::ios_base::openmode  mode = std::ios_base::in 
)

Open gzipped file.

Parameters
nameFile name.
modeOpen mode flags (forced to contain ios::in).

Stream will be in state good() if file opens successfully; otherwise in state fail(). This differs from the behavior of ifstream, which never sets the state to good() and therefore won't allow you to reuse the stream for a second file unless you manually clear() the state. The choice is a matter of convenience.

Definition at line 398 of file zfstream.cc.

References gzfilebuf::open().

Referenced by gzifstream(), and main().

◆ rdbuf()

gzfilebuf* gzifstream::rdbuf ( ) const
inline

Obtain underlying stream buffer.

Definition at line 262 of file zfstream.h.

Referenced by main().


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