cprover
unicode.h File Reference
#include <algorithm>
#include <string>
#include <vector>
+ Include dependency graph for unicode.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::string narrow (const wchar_t *s)
 
std::wstring widen (const char *s)
 
std::string narrow (const std::wstring &s)
 
std::wstring widen (const std::string &s)
 
std::string utf32_native_endian_to_utf8 (const std::basic_string< unsigned int > &s)
 
std::wstring utf8_to_utf16_native_endian (const std::string &in)
 Convert UTF8-encoded string to UTF-16 with architecture-native endianness. More...
 
std::string utf16_native_endian_to_java (const char16_t ch)
 
std::string utf16_native_endian_to_java (const std::wstring &in)
 
std::vector< std::string > narrow_argv (int argc, const wchar_t **argv_wide)
 
template<typename It >
std::vector< const char * > to_c_str_array (It b, It e)
 

Function Documentation

◆ narrow() [1/2]

std::string narrow ( const std::wstring &  s)

Definition at line 77 of file unicode.cpp.

◆ narrow() [2/2]

std::string narrow ( const wchar_t *  s)

Definition at line 27 of file unicode.cpp.

◆ narrow_argv()

std::vector<std::string> narrow_argv ( int  argc,
const wchar_t **  argv_wide 
)

Definition at line 152 of file unicode.cpp.

◆ to_c_str_array()

template<typename It >
std::vector<const char *> to_c_str_array ( It  b,
It  e 
)

Definition at line 35 of file unicode.h.

◆ utf16_native_endian_to_java() [1/2]

std::string utf16_native_endian_to_java ( const char16_t  ch)
Parameters
chUTF-16 character in architecture-native endianness encoding
Returns
String in US-ASCII format, with \uxxxx escapes for other characters

Definition at line 298 of file unicode.cpp.

◆ utf16_native_endian_to_java() [2/2]

std::string utf16_native_endian_to_java ( const std::wstring &  in)
Parameters
inString in UTF-16 (native endianness) format
Returns
String in US-ASCII format, with \uxxxx escapes for other characters

Definition at line 308 of file unicode.cpp.

◆ utf32_native_endian_to_utf8()

std::string utf32_native_endian_to_utf8 ( const std::basic_string< unsigned int > &  s)
Parameters
sUTF-32 encoded wide string
Returns
utf8-encoded string with the same unicode characters as the input.

Definition at line 140 of file unicode.cpp.

◆ utf8_to_utf16_native_endian()

std::wstring utf8_to_utf16_native_endian ( const std::string &  in)

Convert UTF8-encoded string to UTF-16 with architecture-native endianness.

parameters: String in UTF-8 format
Returns
String in UTF-16 format. The encoding follows the endianness of the architecture iff swap_bytes is true.

Definition at line 196 of file unicode.cpp.

◆ widen() [1/2]

std::wstring widen ( const char *  s)

Definition at line 52 of file unicode.cpp.

◆ widen() [2/2]

std::wstring widen ( const std::string &  s)

Definition at line 94 of file unicode.cpp.