diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:22:37 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:22:37 -0700 |
commit | 4b5a43a219d51066c01ff2ab86af18b967f2d0dd (patch) | |
tree | 4dcaf0cd18751d04cf638a9a6ec521990d4f2e90 /contrib/iostream/zfstream.h | |
parent | 086e982175da84b3db958191031380794315f95f (diff) | |
download | zlib-1.2.0.5.tar.gz zlib-1.2.0.5.tar.bz2 zlib-1.2.0.5.zip |
zlib 1.2.0.5v1.2.0.5
Diffstat (limited to 'contrib/iostream/zfstream.h')
-rw-r--r-- | contrib/iostream/zfstream.h | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/contrib/iostream/zfstream.h b/contrib/iostream/zfstream.h index c87fa08..ed79098 100644 --- a/contrib/iostream/zfstream.h +++ b/contrib/iostream/zfstream.h | |||
@@ -1,6 +1,6 @@ | |||
1 | 1 | ||
2 | #ifndef _zfstream_h | 2 | #ifndef zfstream_h |
3 | #define _zfstream_h | 3 | #define zfstream_h |
4 | 4 | ||
5 | #include <fstream.h> | 5 | #include <fstream.h> |
6 | #include "zlib.h" | 6 | #include "zlib.h" |
@@ -16,8 +16,8 @@ public: | |||
16 | gzfilebuf *attach( int file_descriptor, int io_mode ); | 16 | gzfilebuf *attach( int file_descriptor, int io_mode ); |
17 | gzfilebuf *close(); | 17 | gzfilebuf *close(); |
18 | 18 | ||
19 | int setcompressionlevel( short comp_level ); | 19 | int setcompressionlevel( int comp_level ); |
20 | int setcompressionstrategy( short comp_strategy ); | 20 | int setcompressionstrategy( int comp_strategy ); |
21 | 21 | ||
22 | inline int is_open() const { return (file !=NULL); } | 22 | inline int is_open() const { return (file !=NULL); } |
23 | 23 | ||
@@ -98,18 +98,19 @@ private: | |||
98 | T val; | 98 | T val; |
99 | }; | 99 | }; |
100 | 100 | ||
101 | template<class T> gzofstream &operator<<(gzofstream &s, | 101 | template<class T> gzofstream &operator<<(gzofstream &s, const gzomanip<T> &m) |
102 | const gzomanip<T> &m) { | 102 | { |
103 | return (*m.func)(s, m.val); | 103 | return (*m.func)(s, m.val); |
104 | |||
105 | } | 104 | } |
106 | 105 | ||
107 | inline gzofstream &setcompressionlevel( gzofstream &s, int l ) { | 106 | inline gzofstream &setcompressionlevel( gzofstream &s, int l ) |
107 | { | ||
108 | (s.rdbuf())->setcompressionlevel(l); | 108 | (s.rdbuf())->setcompressionlevel(l); |
109 | return s; | 109 | return s; |
110 | } | 110 | } |
111 | 111 | ||
112 | inline gzofstream &setcompressionstrategy( gzofstream &s, int l ) { | 112 | inline gzofstream &setcompressionstrategy( gzofstream &s, int l ) |
113 | { | ||
113 | (s.rdbuf())->setcompressionstrategy(l); | 114 | (s.rdbuf())->setcompressionstrategy(l); |
114 | return s; | 115 | return s; |
115 | } | 116 | } |
@@ -125,18 +126,3 @@ inline gzomanip<int> setcompressionstrategy(int l) | |||
125 | } | 126 | } |
126 | 127 | ||
127 | #endif | 128 | #endif |
128 | |||
129 | |||
130 | |||
131 | |||
132 | |||
133 | |||
134 | |||
135 | |||
136 | |||
137 | |||
138 | |||
139 | |||
140 | |||
141 | |||
142 | |||