Chris@16: #ifndef BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP Chris@16: #define BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP Chris@16: Chris@16: // MS compatible compilers support #pragma once Chris@101: #if defined(_MSC_VER) Chris@16: # pragma once Chris@16: #endif Chris@16: Chris@16: /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 Chris@16: // archive/archive_exception.hpp: Chris@16: Chris@16: // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . Chris@16: // Use, modification and distribution is subject to the Boost Software Chris@16: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // See http://www.boost.org for updates, documentation, and revision history. Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: // note: the only reason this is in here is that windows header Chris@16: // includes #define exception_code _exception_code (arrrgghhhh!). Chris@16: // the most expedient way to address this is be sure that this Chris@16: // header is always included whenever this header file is included. Chris@16: #if defined(BOOST_WINDOWS) Chris@16: #include Chris@16: #endif Chris@16: Chris@16: #include // must be the last header Chris@16: Chris@16: namespace boost { Chris@16: namespace archive { Chris@16: Chris@16: ////////////////////////////////////////////////////////////////////// Chris@16: // exceptions thrown by archives Chris@16: // Chris@16: class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) archive_exception : Chris@16: public virtual std::exception Chris@16: { Chris@16: protected: Chris@16: char m_buffer[128]; Chris@16: public: Chris@16: typedef enum { Chris@16: no_exception, // initialized without code Chris@16: other_exception, // any excepton not listed below Chris@101: unregistered_class, // attempt to serialize a pointer of Chris@16: // an unregistered class Chris@16: invalid_signature, // first line of archive does not contain Chris@16: // expected string Chris@16: unsupported_version,// archive created with library version Chris@16: // subsequent to this one Chris@16: pointer_conflict, // an attempt has been made to directly Chris@16: // serialize an object which has Chris@101: // already been serialized through a pointer. Chris@101: // Were this permitted, the archive load would result Chris@16: // in the creation of an extra copy of the obect. Chris@16: incompatible_native_format, // attempt to read native binary format Chris@16: // on incompatible platform Chris@16: array_size_too_short,// array being loaded doesn't fit in array allocated Chris@16: input_stream_error, // error on input stream Chris@16: invalid_class_name, // class name greater than the maximum permitted. Chris@16: // most likely a corrupted archive or an attempt Chris@16: // to insert virus via buffer overrun method. Chris@16: unregistered_cast, // base - derived relationship not registered with Chris@16: // void_cast_register Chris@16: unsupported_class_version, // type saved with a version # greater than the Chris@101: // one used by the program. This indicates that the program Chris@16: // needs to be rebuilt. Chris@16: multiple_code_instantiation, // code for implementing serialization for some Chris@16: // type has been instantiated in more than one module. Chris@16: output_stream_error // error on input stream Chris@16: } exception_code; Chris@16: public: Chris@16: exception_code code; Chris@16: archive_exception( Chris@16: exception_code c, Chris@16: const char * e1 = NULL, Chris@16: const char * e2 = NULL Chris@16: ); Chris@16: virtual ~archive_exception() throw(); Chris@16: virtual const char *what() const throw(); Chris@16: protected: Chris@16: unsigned int Chris@16: append(unsigned int l, const char * a); Chris@16: archive_exception(); Chris@16: }; Chris@16: Chris@16: }// namespace archive Chris@16: }// namespace boost Chris@16: Chris@16: #include // pops abi_suffix.hpp pragmas Chris@16: Chris@16: #endif //BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP