diff options
author | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-07-31 18:34:08 +0000 |
---|---|---|
committer | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-07-31 18:34:08 +0000 |
commit | dd4a17bc20377d250ed116b1083d851adbe45f25 (patch) | |
tree | 4da8e8084682bbd9121ed76e450ee2074620b59f /include/gtest/internal/gtest-string.h | |
parent | 7ddde1bc28eb7ee5bc3663a9ea427f6ab39d02de (diff) | |
download | gtest-dd4a17bc20377d250ed116b1083d851adbe45f25.tar.gz |
Makes gtest work on Windows Mobile and Symbian. By Mika Raento.
git-svn-id: http://googletest.googlecode.com/svn/trunk@73 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'include/gtest/internal/gtest-string.h')
-rw-r--r-- | include/gtest/internal/gtest-string.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/gtest/internal/gtest-string.h b/include/gtest/internal/gtest-string.h index b5a303f..612b6ce 100644 --- a/include/gtest/internal/gtest-string.h +++ b/include/gtest/internal/gtest-string.h @@ -107,6 +107,32 @@ class String { // memory using malloc(). static const char* CloneCString(const char* c_str); +#ifdef _WIN32_WCE + // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be + // able to pass strings to Win32 APIs on CE we need to convert them + // to 'Unicode', UTF-16. + + // Creates a UTF-16 wide string from the given ANSI string, allocating + // memory using new. The caller is responsible for deleting the return + // value using delete[]. Returns the wide string, or NULL if the + // input is NULL. + // + // The wide string is created using the ANSI codepage (CP_ACP) to + // match the behaviour of the ANSI versions of Win32 calls and the + // C runtime. + static LPCWSTR AnsiToUtf16(const char* c_str); + + // Creates an ANSI string from the given wide string, allocating + // memory using new. The caller is responsible for deleting the return + // value using delete[]. Returns the ANSI string, or NULL if the + // input is NULL. + // + // The returned string is created using the ANSI codepage (CP_ACP) to + // match the behaviour of the ANSI versions of Win32 calls and the + // C runtime. + static const char* Utf16ToAnsi(LPCWSTR utf16_str); +#endif + // Compares two C strings. Returns true iff they have the same content. // // Unlike strcmp(), this function can handle NULL argument(s). A |