2017-10-19 18:13:35 +02:00
|
|
|
#pragma once
|
|
|
|
|
2013-11-22 19:28:04 -05:00
|
|
|
#include <sstream>
|
2019-10-21 09:00:54 -04:00
|
|
|
#include <string>
|
2013-11-22 19:28:04 -05:00
|
|
|
|
2020-04-14 10:20:16 -04:00
|
|
|
#if defined(USE_ICU4C)
|
2019-09-16 17:59:24 -07:00
|
|
|
#include <unicode/unistr.h>
|
|
|
|
typedef std::basic_string<UChar> UCharString;
|
2020-04-14 10:20:16 -04:00
|
|
|
#elif defined(USE_STRINGAPISET)
|
|
|
|
typedef std::basic_string<wchar_t> UCharString;
|
2019-09-16 17:59:24 -07:00
|
|
|
#else
|
|
|
|
typedef std::u16string UCharString;
|
|
|
|
#endif
|
|
|
|
|
2017-03-03 14:41:14 -05:00
|
|
|
namespace peparse {
|
2013-11-22 19:28:04 -05:00
|
|
|
template <class T>
|
2017-03-31 17:01:20 +02:00
|
|
|
static std::string to_string(T t, std::ios_base &(*f)(std::ios_base &) ) {
|
|
|
|
std::ostringstream oss;
|
|
|
|
oss << f << t;
|
|
|
|
return oss.str();
|
2013-11-22 19:28:04 -05:00
|
|
|
}
|
2019-09-16 17:59:24 -07:00
|
|
|
|
|
|
|
std::string from_utf16(const UCharString &u);
|
2017-10-19 18:13:35 +02:00
|
|
|
} // namespace peparse
|