libopenraw
exception.hpp
1/*
2 * libopenraw - exception.h
3 *
4 * Copyright (C) 2006-2014 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#ifndef OR_INTERNALS_EXCEPTION_H_
22#define OR_INTERNALS_EXCEPTION_H_
23
24#include <exception>
25#include <string>
26#include <typeinfo>
27
28namespace OpenRaw {
29namespace Internals {
30
32class Exception
33 : public std::exception
34{
35protected:
36 std::string m_what;
37public:
38 Exception()
39 : std::exception(),
40 m_what()
41 {}
42 Exception(const std::string &w)
43 : std::exception(),
44 m_what(w)
45 {}
46 virtual ~Exception()
47 {}
48 const char *what() const noexcept(true) override
49 {
50 if(m_what.empty()) {
51 return typeid(this).name();
52 }
53 return m_what.c_str();
54 }
55};
56
58class IOException
59 : public Exception
60{
61public:
62 IOException(const std::string &w)
63 : Exception(w)
64 {}
65};
66
67
70 : public Exception
71{
72
73};
74
77 : public Exception
78{
79};
80
82 : public Exception
83{
84};
85
86class DecodingException
87 : public Exception
88{
89public:
90 DecodingException(const std::string &w)
91 : Exception(w)
92 {}
93};
94
95}
96}
97
98#endif
99/*
100 Local Variables:
101 mode:c++
102 c-file-style:"stroustrup"
103 c-file-offsets:((innamespace . 0))
104 tab-width:2
105 c-basic-offset:2
106 indent-tabs-mode:nil
107 fill-column:80
108 End:
109*/
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard....
Definition arwfile.cpp:30