diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lzma.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/lzma.h b/src/lzma.h new file mode 100644 index 0000000..21da6e8 --- /dev/null +++ b/src/lzma.h | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
| 3 | * | ||
| 4 | * This file is part of the libbu++ library and is released under the | ||
| 5 | * terms of the license contained in the file LICENSE. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef BU_LZMA_H | ||
| 9 | #define BU_LZMA_H | ||
| 10 | |||
| 11 | #include <stdint.h> | ||
| 12 | |||
| 13 | #include "bu/filter.h" | ||
| 14 | |||
| 15 | namespace Bu | ||
| 16 | { | ||
| 17 | /** | ||
| 18 | * | ||
| 19 | *@ingroup Streams | ||
| 20 | */ | ||
| 21 | class Lzma : public Bu::Filter | ||
| 22 | { | ||
| 23 | public: | ||
| 24 | enum Format | ||
| 25 | { | ||
| 26 | Xz = 0x01, | ||
| 27 | LzmaAlone = 0x02, | ||
| 28 | }; | ||
| 29 | |||
| 30 | Lzma( Bu::Stream &rNext, int nCompression=6, Format eFmt=Xz ); | ||
| 31 | virtual ~Lzma(); | ||
| 32 | |||
| 33 | virtual void start(); | ||
| 34 | virtual Bu::size stop(); | ||
| 35 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); | ||
| 36 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); | ||
| 37 | |||
| 38 | virtual bool isOpen(); | ||
| 39 | virtual bool isEos(); | ||
| 40 | |||
| 41 | Bu::size getCompressedSize(); | ||
| 42 | |||
| 43 | private: | ||
| 44 | void lzmaError( int code ); | ||
| 45 | void *prState; | ||
| 46 | bool bReading; | ||
| 47 | int nCompression; | ||
| 48 | char *pBuf; | ||
| 49 | uint32_t nBufSize; | ||
| 50 | Bu::size sTotalOut; | ||
| 51 | Format eFmt; | ||
| 52 | bool bEos; | ||
| 53 | }; | ||
| 54 | } | ||
| 55 | |||
| 56 | #endif | ||
