Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: webrtc/system_wrappers/interface/utf_util_win.h

Issue 1413333002: system_wrappers: rename interface -> include (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased again! Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/system_wrappers/interface/trace.h ('k') | webrtc/system_wrappers/source/aligned_array_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/system_wrappers/interface/utf_util_win.h
diff --git a/webrtc/system_wrappers/interface/utf_util_win.h b/webrtc/system_wrappers/interface/utf_util_win.h
deleted file mode 100644
index cc48fd254d5e219add38a773f47f710b118a2fbe..0000000000000000000000000000000000000000
--- a/webrtc/system_wrappers/interface/utf_util_win.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-// Conversion functions for UTF-8 and UTF-16 strings on Windows.
-// Duplicated from talk/base/win32.h.
-#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_UTF_UTIL_H_
-#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_UTF_UTIL_H_
-
-#ifdef WIN32
-#include <windows.h>
-#include <string>
-
-#include "webrtc/base/scoped_ptr.h"
-
-namespace webrtc {
-
-inline std::wstring ToUtf16(const char* utf8, size_t len) {
- int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast<int>(len),
- NULL, 0);
- rtc::scoped_ptr<wchar_t[]> ws(new wchar_t[len16]);
- ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast<int>(len), ws.get(),
- len16);
- return std::wstring(ws.get(), len16);
-}
-
-inline std::wstring ToUtf16(const std::string& str) {
- return ToUtf16(str.data(), str.length());
-}
-
-inline std::string ToUtf8(const wchar_t* wide, size_t len) {
- int len8 = ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast<int>(len),
- NULL, 0, NULL, NULL);
- rtc::scoped_ptr<char[]> ns(new char[len8]);
- ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast<int>(len), ns.get(), len8,
- NULL, NULL);
- return std::string(ns.get(), len8);
-}
-
-inline std::string ToUtf8(const wchar_t* wide) {
- return ToUtf8(wide, wcslen(wide));
-}
-
-inline std::string ToUtf8(const std::wstring& wstr) {
- return ToUtf8(wstr.data(), wstr.length());
-}
-
-} // namespace webrtc
-
-#endif // WIN32
-#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_UTF_UTIL_H_
« no previous file with comments | « webrtc/system_wrappers/interface/trace.h ('k') | webrtc/system_wrappers/source/aligned_array_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698