Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:29

0001 #ifndef BOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP
0002 #define BOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP
0003 
0004 // MS compatible compilers support #pragma once
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008 
0009 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
0010 // dataflow_exception.hpp:
0011 
0012 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
0013 // Use, modification and distribution is subject to the Boost Software
0014 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0015 // http://www.boost.org/LICENSE_1_0.txt)
0016 
0017 //  See http://www.boost.org for updates, documentation, and revision history.
0018 
0019 #include <boost/config.hpp>
0020 #ifndef BOOST_NO_EXCEPTIONS
0021 #include <exception>
0022 #endif //BOOST_NO_EXCEPTIONS
0023 
0024 #include <boost/assert.hpp>
0025 
0026 namespace boost {
0027 namespace archive {
0028 namespace iterators {
0029 
0030 //////////////////////////////////////////////////////////////////////
0031 // exceptions thrown by dataflows
0032 //
0033 class dataflow_exception : public std::exception
0034 {
0035 public:
0036     typedef enum {
0037         invalid_6_bitcode,
0038         invalid_base64_character,
0039         invalid_xml_escape_sequence,
0040         comparison_not_permitted,
0041         invalid_conversion,
0042         other_exception
0043     } exception_code;
0044     exception_code code;
0045 
0046     dataflow_exception(exception_code c = other_exception) : code(c)
0047     {}
0048 
0049     const char *what( ) const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE
0050     {
0051         const char *msg = "unknown exception code";
0052         switch(code){
0053         case invalid_6_bitcode:
0054             msg = "attempt to encode a value > 6 bits";
0055             break;
0056         case invalid_base64_character:
0057             msg = "attempt to decode a value not in base64 char set";
0058             break;
0059         case invalid_xml_escape_sequence:
0060             msg = "invalid xml escape_sequence";
0061             break;
0062         case comparison_not_permitted:
0063             msg = "cannot invoke iterator comparison now";
0064             break;
0065         case invalid_conversion:
0066             msg = "invalid multbyte/wide char conversion";
0067             break;
0068         default:
0069             BOOST_ASSERT(false);
0070             break;
0071         }
0072         return msg;
0073     }
0074 };
0075 
0076 } // namespace iterators
0077 } // namespace archive
0078 } // namespace boost
0079 
0080 #endif //BOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP