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