CppCMS
convert.h
1 #ifndef BOOSTER_NOWIDE_CONVERT_H
2 #define BOOSTER_NOWIDE_CONVERT_H
3 
4 #include <booster/config.h>
5 #include <booster/backtrace.h>
6 
7 #if defined(BOOSTER_WIN_NATIVE) || defined(BOOSTER_DOXYGEN_DOCS)
8 namespace booster {
9  namespace nowide {
10 
14  class BOOSTER_API bad_utf : public booster::runtime_error {
15  public:
16  bad_utf();
17  };
18 
22  BOOSTER_API std::string convert(wchar_t const *s);
26  BOOSTER_API std::wstring convert(char const *s);
30  inline std::string convert(std::wstring const &s)
31  {
32  return convert(s.c_str());
33  }
37  inline std::wstring convert(std::string const &s)
38  {
39  return convert(s.c_str());
40  }
41 
42  } // nowide
43 } // booster
44 #endif
45 
46 #endif
Same as std::runtime_error but records stack trace.
Definition: backtrace.h:158
BOOSTER_API std::string convert(wchar_t const *s)
Booster library namespace. The library that implements Boost Like API in ABI backward compatible way...
Definition: application.h:23
This exception is thrown if invalid UTF-8 or UTF-16 is given as input.
Definition: convert.h:14