convert.h
#ifndef BOOSTER_NOWIDE_CONVERT_H
#define BOOSTER_NOWIDE_CONVERT_H
#include <booster/config.h>
#include <booster/backtrace.h>
#if defined(BOOSTER_WIN_NATIVE) || defined(BOOSTER_DOXYGEN_DOCS)
namespace booster {
namespace nowide {
class BOOSTER_API bad_utf : public booster::runtime_error {
public:
bad_utf();
};
BOOSTER_API std::string convert(wchar_t const *s);
BOOSTER_API std::wstring convert(char const *s);
inline std::string convert(std::wstring const &s)
{
return convert(s.c_str());
}
inline std::wstring convert(std::string const &s)
{
return convert(s.c_str());
}
} // nowide
} // booster
#endif
#endif
booster::runtime_error
Same as std::runtime_error but records stack trace.
Definition: backtrace.h:158
booster::nowide::convert
BOOSTER_API std::string convert(wchar_t const *s)
booster::nowide::bad_utf
This exception is thrown if invalid UTF-8 or UTF-16 is given as input.
Definition: convert.h:14