CppCMS
booster/locale/encoding_errors.h
00001 //
00002 //  Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
00003 //
00004 //  Distributed under the Boost Software License, Version 1.0. (See
00005 //  accompanying file LICENSE_1_0.txt or copy at
00006 //  http://www.boost.org/LICENSE_1_0.txt)
00007 //
00008 #ifndef BOOSTER_LOCALE_ENCODING_ERRORS_H_INCLUDED
00009 #define BOOSTER_LOCALE_ENCODING_ERRORS_H_INCLUDED
00010 
00011 #include <booster/config.h>
00012 #ifdef BOOSTER_MSVC
00013 #  pragma warning(push)
00014 #  pragma warning(disable : 4275 4251 4231 4660)
00015 #endif
00016 #include <booster/backtrace.h>
00017 
00018 
00019 
00020 namespace booster {
00021     namespace locale {
00022         namespace conv {
00027 
00031             class  conversion_error : public booster::runtime_error {
00032             public:
00033                 conversion_error() : booster::runtime_error("Conversion failed") {}
00034             };
00035             
00040             class  invalid_charset_error : public booster::runtime_error {
00041             public:
00042 
00044                 invalid_charset_error(std::string charset) : 
00045                     booster::runtime_error("Invalid or unsupported charset:" + charset)
00046                 {
00047                 }
00048             };
00049             
00050 
00054             typedef enum {
00055                 skip            = 0,    
00056                 stop            = 1,    
00057                 default_method  = skip  
00058             } method_type;
00059 
00060 
00062 
00063         } // conv
00064 
00065     } // locale
00066 } // boost
00067 
00068 #ifdef BOOSTER_MSVC
00069 #pragma warning(pop)
00070 #endif
00071 
00072 #endif
00073 
00074 // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
00075