cprover
|
#include "unicode.h"
#include <cstring>
#include <locale>
#include <iomanip>
#include <sstream>
#include <cstdint>
Go to the source code of this file.
Macros | |
#define | BUFSIZE 100 |
Functions | |
bool | is_little_endian_arch () |
Determine endianness of the architecture. More... | |
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) |
static void | utf8_append_code (unsigned int c, std::string &result) |
Appends a unicode character to a utf8-encoded string. More... | |
std::string | utf32_to_utf8 (const std::basic_string< unsigned int > &s) |
const char ** | narrow_argv (int argc, const wchar_t **argv_wide) |
uint16_t | do_swap_bytes (uint16_t x) |
A helper function for dealing with different UTF16 endians. More... | |
void | utf16_append_code (unsigned int code, bool swap_bytes, std::wstring &result) |
std::wstring | utf8_to_utf16 (const std::string &in, bool swap_bytes) |
std::wstring | utf8_to_utf16_big_endian (const std::string &in) |
std::wstring | utf8_to_utf16_little_endian (const std::string &in) |
std::string | utf16_little_endian_to_ascii (const std::wstring &in) |
#define BUFSIZE 100 |
Definition at line 29 of file unicode.cpp.
uint16_t do_swap_bytes | ( | uint16_t | x | ) |
A helper function for dealing with different UTF16 endians.
Definition at line 173 of file unicode.cpp.
Referenced by utf16_append_code().
bool is_little_endian_arch | ( | ) |
Determine endianness of the architecture.
Definition at line 23 of file unicode.cpp.
Referenced by utf8_to_utf16_big_endian(), and utf8_to_utf16_little_endian().
std::string narrow | ( | const wchar_t * | s | ) |
Definition at line 31 of file unicode.cpp.
References r.
Referenced by narrow_argv(), ms_cl_cmdlinet::parse_env(), and ms_cl_cmdlinet::process_response_file().
std::string narrow | ( | const std::wstring & | s | ) |
Definition at line 81 of file unicode.cpp.
References r.
const char** narrow_argv | ( | int | argc, |
const wchar_t ** | argv_wide | ||
) |
void utf16_append_code | ( | unsigned int | code, |
bool | swap_bytes, | ||
std::wstring & | result | ||
) |
Definition at line 181 of file unicode.cpp.
References do_swap_bytes().
Referenced by utf8_to_utf16().
std::string utf16_little_endian_to_ascii | ( | const std::wstring & | in | ) |
Definition at line 291 of file unicode.cpp.
References loc.
std::string utf32_to_utf8 | ( | const std::basic_string< unsigned int > & | s | ) |
utf32:encoded | wide string |
Definition at line 143 of file unicode.cpp.
References utf8_append_code().
Referenced by append_universal_char(), convert_one_string_literal(), and make_identifier().
|
static |
Appends a unicode character to a utf8-encoded string.
Definition at line 117 of file unicode.cpp.
Referenced by utf32_to_utf8().
std::wstring utf8_to_utf16 | ( | const std::string & | in, |
bool | swap_bytes | ||
) |
Definition at line 214 of file unicode.cpp.
References size_type(), and utf16_append_code().
Referenced by utf8_to_utf16_big_endian(), and utf8_to_utf16_little_endian().
std::wstring utf8_to_utf16_big_endian | ( | const std::string & | in | ) |
Definition at line 275 of file unicode.cpp.
References is_little_endian_arch(), and utf8_to_utf16().
std::wstring utf8_to_utf16_little_endian | ( | const std::string & | in | ) |
Definition at line 283 of file unicode.cpp.
References is_little_endian_arch(), and utf8_to_utf16().
Referenced by string_constraint_generatort::add_axioms_for_constant(), delete_directory(), and java_bytecode_typecheckt::typecheck_expr_java_string_literal().
std::wstring widen | ( | const char * | s | ) |
Definition at line 56 of file unicode.cpp.
References r.
Referenced by string_constraint_generatort::add_axioms_for_constant(), c_preprocess_none(), goto_instrument_parse_optionst::doit(), clobber_parse_optionst::get_goto_program(), cbmc_parse_optionst::get_goto_program(), cbmc_solverst::get_smt1(), cbmc_solverst::get_smt2(), initialize_goto_model(), goto_instrument_parse_optionst::instrument_goto_program(), is_goto_binary(), language_uit::parse(), compilet::parse(), pipe_streamt::pipe_streamt(), console_message_handlert::print(), read_goto_binary(), and run().
std::wstring widen | ( | const std::string & | s | ) |
Definition at line 98 of file unicode.cpp.
References r.