foobar2000 SDK
2015-08-03
|
Data Structures | |
class | char_buffer_t |
class | string_ansi_from_utf8 |
class | string_ansi_from_wide |
class | string_ascii_from_utf8 |
class | string_codepage_from_utf8 |
class | string_codepage_from_wide_t |
class | string_utf8_from_ansi |
class | string_utf8_from_codepage |
class | string_utf8_from_os_ex |
class | string_utf8_from_wide_t |
class | string_utf8_from_win1252_t |
class | string_wide_from_ansi |
class | string_wide_from_codepage_t |
class | string_wide_from_utf8_t |
class | string_wide_from_win1252_t |
class | string_win1252_from_utf8_t |
class | string_win1252_from_wide_t |
Enumerations | |
enum | { codepage_system = CP_ACP, codepage_ascii = 20127, codepage_iso_8859_1 = 28591 } |
Functions | |
char | charToASCII (unsigned c) |
t_size | convert_ansi_to_wide (wchar_t *p_out, t_size p_out_size, const char *p_source, t_size p_source_size) |
t_size | convert_codepage_to_wide (unsigned p_codepage, wchar_t *p_out, t_size p_out_size, const char *p_source, t_size p_source_size) |
t_size | convert_utf8_to_ascii (char *p_out, t_size p_out_size, const char *p_in, t_size p_in_size) |
t_size | convert_utf8_to_wide (wchar_t *p_out, t_size p_out_size, const char *p_source, t_size p_source_size) |
t_size | convert_utf8_to_wide_unchecked (wchar_t *p_out, const char *p_in) |
t_size | convert_utf8_to_win1252 (char *p_out, t_size p_out_size, const char *p_in, t_size p_in_size) |
t_size | convert_wide_to_ansi (char *p_out, t_size p_out_size, const wchar_t *p_source, t_size p_source_size) |
t_size | convert_wide_to_codepage (unsigned p_codepage, char *p_out, t_size p_out_size, const wchar_t *p_source, t_size p_source_size) |
t_size | convert_wide_to_utf8 (char *p_out, t_size p_out_size, const wchar_t *p_source, t_size p_source_size) |
t_size | convert_wide_to_win1252 (char *p_out, t_size p_out_size, const wchar_t *p_in, t_size p_in_size) |
t_size | convert_win1252_to_utf8 (char *p_out, t_size p_out_size, const char *p_in, t_size p_in_size) |
t_size | convert_win1252_to_wide (wchar_t *p_out, t_size p_out_size, const char *p_in, t_size p_in_size) |
t_size | estimate_ansi_to_wide (const char *p_source, t_size p_source_size) |
t_size | estimate_codepage_to_wide (unsigned p_codepage, const char *p_source, t_size p_source_size) |
t_size | estimate_utf8_to_ascii (const char *p_source, t_size p_source_size) |
t_size | estimate_utf8_to_wide (const char *p_in) |
t_size | estimate_utf8_to_wide (const char *p_source, t_size p_source_size) |
t_size | estimate_utf8_to_wide_quick (t_size sourceLen) |
t_size | estimate_utf8_to_wide_quick (const char *source) |
t_size | estimate_utf8_to_wide_quick (const char *source, t_size sourceLen) |
t_size | estimate_utf8_to_win1252 (const char *p_in, t_size p_in_size) |
t_size | estimate_wide_to_ansi (const wchar_t *p_source, t_size p_source_size) |
t_size | estimate_wide_to_codepage (unsigned p_codepage, const wchar_t *p_source, t_size p_source_size) |
t_size | estimate_wide_to_utf8 (const wchar_t *p_source, t_size p_source_size) |
t_size | estimate_wide_to_win1252 (const wchar_t *p_in, t_size p_in_size) |
t_size | estimate_win1252_to_utf8 (const char *p_in, t_size p_in_size) |
t_size | estimate_win1252_to_wide (const char *p_source, t_size p_source_size) |
template<typename t_char > | |
const t_char * | null_string_t () |
template<> | |
const char * | null_string_t< char > () |
template<> | |
const wchar_t * | null_string_t< wchar_t > () |
template<typename t_char > | |
bool | string_is_empty_t (const t_char *p_string, t_size p_string_size=~0) |
template<typename t_char > | |
t_size | strlen_t (const t_char *p_string, t_size p_string_size=~0) |
Definition at line 552 of file string_conv.h.
Definition at line 550 of file string_conv.h.
Definition at line 402 of file string_conv.h.
Definition at line 516 of file string_conv.h.
Definition at line 518 of file string_conv.h.
Definition at line 553 of file string_conv.h.
Definition at line 517 of file string_conv.h.
Definition at line 113 of file string_conv.h.
Definition at line 230 of file string_conv.h.
Definition at line 551 of file string_conv.h.
Definition at line 378 of file string_conv.h.
Definition at line 160 of file string_conv.h.
Definition at line 161 of file string_conv.h.
Definition at line 184 of file string_conv.h.
Definition at line 253 of file string_conv.h.
Definition at line 207 of file string_conv.h.
anonymous enum |
Enumerator | |
---|---|
codepage_system | |
codepage_ascii | |
codepage_iso_8859_1 |
Definition at line 279 of file string_conv.h.
char pfc::stringcvt::charToASCII | ( | unsigned | c | ) |
Definition at line 144 of file string_conv.cpp.
|
inline |
Converts string from system codepage to wide character.
p_out | Output buffer, receives converted string, with null terminator. |
p_source | String to convert. |
p_source_size | Number of characters to read from p_source. If reading stops if null terminator is encountered earlier. |
p_out_size | Size of output buffer, in characters. If converted string is too long, it will be truncated. Null terminator is always written, unless p_out_size is zero. |
Definition at line 326 of file string_conv.h.
t_size pfc::stringcvt::convert_codepage_to_wide | ( | unsigned | p_codepage, |
wchar_t * | p_out, | ||
t_size | p_out_size, | ||
const char * | p_source, | ||
t_size | p_source_size | ||
) |
Converts string from specified codepage to wide character.
p_out | Output buffer, receives converted string, with null terminator. |
p_codepage | Codepage ID of source string. |
p_source | String to convert. |
p_source_size | Number of characters to read from p_source. If reading stops if null terminator is encountered earlier. |
p_out_size | Size of output buffer, in characters. If converted string is too long, it will be truncated. Null terminator is always written, unless p_out_size is zero. |
Definition at line 428 of file string_conv.cpp.
t_size pfc::stringcvt::convert_utf8_to_ascii | ( | char * | p_out, |
t_size | p_out_size, | ||
const char * | p_in, | ||
t_size | p_in_size | ||
) |
Definition at line 400 of file string_conv.cpp.
t_size pfc::stringcvt::convert_utf8_to_wide | ( | wchar_t * | p_out, |
t_size | p_out_size, | ||
const char * | p_source, | ||
t_size | p_source_size | ||
) |
Converts UTF-8 characters to wide character.
p_out | Output buffer, receives converted string, with null terminator. |
p_out_size | Size of output buffer, in characters. If converted string is too long, it will be truncated. Null terminator is always written, unless p_out_size is zero. |
p_source | String to convert. |
p_source_size | Number of characters to read from p_source. If reading stops if null terminator is encountered earlier. |
Definition at line 161 of file string_conv.cpp.
t_size pfc::stringcvt::convert_utf8_to_wide_unchecked | ( | wchar_t * | p_out, |
const char * | p_in | ||
) |
Definition at line 178 of file string_conv.cpp.
t_size pfc::stringcvt::convert_utf8_to_win1252 | ( | char * | p_out, |
t_size | p_out_size, | ||
const char * | p_in, | ||
t_size | p_in_size | ||
) |
Definition at line 342 of file string_conv.cpp.
|
inline |
Converts string from wide character to system codepage.
p_out | Output buffer, receives converted string, with null terminator. |
p_out_size | Size of output buffer, in characters. If converted string is too long, it will be truncated. Null terminator is always written, unless p_out_size is zero. |
p_source | String to convert. |
p_source_size | Number of characters to read from p_source. If reading stops if null terminator is encountered earlier. |
Definition at line 344 of file string_conv.h.
t_size pfc::stringcvt::convert_wide_to_codepage | ( | unsigned | p_codepage, |
char * | p_out, | ||
t_size | p_out_size, | ||
const wchar_t * | p_source, | ||
t_size | p_source_size | ||
) |
Converts string from wide character to specified codepage.
p_codepage | Codepage ID of source string. |
p_out | Output buffer, receives converted string, with null terminator. |
p_out_size | Size of output buffer, in characters. If converted string is too long, it will be truncated. Null terminator is always written, unless p_out_size is zero. |
p_source | String to convert. |
p_source_size | Number of characters to read from p_source. If reading stops if null terminator is encountered earlier. |
Definition at line 436 of file string_conv.cpp.
t_size pfc::stringcvt::convert_wide_to_utf8 | ( | char * | p_out, |
t_size | p_out_size, | ||
const wchar_t * | p_source, | ||
t_size | p_source_size | ||
) |
Converts wide character string to UTF-8.
p_out | Output buffer, receives converted string, with null terminator. |
p_out_size | Size of output buffer, in characters. If converted string is too long, it will be truncated. Null terminator is always written, unless p_out_size is zero. |
p_source | String to convert. |
p_source_size | Number of characters to read from p_source. If reading stops if null terminator is encountered earlier. |
Definition at line 193 of file string_conv.cpp.
t_size pfc::stringcvt::convert_wide_to_win1252 | ( | char * | p_out, |
t_size | p_out_size, | ||
const wchar_t * | p_in, | ||
t_size | p_in_size | ||
) |
Definition at line 284 of file string_conv.cpp.
t_size pfc::stringcvt::convert_win1252_to_utf8 | ( | char * | p_out, |
t_size | p_out_size, | ||
const char * | p_in, | ||
t_size | p_in_size | ||
) |
Definition at line 379 of file string_conv.cpp.
t_size pfc::stringcvt::convert_win1252_to_wide | ( | wchar_t * | p_out, |
t_size | p_out_size, | ||
const char * | p_in, | ||
t_size | p_in_size | ||
) |
Definition at line 309 of file string_conv.cpp.
Estimates buffer size required to convert specified system codepage string to wide character.
p_source | String to be converted. |
p_source_size | Number of characters to read from p_source. If reading stops if null terminator is encountered earlier. |
Definition at line 334 of file string_conv.h.
t_size pfc::stringcvt::estimate_codepage_to_wide | ( | unsigned | p_codepage, |
const char * | p_source, | ||
t_size | p_source_size | ||
) |
Estimates buffer size required to convert specified string from specified codepage to wide character.
p_codepage | Codepage ID of source string. |
p_source | String to be converted. |
p_source_size | Number of characters to read from p_source. If reading stops if null terminator is encountered earlier. |
Definition at line 444 of file string_conv.cpp.
Definition at line 397 of file string_conv.cpp.
t_size pfc::stringcvt::estimate_utf8_to_wide | ( | const char * | p_in | ) |
Definition at line 210 of file string_conv.cpp.
Estimates buffer size required to convert specified UTF-8 string to widechar.
p_source | String to be converted. |
p_source_size | Number of characters to read from p_source. If reading stops if null terminator is encountered earlier. |
Definition at line 227 of file string_conv.cpp.
estimate_utf8_to_wide_quick() functions use simple math to determine buffer size required for the conversion. The result is not accurate length of output string - it's just a safe estimate of required buffer size, possibly bigger than what's really needed.
These functions are meant for scenarios when speed is more important than memory usage.
Definition at line 52 of file string_conv.h.
|
inline |
Definition at line 55 of file string_conv.h.
Definition at line 58 of file string_conv.h.
Definition at line 327 of file string_conv.cpp.
|
inline |
Estimates buffer size required to convert specified wide character string to system codepage.
p_source | String to be converted. |
p_source_size | Number of characters to read from p_source. If reading stops if null terminator is encountered earlier. |
Definition at line 352 of file string_conv.h.
t_size pfc::stringcvt::estimate_wide_to_codepage | ( | unsigned | p_codepage, |
const wchar_t * | p_source, | ||
t_size | p_source_size | ||
) |
Estimates buffer size required to convert specified wide character string to specified codepage.
p_codepage | Codepage ID of source string. |
p_source | String to be converted. |
p_source_size | Number of characters to read from p_source. If reading stops if null terminator is encountered earlier. |
Definition at line 447 of file string_conv.cpp.
Estimates buffer size required to convert specified wide character string to UTF-8.
p_source | String to be converted. |
p_source_size | Number of characters to read from p_source. If reading stops if null terminator is encountered earlier. |
Definition at line 246 of file string_conv.cpp.
Definition at line 267 of file string_conv.cpp.
Definition at line 362 of file string_conv.cpp.
Definition at line 305 of file string_conv.cpp.
const t_char* pfc::stringcvt::null_string_t | ( | ) |
|
inline |
Definition at line 64 of file string_conv.h.
|
inline |
Definition at line 65 of file string_conv.h.
bool pfc::stringcvt::string_is_empty_t | ( | const t_char * | p_string, |
t_size | p_string_size = ~0 |
||
) |
Definition at line 74 of file string_conv.h.
t_size pfc::stringcvt::strlen_t | ( | const t_char * | p_string, |
t_size | p_string_size = ~0 |
||
) |
Definition at line 67 of file string_conv.h.