diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-06-07 19:56:20 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-06-07 19:56:20 +0000 |
commit | 9e8a4944e50fab432012878c66e1bdac20649f76 (patch) | |
tree | 412b0d49ae4086bb330045f9956513397b866807 /src/filter.cpp | |
parent | c2e3879b965d297604804f03271ac71c8c5c81f3 (diff) | |
download | libbu++-9e8a4944e50fab432012878c66e1bdac20649f76.tar.gz libbu++-9e8a4944e50fab432012878c66e1bdac20649f76.tar.bz2 libbu++-9e8a4944e50fab432012878c66e1bdac20649f76.tar.xz libbu++-9e8a4944e50fab432012878c66e1bdac20649f76.zip |
The Stream Filter archetecture is finished, it's actually much cooler than I
had anticipated, and much cleaner. I'll have to add some documentation to it,
because it's not really obvious how any of it fits together from the outset,
although I have to say that the bzip2 test program is the easiest general bzip2
compression program I've ever made...it just goes :)
Decompression in Bu::BZip2 isn't finished yet, but that's ok, it's coming soon.
Diffstat (limited to 'src/filter.cpp')
-rw-r--r-- | src/filter.cpp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/filter.cpp b/src/filter.cpp new file mode 100644 index 0000000..d3faa00 --- /dev/null +++ b/src/filter.cpp | |||
@@ -0,0 +1,77 @@ | |||
1 | #include "bu/filter.h" | ||
2 | |||
3 | Bu::Filter::Filter( Bu::Stream &rNext ) : | ||
4 | rNext( rNext ) | ||
5 | { | ||
6 | } | ||
7 | |||
8 | Bu::Filter::~Filter() | ||
9 | { | ||
10 | printf("-> Bu::Filter::~Filter()\n"); | ||
11 | } | ||
12 | /* | ||
13 | void Bu::Filter::start() | ||
14 | { | ||
15 | printf("-> Bu::Filter::start()\n"); | ||
16 | } | ||
17 | |||
18 | void Bu::Filter::stop() | ||
19 | { | ||
20 | }*/ | ||
21 | |||
22 | void Bu::Filter::close() | ||
23 | { | ||
24 | stop(); | ||
25 | rNext.close(); | ||
26 | } | ||
27 | |||
28 | long Bu::Filter::tell() | ||
29 | { | ||
30 | return rNext.tell(); | ||
31 | } | ||
32 | |||
33 | void Bu::Filter::seek( long offset ) | ||
34 | { | ||
35 | rNext.seek( offset ); | ||
36 | } | ||
37 | |||
38 | void Bu::Filter::setPos( long pos ) | ||
39 | { | ||
40 | rNext.setPos( pos ); | ||
41 | } | ||
42 | |||
43 | void Bu::Filter::setPosEnd( long pos ) | ||
44 | { | ||
45 | rNext.setPosEnd( pos ); | ||
46 | } | ||
47 | |||
48 | bool Bu::Filter::isEOS() | ||
49 | { | ||
50 | return rNext.isEOS(); | ||
51 | } | ||
52 | |||
53 | bool Bu::Filter::canRead() | ||
54 | { | ||
55 | return rNext.canRead(); | ||
56 | } | ||
57 | |||
58 | bool Bu::Filter::canWrite() | ||
59 | { | ||
60 | return rNext.canWrite(); | ||
61 | } | ||
62 | |||
63 | bool Bu::Filter::canSeek() | ||
64 | { | ||
65 | return rNext.canSeek(); | ||
66 | } | ||
67 | |||
68 | bool Bu::Filter::isBlocking() | ||
69 | { | ||
70 | return rNext.isBlocking(); | ||
71 | } | ||
72 | |||
73 | void Bu::Filter::setBlocking( bool bBlocking ) | ||
74 | { | ||
75 | rNext.setBlocking( bBlocking ); | ||
76 | } | ||
77 | |||