1 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
2 // archive_exception.cpp:
4 // (C) Copyright 2009 Robert Ramey - http://www.rrsd.com .
5 // Use, modification and distribution is subject to the Boost Software
6 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // See http://www.boost.org for updates, documentation, and revision history.
11 #if (defined _MSC_VER) && (_MSC_VER == 1200)
12 # pragma warning (disable : 4786) // too long name, harmless warning
19 #define BOOST_ARCHIVE_SOURCE
20 #include <boost/serialization/config.hpp>
21 #include <boost/archive/archive_exception.hpp>
28 archive_exception::append(unsigned int l
, const char * a
){
29 while(l
< (sizeof(m_buffer
) - 1)){
40 archive_exception::archive_exception(
47 unsigned int length
= 0;
50 length
= append(length
, "uninitialized exception");
52 case unregistered_class
:
53 length
= append(length
, "unregistered class");
55 length
= append(length
, " - ");
56 length
= append(length
, e1
);
59 case invalid_signature
:
60 length
= append(length
, "invalid signature");
62 case unsupported_version
:
63 length
= append(length
, "unsupported version");
65 case pointer_conflict
:
66 length
= append(length
, "pointer conflict");
68 case incompatible_native_format
:
69 length
= append(length
, "incompatible native format");
71 length
= append(length
, " - ");
72 length
= append(length
, e1
);
75 case array_size_too_short
:
76 length
= append(length
, "array size too short");
78 case input_stream_error
:
79 length
= append(length
, "input stream error");
81 length
= append(length
, "-");
82 length
= append(length
, e1
);
85 length
= append(length
, "-");
86 length
= append(length
, e2
);
89 case invalid_class_name
:
90 length
= append(length
, "class name too long");
92 case unregistered_cast
:
93 length
= append(length
, "unregistered void cast ");
94 length
= append(length
, (NULL
!= e1
) ? e1
: "?");
95 length
= append(length
, "<-");
96 length
= append(length
, (NULL
!= e2
) ? e2
: "?");
98 case unsupported_class_version
:
99 length
= append(length
, "class version ");
100 length
= append(length
, (NULL
!= e1
) ? e1
: "<unknown class>");
102 case other_exception
:
103 // if get here - it indicates a derived exception
104 // was sliced by passing by value in catch
105 length
= append(length
, "unknown derived exception");
107 case multiple_code_instantiation
:
108 length
= append(length
, "code instantiated in more than one module");
110 length
= append(length
, " - ");
111 length
= append(length
, e1
);
114 case output_stream_error
:
115 length
= append(length
, "output stream error");
117 length
= append(length
, "-");
118 length
= append(length
, e1
);
121 length
= append(length
, "-");
122 length
= append(length
, e2
);
127 length
= append(length
, "programming error");
133 archive_exception::archive_exception(archive_exception
const & oth
) BOOST_NOEXCEPT
:
137 std::memcpy(m_buffer
,oth
.m_buffer
,sizeof m_buffer
);
141 archive_exception::~archive_exception() BOOST_NOEXCEPT_OR_NOTHROW
{}
143 BOOST_ARCHIVE_DECL
const char *
144 archive_exception::what() const BOOST_NOEXCEPT_OR_NOTHROW
{
149 archive_exception::archive_exception() BOOST_NOEXCEPT
: