libopenraw
exception.h
1 /*
2  * libopenraw - exception.h
3  *
4  * Copyright (C) 2006-2007 Hubert Figuiere
5  *
6  * This library is free software: you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation, either version 3 of
9  * the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 
23 #ifndef _OPENRAW_EXCEPTION_H_
24 #define _OPENRAW_EXCEPTION_H_
25 
26 #include <exception>
27 #include <string>
28 #include <typeinfo>
29 
30 namespace OpenRaw {
31  namespace Internals {
32 
34  class Exception
35  : public std::exception
36  {
37  protected:
38  std::string m_what;
39  public:
40  Exception()
41  : std::exception(),
42  m_what()
43  {}
44  Exception(const std::string &w)
45  : std::exception(),
46  m_what(w)
47  {}
48  virtual ~Exception() throw()
49  {}
50  const char *what() const throw()
51  {
52  if(m_what.empty()) {
53  return typeid(this).name();
54  }
55  return m_what.c_str();
56  }
57  };
58 
61  : public Exception
62  {
63  public:
64  IOException(const std::string &w)
65  : Exception(w)
66  {}
67  };
68 
69 
72  : public Exception
73  {
74 
75  };
76 
79  : public Exception
80  {
81  };
82 
84  : public Exception
85  {
86  };
87 
89  : public Exception
90  {
91  public:
92  DecodingException(const std::string &w)
93  : Exception(w)
94  {}
95  };
96 
97  }
98 }
99 
100 #endif
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard. I guess it failed.
Definition: arwfile.cpp:33