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>
26 archive_exception::append(unsigned int l, const char * a){
27 while(l < (sizeof(m_buffer) - 1)){
37 BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
38 archive_exception::archive_exception(
45 unsigned int length = 0;
48 length = append(length, "uninitialized exception");
50 case unregistered_class:
51 length = append(length, "unregistered class");
53 length = append(length, " - ");
54 length = append(length, e1);
57 case invalid_signature:
58 length = append(length, "invalid signature");
60 case unsupported_version:
61 length = append(length, "unsupported version");
63 case pointer_conflict:
64 length = append(length, "pointer conflict");
66 case incompatible_native_format:
67 length = append(length, "incompatible native format");
69 length = append(length, " - ");
70 length = append(length, e1);
73 case array_size_too_short:
74 length = append(length, "array size too short");
76 case input_stream_error:
77 length = append(length, "input stream error");
79 case invalid_class_name:
80 length = append(length, "class name too long");
82 case unregistered_cast:
83 length = append(length, "unregistered void cast ");
84 length = append(length, (NULL != e1) ? e1 : "?");
85 length = append(length, "<-");
86 length = append(length, (NULL != e2) ? e2 : "?");
88 case unsupported_class_version:
89 length = append(length, "class version ");
90 length = append(length, (NULL != e1) ? e1 : "<unknown class>");
93 // if get here - it indicates a derived exception
94 // was sliced by passing by value in catch
95 length = append(length, "unknown derived exception");
97 case multiple_code_instantiation:
98 length = append(length, "code instantiated in more than one module");
100 length = append(length, " - ");
101 length = append(length, e1);
104 case output_stream_error:
105 length = append(length, "output stream error");
109 length = append(length, "programming error");
113 BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
114 archive_exception::~archive_exception() throw() {}
116 BOOST_ARCHIVE_DECL(const char *)
117 archive_exception::what( ) const throw()
121 BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
122 archive_exception::archive_exception() :