encoding_errors.hpp
//
// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_LOCALE_ENCODING_ERRORS_HPP_INCLUDED
#define BOOST_LOCALE_ENCODING_ERRORS_HPP_INCLUDED
#include <boost/locale/definitions.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4275 4251 4231 4660)
#endif
#include <stdexcept>
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(std::string charset) :
std::runtime_error("Invalid or unsupported charset:" + charset)
{
}
};
typedef enum {
skip = 0,
stop = 1,
default_method = skip
} method_type;
} // conv
} // locale
} // boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
boost::locale::conv::conversion_error
The excepton that is thrown in case of conversion error.
Definition: encoding_errors.hpp:31
boost::locale::conv::invalid_charset_error
This exception is thrown in case of use of unsupported or invalid character set.
Definition: encoding_errors.hpp:40
boost::locale::conv::default_method
Default method - skip.
Definition: encoding_errors.hpp:57
boost::locale::conv::invalid_charset_error::invalid_charset_error
invalid_charset_error(std::string charset)
Create an error for charset charset.
Definition: encoding_errors.hpp:44
boost::locale::conv::stop
Stop conversion and throw conversion_error.
Definition: encoding_errors.hpp:56
boost::locale::conv::skip
Skip illegal/unconvertable characters.
Definition: encoding_errors.hpp:55
boost::locale::conv::method_type
method_type
Definition: encoding_errors.hpp:54
- © Copyright 2009-2012 Artyom Beilis, Distributed under the Boost Software License, Version 1.0.