------------------------------------------------------------------------------
| 108 | } |
| 109 | //------------------------------------------------------------------------------ |
| 110 | int FileStreamReader::get() |
| 111 | { |
| 112 | if (!this->is_open() || this->eof()) |
| 113 | { |
| 114 | return this->eof(); |
| 115 | } |
| 116 | |
| 117 | // when reading uncompressed data, zlib will return if it hits |
| 118 | // and eol character |
| 119 | |
| 120 | if (this->Pos >= this->BuffEnd) |
| 121 | { |
| 122 | this->Pos = 0; |
| 123 | // read the first buffer |
| 124 | this->BuffEnd = gzread(this->file, this->buff, FileStreamReader::BUFF_SIZE); |
| 125 | // assign EOF to what gzread returned |
| 126 | this->Eof = (this->BuffEnd <= 0); |
| 127 | if (this->Eof) |
| 128 | { |
| 129 | return this->Eof; |
| 130 | } |
| 131 | } |
| 132 | return this->buff[this->Pos++]; |
| 133 | } |
| 134 | |
| 135 | //------------------------------------------------------------------------------ |
| 136 | void FileStreamReader::rewind() |