Line data Source code
1 : // Network Address -- classes functions to ease handling IP addresses
2 : // Copyright (c) 2012-2018 Made to Order Software Corp. All Rights Reserved
3 : //
4 : // https://snapwebsites.org/project/libaddr
5 : //
6 : // Permission is hereby granted, free of charge, to any person obtaining a
7 : // copy of this software and associated documentation files (the
8 : // "Software"), to deal in the Software without restriction, including
9 : // without limitation the rights to use, copy, modify, merge, publish,
10 : // distribute, sublicense, and/or sell copies of the Software, and to
11 : // permit persons to whom the Software is furnished to do so, subject to
12 : // the following conditions:
13 : //
14 : // The above copyright notice and this permission notice shall be included
15 : // in all copies or substantial portions of the Software.
16 : //
17 : // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 : // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 : // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 : // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 : // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 : // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 : // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 : //
25 : #pragma once
26 :
27 : /** \file
28 : * \brief The libaddr exceptions.
29 : *
30 : * This header defines various exceptions used throughout the addr library.
31 : */
32 :
33 : // libexcept library
34 : //
35 : #include "libexcept/exception.h"
36 :
37 :
38 : namespace addr
39 : {
40 :
41 :
42 1956 : class addr_invalid_argument_exception : public libexcept::exception_t
43 : {
44 : public:
45 346 : addr_invalid_argument_exception(char const * what_msg) : exception_t(what_msg) {}
46 306 : addr_invalid_argument_exception(std::string const & what_msg) : exception_t(what_msg) {}
47 : };
48 :
49 54 : class addr_invalid_state_exception : public libexcept::exception_t
50 : {
51 : public:
52 17 : addr_invalid_state_exception(char const * what_msg) : exception_t(what_msg) {}
53 1 : addr_invalid_state_exception(std::string const & what_msg) : exception_t(what_msg) {}
54 : };
55 :
56 15 : class addr_io_exception : public libexcept::exception_t
57 : {
58 : public:
59 : addr_io_exception(char const * what_msg) : exception_t(what_msg) {}
60 5 : addr_io_exception(std::string const & what_msg) : exception_t(what_msg) {}
61 : };
62 :
63 : class addr_invalid_structure_exception : public libexcept::logic_exception_t
64 : {
65 : public:
66 : addr_invalid_structure_exception(char const * what_msg) : logic_exception_t(what_msg) {}
67 : addr_invalid_structure_exception(std::string const & what_msg) : logic_exception_t(what_msg) {}
68 : };
69 :
70 : class addr_invalid_parameter_exception : public libexcept::logic_exception_t
71 : {
72 : public:
73 : addr_invalid_parameter_exception(char const * what_msg) : logic_exception_t(what_msg) {}
74 : addr_invalid_parameter_exception(std::string const & what_msg) : logic_exception_t(what_msg) {}
75 : };
76 :
77 :
78 : }
79 : // addr namespace
80 : // vim: ts=4 sw=4 et
|