| 119 | { |
| 120 | public: |
| 121 | IStream(bool use_iostream, const char* filename) : |
| 122 | m_use_iostream(use_iostream), |
| 123 | m_filename(filename), |
| 124 | ifile(NULL), |
| 125 | streami(NULL) |
| 126 | { |
| 127 | if (m_use_iostream) |
| 128 | { |
| 129 | #ifdef LZ_WIN32_VC6 |
| 130 | ifb.open(filename, ios::in); |
| 131 | ifb.setmode(filebuf::binary); |
| 132 | streami = new istream(&ifb); |
| 133 | #else |
| 134 | streami = new ifstream(); |
| 135 | streami->open(filename, std::ios::in | std::ios::binary); |
| 136 | #endif |
| 137 | } |
| 138 | else |
| 139 | { |
| 140 | ifile = fopen(filename, "rb"); |
| 141 | } |
| 142 | }; |
| 143 | |
| 144 | ~IStream() |
| 145 | { |