summaryrefslogtreecommitdiff
path: root/boost/libs/serialization/src/archive_exception.cpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2020-05-11 22:17:58 +0200
committerChristoph Berg <myon@debian.org>2020-05-11 22:17:58 +0200
commit32a41b1abe1a4aab0892c9c2051be6ba5b379f1e (patch)
treec6e107c1ee4d70610e43a7912e57c720334a08c7 /boost/libs/serialization/src/archive_exception.cpp
parent08299e8b2bf50ba90daf570f57def529dd29d6e7 (diff)
New upstream version 2.2.0~rc1+repackupstream/2.2.0_rc1+repack
Diffstat (limited to 'boost/libs/serialization/src/archive_exception.cpp')
-rw-r--r--boost/libs/serialization/src/archive_exception.cpp138
1 files changed, 0 insertions, 138 deletions
diff --git a/boost/libs/serialization/src/archive_exception.cpp b/boost/libs/serialization/src/archive_exception.cpp
deleted file mode 100644
index 8fcc6eeb..00000000
--- a/boost/libs/serialization/src/archive_exception.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
-// archive_exception.cpp:
-
-// (C) Copyright 2009 Robert Ramey - http://www.rrsd.com .
-// Use, modification and distribution is subject to the Boost Software
-// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// See http://www.boost.org for updates, documentation, and revision history.
-
-#if (defined _MSC_VER) && (_MSC_VER == 1200)
-# pragma warning (disable : 4786) // too long name, harmless warning
-#endif
-
-#include <exception>
-#include <string>
-#include <cstring>
-
-#define BOOST_ARCHIVE_SOURCE
-#include <boost/serialization/config.hpp>
-#include <boost/archive/archive_exception.hpp>
-
-namespace boost {
-namespace archive {
-
-BOOST_ARCHIVE_DECL
-unsigned int
-archive_exception::append(unsigned int l, const char * a){
- while(l < (sizeof(m_buffer) - 1)){
- char c = *a++;
- if('\0' == c)
- break;
- m_buffer[l++] = c;
- }
- m_buffer[l] = '\0';
- return l;
-}
-
-BOOST_ARCHIVE_DECL
-archive_exception::archive_exception(
- exception_code c,
- const char * e1,
- const char * e2
-) BOOST_NOEXCEPT :
- code(c)
-{
- unsigned int length = 0;
- switch(code){
- case no_exception:
- length = append(length, "uninitialized exception");
- break;
- case unregistered_class:
- length = append(length, "unregistered class");
- if(NULL != e1){
- length = append(length, " - ");
- length = append(length, e1);
- }
- break;
- case invalid_signature:
- length = append(length, "invalid signature");
- break;
- case unsupported_version:
- length = append(length, "unsupported version");
- break;
- case pointer_conflict:
- length = append(length, "pointer conflict");
- break;
- case incompatible_native_format:
- length = append(length, "incompatible native format");
- if(NULL != e1){
- length = append(length, " - ");
- length = append(length, e1);
- }
- break;
- case array_size_too_short:
- length = append(length, "array size too short");
- break;
- case input_stream_error:
- length = append(length, "input stream error");
- break;
- case invalid_class_name:
- length = append(length, "class name too long");
- break;
- case unregistered_cast:
- length = append(length, "unregistered void cast ");
- length = append(length, (NULL != e1) ? e1 : "?");
- length = append(length, "<-");
- length = append(length, (NULL != e2) ? e2 : "?");
- break;
- case unsupported_class_version:
- length = append(length, "class version ");
- length = append(length, (NULL != e1) ? e1 : "<unknown class>");
- break;
- case other_exception:
- // if get here - it indicates a derived exception
- // was sliced by passing by value in catch
- length = append(length, "unknown derived exception");
- break;
- case multiple_code_instantiation:
- length = append(length, "code instantiated in more than one module");
- if(NULL != e1){
- length = append(length, " - ");
- length = append(length, e1);
- }
- break;
- case output_stream_error:
- length = append(length, "output stream error");
- break;
- default:
- BOOST_ASSERT(false);
- length = append(length, "programming error");
- break;
- }
-}
-
-BOOST_ARCHIVE_DECL
-archive_exception::archive_exception(archive_exception const & oth) BOOST_NOEXCEPT :
- std::exception(oth),
- code(oth.code)
-{
- std::memcpy(m_buffer,oth.m_buffer,sizeof m_buffer);
-}
-
-BOOST_ARCHIVE_DECL
-archive_exception::~archive_exception() BOOST_NOEXCEPT_OR_NOTHROW {}
-
-BOOST_ARCHIVE_DECL const char *
-archive_exception::what() const BOOST_NOEXCEPT_OR_NOTHROW {
- return m_buffer;
-}
-
-BOOST_ARCHIVE_DECL
-archive_exception::archive_exception() BOOST_NOEXCEPT :
- code(no_exception)
-{}
-
-} // archive
-} // boost