Orcus
exception.hpp
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6  */
7 
8 #ifndef INCLUDED_ORCUS_EXCEPTION_HPP
9 #define INCLUDED_ORCUS_EXCEPTION_HPP
10 
11 #include <stdexcept>
12 #include <string>
13 
14 #include "env.hpp"
15 
16 namespace orcus {
17 
18 class ORCUS_PSR_DLLPUBLIC general_error : public std::exception
19 {
20 public:
21  explicit general_error(const std::string& msg);
22  explicit general_error(const std::string& cls, const std::string& msg);
23  virtual ~general_error() throw();
24  virtual const char* what() const throw();
25 
26 protected:
27  void append_msg(const std::string& s);
28 
29 private:
30  ::std::string m_msg;
31 };
32 
33 class ORCUS_PSR_DLLPUBLIC invalid_arg_error : public std::invalid_argument
34 {
35 public:
36  explicit invalid_arg_error(const std::string& msg);
37  virtual ~invalid_arg_error() throw();
38 };
39 
40 class ORCUS_PSR_DLLPUBLIC xml_structure_error : public general_error
41 {
42 public:
43  explicit xml_structure_error(const ::std::string& msg);
44  virtual ~xml_structure_error() throw();
45 };
46 
47 class ORCUS_PSR_DLLPUBLIC json_structure_error : public general_error
48 {
49 public:
50  explicit json_structure_error(const ::std::string& msg);
51  virtual ~json_structure_error() throw();
52 };
53 
54 class ORCUS_PSR_DLLPUBLIC invalid_map_error : public general_error
55 {
56 public:
57  explicit invalid_map_error(const ::std::string& msg);
58  virtual ~invalid_map_error() throw();
59 };
60 
61 class ORCUS_PSR_DLLPUBLIC value_error : public general_error
62 {
63 public:
64  explicit value_error(const std::string& msg);
65  virtual ~value_error() throw();
66 };
67 
68 }
69 
70 #endif
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: exception.hpp:54
Definition: exception.hpp:18
Definition: exception.hpp:61
Definition: exception.hpp:33
Definition: exception.hpp:40
Definition: exception.hpp:47
Definition: base64.hpp:15