クラス rcsc::gzfilebuf

gzip file stream buffer class. [詳細]

#include <gzfstream.h>

すべてのメンバ一覧

Public 型

enum  CompressionLevel {
  DEFAULT_COMPRESSION = 6, NO_COMPRESSION = 0, BEST_SPEED = 1, BEST_COMPRESSION = 9,
  DEFAULT_COMPRESSION = -1, NO_COMPRESSION = 0, BEST_SPEED = 1, BEST_COMPRESSION = 9
}
 typical compression level enumeration [詳細]
enum  Strategy { DEFAULT_STRATEGY = 0, FILTERED = 1, HUFFMAN_ONLY = 2, RLE = 3 }
 typical compression strategy enumeration. [詳細]

Public メソッド

 gzfilebuf ()
 default constructor.
virtual ~gzfilebuf ()
 destructor.
bool is_open ()
 check if file is open.
gzfilebufopen (const char *path, std::ios_base::openmode mode, int level=DEFAULT_COMPRESSION, int strategy=DEFAULT_STRATEGY)
 open the file.
gzfilebufclose () throw ()
 closes the file if opened.

Protected メソッド

virtual std::streampos seekoff (std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode mode)
 overrided method. set relative position of internal position pointer
virtual std::streampos seekpos (std::streampos pos, std::ios_base::openmode mode)
 overrided method. seek stream.
virtual std::streamsize showmanyc ()
 overrided method. get number of characters availbale in input sequence
virtual int sync ()
 synchronize stream buffer
virtual std::streambuf::int_type overflow (std::streambuf::int_type c)
 put character at current put position.
virtual std::streambuf::int_type underflow ()
 get current character


説明

gzip file stream buffer class.

This class implements basic_filebuf for gzipped files. It doesn't yet support seeking (allowed by zlib but slow/limited), putback and read/write access(tricky). Otherwise, it attempts to be a drop-in replacement for the standard file streambuf.


列挙型

enum rcsc::gzfilebuf::CompressionLevel

typical compression level enumeration

The list of compresion level defined in zlib.h

enum rcsc::gzfilebuf::Strategy

typical compression strategy enumeration.

The list of strategy defined in zlib.h

For more details, see deflateInit2 in zlib.h.


コンストラクタとデストラクタ

rcsc::gzfilebuf::gzfilebuf (  ) 

default constructor.

Default constructor creates an internal file buffer using boost::scoped_ptr. This buffer is deleted automatically.

rcsc::gzfilebuf::~gzfilebuf (  )  [virtual]

destructor.

close opend file delete dynamically allocated internal buffer


関数

bool rcsc::gzfilebuf::is_open (  ) 

check if file is open.

戻り値:
returns true if file is opend, else false.

gzfilebuf * rcsc::gzfilebuf::open ( const char *  path,
std::ios_base::openmode  mode,
int  level = DEFAULT_COMPRESSION,
int  strategy = DEFAULT_STRATEGY 
)

open the file.

引数:
path file path
mode specifies mode of I/O. Only std::ios_base::in or std::ios_base::out can be used.
level compression level(0-9, -1 means default level)
strategy compression strategy. Z_DEFAULT_COMPRESSION, Z_FILTERD, Z_HUFFMAN_ONLY or Z_RLE. For more details, see deflateInit2 in zlib.h.
If file is already opened, this method has no effect. If file is opened successfully, buffer is also allocated. This buffer is deleted when gzfilebuf is deleted.

gzfilebuf * rcsc::gzfilebuf::close (  )  throw ()

closes the file if opened.

戻り値:
NULL.

std::streampos rcsc::gzfilebuf::seekoff ( std::streamoff  off,
std::ios_base::seekdir  way,
std::ios_base::openmode  mode 
) [protected, virtual]

overrided method. set relative position of internal position pointer

引数:
off offset to move. This is decompressed data size.
way object of type ios_base::seekdir. ios_base::beg (offset from the beginning of the stream's buffer). ios_base::cur (offset from the current position in the stream's buffer). ios_base::cur (offset from the end of the stream's buffer).
mode IO mode
戻り値:
new position value of the modified position pointer. in case of error, returned -1.

zlib does not support seeking from 'end'.

std::streampos rcsc::gzfilebuf::seekpos ( std::streampos  pos,
std::ios_base::openmode  mode 
) [protected, virtual]

overrided method. seek stream.

引数:
pos position for the position pointer.
mode IO mode
戻り値:
new position value of the modified position pointer. in case of error, returned -1.

std::streamsize rcsc::gzfilebuf::showmanyc (  )  [protected, virtual]

overrided method. get number of characters availbale in input sequence

戻り値:
number of characters remaining to be read in the object

int rcsc::gzfilebuf::sync (  )  [protected, virtual]

synchronize stream buffer

戻り値:
0 data was successfully flushed
-1 failed to synchronize

std::streambuf::int_type rcsc::gzfilebuf::overflow ( std::streambuf::int_type  c  )  [protected, virtual]

put character at current put position.

引数:
c this char is put to file.
戻り値:
always 0

std::streambuf::int_type rcsc::gzfilebuf::underflow (  )  [protected, virtual]

get current character

戻り値:
current character. in the case error, returned EOF.


このクラスの説明は次のファイルから生成されました:
librcscに対してThu May 1 15:41:26 2008に生成されました。  doxygen 1.5.0