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 case invalid_class_name
:
82 length
= append(length
, "class name too long");
84 case unregistered_cast
:
85 length
= append(length
, "unregistered void cast ");
86 length
= append(length
, (NULL
!= e1
) ? e1
: "?");
87 length
= append(length
, "<-");
88 length
= append(length
, (NULL
!= e2
) ? e2
: "?");
90 case unsupported_class_version
:
91 length
= append(length
, "class version ");
92 length
= append(length
, (NULL
!= e1
) ? e1
: "<unknown class>");
95 // if get here - it indicates a derived exception
96 // was sliced by passing by value in catch
97 length
= append(length
, "unknown derived exception");
99 case multiple_code_instantiation
:
100 length
= append(length
, "code instantiated in more than one module");
102 length
= append(length
, " - ");
103 length
= append(length
, e1
);
106 case output_stream_error
:
107 length
= append(length
, "output stream error");
111 length
= append(length
, "programming error");
117 archive_exception::archive_exception(archive_exception
const & oth
) BOOST_NOEXCEPT
:
121 std::memcpy(m_buffer
,oth
.m_buffer
,sizeof m_buffer
);
125 archive_exception::~archive_exception() BOOST_NOEXCEPT_OR_NOTHROW
{}
127 BOOST_ARCHIVE_DECL
const char *
128 archive_exception::what() const BOOST_NOEXCEPT_OR_NOTHROW
{
133 archive_exception::archive_exception() BOOST_NOEXCEPT
: