diff options
author | mmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-27 20:57:35 +0000 |
---|---|---|
committer | mmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-27 20:57:35 +0000 |
commit | d13701900a71240fe1b4074b778133ba9a3461e9 (patch) | |
tree | 3ca3fd78ec07a47dcc2cad83defb977b0ad61e81 /webkit/glue/glue_util.cc | |
parent | b8c87bb8ea9f514a8f09a0f2154f8469ba7faf00 (diff) | |
download | chromium_src-d13701900a71240fe1b4074b778133ba9a3461e9.zip chromium_src-d13701900a71240fe1b4074b778133ba9a3461e9.tar.gz chromium_src-d13701900a71240fe1b4074b778133ba9a3461e9.tar.bz2 |
Move std::string16 to base::string16. Don't pollute the std namespace. Don't
assume that all string types can be represented as std::basic_string<CHAR>.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1464 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/glue_util.cc')
-rw-r--r-- | webkit/glue/glue_util.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/webkit/glue/glue_util.cc b/webkit/glue/glue_util.cc index da61bd2..e2d40f6 100644 --- a/webkit/glue/glue_util.cc +++ b/webkit/glue/glue_util.cc @@ -34,15 +34,15 @@ std::wstring StringToStdWString(const WebCore::String& str) { #if defined(WCHAR_T_IS_UTF16) return std::wstring(chars ? chars : L"", str.length()); #elif defined(WCHAR_T_IS_UTF32) - std::string16 str16(chars ? chars : reinterpret_cast<const char16 *>(L""), - str.length()); + string16 str16(chars ? chars : reinterpret_cast<const char16 *>(L""), + str.length()); return UTF16ToWide(str16); #endif } -std::string16 StringToStdString16(const WebCore::String& str) { +string16 StringToString16(const WebCore::String& str) { const UChar* chars = str.characters(); - return std::string16(chars ? chars : (UChar *)L"", str.length()); + return string16(chars ? chars : (UChar *)L"", str.length()); } std::string StringToStdString(const WebCore::String& str) { @@ -57,7 +57,7 @@ WebCore::String StdWStringToString(const std::wstring& str) { #if defined(WCHAR_T_IS_UTF16) return WebCore::String(str.data(), static_cast<unsigned>(str.length())); #elif defined(WCHAR_T_IS_UTF32) - std::string16 str16 = WideToUTF16(str); + string16 str16 = WideToUTF16(str); return WebCore::String(str16.data(), static_cast<unsigned>(str16.length())); #endif } @@ -73,7 +73,7 @@ WebCore::DeprecatedString StdWStringToDeprecatedString( reinterpret_cast<const WebCore::DeprecatedChar*>(str.c_str()), static_cast<int>(str.size())); #elif defined(WCHAR_T_IS_UTF32) - std::string16 str16 = WideToUTF16(str); + string16 str16 = WideToUTF16(str); return WebCore::DeprecatedString( reinterpret_cast<const WebCore::DeprecatedChar*>(str16.c_str()), static_cast<int>(str16.size())); @@ -86,8 +86,8 @@ std::wstring DeprecatedStringToStdWString( return std::wstring(reinterpret_cast<const wchar_t*>(dep.unicode()), dep.length()); #elif defined(WCHAR_T_IS_UTF32) - std::string16 str16(reinterpret_cast<const char16*>(dep.unicode()), - dep.length()); + string16 str16(reinterpret_cast<const char16*>(dep.unicode()), + dep.length()); return UTF16ToWide(str16); #endif } |