Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:16

0001 //
0002 // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0.
0005 // https://www.boost.org/LICENSE_1_0.txt
0006 
0007 #ifndef BOOST_LOCALE_ENCODING_ERRORS_HPP_INCLUDED
0008 #define BOOST_LOCALE_ENCODING_ERRORS_HPP_INCLUDED
0009 
0010 #include <boost/locale/config.hpp>
0011 #include <stdexcept>
0012 #include <string>
0013 
0014 #ifdef BOOST_MSVC
0015 #    pragma warning(push)
0016 #    pragma warning(disable : 4275 4251 4231 4660)
0017 #endif
0018 
0019 namespace boost { namespace locale { namespace conv {
0020     /// \addtogroup codepage
0021     ///
0022     /// @{
0023 
0024     /// \brief The exception that is thrown in case of conversion error
0025     class BOOST_SYMBOL_VISIBLE conversion_error : public std::runtime_error {
0026     public:
0027         conversion_error() : std::runtime_error("Conversion failed") {}
0028     };
0029 
0030     /// \brief This exception is thrown in case of use of unsupported
0031     /// or invalid character set
0032     class BOOST_SYMBOL_VISIBLE invalid_charset_error : public std::runtime_error {
0033     public:
0034         /// Create an error for charset \a charset
0035         invalid_charset_error(const std::string& charset) :
0036             std::runtime_error("Invalid or unsupported charset: " + charset)
0037         {}
0038     };
0039 
0040     /// enum that defines conversion policy
0041     enum method_type {
0042         skip = 0,             ///< Skip illegal/unconvertible characters
0043         stop = 1,             ///< Stop conversion and throw conversion_error
0044         default_method = skip ///< Default method - skip
0045     };
0046 
0047     /// @}
0048 
0049 }}} // namespace boost::locale::conv
0050 
0051 #ifdef BOOST_MSVC
0052 #    pragma warning(pop)
0053 #endif
0054 
0055 #endif