diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/alstring.h | 9 | ||||
-rw-r--r-- | Alc/helpers.cpp | 48 |
2 files changed, 0 insertions, 57 deletions
diff --git a/Alc/alstring.h b/Alc/alstring.h index 923a5ea2..f991310f 100644 --- a/Alc/alstring.h +++ b/Alc/alstring.h @@ -42,15 +42,6 @@ void alstr_append_char(al_string *str, const al_string_char_type c); void alstr_append_cstr(al_string *str, const al_string_char_type *from); void alstr_append_range(al_string *str, const al_string_char_type *from, const al_string_char_type *to); -#ifdef _WIN32 -#include <wchar.h> -/* Windows-only methods to deal with WideChar strings. */ -void alstr_copy_wcstr(al_string *str, const wchar_t *from); -void alstr_append_wcstr(al_string *str, const wchar_t *from); -void alstr_copy_wrange(al_string *str, const wchar_t *from, const wchar_t *to); -void alstr_append_wrange(al_string *str, const wchar_t *from, const wchar_t *to); -#endif - #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/Alc/helpers.cpp b/Alc/helpers.cpp index bfb458b7..864278bb 100644 --- a/Alc/helpers.cpp +++ b/Alc/helpers.cpp @@ -846,51 +846,3 @@ void alstr_append_range(al_string *str, const al_string_char_type *from, const a VECTOR_ELEM(*str, base+i) = 0; } } - -#ifdef _WIN32 -void alstr_copy_wcstr(al_string *str, const wchar_t *from) -{ - int len; - if((len=WideCharToMultiByte(CP_UTF8, 0, from, -1, nullptr, 0, nullptr, nullptr)) > 0) - { - VECTOR_RESIZE(*str, len-1, len); - WideCharToMultiByte(CP_UTF8, 0, from, -1, &VECTOR_FRONT(*str), len, nullptr, nullptr); - VECTOR_ELEM(*str, len-1) = 0; - } -} - -void alstr_append_wcstr(al_string *str, const wchar_t *from) -{ - int len; - if((len=WideCharToMultiByte(CP_UTF8, 0, from, -1, nullptr, 0, nullptr, nullptr)) > 0) - { - size_t base = alstr_length(*str); - VECTOR_RESIZE(*str, base+len-1, base+len); - WideCharToMultiByte(CP_UTF8, 0, from, -1, &VECTOR_ELEM(*str, base), len, nullptr, nullptr); - VECTOR_ELEM(*str, base+len-1) = 0; - } -} - -void alstr_copy_wrange(al_string *str, const wchar_t *from, const wchar_t *to) -{ - int len; - if((len=WideCharToMultiByte(CP_UTF8, 0, from, (int)(to-from), nullptr, 0, nullptr, nullptr)) > 0) - { - VECTOR_RESIZE(*str, len, len+1); - WideCharToMultiByte(CP_UTF8, 0, from, (int)(to-from), &VECTOR_FRONT(*str), len+1, nullptr, nullptr); - VECTOR_ELEM(*str, len) = 0; - } -} - -void alstr_append_wrange(al_string *str, const wchar_t *from, const wchar_t *to) -{ - int len; - if((len=WideCharToMultiByte(CP_UTF8, 0, from, (int)(to-from), nullptr, 0, nullptr, nullptr)) > 0) - { - size_t base = alstr_length(*str); - VECTOR_RESIZE(*str, base+len, base+len+1); - WideCharToMultiByte(CP_UTF8, 0, from, (int)(to-from), &VECTOR_ELEM(*str, base), len+1, nullptr, nullptr); - VECTOR_ELEM(*str, base+len) = 0; - } -} -#endif |