2 // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_LOCALE_ENCODING_ERRORS_HPP_INCLUDED
9 #define BOOST_LOCALE_ENCODING_ERRORS_HPP_INCLUDED
11 #include <boost/locale/definitions.hpp>
13 # pragma warning(push)
14 # pragma warning(disable : 4275 4251 4231 4660)
24 /// \addtogroup codepage
29 /// \brief The excepton that is thrown in case of conversion error
31 class BOOST_SYMBOL_VISIBLE conversion_error : public std::runtime_error {
33 conversion_error() : std::runtime_error("Conversion failed") {}
37 /// \brief This exception is thrown in case of use of unsupported
38 /// or invalid character set
40 class BOOST_SYMBOL_VISIBLE invalid_charset_error : public std::runtime_error {
43 /// Create an error for charset \a charset
44 invalid_charset_error(std::string charset) :
45 std::runtime_error("Invalid or unsupported charset:" + charset)
52 /// enum that defines conversion policy
55 skip = 0, ///< Skip illegal/unconvertable characters
56 stop = 1, ///< Stop conversion and throw conversion_error
57 default_method = skip ///< Default method - skip
74 // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4