aboutsummaryrefslogtreecommitdiff
path: root/src/lzma.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-10-27 04:44:46 +0000
committerMike Buland <eichlan@xagasoft.com>2011-10-27 04:44:46 +0000
commit9906ffe3c54875133448134c09ec12a0949d48cd (patch)
tree0542fef3d27e796700b87b44394a3ad31dd5b852 /src/lzma.h
parent411f240da34bab53cd18aa8b7ba09834ede49b1c (diff)
parent029b5d159023f4dad607359dbfaa2479e21fe9e5 (diff)
downloadlibbu++-9906ffe3c54875133448134c09ec12a0949d48cd.tar.gz
libbu++-9906ffe3c54875133448134c09ec12a0949d48cd.tar.bz2
libbu++-9906ffe3c54875133448134c09ec12a0949d48cd.tar.xz
libbu++-9906ffe3c54875133448134c09ec12a0949d48cd.zip
Reorg'd! I merged in the release-fixup branch and fixed all random warnings.
I also cleaned up the build script, the symlink generation is faster and looks nicer, there's one think left to fix there, but it's not too bad.
Diffstat (limited to '')
-rw-r--r--src/lzma.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/lzma.h b/src/lzma.h
new file mode 100644
index 0000000..090da8d
--- /dev/null
+++ b/src/lzma.h
@@ -0,0 +1,59 @@
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
15namespace Bu
16{
17 /**
18 * Provides XZ compression and decompression, both LZMA1 (LzmaAlone) as
19 * well as the newer LZMA2 (xz) format. This uses .xz by default.
20 *
21 *@ingroup Streams
22 *@ingroup Compression
23 */
24 class Lzma : public Bu::Filter
25 {
26 public:
27 enum Format
28 {
29 Xz = 0x01,
30 LzmaAlone = 0x02,
31 };
32
33 Lzma( Bu::Stream &rNext, int nCompression=6, Format eFmt=Xz );
34 virtual ~Lzma();
35
36 virtual void start();
37 virtual Bu::size stop();
38 virtual Bu::size read( void *pBuf, Bu::size nBytes );
39 virtual Bu::size write( const void *pBuf, Bu::size nBytes );
40
41 virtual bool isOpen();
42 virtual bool isEos();
43
44 Bu::size getCompressedSize();
45
46 private:
47 void lzmaError( int code );
48 void *prState;
49 bool bReading;
50 int nCompression;
51 char *pBuf;
52 uint32_t nBufSize;
53 Bu::size sTotalOut;
54 Format eFmt;
55 bool bEos;
56 };
57}
58
59#endif