📄 zipinputstream.h
字号:
/*------------------------------------------------------------------------------* Copyright (C) 2003-2006 Jos van den Oever* * Distributable under the terms of either the Apache License (Version 2.0) or * the GNU Lesser General Public License, as specified in the COPYING file.------------------------------------------------------------------------------*/#ifndef ZIPINPUTSTREAM_H#define ZIPINPUTSTREAM_H#include "substreamprovider.h"#include "gzipinputstream.h"/** * Partial implementation of the zip file format according to * http://www.pkware.com/business_and_developers/developer/popups/appnote.txt * 99% of zip files on my system can be read with this class. * Exceptions are files that are (at least) * - files generated by writing to stdout * - files using other compression as deflated * - encrypted files **/namespace jstreams {class ZipInputStream : public SubStreamProvider {private: // information relating to the current entry StreamBase<char>* compressedEntryStream; GZipInputStream *uncompressionStream; StreamBase<char>* uncompressedEntryStream; int32_t entryCompressedSize; int32_t compressionMethod; void readFileName(int32_t len); void readHeader(); static int32_t read2bytes(const unsigned char *b); static int32_t read4bytes(const unsigned char *b);public: ZipInputStream(StreamBase<char>* input); ~ZipInputStream(); StreamBase<char>* nextEntry(); static bool checkHeader(const char* data, int32_t datasize);};} // end namespace jstreams#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -