CppCMS
booster/nowide/convert.h
00001 #ifndef BOOSTER_NOWIDE_CONVERT_H
00002 #define BOOSTER_NOWIDE_CONVERT_H
00003 
00004 #include <booster/config.h>
00005 #include <booster/backtrace.h>
00006 
00007 #if defined(BOOSTER_WIN_NATIVE) || defined(BOOSTER_DOXYGEN_DOCS)
00008 namespace booster {
00009         namespace nowide {
00010 
00014                 class BOOSTER_API bad_utf : public booster::runtime_error {
00015                 public:
00016                         bad_utf();
00017                 };
00018 
00022                 BOOSTER_API std::string convert(wchar_t const *s);
00026                 BOOSTER_API std::wstring convert(char const *s);
00030                 inline std::string convert(std::wstring const &s) 
00031                 {
00032                         return convert(s.c_str());
00033                 }
00037                 inline std::wstring convert(std::string const &s) 
00038                 {
00039                         return convert(s.c_str());
00040                 }
00041 
00042         } // nowide
00043 } // booster
00044 #endif
00045 
00046 #endif