• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiónaf7a39bd86ceaabc9cc13777678cc8fc5a1bc55e (tree)
Tiempo2014-05-18 02:31:02
Autorwbenny <w.benny@outl...>
Commiterwbenny

Log Message

* ZipLib is now using "char" streams.

Cambiar Resumen

Diferencia incremental

--- a/Source/ZipLib/compression/bzip2/bzip2_decoder.h
+++ b/Source/ZipLib/compression/bzip2/bzip2_decoder.h
@@ -7,20 +7,16 @@
77
88 #include <cstdint>
99
10-template <typename ELEM_TYPE, typename TRAITS_TYPE>
11-class basic_bzip2_decoder
12- : public compression_decoder_interface_basic<ELEM_TYPE, TRAITS_TYPE>
10+class bzip2_decoder
11+ : public compression_decoder_interface
1312 {
1413 public:
15- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
16- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
17-
18- basic_bzip2_decoder()
14+ bzip2_decoder()
1915 {
2016
2117 }
2218
23- ~basic_bzip2_decoder()
19+ ~bzip2_decoder()
2420 {
2521 if (is_init())
2622 {
@@ -29,13 +25,13 @@ class basic_bzip2_decoder
2925 }
3026 }
3127
32- void init(istream_type& stream) override
28+ void init(std::istream& stream) override
3329 {
3430 bzip2_properties props;
3531 init(stream, props);
3632 }
3733
38- void init(istream_type& stream, compression_properties_interface& props) override
34+ void init(std::istream& stream, compression_properties_interface& props) override
3935 {
4036 // init stream
4137 _stream = &stream;
@@ -49,8 +45,8 @@ class basic_bzip2_decoder
4945 _bufferCapacity = bzip2Props.BufferCapacity;
5046
5147 uninit_buffers();
52- _inputBuffer = new ELEM_TYPE[_bufferCapacity];
53- _outputBuffer = new ELEM_TYPE[_bufferCapacity];
48+ _inputBuffer = new char_type[_bufferCapacity];
49+ _outputBuffer = new char_type[_bufferCapacity];
5450
5551 // init bzip2
5652 _bzstream.bzalloc = nullptr;
@@ -71,12 +67,12 @@ class basic_bzip2_decoder
7167 return (_inputBuffer != nullptr && _outputBuffer != nullptr);
7268 }
7369
74- ELEM_TYPE* get_buffer_begin() override
70+ char_type* get_buffer_begin() override
7571 {
7672 return _outputBuffer;
7773 }
7874
79- ELEM_TYPE* get_buffer_end() override
75+ char_type* get_buffer_end() override
8076 {
8177 return _outputBuffer + _outputBufferSize;
8278 }
@@ -123,7 +119,7 @@ class basic_bzip2_decoder
123119 if (_bzstream.avail_in > 0)
124120 {
125121 _stream->clear();
126- _stream->seekg(-static_cast<typename istream_type::off_type>(_bzstream.avail_in), std::ios::cur);
122+ _stream->seekg(-static_cast<std::istream::off_type>(_bzstream.avail_in), std::ios::cur);
127123 }
128124 }
129125
@@ -160,16 +156,12 @@ class basic_bzip2_decoder
160156 bz_stream _bzstream; // internal bzip2 structure
161157 int _lastError = BZ_OK; // last error of bzip2 operation
162158
163- istream_type* _stream = nullptr;
159+ std::istream* _stream = nullptr;
164160 bool _endOfStream = false;
165161
166162 size_t _bufferCapacity = 0;
167163 size_t _inputBufferSize = 0; // how many bytes are read in the input buffer
168164 size_t _outputBufferSize = 0; // how many bytes are written in the output buffer
169- ELEM_TYPE* _inputBuffer = nullptr; // pointer to the start of the input buffer
170- ELEM_TYPE* _outputBuffer = nullptr; // pointer to the start of the output buffer
165+ char_type* _inputBuffer = nullptr; // pointer to the start of the input buffer
166+ char_type* _outputBuffer = nullptr; // pointer to the start of the output buffer
171167 };
172-
173-typedef basic_bzip2_decoder<uint8_t, std::char_traits<uint8_t>> byte_bzip2_decoder;
174-typedef basic_bzip2_decoder<char, std::char_traits<char>> bzip2_decoder;
175-typedef basic_bzip2_decoder<wchar_t, std::char_traits<wchar_t>> wbzip2_decoder;
--- a/Source/ZipLib/compression/bzip2/bzip2_encoder.h
+++ b/Source/ZipLib/compression/bzip2/bzip2_encoder.h
@@ -7,20 +7,16 @@
77
88 #include <cstdint>
99
10-template <typename ELEM_TYPE, typename TRAITS_TYPE>
11-class basic_bzip2_encoder
12- : public compression_encoder_interface_basic<ELEM_TYPE, TRAITS_TYPE>
10+class bzip2_encoder
11+ : public compression_encoder_interface
1312 {
1413 public:
15- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
16- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
17-
18- basic_bzip2_encoder()
14+ bzip2_encoder()
1915 {
2016
2117 }
2218
23- ~basic_bzip2_encoder()
19+ ~bzip2_encoder()
2420 {
2521 if (is_init())
2622 {
@@ -29,13 +25,13 @@ class basic_bzip2_encoder
2925 }
3026 }
3127
32- void init(ostream_type& stream) override
28+ void init(std::ostream& stream) override
3329 {
3430 bzip2_properties props;
3531 init(stream, props);
3632 }
3733
38- void init(ostream_type& stream, compression_properties_interface& props) override
34+ void init(std::ostream& stream, compression_properties_interface& props) override
3935 {
4036 // init stream
4137 _stream = &stream;
@@ -45,8 +41,8 @@ class basic_bzip2_encoder
4541 _bufferCapacity = bz2Props.BufferCapacity;
4642
4743 uninit_buffers();
48- _inputBuffer = new ELEM_TYPE[_bufferCapacity];
49- _outputBuffer = new ELEM_TYPE[_bufferCapacity];
44+ _inputBuffer = new char_type[_bufferCapacity];
45+ _outputBuffer = new char_type[_bufferCapacity];
5046
5147 // init bzip2
5248 _bzstream.bzalloc = nullptr;
@@ -66,12 +62,12 @@ class basic_bzip2_encoder
6662 return _stream != nullptr;
6763 }
6864
69- ELEM_TYPE* get_buffer_begin() override
65+ char_type* get_buffer_begin() override
7066 {
7167 return _inputBuffer;
7268 }
7369
74- ELEM_TYPE* get_buffer_end() override
70+ char_type* get_buffer_end() override
7571 {
7672 return _inputBuffer + _bufferCapacity;
7773 }
@@ -122,13 +118,9 @@ class basic_bzip2_encoder
122118 bz_stream _bzstream; // internal bzip2 structure
123119 int _lastError = BZ_OK; // last error of bzip2 operation
124120
125- ostream_type* _stream = nullptr;
121+ std::ostream* _stream = nullptr;
126122
127123 size_t _bufferCapacity = 0;
128- ELEM_TYPE* _inputBuffer = nullptr; // pointer to the start of the input buffer
129- ELEM_TYPE* _outputBuffer = nullptr; // pointer to the start of the output buffer
124+ char_type* _inputBuffer = nullptr; // pointer to the start of the input buffer
125+ char_type* _outputBuffer = nullptr; // pointer to the start of the output buffer
130126 };
131-
132-typedef basic_bzip2_encoder<uint8_t, std::char_traits<uint8_t>> byte_bzip2_encoder;
133-typedef basic_bzip2_encoder<char, std::char_traits<char>> bzip2_encoder;
134-typedef basic_bzip2_encoder<wchar_t, std::char_traits<wchar_t>> wbzip2_encoder;
--- a/Source/ZipLib/compression/compression_interface.h
+++ b/Source/ZipLib/compression/compression_interface.h
@@ -16,56 +16,34 @@ struct compression_properties_interface
1616 size_t BufferCapacity = 1 << 15;
1717 };
1818
19-template <typename ELEM_TYPE, typename TRAITS_TYPE>
20-class compression_interface_basic
19+class compression_interface
2120 {
2221 public:
23- typedef std::basic_istream<ELEM_TYPE, TRAITS_TYPE> istream_type;
24- typedef std::basic_ostream<ELEM_TYPE, TRAITS_TYPE> ostream_type;
22+ typedef char char_type;
2523
26- virtual ~compression_interface_basic() { }
24+ virtual ~compression_interface() { }
2725
2826 virtual bool is_init() const = 0;
2927
30- virtual ELEM_TYPE* get_buffer_begin() = 0;
31- virtual ELEM_TYPE* get_buffer_end() = 0;
28+ virtual char_type* get_buffer_begin() = 0;
29+ virtual char_type* get_buffer_end() = 0;
3230 };
3331
34-template <typename ELEM_TYPE, typename TRAITS_TYPE>
35-class compression_encoder_interface_basic
36- : public compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>
32+class compression_encoder_interface
33+ : public compression_interface
3734 {
3835 public:
39- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
40- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
41-
42- virtual void init(ostream_type& stream) = 0;
43- virtual void init(ostream_type& stream, compression_properties_interface& props) = 0;
36+ virtual void init(std::ostream& stream) = 0;
37+ virtual void init(std::ostream& stream, compression_properties_interface& props) = 0;
4438 virtual void encode_next(size_t length) = 0;
4539 virtual void sync() = 0;
4640 };
4741
48-template <typename ELEM_TYPE, typename TRAITS_TYPE>
49-class compression_decoder_interface_basic
50- : public compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>
42+class compression_decoder_interface
43+ : public compression_interface
5144 {
5245 public:
53- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
54- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
55-
56- virtual void init(istream_type& stream) = 0;
57- virtual void init(istream_type& stream, compression_properties_interface& props) = 0;
46+ virtual void init(std::istream& stream) = 0;
47+ virtual void init(std::istream& stream, compression_properties_interface& props) = 0;
5848 virtual size_t decode_next() = 0;
5949 };
60-
61-typedef compression_interface_basic<uint8_t, std::char_traits<uint8_t>> byte_compression_interface;
62-typedef compression_interface_basic<char, std::char_traits<char>> compression_interface;
63-typedef compression_interface_basic<wchar_t, std::char_traits<wchar_t>> wcompression_interface;
64-
65-typedef compression_encoder_interface_basic<uint8_t, std::char_traits<uint8_t>> byte_compression_encoder_interface;
66-typedef compression_encoder_interface_basic<char, std::char_traits<char>> compression_encoder_interface;
67-typedef compression_encoder_interface_basic<wchar_t, std::char_traits<wchar_t>> wcompression_encoder_interface;
68-
69-typedef compression_decoder_interface_basic<uint8_t, std::char_traits<uint8_t>> byte_compression_decoder_interface;
70-typedef compression_decoder_interface_basic<char, std::char_traits<char>> compression_decoder_interface;
71-typedef compression_decoder_interface_basic<wchar_t, std::char_traits<wchar_t>> wcompression_decoder_interface;
--- a/Source/ZipLib/compression/deflate/deflate_decoder.h
+++ b/Source/ZipLib/compression/deflate/deflate_decoder.h
@@ -7,20 +7,16 @@
77
88 #include <cstdint>
99
10-template <typename ELEM_TYPE, typename TRAITS_TYPE>
11-class basic_deflate_decoder
12- : public compression_decoder_interface_basic<ELEM_TYPE, TRAITS_TYPE>
10+class deflate_decoder
11+ : public compression_decoder_interface
1312 {
1413 public:
15- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
16- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
17-
18- basic_deflate_decoder()
14+ deflate_decoder()
1915 {
2016
2117 }
2218
23- ~basic_deflate_decoder()
19+ ~deflate_decoder()
2420 {
2521 if (is_init())
2622 {
@@ -29,13 +25,13 @@ class basic_deflate_decoder
2925 }
3026 }
3127
32- void init(istream_type& stream) override
28+ void init(std::istream& stream) override
3329 {
3430 deflate_properties props;
3531 init(stream, props);
3632 }
3733
38- void init(istream_type& stream, compression_properties_interface& props) override
34+ void init(std::istream& stream, compression_properties_interface& props) override
3935 {
4036 // init stream
4137 _stream = &stream;
@@ -49,8 +45,8 @@ class basic_deflate_decoder
4945 _bufferCapacity = deflateProps.BufferCapacity;
5046
5147 uninit_buffers();
52- _inputBuffer = new ELEM_TYPE[_bufferCapacity];
53- _outputBuffer = new ELEM_TYPE[_bufferCapacity];
48+ _inputBuffer = new char_type[_bufferCapacity];
49+ _outputBuffer = new char_type[_bufferCapacity];
5450
5551 // init deflate
5652 _zstream.zalloc = nullptr;
@@ -70,12 +66,12 @@ class basic_deflate_decoder
7066 return (_inputBuffer != nullptr && _outputBuffer != nullptr);
7167 }
7268
73- ELEM_TYPE* get_buffer_begin() override
69+ char_type* get_buffer_begin() override
7470 {
7571 return _outputBuffer;
7672 }
7773
78- ELEM_TYPE* get_buffer_end() override
74+ char_type* get_buffer_end() override
7975 {
8076 return _outputBuffer + _outputBufferSize;
8177 }
@@ -122,7 +118,7 @@ class basic_deflate_decoder
122118 if (_zstream.avail_in > 0)
123119 {
124120 _stream->clear();
125- _stream->seekg(-static_cast<typename istream_type::off_type>(_zstream.avail_in), std::ios::cur);
121+ _stream->seekg(-static_cast<std::istream::off_type>(_zstream.avail_in), std::ios::cur);
126122 }
127123 }
128124
@@ -159,16 +155,12 @@ class basic_deflate_decoder
159155 z_stream _zstream; // internal zlib structure
160156 int _lastError = Z_OK; // last error of zlib operation
161157
162- istream_type* _stream = nullptr;
158+ std::istream* _stream = nullptr;
163159 bool _endOfStream = false;
164160
165161 size_t _bufferCapacity = 0;
166162 size_t _inputBufferSize = 0; // how many bytes are read in the input buffer
167163 size_t _outputBufferSize = 0; // how many bytes are written in the output buffer
168- ELEM_TYPE* _inputBuffer = nullptr; // pointer to the start of the input buffer
169- ELEM_TYPE* _outputBuffer = nullptr; // pointer to the start of the output buffer
164+ char_type* _inputBuffer = nullptr; // pointer to the start of the input buffer
165+ char_type* _outputBuffer = nullptr; // pointer to the start of the output buffer
170166 };
171-
172-typedef basic_deflate_decoder<uint8_t, std::char_traits<uint8_t>> byte_deflate_decoder;
173-typedef basic_deflate_decoder<char, std::char_traits<char>> deflate_decoder;
174-typedef basic_deflate_decoder<wchar_t, std::char_traits<wchar_t>> wdeflate_decoder;
--- a/Source/ZipLib/compression/deflate/deflate_encoder.h
+++ b/Source/ZipLib/compression/deflate/deflate_encoder.h
@@ -7,20 +7,16 @@
77
88 #include <cstdint>
99
10-template <typename ELEM_TYPE, typename TRAITS_TYPE>
11-class basic_deflate_encoder
12- : public compression_encoder_interface_basic<ELEM_TYPE, TRAITS_TYPE>
10+class deflate_encoder
11+ : public compression_encoder_interface
1312 {
1413 public:
15- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
16- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
17-
18- basic_deflate_encoder()
14+ deflate_encoder()
1915 {
2016
2117 }
2218
23- ~basic_deflate_encoder()
19+ ~deflate_encoder()
2420 {
2521 if (is_init())
2622 {
@@ -29,13 +25,13 @@ class basic_deflate_encoder
2925 }
3026 }
3127
32- void init(ostream_type& stream) override
28+ void init(std::ostream& stream) override
3329 {
3430 deflate_properties props;
3531 init(stream, props);
3632 }
3733
38- void init(ostream_type& stream, compression_properties_interface& props) override
34+ void init(std::ostream& stream, compression_properties_interface& props) override
3935 {
4036 // init stream
4137 _stream = &stream;
@@ -45,8 +41,8 @@ class basic_deflate_encoder
4541 _bufferCapacity = deflateProps.BufferCapacity;
4642
4743 uninit_buffers();
48- _inputBuffer = new ELEM_TYPE[_bufferCapacity];
49- _outputBuffer = new ELEM_TYPE[_bufferCapacity];
44+ _inputBuffer = new char_type[_bufferCapacity];
45+ _outputBuffer = new char_type[_bufferCapacity];
5046
5147 // init deflate
5248 _zstream.zalloc = nullptr;
@@ -66,12 +62,12 @@ class basic_deflate_encoder
6662 return _stream != nullptr;
6763 }
6864
69- ELEM_TYPE* get_buffer_begin() override
65+ char_type* get_buffer_begin() override
7066 {
7167 return _inputBuffer;
7268 }
7369
74- ELEM_TYPE* get_buffer_end() override
70+ char_type* get_buffer_end() override
7571 {
7672 return _inputBuffer + _bufferCapacity;
7773 }
@@ -122,13 +118,9 @@ class basic_deflate_encoder
122118 z_stream _zstream; // internal zlib structure
123119 int _lastError = Z_OK; // last error of zlib operation
124120
125- ostream_type* _stream = nullptr;
121+ std::ostream* _stream = nullptr;
126122
127123 size_t _bufferCapacity = 0;
128- ELEM_TYPE* _inputBuffer = nullptr; // pointer to the start of the input buffer
129- ELEM_TYPE* _outputBuffer = nullptr; // pointer to the start of the output buffer
124+ char_type* _inputBuffer = nullptr; // pointer to the start of the input buffer
125+ char_type* _outputBuffer = nullptr; // pointer to the start of the output buffer
130126 };
131-
132-typedef basic_deflate_encoder<uint8_t, std::char_traits<uint8_t>> byte_deflate_encoder;
133-typedef basic_deflate_encoder<char, std::char_traits<char>> deflate_encoder;
134-typedef basic_deflate_encoder<wchar_t, std::char_traits<wchar_t>> wdeflate_encoder;
--- a/Source/ZipLib/compression/lzma/detail/lzma_header.h
+++ b/Source/ZipLib/compression/lzma/detail/lzma_header.h
@@ -29,8 +29,7 @@ namespace detail
2929 LzmaEnc_WriteProperties(handle.get_native_handle(), &_header[4], &headerSize);
3030 }
3131
32- template <typename ELEM_TYPE, typename TRAITS_TYPE>
33- void write_to_stream(detail::lzma_out_stream<ELEM_TYPE, TRAITS_TYPE>& stream)
32+ void write_to_stream(detail::lzma_out_stream& stream)
3433 {
3534 stream.write(&_header, HEADER_SIZE);
3635 }
--- a/Source/ZipLib/compression/lzma/detail/lzma_in_stream.h
+++ b/Source/ZipLib/compression/lzma/detail/lzma_in_stream.h
@@ -5,21 +5,19 @@
55 #include <mutex>
66
77 // forward declaration
8-template <typename ELEM_TYPE_, typename TRAITS_TYPE_>
9-class basic_lzma_encoder;
8+class lzma_encoder;
109
1110 namespace detail
1211 {
13- template <typename ELEM_TYPE, typename TRAITS_TYPE>
1412 class lzma_in_stream
1513 : public ISeqInStream
1614 {
1715 public:
18- template <typename ELEM_TYPE_, typename TRAITS_TYPE_>
19- friend class ::basic_lzma_encoder;
16+ friend class ::lzma_encoder;
2017
21- typedef std::condition_variable event_t;
22- typedef std::mutex mutex_t;
18+ typedef char char_type;
19+ typedef std::condition_variable event_type;
20+ typedef std::mutex mutex_type;
2321
2422 lzma_in_stream()
2523 {
@@ -35,8 +33,8 @@ namespace detail
3533 size_t lastBytesRead = _bytesRead;
3634
3735 // set buffer pointer and get required size
38- _internalInputBuffer = static_cast<ELEM_TYPE*>(buf);
39- _internalBufferSize = *size / sizeof(ELEM_TYPE);
36+ _internalInputBuffer = static_cast<char_type*>(buf);
37+ _internalBufferSize = *size / sizeof(char_type);
4038
4139 // give control back to the main thread
4240 set_event();
@@ -61,13 +59,13 @@ namespace detail
6159 private:
6260 size_t _bytesRead = 0;
6361 size_t _internalBufferSize = 0;
64- ELEM_TYPE* _internalInputBuffer = nullptr;
65- event_t _event;
66- mutex_t _mutex;
62+ char_type* _internalInputBuffer = nullptr;
63+ event_type _event;
64+ mutex_type _mutex;
6765 bool _endOfStream = false;
6866
69- ELEM_TYPE* get_buffer_begin() { return _internalInputBuffer; }
70- ELEM_TYPE* get_buffer_end() { return _internalInputBuffer + _internalBufferSize; }
67+ char_type* get_buffer_begin() { return _internalInputBuffer; }
68+ char_type* get_buffer_end() { return _internalInputBuffer + _internalBufferSize; }
7169
7270 void set_event()
7371 {
@@ -76,7 +74,7 @@ namespace detail
7674
7775 void wait_for_event()
7876 {
79- std::unique_lock<std::mutex> lk(_mutex);
77+ std::unique_lock<mutex_type> lk(_mutex);
8078 _event.wait(lk);
8179 }
8280
--- a/Source/ZipLib/compression/lzma/detail/lzma_out_stream.h
+++ b/Source/ZipLib/compression/lzma/detail/lzma_out_stream.h
@@ -3,12 +3,11 @@
33
44 namespace detail
55 {
6- template <typename ELEM_TYPE, typename TRAITS_TYPE>
76 class lzma_out_stream
87 : public ISeqOutStream
98 {
109 public:
11- typedef std::basic_ostream<ELEM_TYPE, TRAITS_TYPE> ostream_type;
10+ typedef char char_type;
1211
1312 lzma_out_stream()
1413 {
@@ -22,18 +21,18 @@ namespace detail
2221 size_t write(const void* buf, size_t size)
2322 {
2423 auto currentPosition = _stream->tellp();
25- _stream->write(reinterpret_cast<const ELEM_TYPE*>(buf), size);
24+ _stream->write(reinterpret_cast<const char_type*>(buf), size);
2625
2726 size_t delta = static_cast<size_t>(_stream->tellp()) - static_cast<size_t>(currentPosition);
2827
2928 return delta;
3029 }
3130
32- const ostream_type& get_stream() const { return *_stream; }
33- ostream_type& get_stream() { return *_stream; }
34- void set_stream(ostream_type& stream) { _stream = &stream; }
31+ const std::ostream& get_stream() const { return *_stream; }
32+ std::ostream& get_stream() { return *_stream; }
33+ void set_stream(std::ostream& stream) { _stream = &stream; }
3534
3635 private:
37- ostream_type* _stream = nullptr;
36+ std::ostream* _stream = nullptr;
3837 };
3938 }
--- a/Source/ZipLib/compression/lzma/lzma_decoder.h
+++ b/Source/ZipLib/compression/lzma/lzma_decoder.h
@@ -8,20 +8,16 @@
88
99 #include <cstdint>
1010
11-template <typename ELEM_TYPE, typename TRAITS_TYPE>
12-class basic_lzma_decoder
13- : public compression_decoder_interface_basic<ELEM_TYPE, TRAITS_TYPE>
11+class lzma_decoder
12+ : public compression_decoder_interface
1413 {
1514 public:
16- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
17- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
18-
19- basic_lzma_decoder()
15+ lzma_decoder()
2016 {
2117 LzmaDec_Construct(&_handle);
2218 }
2319
24- ~basic_lzma_decoder()
20+ ~lzma_decoder()
2521 {
2622 if (is_init())
2723 {
@@ -30,13 +26,13 @@ class basic_lzma_decoder
3026 }
3127 }
3228
33- void init(istream_type& stream) override
29+ void init(std::istream& stream) override
3430 {
3531 lzma_properties props;
3632 init(stream, props);
3733 }
3834
39- void init(istream_type& stream, compression_properties_interface& props) override
35+ void init(std::istream& stream, compression_properties_interface& props) override
4036 {
4137 // init stream
4238 _stream = &stream;
@@ -50,12 +46,12 @@ class basic_lzma_decoder
5046 _bufferCapacity = lzmaProps.BufferCapacity;
5147
5248 uninit_buffers();
53- _inputBuffer = new ELEM_TYPE[_bufferCapacity];
54- _outputBuffer = new ELEM_TYPE[_bufferCapacity];
49+ _inputBuffer = new char_type[_bufferCapacity];
50+ _outputBuffer = new char_type[_bufferCapacity];
5551
5652 // read lzma header
5753 Byte header[LZMA_PROPS_SIZE + 4];
58- _stream->read(reinterpret_cast<ELEM_TYPE*>(header), sizeof(header) / sizeof(ELEM_TYPE));
54+ _stream->read(reinterpret_cast<char_type*>(header), sizeof(header) / sizeof(char_type));
5955
6056 // init lzma
6157 LzmaDec_Allocate(&_handle, &header[4], LZMA_PROPS_SIZE, &_alloc);
@@ -67,12 +63,12 @@ class basic_lzma_decoder
6763 return (_inputBuffer != nullptr && _outputBuffer != nullptr);
6864 }
6965
70- ELEM_TYPE* get_buffer_begin() override
66+ char_type* get_buffer_begin() override
7167 {
7268 return _outputBuffer;
7369 }
7470
75- ELEM_TYPE* get_buffer_end() override
71+ char_type* get_buffer_end() override
7672 {
7773 return _outputBuffer + _outputBufferSize;
7874 }
@@ -142,15 +138,11 @@ class basic_lzma_decoder
142138 SizeT _inProcessed = 0;
143139 SizeT _outProcessed = 0;
144140
145- istream_type* _stream = nullptr;
141+ std::istream* _stream = nullptr;
146142
147143 size_t _bufferCapacity = 0;
148144 size_t _inputBufferSize = 0; // how many bytes are read in the input buffer
149145 size_t _outputBufferSize = 0; // how many bytes are written in the output buffer
150- ELEM_TYPE* _inputBuffer = nullptr; // pointer to the start of the input buffer
151- ELEM_TYPE* _outputBuffer = nullptr; // pointer to the start of the output buffer
146+ char_type* _inputBuffer = nullptr; // pointer to the start of the input buffer
147+ char_type* _outputBuffer = nullptr; // pointer to the start of the output buffer
152148 };
153-
154-typedef basic_lzma_decoder<uint8_t, std::char_traits<uint8_t>> byte_lzma_decoder;
155-typedef basic_lzma_decoder<char, std::char_traits<char>> lzma_decoder;
156-typedef basic_lzma_decoder<wchar_t, std::char_traits<wchar_t>> wlzma_decoder;
--- a/Source/ZipLib/compression/lzma/lzma_encoder.h
+++ b/Source/ZipLib/compression/lzma/lzma_encoder.h
@@ -12,20 +12,16 @@
1212 #include <thread>
1313 #include <cstdint>
1414
15-template <typename ELEM_TYPE, typename TRAITS_TYPE>
16-class basic_lzma_encoder
17- : public compression_encoder_interface_basic<ELEM_TYPE, TRAITS_TYPE>
15+class lzma_encoder
16+ : public compression_encoder_interface
1817 {
1918 public:
20- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
21- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
22-
23- basic_lzma_encoder()
19+ lzma_encoder()
2420 {
2521
2622 }
2723
28- ~basic_lzma_encoder()
24+ ~lzma_encoder()
2925 {
3026 if (is_init())
3127 {
@@ -33,13 +29,13 @@ class basic_lzma_encoder
3329 }
3430 }
3531
36- void init(ostream_type& stream) override
32+ void init(std::ostream& stream) override
3733 {
3834 lzma_properties props;
3935 init(stream, props);
4036 }
4137
42- void init(ostream_type& stream, compression_properties_interface& props) override
38+ void init(std::ostream& stream, compression_properties_interface& props) override
4339 {
4440 lzma_properties& lzmaProps = static_cast<lzma_properties&>(props);
4541
@@ -54,12 +50,12 @@ class basic_lzma_encoder
5450 return &_ostream.get_stream() != nullptr;
5551 }
5652
57- ELEM_TYPE* get_buffer_begin() override
53+ char_type* get_buffer_begin() override
5854 {
5955 return _istream.get_buffer_begin();
6056 }
6157
62- ELEM_TYPE* get_buffer_end() override
58+ char_type* get_buffer_end() override
6359 {
6460 return _istream.get_buffer_end();
6561 }
@@ -84,7 +80,7 @@ class basic_lzma_encoder
8480 header.apply(_handle);
8581 header.write_to_stream(_ostream);
8682
87- _compressionThread = std::thread(&basic_lzma_encoder::encode_threadroutine, this);
83+ _compressionThread = std::thread(&lzma_encoder::encode_threadroutine, this);
8884
8985 _istream.wait_for_event();
9086 }
@@ -96,12 +92,8 @@ class basic_lzma_encoder
9692
9793 detail::lzma_handle _handle;
9894 detail::lzma_alloc _alloc;
99- detail::lzma_in_stream<ELEM_TYPE, TRAITS_TYPE> _istream;
100- detail::lzma_out_stream<ELEM_TYPE, TRAITS_TYPE> _ostream;
95+ detail::lzma_in_stream _istream;
96+ detail::lzma_out_stream _ostream;
10197
10298 std::thread _compressionThread;
10399 };
104-
105-typedef basic_lzma_encoder<uint8_t, std::char_traits<uint8_t>> byte_lzma_encoder;
106-typedef basic_lzma_encoder<char, std::char_traits<char>> lzma_encoder;
107-typedef basic_lzma_encoder<wchar_t, std::char_traits<wchar_t>> wlzma_encoder;
--- a/Source/ZipLib/compression/store/store_decoder.h
+++ b/Source/ZipLib/compression/store/store_decoder.h
@@ -8,20 +8,16 @@
88
99 #include <cstdint>
1010
11-template <typename ELEM_TYPE, typename TRAITS_TYPE>
12-class basic_store_decoder
13- : public compression_decoder_interface_basic<ELEM_TYPE, TRAITS_TYPE>
11+class store_decoder
12+ : public compression_decoder_interface
1413 {
1514 public:
16- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
17- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
18-
19- basic_store_decoder()
15+ store_decoder()
2016 {
2117
2218 }
2319
24- ~basic_store_decoder()
20+ ~store_decoder()
2521 {
2622 if (is_init())
2723 {
@@ -29,13 +25,13 @@ class basic_store_decoder
2925 }
3026 }
3127
32- void init(istream_type& stream) override
28+ void init(std::istream& stream) override
3329 {
3430 store_properties props;
3531 init(stream, props);
3632 }
3733
38- void init(istream_type& stream, compression_properties_interface& props) override
34+ void init(std::istream& stream, compression_properties_interface& props) override
3935 {
4036 // init stream
4137 _stream = &stream;
@@ -48,7 +44,7 @@ class basic_store_decoder
4844 _bufferCapacity = storeProps.BufferCapacity;
4945
5046 uninit_buffers();
51- _outputBuffer = new ELEM_TYPE[_bufferCapacity];
47+ _outputBuffer = new char_type[_bufferCapacity];
5248 }
5349
5450 bool is_init() const override
@@ -56,12 +52,12 @@ class basic_store_decoder
5652 return (_outputBuffer != nullptr);
5753 }
5854
59- ELEM_TYPE* get_buffer_begin() override
55+ char_type* get_buffer_begin() override
6056 {
6157 return _outputBuffer;
6258 }
6359
64- ELEM_TYPE* get_buffer_end() override
60+ char_type* get_buffer_end() override
6561 {
6662 return _outputBuffer + _outputBufferSize;
6763 }
@@ -84,13 +80,9 @@ class basic_store_decoder
8480 delete[] _outputBuffer;
8581 }
8682
87- istream_type* _stream = nullptr;
83+ std::istream* _stream = nullptr;
8884
8985 size_t _bufferCapacity = 0;
9086 size_t _outputBufferSize = 0; // how many bytes are written in the output buffer
91- ELEM_TYPE* _outputBuffer = nullptr; // pointer to the start of the output buffer
87+ char_type* _outputBuffer = nullptr; // pointer to the start of the output buffer
9288 };
93-
94-typedef basic_store_decoder<uint8_t, std::char_traits<uint8_t>> byte_store_decoder;
95-typedef basic_store_decoder<char, std::char_traits<char>> store_decoder;
96-typedef basic_store_decoder<wchar_t, std::char_traits<wchar_t>> wstore_decoder;
--- a/Source/ZipLib/compression/store/store_encoder.h
+++ b/Source/ZipLib/compression/store/store_encoder.h
@@ -8,20 +8,16 @@
88
99 #include <cstdint>
1010
11-template <typename ELEM_TYPE, typename TRAITS_TYPE>
12-class basic_store_encoder
13- : public compression_encoder_interface_basic<ELEM_TYPE, TRAITS_TYPE>
11+class store_encoder
12+ : public compression_encoder_interface
1413 {
1514 public:
16- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
17- typedef typename compression_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
18-
19- basic_store_encoder()
15+ store_encoder()
2016 {
2117
2218 }
2319
24- ~basic_store_encoder()
20+ ~store_encoder()
2521 {
2622 if (is_init())
2723 {
@@ -29,13 +25,13 @@ class basic_store_encoder
2925 }
3026 }
3127
32- void init(ostream_type& stream) override
28+ void init(std::ostream& stream) override
3329 {
3430 store_properties props;
3531 init(stream, props);
3632 }
3733
38- void init(ostream_type& stream, compression_properties_interface& props) override
34+ void init(std::ostream& stream, compression_properties_interface& props) override
3935 {
4036 // init stream
4137 _stream = &stream;
@@ -45,8 +41,8 @@ class basic_store_encoder
4541 _bufferCapacity = storeProps.BufferCapacity;
4642
4743 uninit_buffers();
48- _inputBuffer = new ELEM_TYPE[_bufferCapacity];
49- _outputBuffer = new ELEM_TYPE[_bufferCapacity];
44+ _inputBuffer = new char_type[_bufferCapacity];
45+ _outputBuffer = new char_type[_bufferCapacity];
5046 }
5147
5248 bool is_init() const override
@@ -54,12 +50,12 @@ class basic_store_encoder
5450 return _stream != nullptr;
5551 }
5652
57- ELEM_TYPE* get_buffer_begin() override
53+ char_type* get_buffer_begin() override
5854 {
5955 return _inputBuffer;
6056 }
6157
62- ELEM_TYPE* get_buffer_end() override
58+ char_type* get_buffer_end() override
6359 {
6460 return _inputBuffer + _bufferCapacity;
6561 }
@@ -81,13 +77,9 @@ class basic_store_encoder
8177 delete[] _outputBuffer;
8278 }
8379
84- ostream_type* _stream = nullptr;
80+ std::ostream* _stream = nullptr;
8581
8682 size_t _bufferCapacity = 0;
87- ELEM_TYPE* _inputBuffer = nullptr; // pointer to the start of the input buffer
88- ELEM_TYPE* _outputBuffer = nullptr; // pointer to the start of the output buffer
83+ char_type* _inputBuffer = nullptr; // pointer to the start of the input buffer
84+ char_type* _outputBuffer = nullptr; // pointer to the start of the output buffer
8985 };
90-
91-typedef basic_store_encoder<uint8_t, std::char_traits<uint8_t>> byte_store_encoder;
92-typedef basic_store_encoder<char, std::char_traits<char>> store_encoder;
93-typedef basic_store_encoder<wchar_t, std::char_traits<wchar_t>> wstore_encoder;
--- a/Source/ZipLib/encryption/aes/aes_decoder.h
+++ b/Source/ZipLib/encryption/aes/aes_decoder.h
@@ -6,20 +6,16 @@
66
77 #include <cstdint>
88
9-template <typename ELEM_TYPE, typename TRAITS_TYPE>
10-class basic_aes_decoder
11- : public encryption_decoder_interface_basic<ELEM_TYPE, TRAITS_TYPE>
9+class aes_decoder
10+ : public encryption_decoder_interface
1211 {
1312 public:
14- typedef typename encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
15- typedef typename encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
16-
17- basic_aes_decoder()
13+ aes_decoder()
1814 {
1915
2016 }
2117
22- ~basic_aes_decoder()
18+ ~aes_decoder()
2319 {
2420 if (is_init())
2521 {
@@ -27,20 +23,20 @@ class basic_aes_decoder
2723 }
2824 }
2925
30- void init(istream_type& stream) override
26+ void init(std::istream& stream) override
3127 {
3228 aes_properties props;
3329 init(stream, props);
3430 }
3531
36- void init(istream_type& stream, encryption_properties_interface& props) override
32+ void init(std::istream& stream, encryption_properties_interface& props) override
3733 {
3834 // init buffers
3935 aes_properties& aesProps = static_cast<aes_properties&>(props);
4036 _bufferCapacity = aesProps.BufferCapacity;
4137
4238 uninit_buffers();
43- _inputBuffer = new ELEM_TYPE[_bufferCapacity];
39+ _inputBuffer = new char_type[_bufferCapacity];
4440
4541 // init stream
4642 _stream = &stream;
@@ -65,12 +61,12 @@ class basic_aes_decoder
6561 return _stream != nullptr && _encryptedStream != nullptr && _authCodeStream != nullptr;
6662 }
6763
68- ELEM_TYPE* get_buffer_begin() override
64+ char_type* get_buffer_begin() override
6965 {
7066 return _inputBuffer;
7167 }
7268
73- ELEM_TYPE* get_buffer_end() override
69+ char_type* get_buffer_end() override
7470 {
7571 return _inputBuffer + _bufferCapacity;
7672 }
@@ -137,10 +133,10 @@ class basic_aes_decoder
137133 delete[] _inputBuffer;
138134 }
139135
140- ELEM_TYPE* _inputBuffer = nullptr;
136+ char_type* _inputBuffer = nullptr;
141137 size_t _bufferCapacity = 0;
142138
143- istream_type* _stream = nullptr;
139+ std::istream* _stream = nullptr;
144140 std::unique_ptr<isubstream> _encryptedStream;
145141 std::unique_ptr<isubstream> _authCodeStream;
146142
@@ -164,7 +160,3 @@ class basic_aes_decoder
164160 bool _encryptionHeaderRead = false;
165161 bool _encryptionFooterRead = false;
166162 };
167-
168-typedef basic_aes_decoder<uint8_t, std::char_traits<uint8_t>> byte_aes_decoder;
169-typedef basic_aes_decoder<char, std::char_traits<char>> aes_decoder;
170-typedef basic_aes_decoder<wchar_t, std::char_traits<wchar_t>> waes_decoder;
--- a/Source/ZipLib/encryption/aes/aes_encoder.h
+++ b/Source/ZipLib/encryption/aes/aes_encoder.h
@@ -6,20 +6,16 @@
66
77 #include <cstdint>
88
9-template <typename ELEM_TYPE, typename TRAITS_TYPE>
10-class basic_aes_encoder
11- : public encryption_encoder_interface_basic<ELEM_TYPE, TRAITS_TYPE>
9+class aes_encoder
10+ : public encryption_encoder_interface
1211 {
1312 public:
14- typedef typename encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
15- typedef typename encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
16-
17- basic_aes_encoder()
13+ aes_encoder()
1814 {
1915
2016 }
2117
22- ~basic_aes_encoder()
18+ ~aes_encoder()
2319 {
2420 if (is_init())
2521 {
@@ -27,20 +23,20 @@ class basic_aes_encoder
2723 }
2824 }
2925
30- void init(ostream_type& stream) override
26+ void init(std::ostream& stream) override
3127 {
3228 aes_properties props;
3329 init(stream, props);
3430 }
3531
36- void init(ostream_type& stream, encryption_properties_interface& props) override
32+ void init(std::ostream& stream, encryption_properties_interface& props) override
3733 {
3834 // init buffers
3935 aes_properties& aesProps = static_cast<aes_properties&>(props);
4036 _bufferCapacity = aesProps.BufferCapacity;
4137
4238 uninit_buffers();
43- _inputBuffer = new ELEM_TYPE[_bufferCapacity];
39+ _inputBuffer = new char_type[_bufferCapacity];
4440
4541 // init stream
4642 _stream = &stream;
@@ -58,12 +54,12 @@ class basic_aes_encoder
5854 return _stream != nullptr;
5955 }
6056
61- ELEM_TYPE* get_buffer_begin() override
57+ char_type* get_buffer_begin() override
6258 {
6359 return _inputBuffer;
6460 }
6561
66- ELEM_TYPE* get_buffer_end() override
62+ char_type* get_buffer_end() override
6763 {
6864 return _inputBuffer + _bufferCapacity;
6965 }
@@ -99,10 +95,10 @@ class basic_aes_encoder
9995 delete[] _inputBuffer;
10096 }
10197
102- ELEM_TYPE* _inputBuffer = nullptr;
98+ char_type* _inputBuffer = nullptr;
10399 size_t _bufferCapacity = 0;
104100
105- ostream_type* _stream = nullptr;
101+ std::ostream* _stream = nullptr;
106102
107103 struct aes_context
108104 {
@@ -115,7 +111,3 @@ class basic_aes_encoder
115111
116112 bool _encryptionHeaderWritten = false;
117113 };
118-
119-typedef basic_aes_encoder<uint8_t, std::char_traits<uint8_t>> byte_aes_encoder;
120-typedef basic_aes_encoder<char, std::char_traits<char>> aes_encoder;
121-typedef basic_aes_encoder<wchar_t, std::char_traits<wchar_t>> waes_encoder;
--- a/Source/ZipLib/encryption/encryption_interface.h
+++ b/Source/ZipLib/encryption/encryption_interface.h
@@ -18,57 +18,35 @@ struct encryption_properties_interface
1818 std::string Password;
1919 };
2020
21-template <typename ELEM_TYPE, typename TRAITS_TYPE>
22-class encryption_interface_basic
21+class encryption_interface
2322 {
2423 public:
25- typedef std::basic_istream<ELEM_TYPE, TRAITS_TYPE> istream_type;
26- typedef std::basic_ostream<ELEM_TYPE, TRAITS_TYPE> ostream_type;
24+ typedef char char_type;
2725
28- virtual ~encryption_interface_basic() { }
26+ virtual ~encryption_interface() { }
2927
3028 virtual bool is_init() const = 0;
3129
32- virtual ELEM_TYPE* get_buffer_begin() = 0;
33- virtual ELEM_TYPE* get_buffer_end() = 0;
30+ virtual char_type* get_buffer_begin() = 0;
31+ virtual char_type* get_buffer_end() = 0;
3432 };
3533
36-template <typename ELEM_TYPE, typename TRAITS_TYPE>
37-class encryption_encoder_interface_basic
38- : public encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>
34+class encryption_encoder_interface
35+ : public encryption_interface
3936 {
4037 public:
41- typedef typename encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
42- typedef typename encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
43-
44- virtual void init(ostream_type& stream) = 0;
45- virtual void init(ostream_type& stream, encryption_properties_interface& props) = 0;
38+ virtual void init(std::ostream& stream) = 0;
39+ virtual void init(std::ostream& stream, encryption_properties_interface& props) = 0;
4640 virtual void encrypt_next(size_t length) = 0;
4741 virtual void sync() = 0;
4842 };
4943
50-template <typename ELEM_TYPE, typename TRAITS_TYPE>
51-class encryption_decoder_interface_basic
52- : public encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>
44+class encryption_decoder_interface
45+ : public encryption_interface
5346 {
5447 public:
55- typedef typename encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
56- typedef typename encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
57-
58- virtual void init(istream_type& stream) = 0;
59- virtual void init(istream_type& stream, encryption_properties_interface& props) = 0;
48+ virtual void init(std::istream& stream) = 0;
49+ virtual void init(std::istream& stream, encryption_properties_interface& props) = 0;
6050 virtual size_t decrypt_next() = 0;
6151 virtual bool has_correct_password() const = 0;
6252 };
63-
64-typedef encryption_interface_basic<uint8_t, std::char_traits<uint8_t>> byte_encryption_interface;
65-typedef encryption_interface_basic<char, std::char_traits<char>> encryption_interface;
66-typedef encryption_interface_basic<wchar_t, std::char_traits<wchar_t>> wencryption_interface;
67-
68-typedef encryption_encoder_interface_basic<uint8_t, std::char_traits<uint8_t>> byte_encryption_encoder_interface;
69-typedef encryption_encoder_interface_basic<char, std::char_traits<char>> encryption_encoder_interface;
70-typedef encryption_encoder_interface_basic<wchar_t, std::char_traits<wchar_t>> wencryption_encoder_interface;
71-
72-typedef encryption_decoder_interface_basic<uint8_t, std::char_traits<uint8_t>> byte_encryption_decoder_interface;
73-typedef encryption_decoder_interface_basic<char, std::char_traits<char>> encryption_decoder_interface;
74-typedef encryption_decoder_interface_basic<wchar_t, std::char_traits<wchar_t>> wencryption_decoder_interface;
--- a/Source/ZipLib/encryption/zipcrypto/zipcrypto_decoder.h
+++ b/Source/ZipLib/encryption/zipcrypto/zipcrypto_decoder.h
@@ -6,20 +6,16 @@
66
77 #include <cstdint>
88
9-template <typename ELEM_TYPE, typename TRAITS_TYPE>
10-class basic_zipcrypto_decoder
11- : public encryption_decoder_interface_basic<ELEM_TYPE, TRAITS_TYPE>
9+class zipcrypto_decoder
10+ : public encryption_decoder_interface
1211 {
1312 public:
14- typedef typename encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
15- typedef typename encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
16-
17- basic_zipcrypto_decoder()
13+ zipcrypto_decoder()
1814 {
1915
2016 }
2117
22- ~basic_zipcrypto_decoder()
18+ ~zipcrypto_decoder()
2319 {
2420 if (is_init())
2521 {
@@ -27,20 +23,20 @@ class basic_zipcrypto_decoder
2723 }
2824 }
2925
30- void init(istream_type& stream) override
26+ void init(std::istream& stream) override
3127 {
3228 zipcrypto_properties props;
3329 init(stream, props);
3430 }
3531
36- void init(istream_type& stream, encryption_properties_interface& props) override
32+ void init(std::istream& stream, encryption_properties_interface& props) override
3733 {
3834 // init buffers
3935 zipcrypto_properties& zipcryptoProps = static_cast<zipcrypto_properties&>(props);
4036 _bufferCapacity = zipcryptoProps.BufferCapacity;
4137
4238 uninit_buffers();
43- _inputBuffer = new ELEM_TYPE[_bufferCapacity];
39+ _inputBuffer = new char_type[_bufferCapacity];
4440
4541 // init stream
4642 _stream = &stream;
@@ -61,12 +57,12 @@ class basic_zipcrypto_decoder
6157 return _stream != nullptr;
6258 }
6359
64- ELEM_TYPE* get_buffer_begin() override
60+ char_type* get_buffer_begin() override
6561 {
6662 return _inputBuffer;
6763 }
6864
69- ELEM_TYPE* get_buffer_end() override
65+ char_type* get_buffer_end() override
7066 {
7167 return _inputBuffer + _bufferCapacity;
7268 }
@@ -95,7 +91,7 @@ class basic_zipcrypto_decoder
9591 void read_encryption_header()
9692 {
9793 _stream->read(
98- reinterpret_cast<ELEM_TYPE*>(&_zipcrypto.get_encryption_header()),
94+ reinterpret_cast<char_type*>(&_zipcrypto.get_encryption_header()),
9995 _zipcrypto.get_encryption_header_size());
10096
10197 _zipcrypto.decrypt_header();
@@ -107,14 +103,10 @@ class basic_zipcrypto_decoder
107103 delete[] _inputBuffer;
108104 }
109105
110- ELEM_TYPE* _inputBuffer = nullptr;
106+ char_type* _inputBuffer = nullptr;
111107 size_t _bufferCapacity = 0;
112108
113- istream_type* _stream = nullptr;
109+ std::istream* _stream = nullptr;
114110 detail::zipcrypto _zipcrypto;
115111 bool _encryptionHeaderRead = false;
116112 };
117-
118-typedef basic_zipcrypto_decoder<uint8_t, std::char_traits<uint8_t>> byte_zipcrypto_decoder;
119-typedef basic_zipcrypto_decoder<char, std::char_traits<char>> zipcrypto_decoder;
120-typedef basic_zipcrypto_decoder<wchar_t, std::char_traits<wchar_t>> wzipcrypto_decoder;
--- a/Source/ZipLib/encryption/zipcrypto/zipcrypto_encoder.h
+++ b/Source/ZipLib/encryption/zipcrypto/zipcrypto_encoder.h
@@ -5,20 +5,16 @@
55
66 #include <cstdint>
77
8-template <typename ELEM_TYPE, typename TRAITS_TYPE>
9-class basic_zipcrypto_encoder
10- : public encryption_encoder_interface_basic<ELEM_TYPE, TRAITS_TYPE>
8+class zipcrypto_encoder
9+ : public encryption_encoder_interface
1110 {
1211 public:
13- typedef typename encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
14- typedef typename encryption_interface_basic<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
15-
16- basic_zipcrypto_encoder()
12+ zipcrypto_encoder()
1713 {
1814
1915 }
2016
21- ~basic_zipcrypto_encoder()
17+ ~zipcrypto_encoder()
2218 {
2319 if (is_init())
2420 {
@@ -26,20 +22,20 @@ class basic_zipcrypto_encoder
2622 }
2723 }
2824
29- void init(ostream_type& stream) override
25+ void init(std::ostream& stream) override
3026 {
3127 zipcrypto_properties props;
3228 init(stream, props);
3329 }
3430
35- void init(ostream_type& stream, encryption_properties_interface& props) override
31+ void init(std::ostream& stream, encryption_properties_interface& props) override
3632 {
3733 // init buffers
3834 zipcrypto_properties& zipcryptoProps = static_cast<zipcrypto_properties&>(props);
3935 _bufferCapacity = zipcryptoProps.BufferCapacity;
4036
4137 uninit_buffers();
42- _inputBuffer = new ELEM_TYPE[_bufferCapacity];
38+ _inputBuffer = new char_type[_bufferCapacity];
4339
4440 // init stream
4541 _stream = &stream;
@@ -57,12 +53,12 @@ class basic_zipcrypto_encoder
5753 return _stream != nullptr;
5854 }
5955
60- ELEM_TYPE* get_buffer_begin() override
56+ char_type* get_buffer_begin() override
6157 {
6258 return _inputBuffer;
6359 }
6460
65- ELEM_TYPE* get_buffer_end() override
61+ char_type* get_buffer_end() override
6662 {
6763 return _inputBuffer + _bufferCapacity;
6864 }
@@ -88,7 +84,7 @@ class basic_zipcrypto_encoder
8884 {
8985 _zipcrypto.encrypt_header();
9086 _stream->write(
91- reinterpret_cast<const ELEM_TYPE*>(&_zipcrypto.get_encryption_header()),
87+ reinterpret_cast<const char_type*>(&_zipcrypto.get_encryption_header()),
9288 _zipcrypto.get_encryption_header_size());
9389
9490 _encryptionHeaderWritten = true;
@@ -99,14 +95,10 @@ class basic_zipcrypto_encoder
9995 delete[] _inputBuffer;
10096 }
10197
102- ELEM_TYPE* _inputBuffer = nullptr;
98+ char_type* _inputBuffer = nullptr;
10399 size_t _bufferCapacity = 0;
104100
105- ostream_type* _stream = nullptr;
101+ std::ostream* _stream = nullptr;
106102 detail::zipcrypto _zipcrypto;
107103 bool _encryptionHeaderWritten = false;
108104 };
109-
110-typedef basic_zipcrypto_encoder<uint8_t, std::char_traits<uint8_t>> byte_zipcrypto_encoder;
111-typedef basic_zipcrypto_encoder<char, std::char_traits<char>> zipcrypto_encoder;
112-typedef basic_zipcrypto_encoder<wchar_t, std::char_traits<wchar_t>> wzipcrypto_encoder;
--- a/Source/ZipLib/methods/CompressionMethod.h
+++ b/Source/ZipLib/methods/CompressionMethod.h
@@ -13,13 +13,13 @@ class CompressionMethod
1313 , public std::enable_shared_from_this<CompressionMethod>
1414 {
1515 public:
16- typedef std::shared_ptr<CompressionMethod> Ptr;
17- typedef std::shared_ptr<EncryptionMethod> EncryptionMethodPtr;
18- typedef std::shared_ptr<ZipArchiveEntry> ZipArchiveEntryPtr;
16+ typedef std::shared_ptr<CompressionMethod> Ptr;
17+ typedef std::shared_ptr<EncryptionMethod> EncryptionMethodPtr;
18+ typedef std::shared_ptr<ZipArchiveEntry> ZipArchiveEntryPtr;
1919
20- typedef CompressionMethodBase::encoder_t encoder_t;
21- typedef CompressionMethodBase::decoder_t decoder_t;
22- typedef CompressionMethodBase::properties_t properties_t;
20+ typedef CompressionMethodBase::encoder_type encoder_type;
21+ typedef CompressionMethodBase::decoder_type decoder_type;
22+ typedef CompressionMethodBase::properties_type properties_type;
2323
2424 EncryptionMethodPtr GetEncryptionMethod() const;
2525 void SetEncryptionMethod(EncryptionMethodPtr encryptionMethod);
--- a/Source/ZipLib/methods/EncryptionMethod.h
+++ b/Source/ZipLib/methods/EncryptionMethod.h
@@ -18,13 +18,13 @@ class EncryptionMethod
1818 friend class ZipMethodResolver;
1919
2020 public:
21- typedef std::shared_ptr<EncryptionMethod> Ptr;
22- typedef std::shared_ptr<CompressionMethod> CompressionMethodPtr;
23- typedef std::shared_ptr<ZipArchiveEntry> ZipArchiveEntryPtr;
21+ typedef std::shared_ptr<EncryptionMethod> Ptr;
22+ typedef std::shared_ptr<CompressionMethod> CompressionMethodPtr;
23+ typedef std::shared_ptr<ZipArchiveEntry> ZipArchiveEntryPtr;
2424
25- typedef EncryptionMethodBase::encoder_t encoder_t;
26- typedef EncryptionMethodBase::decoder_t decoder_t;
27- typedef EncryptionMethodBase::properties_t properties_t;
25+ typedef EncryptionMethodBase::encoder_type encoder_type;
26+ typedef EncryptionMethodBase::decoder_type decoder_type;
27+ typedef EncryptionMethodBase::properties_type properties_type;
2828
2929 CompressionMethodPtr GetCompressionMethod() const;
3030
--- a/Source/ZipLib/methods/MethodTemplate.h
+++ b/Source/ZipLib/methods/MethodTemplate.h
@@ -12,10 +12,10 @@ class MethodTemplate
1212 : public BASE_METHOD_CLASS
1313 {
1414 public:
15- typedef std::shared_ptr<METHOD_CLASS> Ptr;
16- typedef typename BASE_METHOD_CLASS::encoder_t encoder_t;
17- typedef typename BASE_METHOD_CLASS::decoder_t decoder_t;
18- typedef typename BASE_METHOD_CLASS::properties_t properties_t;
15+ typedef std::shared_ptr<METHOD_CLASS> Ptr;
16+ typedef typename BASE_METHOD_CLASS::encoder_type encoder_type;
17+ typedef typename BASE_METHOD_CLASS::decoder_type decoder_type;
18+ typedef typename BASE_METHOD_CLASS::properties_type properties_type;
1919
2020 static const uint16_t CompressionMethod = COMPRESSION_METHOD;
2121 static const uint16_t VersionNeededToExtract = VERSION_NEEDED_TO_EXTRACT;
@@ -31,7 +31,7 @@ class MethodTemplate
3131 return std::make_shared<METHOD_CLASS>();
3232 }
3333
34- properties_t& GetProperties() override
34+ properties_type& GetProperties() override
3535 {
3636 _properties.normalize();
3737 return _properties;
--- a/Source/ZipLib/methods/ZipMethod.h
+++ b/Source/ZipLib/methods/ZipMethod.h
@@ -37,22 +37,22 @@ class ZipMethod
3737 : public ZipMethodBase
3838 {
3939 public:
40- typedef std::shared_ptr<ENCODER_TYPE> encoder_t;
41- typedef std::shared_ptr<DECODER_TYPE> decoder_t;
42- typedef PROPS_TYPE properties_t;
40+ typedef std::shared_ptr<ENCODER_TYPE> encoder_type;
41+ typedef std::shared_ptr<DECODER_TYPE> decoder_type;
42+ typedef PROPS_TYPE properties_type;
4343
44- void SetEncoder(encoder_t encoder) { _encoder = encoder; }
45- void SetDecoder(decoder_t decoder) { _decoder = decoder; }
44+ void SetEncoder(encoder_type encoder) { _encoder = encoder; }
45+ void SetDecoder(decoder_type decoder) { _decoder = decoder; }
4646
47- encoder_t GetEncoder() const { return _encoder; }
48- decoder_t GetDecoder() const { return _decoder; }
47+ encoder_type GetEncoder() const { return _encoder; }
48+ decoder_type GetDecoder() const { return _decoder; }
4949
50- virtual properties_t& GetProperties() = 0;
50+ virtual properties_type& GetProperties() = 0;
5151
5252 protected:
5353 ZipMethod() { }
5454
5555 private:
56- encoder_t _encoder;
57- decoder_t _decoder;
56+ encoder_type _encoder;
57+ decoder_type _decoder;
5858 };
--- a/Source/ZipLib/methods/encryption/detail/AesExtraField.h
+++ b/Source/ZipLib/methods/encryption/detail/AesExtraField.h
@@ -32,7 +32,7 @@ namespace detail {
3232 return;
3333 }
3434
35- byte_imemstream extraFieldDataStream(extraField.Data.data(), extraField.Data.size());
35+ imemstream extraFieldDataStream((const char*)extraField.Data.data(), extraField.Data.size());
3636
3737 uint16_t dummyVendorID;
3838
@@ -49,7 +49,7 @@ namespace detail {
4949
5050 extraField.Data.resize(SIZE_IN_BYTES);
5151
52- byte_omemstream extraFieldDataStream(extraField.Data.data(), extraField.Data.size());
52+ omemstream extraFieldDataStream((char*)extraField.Data.data(), extraField.Data.size());
5353
5454 serialize(extraFieldDataStream, AesVersion);
5555 serialize(extraFieldDataStream, VendorID);
--- a/Source/ZipLib/streams/auditstream.h
+++ b/Source/ZipLib/streams/auditstream.h
@@ -2,27 +2,24 @@
22 #include <iostream>
33 #include "streambuffs/audit_streambuf.h"
44
5-template <typename ELEM_TYPE, typename TRAITS_TYPE>
6-class basic_iauditstream
7- : public std::basic_istream<ELEM_TYPE, TRAITS_TYPE>
5+class iauditstream
6+ : public std::istream
87 {
98 public:
10- typedef std::basic_ios<ELEM_TYPE, TRAITS_TYPE> stream_type;
11-
12- basic_iauditstream()
13- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_auditStreambuf)
9+ iauditstream()
10+ : std::istream(&_auditStreambuf)
1411 {
1512
1613 }
1714
18- basic_iauditstream(stream_type& stream)
19- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_auditStreambuf)
15+ iauditstream(std::ios& stream)
16+ : std::istream(&_auditStreambuf)
2017 , _auditStreambuf(stream)
2118 {
2219
2320 }
2421
25- void set_stream(stream_type& stream)
22+ void set_stream(std::ios& stream)
2623 {
2724 _auditStreambuf.set_stream(stream);
2825 }
@@ -33,30 +30,27 @@ class basic_iauditstream
3330 }
3431
3532 private:
36- audit_streambuf<ELEM_TYPE, TRAITS_TYPE> _auditStreambuf;
33+ audit_streambuf _auditStreambuf;
3734 };
3835
39-template <typename ELEM_TYPE, typename TRAITS_TYPE>
40-class basic_oauditstream
41- : public std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>
36+class oauditstream
37+ : public std::ostream
4238 {
4339 public:
44- typedef std::basic_ios<ELEM_TYPE, TRAITS_TYPE> stream_type;
45-
46- basic_oauditstream()
47- : std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>(&_auditStreambuf)
40+ oauditstream()
41+ : std::ostream(&_auditStreambuf)
4842 {
4943
5044 }
5145
52- basic_oauditstream(stream_type& stream)
53- : std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>(&_auditStreambuf)
46+ oauditstream(std::ios& stream)
47+ : std::ostream(&_auditStreambuf)
5448 , _auditStreambuf(stream)
5549 {
5650
5751 }
5852
59- void set_stream(stream_type& stream)
53+ void set_stream(std::ios& stream)
6054 {
6155 _auditStreambuf.set_stream(stream);
6256 }
@@ -67,30 +61,27 @@ class basic_oauditstream
6761 }
6862
6963 private:
70- audit_streambuf<ELEM_TYPE, TRAITS_TYPE> _auditStreambuf;
64+ audit_streambuf _auditStreambuf;
7165 };
7266
73-template <typename ELEM_TYPE, typename TRAITS_TYPE>
74-class basic_ioauditstream
75- : public std::basic_iostream<ELEM_TYPE, TRAITS_TYPE>
67+class ioauditstream
68+ : public std::iostream
7669 {
7770 public:
78- typedef std::basic_ios<ELEM_TYPE, TRAITS_TYPE> stream_type;
79-
80- basic_ioauditstream()
81- : std::basic_iostream<ELEM_TYPE, TRAITS_TYPE>(&_auditStreambuf)
71+ ioauditstream()
72+ : std::iostream(&_auditStreambuf)
8273 {
8374
8475 }
8576
86- basic_ioauditstream(stream_type& stream)
87- : std::basic_iostream<ELEM_TYPE, TRAITS_TYPE>(&_auditStreambuf)
77+ ioauditstream(std::ios& stream)
78+ : std::iostream(&_auditStreambuf)
8879 , _auditStreambuf(stream)
8980 {
9081
9182 }
9283
93- void set_stream(stream_type& stream)
84+ void set_stream(std::ios& stream)
9485 {
9586 _auditStreambuf.set_stream(stream);
9687 }
@@ -106,19 +97,5 @@ class basic_ioauditstream
10697 }
10798
10899 private:
109- audit_streambuf<ELEM_TYPE, TRAITS_TYPE> _auditStreambuf;
100+ audit_streambuf _auditStreambuf;
110101 };
111-
112-//////////////////////////////////////////////////////////////////////////
113-
114-typedef basic_iauditstream<uint8_t, std::char_traits<uint8_t>> byte_iauditstream;
115-typedef basic_iauditstream<char, std::char_traits<char>> iauditstream;
116-typedef basic_iauditstream<wchar_t, std::char_traits<wchar_t>> wiauditstream;
117-
118-typedef basic_oauditstream<uint8_t, std::char_traits<uint8_t>> byte_oauditstream;
119-typedef basic_oauditstream<char, std::char_traits<char>> oauditstream;
120-typedef basic_oauditstream<wchar_t, std::char_traits<wchar_t>> woauditstream;
121-
122-typedef basic_ioauditstream<uint8_t, std::char_traits<uint8_t>> byte_ioauditstream;
123-typedef basic_ioauditstream<char, std::char_traits<char>> ioauditstream;
124-typedef basic_ioauditstream<wchar_t, std::char_traits<wchar_t>> wioauditstream;
--- a/Source/ZipLib/streams/compression_decoder_stream.h
+++ b/Source/ZipLib/streams/compression_decoder_stream.h
@@ -5,45 +5,40 @@
55 /**
66 * \brief Basic generic compression decoder stream.
77 */
8-template <typename ELEM_TYPE, typename TRAITS_TYPE>
9-class basic_compression_decoder_stream
10- : public std::basic_istream<ELEM_TYPE, TRAITS_TYPE>
8+class compression_decoder_stream
9+ : public std::istream
1110 {
1211 public:
13- typedef typename compression_decoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
14- typedef typename compression_decoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
12+ typedef compression_decoder_streambuf::compression_decoder_interface_ptr compression_decoder_interface_ptr;
1513
16- typedef typename compression_decoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::icompression_decoder_type icompression_decoder_type;
17- typedef typename compression_decoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::icompression_decoder_ptr_type icompression_decoder_ptr_type;
18-
19- basic_compression_decoder_stream()
20- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_compressionDecoderStreambuf)
14+ compression_decoder_stream()
15+ : std::istream(&_compressionDecoderStreambuf)
2116 {
2217
2318 }
2419
25- basic_compression_decoder_stream(icompression_decoder_ptr_type compressionDecoder, istream_type& stream)
26- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_compressionDecoderStreambuf)
20+ compression_decoder_stream(compression_decoder_interface_ptr compressionDecoder, std::istream& stream)
21+ : std::istream(&_compressionDecoderStreambuf)
2722 , _compressionDecoderStreambuf(compressionDecoder, stream)
2823 {
2924
3025 }
3126
32- basic_compression_decoder_stream(icompression_decoder_ptr_type compressionDecoder, compression_properties_interface& props, istream_type& stream)
33- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_compressionDecoderStreambuf)
27+ compression_decoder_stream(compression_decoder_interface_ptr compressionDecoder, compression_properties_interface& props, std::istream& stream)
28+ : std::istream(&_compressionDecoderStreambuf)
3429 , _compressionDecoderStreambuf(compressionDecoder, props, stream)
3530 {
3631
3732 }
3833
39- bool init(icompression_decoder_ptr_type compressionDecoder, istream_type& stream)
34+ void init(compression_decoder_interface_ptr compressionDecoder, std::istream& stream)
4035 {
41- return _compressionDecoderStreambuf.init(compressionDecoder, stream);
36+ _compressionDecoderStreambuf.init(compressionDecoder, stream);
4237 }
4338
44- bool init(icompression_decoder_ptr_type compressionDecoder, compression_properties_interface& props, istream_type& stream)
39+ void init(compression_decoder_interface_ptr compressionDecoder, compression_properties_interface& props, std::istream& stream)
4540 {
46- return _compressionDecoderStreambuf.init(compressionDecoder, props, stream);
41+ _compressionDecoderStreambuf.init(compressionDecoder, props, stream);
4742 }
4843
4944 bool is_init() const
@@ -52,11 +47,5 @@ class basic_compression_decoder_stream
5247 }
5348
5449 private:
55- compression_decoder_streambuf<ELEM_TYPE, TRAITS_TYPE> _compressionDecoderStreambuf;
50+ compression_decoder_streambuf _compressionDecoderStreambuf;
5651 };
57-
58-//////////////////////////////////////////////////////////////////////////
59-
60-typedef basic_compression_decoder_stream<uint8_t, std::char_traits<uint8_t>> byte_compression_decoder_stream;
61-typedef basic_compression_decoder_stream<char, std::char_traits<char>> compression_decoder_stream;
62-typedef basic_compression_decoder_stream<wchar_t, std::char_traits<wchar_t>> wcompression_decoder_stream;
--- a/Source/ZipLib/streams/compression_encoder_stream.h
+++ b/Source/ZipLib/streams/compression_encoder_stream.h
@@ -5,43 +5,38 @@
55 /**
66 * \brief Basic generic compression encoder stream.
77 */
8-template <typename ELEM_TYPE, typename TRAITS_TYPE>
9-class basic_compression_encoder_stream
10- : public std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>
8+class compression_encoder_stream
9+ : public std::ostream
1110 {
1211 public:
13- typedef typename compression_encoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
14- typedef typename compression_encoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
12+ typedef compression_encoder_streambuf::compression_encoder_interface_ptr compression_encoder_interface_ptr;
1513
16- typedef typename compression_encoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::icompression_encoder_type icompression_encoder_type;
17- typedef typename compression_encoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::icompression_encoder_ptr_type icompression_encoder_ptr_type;
18-
19- basic_compression_encoder_stream()
20- : std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>(&_compressionEncoderStreambuf)
14+ compression_encoder_stream()
15+ : std::ostream(&_compressionEncoderStreambuf)
2116 {
2217
2318 }
2419
25- basic_compression_encoder_stream(icompression_encoder_ptr_type compressionEncoder, ostream_type& stream)
26- : std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>(&_compressionEncoderStreambuf)
20+ compression_encoder_stream(compression_encoder_interface_ptr compressionEncoder, std::ostream& stream)
21+ : std::ostream(&_compressionEncoderStreambuf)
2722 , _compressionEncoderStreambuf(compressionEncoder, stream)
2823 {
2924
3025 }
3126
32- basic_compression_encoder_stream(icompression_encoder_ptr_type compressionEncoder, compression_properties_interface& props, ostream_type& stream)
33- : std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>(&_compressionEncoderStreambuf)
27+ compression_encoder_stream(compression_encoder_interface_ptr compressionEncoder, compression_properties_interface& props, std::ostream& stream)
28+ : std::ostream(&_compressionEncoderStreambuf)
3429 , _compressionEncoderStreambuf(compressionEncoder, props, stream)
3530 {
3631
3732 }
3833
39- void init(icompression_encoder_ptr_type compressionEncoder, ostream_type& stream)
34+ void init(compression_encoder_interface_ptr compressionEncoder, std::ostream& stream)
4035 {
4136 _compressionEncoderStreambuf.init(compressionEncoder, stream);
4237 }
4338
44- void init(icompression_encoder_ptr_type compressionEncoder, compression_properties_interface& props, ostream_type& stream)
39+ void init(compression_encoder_interface_ptr compressionEncoder, compression_properties_interface& props, std::ostream& stream)
4540 {
4641 _compressionEncoderStreambuf.init(compressionEncoder, props, stream);
4742 }
@@ -52,11 +47,5 @@ class basic_compression_encoder_stream
5247 }
5348
5449 private:
55- compression_encoder_streambuf<ELEM_TYPE, TRAITS_TYPE> _compressionEncoderStreambuf;
50+ compression_encoder_streambuf _compressionEncoderStreambuf;
5651 };
57-
58-//////////////////////////////////////////////////////////////////////////
59-
60-typedef basic_compression_encoder_stream<uint8_t, std::char_traits<uint8_t>> byte_compression_encoder_stream;
61-typedef basic_compression_encoder_stream<char, std::char_traits<char>> compression_encoder_stream;
62-typedef basic_compression_encoder_stream<wchar_t, std::char_traits<wchar_t>> wcompression_encoder_stream;
--- a/Source/ZipLib/streams/crc32stream.h
+++ b/Source/ZipLib/streams/crc32stream.h
@@ -5,25 +5,24 @@
55 /**
66 * \brief Basic CRC32 output stream. Computes CRC32 of input data.
77 */
8-template <typename ELEM_TYPE, typename TRAITS_TYPE>
9-class basic_crc32stream
10- : public std::basic_istream<ELEM_TYPE, TRAITS_TYPE>
8+class crc32stream
9+ : public std::istream
1110 {
1211 public:
13- basic_crc32stream()
14- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_crc32Streambuf)
12+ crc32stream()
13+ : std::istream(&_crc32Streambuf)
1514 {
1615
1716 }
1817
19- basic_crc32stream(std::basic_istream<ELEM_TYPE, TRAITS_TYPE>* stream)
20- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_crc32Streambuf)
18+ crc32stream(std::istream& stream)
19+ : std::istream(&_crc32Streambuf)
2120 , _crc32Streambuf(stream)
2221 {
2322
2423 }
2524
26- void init(std::basic_istream<ELEM_TYPE, TRAITS_TYPE>& stream)
25+ void init(std::istream& stream)
2726 {
2827 _crc32Streambuf.init(stream);
2928 }
@@ -34,11 +33,5 @@ class basic_crc32stream
3433 }
3534
3635 private:
37- crc32_streambuf<ELEM_TYPE, TRAITS_TYPE> _crc32Streambuf;
36+ crc32_streambuf _crc32Streambuf;
3837 };
39-
40-//////////////////////////////////////////////////////////////////////////
41-
42-typedef basic_crc32stream<uint8_t, std::char_traits<uint8_t>> byte_crc32stream;
43-typedef basic_crc32stream<char, std::char_traits<char>> crc32stream;
44-typedef basic_crc32stream<wchar_t, std::char_traits<wchar_t>> wcrc32stream;
--- a/Source/ZipLib/streams/encryption_decoder_stream.h
+++ b/Source/ZipLib/streams/encryption_decoder_stream.h
@@ -5,45 +5,40 @@
55 /**
66 * \brief Basic generic encryption decoder stream.
77 */
8-template <typename ELEM_TYPE, typename TRAITS_TYPE>
9-class basic_encryption_decoder_stream
10- : public std::basic_istream<ELEM_TYPE, TRAITS_TYPE>
8+class encryption_decoder_stream
9+ : public std::istream
1110 {
1211 public:
13- typedef typename encryption_decoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
14- typedef typename encryption_decoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
12+ typedef encryption_decoder_streambuf::encryption_decoder_interface_ptr encryption_decoder_interface_ptr;
1513
16- typedef typename encryption_decoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::iencryption_decoder_type iencryption_decoder_type;
17- typedef typename encryption_decoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::iencryption_decoder_ptr_type iencryption_decoder_ptr_type;
18-
19- basic_encryption_decoder_stream()
20- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_encryptionDecoderStreambuf)
14+ encryption_decoder_stream()
15+ : std::istream(&_encryptionDecoderStreambuf)
2116 {
2217
2318 }
2419
25- basic_encryption_decoder_stream(iencryption_decoder_ptr_type encryptionDecoder, istream_type& stream)
26- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_encryptionDecoderStreambuf)
20+ encryption_decoder_stream(encryption_decoder_interface_ptr encryptionDecoder, std::istream& stream)
21+ : std::istream(&_encryptionDecoderStreambuf)
2722 , _encryptionDecoderStreambuf(encryptionDecoder, stream)
2823 {
2924
3025 }
3126
32- basic_encryption_decoder_stream(iencryption_decoder_ptr_type encryptionDecoder, encryption_properties_interface& props, istream_type& stream)
33- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_encryptionDecoderStreambuf)
27+ encryption_decoder_stream(encryption_decoder_interface_ptr encryptionDecoder, encryption_properties_interface& props, std::istream& stream)
28+ : std::istream(&_encryptionDecoderStreambuf)
3429 , _encryptionDecoderStreambuf(encryptionDecoder, props, stream)
3530 {
3631
3732 }
3833
39- bool init(iencryption_decoder_ptr_type encryptionDecoder, istream_type& stream)
34+ void init(encryption_decoder_interface_ptr encryptionDecoder, std::istream& stream)
4035 {
41- return _encryptionDecoderStreambuf.init(encryptionDecoder, stream);
36+ _encryptionDecoderStreambuf.init(encryptionDecoder, stream);
4237 }
4338
44- bool init(iencryption_decoder_ptr_type encryptionDecoder, encryption_properties_interface& props, istream_type& stream)
39+ void init(encryption_decoder_interface_ptr encryptionDecoder, encryption_properties_interface& props, std::istream& stream)
4540 {
46- return _encryptionDecoderStreambuf.init(encryptionDecoder, props, stream);
41+ _encryptionDecoderStreambuf.init(encryptionDecoder, props, stream);
4742 }
4843
4944 bool is_init() const
@@ -52,11 +47,5 @@ class basic_encryption_decoder_stream
5247 }
5348
5449 private:
55- encryption_decoder_streambuf<ELEM_TYPE, TRAITS_TYPE> _encryptionDecoderStreambuf;
50+ encryption_decoder_streambuf _encryptionDecoderStreambuf;
5651 };
57-
58-//////////////////////////////////////////////////////////////////////////
59-
60-typedef basic_encryption_decoder_stream<uint8_t, std::char_traits<uint8_t>> byte_encryption_decoder_stream;
61-typedef basic_encryption_decoder_stream<char, std::char_traits<char>> encryption_decoder_stream;
62-typedef basic_encryption_decoder_stream<wchar_t, std::char_traits<wchar_t>> wencryption_decoder_stream;
--- a/Source/ZipLib/streams/encryption_encoder_stream.h
+++ b/Source/ZipLib/streams/encryption_encoder_stream.h
@@ -5,43 +5,38 @@
55 /**
66 * \brief Basic generic encryption encoder stream.
77 */
8-template <typename ELEM_TYPE, typename TRAITS_TYPE>
9-class basic_encryption_encoder_stream
10- : public std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>
8+class encryption_encoder_stream
9+ : public std::ostream
1110 {
1211 public:
13- typedef typename encryption_encoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::istream_type istream_type;
14- typedef typename encryption_encoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::ostream_type ostream_type;
12+ typedef encryption_encoder_streambuf::encryption_encoder_interface_ptr encryption_encoder_interface_ptr;
1513
16- typedef typename encryption_encoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::iencryption_encoder_type iencryption_encoder_type;
17- typedef typename encryption_encoder_streambuf<ELEM_TYPE, TRAITS_TYPE>::iencryption_encoder_ptr_type iencryption_encoder_ptr_type;
18-
19- basic_encryption_encoder_stream()
20- : std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>(&_encryptionEncoderStreambuf)
14+ encryption_encoder_stream()
15+ : std::ostream(&_encryptionEncoderStreambuf)
2116 {
2217
2318 }
2419
25- basic_encryption_encoder_stream(iencryption_encoder_ptr_type encryptionEncoder, ostream_type& stream)
26- : std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>(&_encryptionEncoderStreambuf)
20+ encryption_encoder_stream(encryption_encoder_interface_ptr encryptionEncoder, std::ostream& stream)
21+ : std::ostream(&_encryptionEncoderStreambuf)
2722 , _encryptionEncoderStreambuf(encryptionEncoder, stream)
2823 {
2924
3025 }
3126
32- basic_encryption_encoder_stream(iencryption_encoder_ptr_type encryptionEncoder, encryption_properties_interface& props, ostream_type& stream)
33- : std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>(&_encryptionEncoderStreambuf)
27+ encryption_encoder_stream(encryption_encoder_interface_ptr encryptionEncoder, encryption_properties_interface& props, std::ostream& stream)
28+ : std::ostream(&_encryptionEncoderStreambuf)
3429 , _encryptionEncoderStreambuf(encryptionEncoder, props, stream)
3530 {
3631
3732 }
3833
39- void init(iencryption_encoder_ptr_type encryptionEncoder, ostream_type& stream)
34+ void init(encryption_encoder_interface_ptr encryptionEncoder, std::ostream& stream)
4035 {
4136 _encryptionEncoderStreambuf.init(encryptionEncoder, stream);
4237 }
4338
44- void init(iencryption_encoder_ptr_type encryptionEncoder, encryption_properties_interface& props, ostream_type& stream)
39+ void init(encryption_encoder_interface_ptr encryptionEncoder, encryption_properties_interface& props, std::ostream& stream)
4540 {
4641 _encryptionEncoderStreambuf.init(encryptionEncoder, props, stream);
4742 }
@@ -52,11 +47,5 @@ class basic_encryption_encoder_stream
5247 }
5348
5449 private:
55- encryption_encoder_streambuf<ELEM_TYPE, TRAITS_TYPE> _encryptionEncoderStreambuf;
50+ encryption_encoder_streambuf _encryptionEncoderStreambuf;
5651 };
57-
58-//////////////////////////////////////////////////////////////////////////
59-
60-typedef basic_encryption_encoder_stream<uint8_t, std::char_traits<uint8_t>> byte_encryption_encoder_stream;
61-typedef basic_encryption_encoder_stream<char, std::char_traits<char>> encryption_encoder_stream;
62-typedef basic_encryption_encoder_stream<wchar_t, std::char_traits<wchar_t>> wencryption_encoder_stream;
--- a/Source/ZipLib/streams/memstream.h
+++ b/Source/ZipLib/streams/memstream.h
@@ -9,27 +9,26 @@
99 * Supports seeking.
1010 * Returns EOF when stream seeks behind the size of buffer.
1111 */
12-template <typename ELEM_TYPE, typename TRAITS_TYPE>
13-class basic_imemstream
14- : public std::basic_istream<ELEM_TYPE, TRAITS_TYPE>
12+class imemstream
13+ : public std::istream
1514 {
1615 public:
17- basic_imemstream(const ELEM_TYPE* buffer, size_t length)
18- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_memStreambuf)
19- , _memStreambuf(const_cast<ELEM_TYPE*>(buffer), length)
16+ imemstream(const char_type* buffer, size_t length)
17+ : std::istream(&_memStreambuf)
18+ , _memStreambuf(const_cast<char_type*>(buffer), length)
2019 {
2120
2221 }
2322
2423 template <size_t N>
25- basic_imemstream(const ELEM_TYPE (&buffer)[N])
26- : basic_imemstream(buffer, N)
24+ imemstream(const char_type (&buffer)[N])
25+ : imemstream(buffer, N)
2726 {
2827
2928 }
3029
3130 private:
32- mem_streambuf<ELEM_TYPE, TRAITS_TYPE> _memStreambuf;
31+ mem_streambuf _memStreambuf;
3332 };
3433
3534 /**
@@ -38,28 +37,27 @@ class basic_imemstream
3837 * Supports seeking.
3938 * Sets badbit if the stream wants to write behind the buffer size.
4039 */
41-template <typename ELEM_TYPE, typename TRAITS_TYPE>
42-class basic_omemstream
43- : public std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>
40+class omemstream
41+ : public std::ostream
4442 {
4543 public:
46- basic_omemstream(ELEM_TYPE* buffer, size_t length)
44+ omemstream(char_type* buffer, size_t length)
4745 : _memStreambuf(buffer, length)
48- , std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>(&_memStreambuf)
46+ , std::ostream(&_memStreambuf)
4947 {
5048
5149 }
5250
5351 template <size_t N>
54- basic_omemstream(ELEM_TYPE (&buffer)[N])
52+ omemstream(char_type (&buffer)[N])
5553 : _memStreambuf(buffer, N)
56- , std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>(&_memStreambuf)
54+ , std::ostream(&_memStreambuf)
5755 {
5856
5957 }
6058
6159 private:
62- mem_streambuf<ELEM_TYPE, TRAITS_TYPE> _memStreambuf;
60+ mem_streambuf _memStreambuf;
6361 };
6462
6563 /**
@@ -70,40 +68,25 @@ class basic_omemstream
7068 * Returns EOF when stream seeks behind the size of buffer.
7169 * Sets badbit if the stream wants to write behind the buffer size.
7270 */
73-template <typename ELEM_TYPE, typename TRAITS_TYPE>
74-class basic_iomemstream
75- : public std::basic_iostream<ELEM_TYPE, TRAITS_TYPE>
71+class iomemstream
72+ : public std::iostream
7673 {
7774 public:
78- basic_iomemstream(ELEM_TYPE* buffer, size_t length)
75+ iomemstream(char_type* buffer, size_t length)
7976 : _memStreambuf(buffer, length)
80- , std::basic_iostream<ELEM_TYPE, TRAITS_TYPE>(&_memStreambuf)
77+ , std::iostream(&_memStreambuf)
8178 {
8279
8380 }
8481
8582 template <size_t N>
86- basic_iomemstream(ELEM_TYPE (&buffer)[N])
83+ iomemstream(char_type (&buffer)[N])
8784 : _memStreambuf(buffer, N)
88- , std::basic_iostream<ELEM_TYPE, TRAITS_TYPE>(&_memStreambuf)
85+ , std::iostream(&_memStreambuf)
8986 {
9087
9188 }
9289
9390 private:
94- mem_streambuf<ELEM_TYPE, TRAITS_TYPE> _memStreambuf;
91+ mem_streambuf _memStreambuf;
9592 };
96-
97-//////////////////////////////////////////////////////////////////////////
98-
99-typedef basic_imemstream<uint8_t, std::char_traits<uint8_t>> byte_imemstream;
100-typedef basic_imemstream<char, std::char_traits<char>> imemstream;
101-typedef basic_imemstream<wchar_t, std::char_traits<wchar_t>> wimemstream;
102-
103-typedef basic_omemstream<uint8_t, std::char_traits<uint8_t>> byte_omemstream;
104-typedef basic_omemstream<char, std::char_traits<char>> omemstream;
105-typedef basic_omemstream<wchar_t, std::char_traits<wchar_t>> womemstream;
106-
107-typedef basic_iomemstream<uint8_t, std::char_traits<uint8_t>> byte_iomemstream;
108-typedef basic_iomemstream<char, std::char_traits<char>> iomemstream;
109-typedef basic_iomemstream<wchar_t, std::char_traits<wchar_t>> wiomemstream;
--- a/Source/ZipLib/streams/nullstream.h
+++ b/Source/ZipLib/streams/nullstream.h
@@ -1,28 +1,20 @@
11 #pragma once
22 #include <iostream>
3-#include <cstdint>
43 #include "streambuffs/null_streambuf.h"
54
65 /**
76 * \brief Basic null stream.
87 */
9-template <typename ELEM_TYPE, typename TRAITS_TYPE>
10-class basic_nullstream
11- : public std::basic_iostream<ELEM_TYPE, TRAITS_TYPE>
8+class nullstream
9+ : public std::iostream
1210 {
1311 public:
14- basic_nullstream()
15- : std::basic_iostream<ELEM_TYPE, TRAITS_TYPE>(&_nullStreambuf)
12+ nullstream()
13+ : std::iostream(&_nullStreambuf)
1614 {
1715
1816 }
1917
2018 private:
21- null_streambuf<ELEM_TYPE, TRAITS_TYPE> _nullStreambuf;
19+ null_streambuf _nullStreambuf;
2220 };
23-
24-//////////////////////////////////////////////////////////////////////////
25-
26-typedef basic_nullstream<uint8_t, std::char_traits<uint8_t>> byte_nullstream;
27-typedef basic_nullstream<char, std::char_traits<char>> nullstream;
28-typedef basic_nullstream<wchar_t, std::char_traits<wchar_t>> wnullstream;
--- a/Source/ZipLib/streams/serialization.h
+++ b/Source/ZipLib/streams/serialization.h
@@ -204,4 +204,4 @@ template <typename ELEM_TYPE, typename TRAITS_TYPE, typename ARRAY_ELEM_TYPE, si
204204 std::ios::pos_type deserialize(std::basic_istream<ELEM_TYPE, TRAITS_TYPE>& stream, std::array<ARRAY_ELEM_TYPE, ARRAY_SIZE>& out)
205205 {
206206 return detail::deserialize_stl_container(stream, out, out.size());
207-}
207+}
\ No newline at end of file
--- a/Source/ZipLib/streams/streambuffs/audit_streambuf.h
+++ b/Source/ZipLib/streams/streambuffs/audit_streambuf.h
@@ -3,37 +3,22 @@
33 #include <cstdint>
44 #include <cassert>
55
6-template <typename ELEM_TYPE, typename TRAITS_TYPE>
76 class audit_streambuf
8- : public std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>
7+ : public std::streambuf
98 {
109 public:
11- typedef std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE> base_type;
12- typedef typename std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>::traits_type traits_type;
13-
14- typedef typename base_type::char_type char_type;
15- typedef typename base_type::int_type int_type;
16- typedef typename base_type::pos_type pos_type;
17- typedef typename base_type::off_type off_type;
18-
19- typedef base_type streambuf_type;
20- typedef std::basic_ios<ELEM_TYPE, TRAITS_TYPE> stream_type;
21- typedef std::basic_istream<ELEM_TYPE, TRAITS_TYPE> istream_type;
22- typedef std::basic_ostream<ELEM_TYPE, TRAITS_TYPE> ostream_type;
23-
24-
2510 audit_streambuf()
2611 {
2712
2813 }
2914
30- audit_streambuf(stream_type& stream)
15+ audit_streambuf(std::ios& stream)
3116 : _streambuf(stream.rdbuf())
3217 {
3318
3419 }
3520
36- void set_stream(stream_type& stream)
21+ void set_stream(std::ios& stream)
3722 {
3823 _streambuf = stream.rdbuf();
3924 }
@@ -71,7 +56,7 @@ class audit_streambuf
7156 return n;
7257 }
7358
74- std::streamsize xsputn(const ELEM_TYPE* ptr, std::streamsize count) override
59+ std::streamsize xsputn(const char_type* ptr, std::streamsize count) override
7560 {
7661 auto n = _streambuf->sputn(ptr, count);
7762 _bytesWritten += static_cast<size_t>(n);
@@ -84,7 +69,7 @@ class audit_streambuf
8469 }
8570
8671 private:
87- streambuf_type* _streambuf = nullptr;
72+ std::streambuf* _streambuf = nullptr;
8873 size_t _bytesRead = 0;
8974 size_t _bytesWritten = 0;
9075 };
--- a/Source/ZipLib/streams/streambuffs/compression_decoder_streambuf.h
+++ b/Source/ZipLib/streams/streambuffs/compression_decoder_streambuf.h
@@ -6,42 +6,28 @@
66
77 #include "../../compression/compression_interface.h"
88
9-template <typename ELEM_TYPE, typename TRAITS_TYPE>
109 class compression_decoder_streambuf
11- : public std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>
10+ : public std::streambuf
1211 {
1312 public:
14- typedef std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE> base_type;
15- typedef typename std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>::traits_type traits_type;
16-
17- typedef typename base_type::char_type char_type;
18- typedef typename base_type::int_type int_type;
19- typedef typename base_type::pos_type pos_type;
20- typedef typename base_type::off_type off_type;
21-
22- typedef std::basic_ios<ELEM_TYPE, TRAITS_TYPE> stream_type;
23- typedef std::basic_istream<ELEM_TYPE, TRAITS_TYPE> istream_type;
24- typedef std::basic_ostream<ELEM_TYPE, TRAITS_TYPE> ostream_type;
25-
26- typedef compression_decoder_interface_basic<ELEM_TYPE, TRAITS_TYPE> icompression_decoder_type;
27- typedef std::shared_ptr<icompression_decoder_type> icompression_decoder_ptr_type;
13+ typedef std::shared_ptr<compression_decoder_interface> compression_decoder_interface_ptr;
2814
2915 compression_decoder_streambuf()
3016 {
3117
3218 }
3319
34- compression_decoder_streambuf(icompression_decoder_ptr_type compressionDecoder, istream_type& stream)
20+ compression_decoder_streambuf(compression_decoder_interface_ptr compressionDecoder, std::istream& stream)
3521 {
3622 init(compressionDecoder, stream);
3723 }
3824
39- compression_decoder_streambuf(icompression_decoder_ptr_type compressionDecoder, compression_properties_interface& props, istream_type& stream)
25+ compression_decoder_streambuf(compression_decoder_interface_ptr compressionDecoder, compression_properties_interface& props, std::istream& stream)
4026 {
4127 init(compressionDecoder, props, stream);
4228 }
4329
44- void init(icompression_decoder_ptr_type compressionDecoder, istream_type& stream)
30+ void init(compression_decoder_interface_ptr compressionDecoder, std::istream& stream)
4531 {
4632 _compressionDecoder = compressionDecoder;
4733
@@ -52,7 +38,7 @@ class compression_decoder_streambuf
5238 this->setg(_compressionDecoder->get_buffer_end(), _compressionDecoder->get_buffer_end(), _compressionDecoder->get_buffer_end());
5339 }
5440
55- void init(icompression_decoder_ptr_type compressionDecoder, compression_properties_interface& props, istream_type& stream)
41+ void init(compression_decoder_interface_ptr compressionDecoder, compression_properties_interface& props, std::istream& stream)
5642 {
5743 _compressionDecoder = compressionDecoder;
5844
@@ -74,7 +60,7 @@ class compression_decoder_streambuf
7460 // buffer exhausted
7561 if (this->gptr() >= this->egptr())
7662 {
77- ELEM_TYPE* base = _compressionDecoder->get_buffer_begin();
63+ char_type* base = _compressionDecoder->get_buffer_begin();
7864
7965 // how many bytes has been read
8066 size_t n = _compressionDecoder->decode_next();
@@ -92,5 +78,5 @@ class compression_decoder_streambuf
9278 }
9379
9480 private:
95- icompression_decoder_ptr_type _compressionDecoder;
81+ compression_decoder_interface_ptr _compressionDecoder;
9682 };
--- a/Source/ZipLib/streams/streambuffs/compression_encoder_streambuf.h
+++ b/Source/ZipLib/streams/streambuffs/compression_encoder_streambuf.h
@@ -6,37 +6,23 @@
66
77 #include "../../compression/compression_interface.h"
88
9-template <typename ELEM_TYPE, typename TRAITS_TYPE>
109 class compression_encoder_streambuf
11- : public std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>
10+ : public std::streambuf
1211 {
1312 public:
14- typedef std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE> base_type;
15- typedef typename std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>::traits_type traits_type;
16-
17- typedef typename base_type::char_type char_type;
18- typedef typename base_type::int_type int_type;
19- typedef typename base_type::pos_type pos_type;
20- typedef typename base_type::off_type off_type;
21-
22- typedef std::basic_ios<ELEM_TYPE, TRAITS_TYPE> stream_type;
23- typedef std::basic_istream<ELEM_TYPE, TRAITS_TYPE> istream_type;
24- typedef std::basic_ostream<ELEM_TYPE, TRAITS_TYPE> ostream_type;
25-
26- typedef compression_encoder_interface_basic<ELEM_TYPE, TRAITS_TYPE> icompression_encoder_type;
27- typedef std::shared_ptr<icompression_encoder_type> icompression_encoder_ptr_type;
13+ typedef std::shared_ptr<compression_encoder_interface> compression_encoder_interface_ptr;
2814
2915 compression_encoder_streambuf()
3016 {
3117
3218 }
3319
34- compression_encoder_streambuf(icompression_encoder_ptr_type compressionEncoder, ostream_type& stream)
20+ compression_encoder_streambuf(compression_encoder_interface_ptr compressionEncoder, std::ostream& stream)
3521 {
3622 init(compressionEncoder, stream);
3723 }
3824
39- compression_encoder_streambuf(icompression_encoder_ptr_type compressionEncoder, compression_properties_interface& props, ostream_type& stream)
25+ compression_encoder_streambuf(compression_encoder_interface_ptr compressionEncoder, compression_properties_interface& props, std::ostream& stream)
4026 {
4127 init(compressionEncoder, props, stream);
4228 }
@@ -46,7 +32,7 @@ class compression_encoder_streambuf
4632 sync();
4733 }
4834
49- void init(icompression_encoder_ptr_type compressionEncoder, ostream_type& stream)
35+ void init(compression_encoder_interface_ptr compressionEncoder, std::ostream& stream)
5036 {
5137 _compressionEncoder = compressionEncoder;
5238
@@ -57,7 +43,7 @@ class compression_encoder_streambuf
5743 this->setp(_compressionEncoder->get_buffer_begin(), _compressionEncoder->get_buffer_end() - 1);
5844 }
5945
60- void init(icompression_encoder_ptr_type compressionEncoder, compression_properties_interface& props, ostream_type& stream)
46+ void init(compression_encoder_interface_ptr compressionEncoder, compression_properties_interface& props, std::ostream& stream)
6147 {
6248 _compressionEncoder = compressionEncoder;
6349
@@ -115,5 +101,5 @@ class compression_encoder_streambuf
115101 this->setp(_compressionEncoder->get_buffer_begin(), _compressionEncoder->get_buffer_end() - 1);
116102 }
117103
118- icompression_encoder_ptr_type _compressionEncoder;
104+ compression_encoder_interface_ptr _compressionEncoder;
119105 };
--- a/Source/ZipLib/streams/streambuffs/crc32_streambuf.h
+++ b/Source/ZipLib/streams/streambuffs/crc32_streambuf.h
@@ -5,38 +5,25 @@
55 #include "../substream.h"
66 #include "../../extlibs/zlib/zlib.h"
77
8-template <typename ELEM_TYPE, typename TRAITS_TYPE>
98 class crc32_streambuf
10- : public std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>
9+ : public std::streambuf
1110 {
1211 public:
13- typedef std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE> base_type;
14- typedef typename std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>::traits_type traits_type;
15-
16- typedef typename base_type::char_type char_type;
17- typedef typename base_type::int_type int_type;
18- typedef typename base_type::pos_type pos_type;
19- typedef typename base_type::off_type off_type;
20-
21- typedef std::basic_ios<ELEM_TYPE, TRAITS_TYPE> stream_type;
22- typedef std::basic_istream<ELEM_TYPE, TRAITS_TYPE> istream_type;
23- typedef std::basic_ostream<ELEM_TYPE, TRAITS_TYPE> ostream_type;
24-
2512 crc32_streambuf()
2613 {
2714
2815 }
2916
30- crc32_streambuf(istream_type& input)
17+ crc32_streambuf(std::istream& input)
3118 {
3219 init(input);
3320 }
3421
35- void init(istream_type& input)
22+ void init(std::istream& input)
3623 {
3724 _inputStream = &input;
3825
39- ELEM_TYPE* endOfBuffer = _internalBuffer + INTERNAL_BUFFER_SIZE;
26+ char_type* endOfBuffer = _internalBuffer + INTERNAL_BUFFER_SIZE;
4027 this->setg(endOfBuffer, endOfBuffer, endOfBuffer);
4128 }
4229
@@ -69,13 +56,13 @@ class crc32_streambuf
6956 }
7057
7158 // set buffer pointers, increment current position
72- ELEM_TYPE* base = _internalBufferPosition++;
59+ char_type* base = _internalBufferPosition++;
7360
7461 // setting all pointers to the same position forces calling of this method each time,
7562 // so crc32 really represents the checksum of what really has been read
7663 this->setg(base, base, base + 1);
7764
78- _crc32 = crc32(_crc32, reinterpret_cast<Bytef*>(this->gptr()), static_cast<uInt>(sizeof(ELEM_TYPE)));
65+ _crc32 = crc32(_crc32, reinterpret_cast<Bytef*>(this->gptr()), static_cast<uInt>(sizeof(char_type)));
7966
8067 return traits_type::to_int_type(*this->gptr());
8168 }
@@ -86,10 +73,10 @@ class crc32_streambuf
8673 INTERNAL_BUFFER_SIZE = 1 << 15
8774 };
8875
89- ELEM_TYPE _internalBuffer[INTERNAL_BUFFER_SIZE];
90- ELEM_TYPE* _internalBufferPosition = _internalBuffer + INTERNAL_BUFFER_SIZE;
91- ELEM_TYPE* _internalBufferEnd = _internalBuffer + INTERNAL_BUFFER_SIZE;
76+ char_type _internalBuffer[INTERNAL_BUFFER_SIZE];
77+ char_type* _internalBufferPosition = _internalBuffer + INTERNAL_BUFFER_SIZE;
78+ char_type* _internalBufferEnd = _internalBuffer + INTERNAL_BUFFER_SIZE;
9279
93- istream_type* _inputStream = nullptr;
80+ std::istream* _inputStream = nullptr;
9481 uint32_t _crc32 = 0;
9582 };
--- a/Source/ZipLib/streams/streambuffs/encryption_decoder_streambuf.h
+++ b/Source/ZipLib/streams/streambuffs/encryption_decoder_streambuf.h
@@ -6,42 +6,28 @@
66
77 #include "../../encryption/encryption_interface.h"
88
9-template <typename ELEM_TYPE, typename TRAITS_TYPE>
109 class encryption_decoder_streambuf
11- : public std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>
10+ : public std::streambuf
1211 {
1312 public:
14- typedef std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE> base_type;
15- typedef typename std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>::traits_type traits_type;
16-
17- typedef typename base_type::char_type char_type;
18- typedef typename base_type::int_type int_type;
19- typedef typename base_type::pos_type pos_type;
20- typedef typename base_type::off_type off_type;
21-
22- typedef std::basic_ios<ELEM_TYPE, TRAITS_TYPE> stream_type;
23- typedef std::basic_istream<ELEM_TYPE, TRAITS_TYPE> istream_type;
24- typedef std::basic_ostream<ELEM_TYPE, TRAITS_TYPE> ostream_type;
25-
26- typedef encryption_decoder_interface_basic<ELEM_TYPE, TRAITS_TYPE> iencryption_decoder_type;
27- typedef std::shared_ptr<iencryption_decoder_type> iencryption_decoder_ptr_type;
13+ typedef std::shared_ptr<encryption_decoder_interface> encryption_decoder_interface_ptr;
2814
2915 encryption_decoder_streambuf()
3016 {
3117
3218 }
3319
34- encryption_decoder_streambuf(iencryption_decoder_ptr_type encryptionDecoder, istream_type& stream)
20+ encryption_decoder_streambuf(encryption_decoder_interface_ptr encryptionDecoder, std::istream& stream)
3521 {
3622 init(encryptionDecoder, stream);
3723 }
3824
39- encryption_decoder_streambuf(iencryption_decoder_ptr_type encryptionDecoder, encryption_properties_interface& props, istream_type& stream)
25+ encryption_decoder_streambuf(encryption_decoder_interface_ptr encryptionDecoder, encryption_properties_interface& props, std::istream& stream)
4026 {
4127 init(encryptionDecoder, props, stream);
4228 }
4329
44- void init(iencryption_decoder_ptr_type encryptionDecoder, istream_type& stream)
30+ void init(encryption_decoder_interface_ptr encryptionDecoder, std::istream& stream)
4531 {
4632 _encryptionDecoder = encryptionDecoder;
4733
@@ -52,7 +38,7 @@ class encryption_decoder_streambuf
5238 this->setg(_encryptionDecoder->get_buffer_end(), _encryptionDecoder->get_buffer_end(), _encryptionDecoder->get_buffer_end());
5339 }
5440
55- void init(iencryption_decoder_ptr_type encryptionDecoder, encryption_properties_interface& props, istream_type& stream)
41+ void init(encryption_decoder_interface_ptr encryptionDecoder, encryption_properties_interface& props, std::istream& stream)
5642 {
5743 _encryptionDecoder = encryptionDecoder;
5844
@@ -74,7 +60,7 @@ class encryption_decoder_streambuf
7460 // buffer exhausted
7561 if (this->gptr() >= this->egptr())
7662 {
77- ELEM_TYPE* base = _encryptionDecoder->get_buffer_begin();
63+ char_type* base = _encryptionDecoder->get_buffer_begin();
7864
7965 // how many bytes has been read
8066 size_t n = _encryptionDecoder->decrypt_next();
@@ -92,5 +78,5 @@ class encryption_decoder_streambuf
9278 }
9379
9480 private:
95- iencryption_decoder_ptr_type _encryptionDecoder;
81+ encryption_decoder_interface_ptr _encryptionDecoder;
9682 };
--- a/Source/ZipLib/streams/streambuffs/encryption_encoder_streambuf.h
+++ b/Source/ZipLib/streams/streambuffs/encryption_encoder_streambuf.h
@@ -6,37 +6,23 @@
66
77 #include "../../encryption/encryption_interface.h"
88
9-template <typename ELEM_TYPE, typename TRAITS_TYPE>
109 class encryption_encoder_streambuf
11- : public std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>
10+ : public std::streambuf
1211 {
1312 public:
14- typedef std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE> base_type;
15- typedef typename std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>::traits_type traits_type;
16-
17- typedef typename base_type::char_type char_type;
18- typedef typename base_type::int_type int_type;
19- typedef typename base_type::pos_type pos_type;
20- typedef typename base_type::off_type off_type;
21-
22- typedef std::basic_ios<ELEM_TYPE, TRAITS_TYPE> stream_type;
23- typedef std::basic_istream<ELEM_TYPE, TRAITS_TYPE> istream_type;
24- typedef std::basic_ostream<ELEM_TYPE, TRAITS_TYPE> ostream_type;
25-
26- typedef encryption_encoder_interface_basic<ELEM_TYPE, TRAITS_TYPE> iencryption_encoder_type;
27- typedef std::shared_ptr<iencryption_encoder_type> iencryption_encoder_ptr_type;
13+ typedef std::shared_ptr<encryption_encoder_interface> encryption_encoder_interface_ptr;
2814
2915 encryption_encoder_streambuf()
3016 {
3117
3218 }
3319
34- encryption_encoder_streambuf(iencryption_encoder_ptr_type encryptionEncoder, ostream_type& stream)
20+ encryption_encoder_streambuf(encryption_encoder_interface_ptr encryptionEncoder, std::ostream& stream)
3521 {
3622 init(encryptionEncoder, stream);
3723 }
3824
39- encryption_encoder_streambuf(iencryption_encoder_ptr_type encryptionEncoder, encryption_properties_interface& props, ostream_type& stream)
25+ encryption_encoder_streambuf(encryption_encoder_interface_ptr encryptionEncoder, encryption_properties_interface& props, std::ostream& stream)
4026 {
4127 init(encryptionEncoder, props, stream);
4228 }
@@ -46,7 +32,7 @@ class encryption_encoder_streambuf
4632 sync();
4733 }
4834
49- void init(iencryption_encoder_ptr_type encryptionEncoder, ostream_type& stream)
35+ void init(encryption_encoder_interface_ptr encryptionEncoder, std::ostream& stream)
5036 {
5137 _encryptionEncoder = encryptionEncoder;
5238
@@ -57,7 +43,7 @@ class encryption_encoder_streambuf
5743 this->setp(_encryptionEncoder->get_buffer_begin(), _encryptionEncoder->get_buffer_end() - 1);
5844 }
5945
60- void init(iencryption_encoder_ptr_type encryptionEncoder, encryption_properties_interface& props, ostream_type& stream)
46+ void init(encryption_encoder_interface_ptr encryptionEncoder, encryption_properties_interface& props, std::ostream& stream)
6147 {
6248 _encryptionEncoder = encryptionEncoder;
6349
@@ -115,5 +101,5 @@ class encryption_encoder_streambuf
115101 this->setp(_encryptionEncoder->get_buffer_begin(), _encryptionEncoder->get_buffer_end() - 1);
116102 }
117103
118- iencryption_encoder_ptr_type _encryptionEncoder;
104+ encryption_encoder_interface_ptr _encryptionEncoder;
119105 };
--- a/Source/ZipLib/streams/streambuffs/mem_streambuf.h
+++ b/Source/ZipLib/streams/streambuffs/mem_streambuf.h
@@ -3,27 +3,14 @@
33 #include <cstdint>
44 #include <cassert>
55
6-template <typename ELEM_TYPE, typename TRAITS_TYPE>
76 class mem_streambuf
8- : public std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>
7+ : public std::streambuf
98 {
109 public:
11- typedef std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE> base_type;
12- typedef typename std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>::traits_type traits_type;
13-
14- typedef typename base_type::char_type char_type;
15- typedef typename base_type::int_type int_type;
16- typedef typename base_type::pos_type pos_type;
17- typedef typename base_type::off_type off_type;
18-
19- typedef std::basic_ios<ELEM_TYPE, TRAITS_TYPE> stream_type;
20- typedef std::basic_istream<ELEM_TYPE, TRAITS_TYPE> istream_type;
21- typedef std::basic_ostream<ELEM_TYPE, TRAITS_TYPE> ostream_type;
22-
23- mem_streambuf(ELEM_TYPE* buffer, size_t length)
10+ mem_streambuf(char_type* buffer, size_t length)
2411 {
2512 // set stream buffer
26- ELEM_TYPE* endOfBuffer = buffer + length;
13+ char_type* endOfBuffer = buffer + length;
2714 this->setg(buffer, buffer, endOfBuffer);
2815 this->setp(buffer, buffer, endOfBuffer);
2916 }
@@ -198,9 +185,9 @@ class mem_streambuf
198185 }
199186
200187 private:
201- void setp(ELEM_TYPE* first, ELEM_TYPE* next, ELEM_TYPE* last)
188+ void setp(char_type* first, char_type* next, char_type* last)
202189 {
203- this->std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>::setp(first, last);
190+ this->std::streambuf::setp(first, last);
204191 this->pbump(static_cast<int>(next - first));
205192 }
206193 };
--- a/Source/ZipLib/streams/streambuffs/null_streambuf.h
+++ b/Source/ZipLib/streams/streambuffs/null_streambuf.h
@@ -1,23 +1,10 @@
11 #pragma once
22 #include <streambuf>
33
4-template <typename ELEM_TYPE, typename TRAITS_TYPE>
54 class null_streambuf
6- : public std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>
5+ : public std::streambuf
76 {
87 public:
9- typedef std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE> base_type;
10- typedef typename std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>::traits_type traits_type;
11-
12- typedef typename base_type::char_type char_type;
13- typedef typename base_type::int_type int_type;
14- typedef typename base_type::pos_type pos_type;
15- typedef typename base_type::off_type off_type;
16-
17- typedef std::basic_ios<ELEM_TYPE, TRAITS_TYPE> stream_type;
18- typedef std::basic_istream<ELEM_TYPE, TRAITS_TYPE> istream_type;
19- typedef std::basic_ostream<ELEM_TYPE, TRAITS_TYPE> ostream_type;
20-
218 null_streambuf()
229 {
2310
@@ -29,7 +16,7 @@ class null_streambuf
2916 return 0;
3017 }
3118
32- std::streamsize xsputn(const ELEM_TYPE* ptr, std::streamsize count) override
19+ std::streamsize xsputn(const char_type* ptr, std::streamsize count) override
3320 {
3421 return count;
3522 }
--- a/Source/ZipLib/streams/streambuffs/sub_streambuf.h
+++ b/Source/ZipLib/streams/streambuffs/sub_streambuf.h
@@ -3,43 +3,30 @@
33 #include <istream>
44 #include <cstdint>
55
6-template <typename ELEM_TYPE, typename TRAITS_TYPE>
7-class sub_streambuf :
8- public std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>
6+class sub_streambuf
7+ : public std::streambuf
98 {
109 public:
11- typedef std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE> base_type;
12- typedef typename std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>::traits_type traits_type;
13-
14- typedef typename base_type::char_type char_type;
15- typedef typename base_type::int_type int_type;
16- typedef typename base_type::pos_type pos_type;
17- typedef typename base_type::off_type off_type;
18-
19- typedef std::basic_ios<ELEM_TYPE, TRAITS_TYPE> stream_type;
20- typedef std::basic_istream<ELEM_TYPE, TRAITS_TYPE> istream_type;
21- typedef std::basic_ostream<ELEM_TYPE, TRAITS_TYPE> ostream_type;
22-
2310 sub_streambuf()
2411 {
2512
2613 }
2714
28- sub_streambuf(istream_type& input, pos_type startOffset, size_t length)
15+ sub_streambuf(std::istream& input, pos_type startOffset, size_t length)
2916 {
3017 init(input, startOffset, length);
3118 }
3219
33- void init(istream_type& input, pos_type startOffset, size_t length)
20+ void init(std::istream& input, pos_type startOffset, size_t length)
3421 {
3522 _inputStream = &input;
3623 _startPosition = startOffset;
3724 _currentPosition = startOffset;
3825 _endPosition = startOffset + static_cast<pos_type>(length);
39- _internalBuffer = new ELEM_TYPE[INTERNAL_BUFFER_SIZE];
26+ _internalBuffer = new char_type[INTERNAL_BUFFER_SIZE];
4027
4128 // set stream buffer
42- ELEM_TYPE* endOfOutputBuffer = _internalBuffer + INTERNAL_BUFFER_SIZE;
29+ char_type* endOfOutputBuffer = _internalBuffer + INTERNAL_BUFFER_SIZE;
4330 this->setg(endOfOutputBuffer, endOfOutputBuffer, endOfOutputBuffer);
4431 }
4532
@@ -59,7 +46,7 @@ class sub_streambuf :
5946 // buffer exhausted
6047 if (this->gptr() >= this->egptr())
6148 {
62- ELEM_TYPE* base = _internalBuffer;
49+ char_type* base = _internalBuffer;
6350
6451 _inputStream->seekg(_currentPosition, std::ios::beg);
6552 _inputStream->read(_internalBuffer, std::min(static_cast<size_t>(INTERNAL_BUFFER_SIZE), static_cast<size_t>(_endPosition - _currentPosition)));
@@ -92,7 +79,7 @@ class sub_streambuf :
9279 _currentPosition = _startPosition + pos;
9380
9481 // invalidate stream buffer
95- ELEM_TYPE* endOfOutputBuffer = _internalBuffer + INTERNAL_BUFFER_SIZE;
82+ char_type* endOfOutputBuffer = _internalBuffer + INTERNAL_BUFFER_SIZE;
9683 this->setg(endOfOutputBuffer, endOfOutputBuffer, endOfOutputBuffer);
9784
9885 return pos_type(_inputStream->rdbuf()->pubseekpos(_startPosition + pos, which) - _startPosition);
@@ -114,7 +101,7 @@ class sub_streambuf :
114101 dir == std::ios::end ? _endPosition : 0;
115102
116103 // invalidate stream buffer
117- ELEM_TYPE* endOfOutputBuffer = _internalBuffer + INTERNAL_BUFFER_SIZE;
104+ char_type* endOfOutputBuffer = _internalBuffer + INTERNAL_BUFFER_SIZE;
118105 this->setg(endOfOutputBuffer, endOfOutputBuffer, endOfOutputBuffer);
119106
120107 // set new current position
@@ -129,10 +116,10 @@ class sub_streambuf :
129116 INTERNAL_BUFFER_SIZE = 1 << 15
130117 };
131118
132- ELEM_TYPE* _internalBuffer = nullptr;
119+ char_type* _internalBuffer = nullptr;
133120
134- istream_type* _inputStream = nullptr;
135- pos_type _startPosition = 0;
136- pos_type _currentPosition = 0;
137- pos_type _endPosition = 0;
121+ std::istream* _inputStream = nullptr;
122+ pos_type _startPosition = 0;
123+ pos_type _currentPosition = 0;
124+ pos_type _endPosition = 0;
138125 };
--- a/Source/ZipLib/streams/streambuffs/tee_streambuff.h
+++ b/Source/ZipLib/streams/streambuffs/tee_streambuff.h
@@ -1,31 +1,19 @@
11 #pragma once
22 #include <streambuf>
33 #include <algorithm>
4+#include <vector>
45
5-template <typename ELEM_TYPE, typename TRAITS_TYPE>
6-class tee_streambuf:
7- public std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>
6+class tee_streambuf
7+ : public std::streambuf
88 {
99 public:
10- typedef std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE> base_type;
11- typedef typename std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>::traits_type traits_type;
12-
13- typedef typename base_type::char_type char_type;
14- typedef typename base_type::int_type int_type;
15- typedef typename base_type::pos_type pos_type;
16- typedef typename base_type::off_type off_type;
17-
18- typedef std::basic_ios<ELEM_TYPE, TRAITS_TYPE> stream_type;
19- typedef std::basic_istream<ELEM_TYPE, TRAITS_TYPE> istream_type;
20- typedef std::basic_ostream<ELEM_TYPE, TRAITS_TYPE> ostream_type;
21-
22- tee_streambuf& bind(base_type* sb)
10+ tee_streambuf& bind(std::streambuf* sb)
2311 {
2412 _sbCollection.push_back(sb);
2513 return *this;
2614 }
2715
28- tee_streambuf& bind(ostream_type& stream)
16+ tee_streambuf& bind(std::ostream& stream)
2917 {
3018 _sbCollection.push_back(stream.rdbuf());
3119 return *this;
@@ -63,5 +51,5 @@ class tee_streambuf:
6351 }
6452
6553 private:
66- std::vector<base_type*> _sbCollection;
54+ std::vector<std::streambuf*> _sbCollection;
6755 };
--- a/Source/ZipLib/streams/substream.h
+++ b/Source/ZipLib/streams/substream.h
@@ -6,39 +6,36 @@
66 * \brief Basic input substream. Creates a virtual stream over an existing input stream.
77 * The substream starts at the position 0 and continues until EOF or the specified length.
88 */
9-template <typename ELEM_TYPE, typename TRAITS_TYPE>
10-class basic_isubstream
11- : public std::basic_istream<ELEM_TYPE, TRAITS_TYPE>
9+class isubstream
10+ : public std::istream
1211 {
1312 public:
14- typedef typename std::basic_istream<ELEM_TYPE, TRAITS_TYPE>::pos_type pos_type;
15-
16- basic_isubstream()
17- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_subStreambuf)
13+ isubstream()
14+ : std::istream(&_subStreambuf)
1815 {
1916
2017 }
2118
22- basic_isubstream(std::basic_istream<ELEM_TYPE, TRAITS_TYPE>& input, pos_type startOffset = 0)
23- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_subStreambuf)
19+ isubstream(std::istream& input, pos_type startOffset = 0)
20+ : std::istream(&_subStreambuf)
2421 , _subStreambuf(input, startOffset, static_cast<size_t>(-1))
2522 {
2623
2724 }
2825
29- basic_isubstream(std::basic_istream<ELEM_TYPE, TRAITS_TYPE>& input, pos_type startOffset, size_t length)
30- : std::basic_istream<ELEM_TYPE, TRAITS_TYPE>(&_subStreambuf)
26+ isubstream(std::istream& input, pos_type startOffset, size_t length)
27+ : std::istream(&_subStreambuf)
3128 , _subStreambuf(input, startOffset, length)
3229 {
3330
3431 }
3532
36- void init(std::basic_istream<ELEM_TYPE, TRAITS_TYPE>& input, pos_type startOffset = 0)
33+ void init(std::istream& input, pos_type startOffset = 0)
3734 {
3835 _subStreambuf.init(input, startOffset, static_cast<size_t>(-1));
3936 }
4037
41- void init(std::basic_istream<ELEM_TYPE, TRAITS_TYPE>& input, pos_type startOffset, size_t length)
38+ void init(std::istream& input, pos_type startOffset, size_t length)
4239 {
4340 _subStreambuf.init(input, startOffset, length);
4441 }
@@ -49,11 +46,5 @@ class basic_isubstream
4946 }
5047
5148 private:
52- sub_streambuf<ELEM_TYPE, TRAITS_TYPE> _subStreambuf;
49+ sub_streambuf _subStreambuf;
5350 };
54-
55-//////////////////////////////////////////////////////////////////////////
56-
57-typedef basic_isubstream<uint8_t, std::char_traits<uint8_t>> byte_isubstream;
58-typedef basic_isubstream<char, std::char_traits<char>> isubstream;
59-typedef basic_isubstream<wchar_t, std::char_traits<wchar_t>> wisubstream;
--- a/Source/ZipLib/streams/teestream.h
+++ b/Source/ZipLib/streams/teestream.h
@@ -1,55 +1,47 @@
11 #pragma once
22 #include <ostream>
3-#include <cstdint>
43 #include "streambuffs/tee_streambuff.h"
54
65 /**
76 * \brief Basic teestream. Distributes the input data into every bound output stream.
87 */
9-template <typename ELEM_TYPE, typename TRAITS_TYPE>
10-class basic_teestream
11- : public std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>
8+class teestream
9+ : public std::ostream
1210 {
1311 public:
14- basic_teestream()
15- : std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>(&_teeStreambuf)
12+ teestream()
13+ : std::ostream(&_teeStreambuf)
1614 {
1715
1816 }
1917
20- basic_teestream(basic_teestream<ELEM_TYPE, TRAITS_TYPE>&& other)
21- : basic_teestream()
18+ teestream(teestream&& other)
19+ : teestream()
2220 {
2321 _teeStreambuf = std::move(other._teeStreambuf);
2422 this->swap(other);
2523 }
2624
27- basic_teestream& bind(std::basic_streambuf<ELEM_TYPE, TRAITS_TYPE>* sb)
25+ teestream& bind(std::streambuf* sb)
2826 {
2927 _teeStreambuf.bind(sb);
3028 return *this;
3129 }
3230
33- basic_teestream& bind(std::basic_ostream<ELEM_TYPE, TRAITS_TYPE>& stream)
31+ teestream& bind(std::ostream& stream)
3432 {
3533 _teeStreambuf.bind(stream);
3634 return *this;
3735 }
3836
39- basic_teestream move()
37+ teestream move()
4038 {
4139 return std::move(*this);
4240 }
4341
4442 private:
45- basic_teestream(const basic_teestream&) = delete;
46- basic_teestream& operator = (const basic_teestream&) = delete;
43+ teestream(const teestream&) = delete;
44+ teestream& operator = (const teestream&) = delete;
4745
48- tee_streambuf<ELEM_TYPE, TRAITS_TYPE> _teeStreambuf;
46+ tee_streambuf _teeStreambuf;
4947 };
50-
51-//////////////////////////////////////////////////////////////////////////
52-
53-typedef basic_teestream<uint8_t, std::char_traits<uint8_t>> byte_teestream;
54-typedef basic_teestream<char, std::char_traits<char>> teestream;
55-typedef basic_teestream<wchar_t, std::char_traits<wchar_t>> wteestream;