Line data Source code
1 : // Network Address -- classes functions to ease handling IP addresses
2 : // Copyright (C) 2012-2017 Made to Order Software Corp.
3 : //
4 : // http://snapwebsites.org/project/libaddr
5 : //
6 : // This program is free software; you can redistribute it and/or modify
7 : // it under the terms of the GNU General Public License as published by
8 : // the Free Software Foundation; either version 2 of the License, or
9 : // (at your option) any later version.
10 : //
11 : // This program 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
14 : // GNU General Public License for more details.
15 : //
16 : // You should have received a copy of the GNU General Public License
17 : // along with this program; if not, write to the Free Software
18 : // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 : #pragma once
20 :
21 : /** \file
22 : * \brief The libaddr exceptions.
23 : *
24 : * This header defines various exceptions used throughout the addr library.
25 : */
26 :
27 : // libexcept library
28 : //
29 : #include "libexcept/exception.h"
30 :
31 :
32 : namespace addr
33 : {
34 :
35 :
36 1953 : class addr_invalid_argument_exception : public libexcept::exception_t
37 : {
38 : public:
39 346 : addr_invalid_argument_exception(char const * what_msg) : exception_t(what_msg) {}
40 305 : addr_invalid_argument_exception(std::string const & what_msg) : exception_t(what_msg) {}
41 : };
42 :
43 54 : class addr_invalid_state_exception : public libexcept::exception_t
44 : {
45 : public:
46 17 : addr_invalid_state_exception(char const * what_msg) : exception_t(what_msg) {}
47 1 : addr_invalid_state_exception(std::string const & what_msg) : exception_t(what_msg) {}
48 : };
49 :
50 15 : class addr_io_exception : public libexcept::exception_t
51 : {
52 : public:
53 : addr_io_exception(char const * what_msg) : exception_t(what_msg) {}
54 5 : addr_io_exception(std::string const & what_msg) : exception_t(what_msg) {}
55 : };
56 :
57 : class addr_invalid_structure_exception : public libexcept::logic_exception_t
58 : {
59 : public:
60 : addr_invalid_structure_exception(char const * what_msg) : logic_exception_t(what_msg) {}
61 : addr_invalid_structure_exception(std::string const & what_msg) : logic_exception_t(what_msg) {}
62 : };
63 :
64 : class addr_invalid_parameter_exception : public libexcept::logic_exception_t
65 : {
66 : public:
67 : addr_invalid_parameter_exception(char const * what_msg) : logic_exception_t(what_msg) {}
68 : addr_invalid_parameter_exception(std::string const & what_msg) : logic_exception_t(what_msg) {}
69 : };
70 :
71 :
72 : }
73 : // addr namespace
74 : // vim: ts=4 sw=4 et
|