@@ -127,8 +127,8 @@ extern "C" {
127127// / buffer at all costs.
128128class bz2outbuf : public std ::streambuf {
129129 private:
130- bz2outbuf ( const bz2outbuf& ); // no copies please
131- bz2outbuf& operator =( const bz2outbuf& ); // no copies please
130+ bz2outbuf ( const bz2outbuf& ) = delete ; // no copies please
131+ bz2outbuf& operator =( const bz2outbuf& ) = delete ; // no copies please
132132 protected:
133133 std::streambuf* dest;
134134 std::vector<char > buffer;
@@ -305,12 +305,12 @@ class bz2outbuf : public std::streambuf {
305305 // / std::exception derived exception. All exceptions but
306306 // / std::bad_alloc include descriptions of what went bad. Thus
307307 // / using the what() member makes sense.
308- bz2outbuf (std::streambuf* _dest, unsigned int block_size_100K = 9 ,
309- unsigned int verbosity = 0 , unsigned int work_factor = 0 ,
310- bzalloc_ptr bzalloc = NULL , bzfree_ptr bzfree = NULL ,
311- void * opaque = NULL , size_t stream_buffer_size = 2048 ,
312- size_t out_buffer_size = 2048 )
313- : dest(_dest)
308+ explicit bz2outbuf (std::streambuf* _dest, unsigned int block_size_100K = 9 ,
309+ unsigned int verbosity = 0 , unsigned int work_factor = 0 ,
310+ bzalloc_ptr bzalloc = NULL , bzfree_ptr bzfree = NULL ,
311+ void * opaque = NULL , size_t stream_buffer_size = 2048 ,
312+ size_t out_buffer_size = 2048 )
313+ : dest(_dest)
314314 {
315315 // check the parameters
316316 if (block_size_100K > 9 )
@@ -386,19 +386,19 @@ class bz2outbuf : public std::streambuf {
386386// / stream buffer you want.
387387class bz2ostream : public std ::ostream {
388388protected:
389- bz2outbuf buf;
389+ bz2outbuf buf;
390390public:
391- // / \brief Creates a new bz2ostream object. See
392- // / bz2outbuf::bz2outbuf for an explanation of the parameters.
393- bz2ostream (std::streambuf* dest, unsigned int block_size_100K = 9 ,
394- unsigned int verbosity = 0 , unsigned int work_factor = 0 ,
395- bzalloc_ptr bzalloc = NULL , bzfree_ptr bzfree = NULL ,
396- void * opaque = NULL , size_t buffer_size = 1024 ,
397- size_t out_buffer_size = 1024 )
398- : std::ostream(&buf),
399- buf (dest, block_size_100K, verbosity, work_factor, bzalloc, bzfree,
400- opaque, buffer_size, out_buffer_size)
401- {}
391+ // / \brief Creates a new bz2ostream object. See
392+ // / bz2outbuf::bz2outbuf for an explanation of the parameters.
393+ explicit bz2ostream (std::streambuf* dest, unsigned int block_size_100K = 9 ,
394+ unsigned int verbosity = 0 , unsigned int work_factor = 0 ,
395+ bzalloc_ptr bzalloc = NULL , bzfree_ptr bzfree = NULL ,
396+ void * opaque = NULL , size_t buffer_size = 1024 ,
397+ size_t out_buffer_size = 1024 )
398+ : std::ostream(&buf),
399+ buf(dest, block_size_100K, verbosity, work_factor, bzalloc, bzfree,
400+ opaque, buffer_size, out_buffer_size)
401+ {}
402402};
403403
404404// / \brief A stream buffer reading from another stream buffer and
@@ -408,8 +408,8 @@ class bz2ostream : public std::ostream {
408408// / constructor.
409409class bz2inbuf : public std ::streambuf {
410410 private:
411- bz2inbuf ( const bz2inbuf& ); // no copies please
412- bz2inbuf& operator =( const bz2inbuf& ); // no copies please
411+ bz2inbuf ( const bz2inbuf& ) = delete ; // no copies please
412+ bz2inbuf& operator =( const bz2inbuf& ) = delete ; // no copies please
413413 protected:
414414 std::streambuf* source;
415415 std::vector<char > buffer;
@@ -531,12 +531,12 @@ class bz2inbuf : public std::streambuf {
531531 // /
532532 // / For future compatibility, expect this constructor to throw any
533533 // / std::exception derived exception.
534- bz2inbuf (std::streambuf* _source, unsigned int verbosity = 0 ,
535- bool small_but_slow = false , bzalloc_ptr bzalloc = NULL ,
536- bzfree_ptr bzfree = NULL , void * opaque = NULL ,
537- size_t stream_buffer_size = 1024 , size_t in_buffer_size = 1024 ,
538- size_t max_putback_size = 64 )
539- : source(_source)
534+ explicit bz2inbuf (std::streambuf* _source, unsigned int verbosity = 0 ,
535+ bool small_but_slow = false , bzalloc_ptr bzalloc = NULL ,
536+ bzfree_ptr bzfree = NULL , void * opaque = NULL ,
537+ size_t stream_buffer_size = 1024 , size_t in_buffer_size = 1024 ,
538+ size_t max_putback_size = 64 )
539+ : source(_source)
540540 {
541541 // check the parameters
542542 if (verbosity > 4 )
@@ -606,15 +606,15 @@ class bz2istream : public std::istream {
606606 // / buffer to read data from.
607607 // /
608608 // / See bz2inbuf::bz2inbuf for an explanation of the parameters.
609- bz2istream (std::streambuf* source, unsigned int verbosity = 0 ,
610- bool small_but_slow = false , bzalloc_ptr bzalloc = NULL ,
611- bzfree_ptr bzfree = NULL , void * opaque = NULL ,
612- size_t buffer_size = 1024 , size_t in_buffer_size = 1024 ,
613- size_t max_putback_size = 64 )
614- : std::istream(&buf),
615- buf (source, verbosity, small_but_slow, bzalloc, bzfree, opaque,
616- buffer_size, in_buffer_size, max_putback_size)
617- {}
609+ explicit bz2istream (std::streambuf* source, unsigned int verbosity = 0 ,
610+ bool small_but_slow = false , bzalloc_ptr bzalloc = NULL ,
611+ bzfree_ptr bzfree = NULL , void * opaque = NULL ,
612+ size_t buffer_size = 1024 , size_t in_buffer_size = 1024 ,
613+ size_t max_putback_size = 64 )
614+ : std::istream(&buf),
615+ buf(source, verbosity, small_but_slow, bzalloc, bzfree, opaque,
616+ buffer_size, in_buffer_size, max_putback_size)
617+ {}
618618};
619619
620620#endif // !BZ2STREAM_BZ2STREAM_HPP
0 commit comments