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
16 #include <boost/assert.hpp>
19 #define BOOST_ARCHIVE_SOURCE
20 #include <boost/archive/archive_exception.hpp>
25 BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
26 archive_exception::archive_exception(
33 m_msg = "programming error";
36 m_msg = "uninitialized exception";
38 case unregistered_class:
39 m_msg = "unregistered class";
45 case invalid_signature:
46 m_msg = "invalid signature";
48 case unsupported_version:
49 m_msg = "unsupported version";
51 case pointer_conflict:
52 m_msg = "pointer conflict";
54 case incompatible_native_format:
55 m_msg = "incompatible native format";
61 case array_size_too_short:
62 m_msg = "array size too short";
64 case input_stream_error:
65 m_msg = "input stream error";
67 case invalid_class_name:
68 m_msg = "class name too long";
70 case unregistered_cast:
71 m_msg = "unregistered void cast ";
72 m_msg += (NULL != e1) ? e1 : "?";
74 m_msg += (NULL != e2) ? e2 : "?";
76 case unsupported_class_version:
77 m_msg = "class version ";
78 m_msg += (NULL != e1) ? e1 : "<unknown class>";
81 // if get here - it indicates a derived exception
82 // was sliced by passing by value in catch
83 m_msg = "unknown derived exception";
85 case multiple_code_instantiation:
86 m_msg = "code instantiated in more than one module";
92 case output_stream_error:
93 m_msg = "output stream error";
100 BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
101 archive_exception::~archive_exception() throw () {}
103 BOOST_ARCHIVE_DECL(const char *)
104 archive_exception::what( ) const throw()
106 return m_msg.c_str();
108 BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
109 archive_exception::archive_exception() :