Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
except/bz.h
Go to the documentation of this file.
1 /*! \file xstream/except/bz.h
2  *
3  * \brief exceptions related to bzlib usage xstream::bz namespace
4  *
5  */
6 
7 #ifndef __XSTREAM_EXCEPT_BZ_H
8 #define __XSTREAM_EXCEPT_BZ_H
9 
10 #include <xstream/config.h>
11 
12 #include <string>
13 #include <xstream/except.h>
14 #include <xstream/bz.h>
15 
16 namespace xstream{
17  namespace bz{
18 
19 /*!
20  * \brief errors in bzlib usage
21  *
22  */
24 {
25  public:
27  const std::string& w="generic error in bzlib stream"
28  )
29  :xstream::fatal_error(w)
30  {};
31  virtual std::string module() const
32  {
33  return (xstream::fatal_error::module()+"::bzlib");
34  }
35 };
36 
37 /*!
38  * \brief general bzlib compression errors
39  *
40  */
41 
42 
44 {
45  public:
46  /*!
47  * \brief ostreambuf that caused the exception
48  *
49  * */
50  xstream::bz::ostreambuf* stream;
52  xstream::bz::ostreambuf* p,
53  const std::string& w
54  )
55  :general_error(w),stream(p){};
56 
57  compress_error(xstream::bz::ostreambuf* p)
58  :general_error(),stream(p){};
59 
60  virtual std::string module() const{
61  return (general_error::module()+"::compress");
62  }
63 };
64 
65 
66 /*!
67  * \brief general bzlib decompression errors
68  *
69  */
70 
72  public:
73  /*!
74  * \brief istreambuf that caused the exception
75  *
76  * */
77  xstream::bz::istreambuf* stream;
79  xstream::bz::istreambuf* p,
80  const std::string& w
81  )
82  :general_error(w),stream(p)
83  {};
84 
85  decompress_error(xstream::bz::istreambuf* p)
86  :general_error(),stream(p)
87  {};
88 
89  virtual std::string module() const
90  {
91  return (general_error::module()+"::decompress");
92  }
93 };
94 
95 }//namespace bz
96 }//namespace xstream
97 
98 #endif
Main header file for exception related to xstream library.
char string[256]
compress_error(xstream::bz::ostreambuf *p)
Definition: except/bz.h:57
general errors only detected at runtime, no solution possible
Definition: except.h:23
virtual std::string module() const
describes the current library module (zlib,bzlib,base64,...)
Definition: except/bz.h:60
compress_error(xstream::bz::ostreambuf *p, const std::string &w)
Definition: except/bz.h:51
xstream::bz::istreambuf * stream
istreambuf that caused the exception
Definition: except/bz.h:77
C++ streambuf interface to read and write bzip2 streams.
decompress_error(xstream::bz::istreambuf *p)
Definition: except/bz.h:85
errors in bzlib usage
Definition: except/bz.h:23
general bzlib compression errors
Definition: except/bz.h:43
decompress_error(xstream::bz::istreambuf *p, const std::string &w)
Definition: except/bz.h:78
general bzlib decompression errors
Definition: except/bz.h:71
virtual std::string module() const
describes the current library module (zlib,bzlib,base64,...)
Definition: except/bz.h:31
virtual std::string module() const
describes the current library module (zlib,bzlib,base64,...)
Definition: except/bz.h:89
xstream::bz::ostreambuf * stream
ostreambuf that caused the exception
Definition: except/bz.h:50
virtual std::string module() const
describes the current library module (zlib,bzlib,base64,...)
Definition: except.h:33
general_error(const std::string &w="generic error in bzlib stream")
Definition: except/bz.h:26