CppCMS
encoding_errors.h
1 //
2 // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
3 //
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)
7 //
8 #ifndef BOOSTER_LOCALE_ENCODING_ERRORS_H_INCLUDED
9 #define BOOSTER_LOCALE_ENCODING_ERRORS_H_INCLUDED
10 
11 #include <booster/config.h>
12 #ifdef BOOSTER_MSVC
13 # pragma warning(push)
14 # pragma warning(disable : 4275 4251 4231 4660)
15 #endif
16 #include <booster/backtrace.h>
17 
18 
19 
20 namespace booster {
21  namespace locale {
22  namespace conv {
27 
32  public:
33  conversion_error() : booster::runtime_error("Conversion failed") {}
34  };
35 
41  public:
42 
44  invalid_charset_error(std::string charset) :
45  booster::runtime_error("Invalid or unsupported charset:" + charset)
46  {
47  }
48  };
49 
50 
54  typedef enum {
55  skip = 0,
56  stop = 1,
58  } method_type;
59 
60 
62 
63  } // conv
64 
65  } // locale
66 } // boost
67 
68 #ifdef BOOSTER_MSVC
69 #pragma warning(pop)
70 #endif
71 
72 #endif
73 
74 // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
75 
Same as std::runtime_error but records stack trace.
Definition: backtrace.h:158
Default method - skip.
Definition: encoding_errors.h:57
The excepton that is thrown in case of conversion error.
Definition: encoding_errors.h:31
This exception is thrown in case of use of unsupported or invalid character set.
Definition: encoding_errors.h:40
This is the main namespace that encloses all localization classes.
Definition: locale_fwd.h:14
invalid_charset_error(std::string charset)
Create an error for charset charset.
Definition: encoding_errors.h:44
Skip illegal/unconvertable characters.
Definition: encoding_errors.h:55
method_type
Definition: encoding_errors.h:54
Booster library namespace. The library that implements Boost Like API in ABI backward compatible way...
Definition: application.h:23
Stop conversion and throw conversion_error.
Definition: encoding_errors.h:56