1 #ifndef BOOST_ARCHIVE_ITERATORS_BASE64_EXCEPTION_HPP
2 #define BOOST_ARCHIVE_ITERATORS_BASE64_EXCEPTION_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // base64_exception.hpp:
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 #include <boost/config.hpp>
20 #ifndef BOOST_NO_EXCEPTIONS
23 #include <boost/assert.hpp>
29 //////////////////////////////////////////////////////////////////////
30 // exceptions thrown by base64s
32 class base64_exception
: public std::exception
36 invalid_code
, // attempt to encode a value > 6 bits
37 invalid_character
, // decode a value not in base64 char set
42 base64_exception(exception_code c
= other_exception
) : code(c
)
45 virtual const char *what( ) const throw( )
47 const char *msg
= "unknown exception code";
50 msg
= "attempt to encode a value > 6 bits";
52 case invalid_character
:
53 msg
= "attempt to decode a value not in base64 char set";
63 } // namespace iterators
64 } // namespace archive
67 #endif //BOOST_NO_EXCEPTIONS
68 #endif //BOOST_ARCHIVE_ITERATORS_ARCHIVE_EXCEPTION_HPP