Overview

The RoseInputGzipStream class is a subclass of RoseInputStream used to feed parsing code with Gzip compressed source provided by another stream object. The underlying source stream is usually a file, but could be any of the other stream subtypes.

RoseInputFile fs;
RoseInputGzipStream stream;

FILE * f = fopen ("input.gz", "rb");
fs.file(f)

stream.gzsrc(&fs);
while ((c=stream.get()) != EOF)
{
    // process the characters
}

fclose (f);

ctor()

RoseInputGzipStream();
RoseInputGzipStream(
	RoseInputStream * bs
	);

The RoseInputGzipStream() class has a default constructor and one that takes a second stream to initialize the gzsrc() field.

gzsrc()

RoseInputStream * gzsrc();
void gzsrc (RoseInputStream * bs);

The gzsrc() function gets and sets the underlying source stream that the compressed data will be read from. This is normally a RoseInputFile instance but could be a different stream type. If it is a file, be sure to fopen() it in binary mode on Windows.

refill()

virtual size_t refill();

The refill() function reads data from the gzsrc() stream and uncompresses at most io_size() characters into the I/0 buffer. It returns the number of characters copied.

This is called automatically by get() when it reaches the end of the buffer. This is a virtual function that is overridden by each stream subtype.