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
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <boost/config.hpp>
0020 #ifndef BOOST_NO_EXCEPTIONS
0021 #include <exception>
0022 #endif
0023
0024 #include <boost/assert.hpp>
0025
0026 namespace boost {
0027 namespace archive {
0028 namespace iterators {
0029
0030
0031
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 }
0077 }
0078 }
0079
0080 #endif