encoding_errors.hpp
//
// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
//
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_LOCALE_ENCODING_ERRORS_HPP_INCLUDED
#define BOOST_LOCALE_ENCODING_ERRORS_HPP_INCLUDED
#include <boost/locale/config.hpp>
#include <stdexcept>
#include <string>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4275 4251 4231 4660)
#endif
namespace boost { namespace locale { namespace conv {
class BOOST_SYMBOL_VISIBLE conversion_error : public std::runtime_error {
public:
conversion_error() : std::runtime_error("Conversion failed") {}
};
class BOOST_SYMBOL_VISIBLE invalid_charset_error : public std::runtime_error {
public:
invalid_charset_error(const std::string& charset) :
std::runtime_error("Invalid or unsupported charset:" + charset)
{}
};
enum method_type {
skip = 0,
stop = 1,
default_method = skip
};
}}} // namespace boost::locale::conv
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#endif
boost::locale::conv::conversion_error
The exception that is thrown in case of conversion error.
Definition: encoding_errors.hpp:25
boost::locale::conv::invalid_charset_error
This exception is thrown in case of use of unsupported or invalid character set.
Definition: encoding_errors.hpp:32
boost::locale::conv::default_method
Default method - skip.
Definition: encoding_errors.hpp:44
boost::locale::conv::invalid_charset_error::invalid_charset_error
invalid_charset_error(const std::string &charset)
Create an error for charset charset.
Definition: encoding_errors.hpp:35
boost::locale::conv::stop
Stop conversion and throw conversion_error.
Definition: encoding_errors.hpp:43
boost::locale::conv::skip
Skip illegal/unconvertible characters.
Definition: encoding_errors.hpp:42
boost::locale::conv::method_type
method_type
enum that defines conversion policy
Definition: encoding_errors.hpp:41
- © Copyright 2009-2012 Artyom Beilis, Distributed under the Boost Software License, Version 1.0.