Ice 3.7 C++11 API Reference
|
Go to the documentation of this file.
5 #ifndef ICE_UTIL_STRING_CONVERTER_H
6 #define ICE_UTIL_STRING_CONVERTER_H
45 template<
typename charT>
47 #ifndef ICE_CPP11_MAPPING
62 virtual void fromUTF8(
const Byte* sourceStart,
const Byte* sourceEnd, std::basic_string<charT>& target)
const = 0;
69 #if defined(__clang__) && !defined(ICE_STATIC_LIBS)
74 template class ICE_API BasicStringConverter<char>;
75 template class ICE_API BasicStringConverter<wchar_t>;
164 namespace IceUtilInternal
170 ICE_API std::vector<unsigned short> toUTF16(
const std::vector<IceUtil::Byte>&);
171 ICE_API std::vector<unsigned int> toUTF32(
const std::vector<IceUtil::Byte>&);
176 ICE_API std::vector<IceUtil::Byte> fromUTF32(
const std::vector<unsigned int>&);
WstringConverterPtr getProcessWstringConverter()
Retrieves the per-process wide string converter.
#define ICE_DEFINE_PTR(TPtr, T)
Definition: Config.h:359
virtual void fromUTF8(const Byte *sourceStart, const Byte *sourceEnd, std::basic_string< charT > &target) const =0
Unmarshals a UTF-8 sequence into a basic_string.
::std::shared_ptr< WstringConverter > WstringConverterPtr
Definition: StringConverter.h:84
std::string nativeToUTF8(const std::string &str, const StringConverterPtr &nc)
Converts the given string from the native narrow string encoding to UTF-8 using the given converter.
Definition: Optional.h:1095
#define ICE_API
Definition: Config.h:197
void setProcessStringConverter(const StringConverterPtr &c)
Sets the per-process narrow string converter.
std::string UTF8ToNative(const std::string &str, const StringConverterPtr &nc)
Converts the given string from UTF-8 to the native narrow string encoding using the given converter.
BasicStringConverter< char > StringConverter
A narrow string converter.
Definition: StringConverter.h:79
virtual ~BasicStringConverter()
Definition: StringConverter.h:64
unsigned char Byte
Definition: Config.h:326
virtual Byte * getMoreBytes(size_t howMany, Byte *firstUnused)=0
Obtains more bytes.
BasicStringConverter< wchar_t > WstringConverter
A wide string converter.
Definition: StringConverter.h:83
Provides bytes to toUTF8.
Definition: StringConverter.h:24
virtual Byte * toUTF8(const charT *sourceStart, const charT *sourceEnd, UTF8Buffer &buf) const =0
Returns a pointer to byte after the last written byte (which may be past the last byte returned by ge...
std::wstring stringToWstring(const std::string &str, const StringConverterPtr &nc=0, const WstringConverterPtr &wc=0)
Converts the given narrow string to a wide string.
::std::shared_ptr< StringConverter > StringConverterPtr
Definition: StringConverter.h:80
StringConverterPtr getProcessStringConverter()
Retrieves the per-process narrow string converter.
void setProcessWstringConverter(const WstringConverterPtr &c)
Sets the per process wide string converter.
WstringConverterPtr createUnicodeWstringConverter()
Creates a WstringConverter that converts to and from UTF-16 or UTF-32 depending on sizeof(wchar_t).
A StringConverter converts narrow or wide-strings to and from UTF-8 byte sequences.
Definition: StringConverter.h:50
std::string wstringToString(const std::wstring &str, const StringConverterPtr &nc=0, const WstringConverterPtr &wc=0)
Converts the given wide string to a narrow string.