| 64 | { |
| 65 | public: |
| 66 | OStream(bool use_iostream, const char* filename) : |
| 67 | m_use_iostream(use_iostream), |
| 68 | m_filename(filename), |
| 69 | ofile(NULL), |
| 70 | streamo(NULL) |
| 71 | { |
| 72 | if (m_use_iostream) |
| 73 | { |
| 74 | #ifdef LZ_WIN32_VC6 |
| 75 | ofb.open(filename, ios::out); |
| 76 | ofb.setmode(filebuf::binary); |
| 77 | streamo = new ostream(&ofb); |
| 78 | #else |
| 79 | streamo = new ofstream(); |
| 80 | streamo->open(filename, std::ios::out | std::ios::binary ); |
| 81 | #endif |
| 82 | } |
| 83 | else |
| 84 | { |
| 85 | ofile = fopen(filename, "wb"); |
| 86 | } |
| 87 | }; |
| 88 | |
| 89 | ~OStream() |
| 90 | { |