MessagePack for C++
unpack_exception.hpp
Go to the documentation of this file.
1 //
2 // MessagePack for C++ deserializing routine
3 //
4 // Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
5 //
6 // Distributed under the Boost Software License, Version 1.0.
7 // (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9 //
10 #ifndef MSGPACK_V1_UNPACK_EXCEPTION_HPP
11 #define MSGPACK_V1_UNPACK_EXCEPTION_HPP
12 
13 #include "msgpack/versioning.hpp"
14 
15 #include <string>
16 #include <stdexcept>
17 
18 
19 namespace msgpack {
20 
24 
25 struct unpack_error : public std::runtime_error {
26  explicit unpack_error(const std::string& msg)
27  :std::runtime_error(msg) {}
28 #if !defined(MSGPACK_USE_CPP03)
29  explicit unpack_error(const char* msg):
30  std::runtime_error(msg) {}
31 #endif // !defined(MSGPACK_USE_CPP03)
32 };
33 
34 struct parse_error : public unpack_error {
35  explicit parse_error(const std::string& msg)
36  :unpack_error(msg) {}
37 #if !defined(MSGPACK_USE_CPP03)
38  explicit parse_error(const char* msg)
39  :unpack_error(msg) {}
40 #endif // !defined(MSGPACK_USE_CPP03)
41 };
42 
44  explicit insufficient_bytes(const std::string& msg)
45  :unpack_error(msg) {}
46 #if !defined(MSGPACK_USE_CPP03)
47  explicit insufficient_bytes(const char* msg)
48  :unpack_error(msg) {}
49 #endif // !defined(MSGPACK_USE_CPP03)
50 };
51 
52 struct size_overflow : public unpack_error {
53  explicit size_overflow(const std::string& msg)
54  :unpack_error(msg) {}
55 #if !defined(MSGPACK_USE_CPP03)
56  explicit size_overflow(const char* msg)
57  :unpack_error(msg) {}
58 #endif
59 };
60 
62  array_size_overflow(const std::string& msg)
63  :size_overflow(msg) {}
64 #if !defined(MSGPACK_USE_CPP03)
65  array_size_overflow(const char* msg)
66  :size_overflow(msg) {}
67 #endif
68 };
69 
71  map_size_overflow(const std::string& msg)
72  :size_overflow(msg) {}
73 #if !defined(MSGPACK_USE_CPP03)
74  map_size_overflow(const char* msg)
75  :size_overflow(msg) {}
76 #endif
77 };
78 
80  str_size_overflow(const std::string& msg)
81  :size_overflow(msg) {}
82 #if !defined(MSGPACK_USE_CPP03)
83  str_size_overflow(const char* msg)
84  :size_overflow(msg) {}
85 #endif
86 };
87 
89  bin_size_overflow(const std::string& msg)
90  :size_overflow(msg) {}
91 #if !defined(MSGPACK_USE_CPP03)
92  bin_size_overflow(const char* msg)
93  :size_overflow(msg) {}
94 #endif
95 };
96 
98  ext_size_overflow(const std::string& msg)
99  :size_overflow(msg) {}
100 #if !defined(MSGPACK_USE_CPP03)
101  ext_size_overflow(const char* msg)
102  :size_overflow(msg) {}
103 #endif
104 };
105 
107  depth_size_overflow(const std::string& msg)
108  :size_overflow(msg) {}
109 #if !defined(MSGPACK_USE_CPP03)
110  depth_size_overflow(const char* msg)
111  :size_overflow(msg) {}
112 #endif
113 };
114 
116 } // MSGPACK_API_VERSION_NAMESPACE(v1)
118 
119 } // namespace msgpack
120 
121 
122 #endif // MSGPACK_V1_UNPACK_EXCEPTION_HPP
msgpack::depth_size_overflow::depth_size_overflow
depth_size_overflow(const char *msg)
Definition: unpack_exception.hpp:110
msgpack::size_overflow::size_overflow
size_overflow(const char *msg)
Definition: unpack_exception.hpp:56
msgpack::size_overflow::size_overflow
size_overflow(const std::string &msg)
Definition: unpack_exception.hpp:53
msgpack::insufficient_bytes::insufficient_bytes
insufficient_bytes(const std::string &msg)
Definition: unpack_exception.hpp:44
msgpack::map_size_overflow::map_size_overflow
map_size_overflow(const char *msg)
Definition: unpack_exception.hpp:74
msgpack::depth_size_overflow::depth_size_overflow
depth_size_overflow(const std::string &msg)
Definition: unpack_exception.hpp:107
msgpack
Definition: adaptor_base.hpp:15
msgpack::str_size_overflow
Definition: unpack_exception.hpp:79
msgpack::bin_size_overflow::bin_size_overflow
bin_size_overflow(const char *msg)
Definition: unpack_exception.hpp:92
msgpack::depth_size_overflow
Definition: unpack_exception.hpp:106
msgpack::insufficient_bytes
Definition: unpack_exception.hpp:43
MSGPACK_API_VERSION_NAMESPACE
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:58
msgpack::parse_error::parse_error
parse_error(const std::string &msg)
Definition: unpack_exception.hpp:35
msgpack::map_size_overflow
Definition: unpack_exception.hpp:70
msgpack::unpack_error
Definition: unpack_exception.hpp:25
msgpack::unpack_error::unpack_error
unpack_error(const char *msg)
Definition: unpack_exception.hpp:29
msgpack::array_size_overflow
Definition: unpack_exception.hpp:61
versioning.hpp
msgpack::ext_size_overflow::ext_size_overflow
ext_size_overflow(const std::string &msg)
Definition: unpack_exception.hpp:98
msgpack::parse_error::parse_error
parse_error(const char *msg)
Definition: unpack_exception.hpp:38
msgpack::unpack_error::unpack_error
unpack_error(const std::string &msg)
Definition: unpack_exception.hpp:26
msgpack::parse_error
Definition: unpack_exception.hpp:34
msgpack::str_size_overflow::str_size_overflow
str_size_overflow(const std::string &msg)
Definition: unpack_exception.hpp:80
msgpack::map_size_overflow::map_size_overflow
map_size_overflow(const std::string &msg)
Definition: unpack_exception.hpp:71
msgpack::ext_size_overflow
Definition: unpack_exception.hpp:97
msgpack::array_size_overflow::array_size_overflow
array_size_overflow(const std::string &msg)
Definition: unpack_exception.hpp:62
msgpack::bin_size_overflow::bin_size_overflow
bin_size_overflow(const std::string &msg)
Definition: unpack_exception.hpp:89
msgpack::array_size_overflow::array_size_overflow
array_size_overflow(const char *msg)
Definition: unpack_exception.hpp:65
msgpack::ext_size_overflow::ext_size_overflow
ext_size_overflow(const char *msg)
Definition: unpack_exception.hpp:101
msgpack::str_size_overflow::str_size_overflow
str_size_overflow(const char *msg)
Definition: unpack_exception.hpp:83
msgpack::bin_size_overflow
Definition: unpack_exception.hpp:88
msgpack::insufficient_bytes::insufficient_bytes
insufficient_bytes(const char *msg)
Definition: unpack_exception.hpp:47
msgpack::size_overflow
Definition: unpack_exception.hpp:52