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

Side by Side Diff: base/strings/utf_string_conversions.cc

Issue 768973003: Cleanup: Get rid of base::ASCIIToWide(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build Created 6 years 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 unified diff | Download patch
« no previous file with comments | « base/strings/utf_string_conversions.h ('k') | rlz/win/lib/machine_deal.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 6
7 #include "base/strings/string_piece.h" 7 #include "base/strings/string_piece.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversion_utils.h" 9 #include "base/strings/utf_string_conversion_utils.h"
10 10
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 bool UTF16ToUTF8(const char16* src, size_t src_len, std::string* output) { 202 bool UTF16ToUTF8(const char16* src, size_t src_len, std::string* output) {
203 return WideToUTF8(src, src_len, output); 203 return WideToUTF8(src, src_len, output);
204 } 204 }
205 205
206 std::string UTF16ToUTF8(const string16& utf16) { 206 std::string UTF16ToUTF8(const string16& utf16) {
207 return WideToUTF8(utf16); 207 return WideToUTF8(utf16);
208 } 208 }
209 209
210 #endif 210 #endif
211 211
212 std::wstring ASCIIToWide(const StringPiece& ascii) {
213 DCHECK(IsStringASCII(ascii)) << ascii;
214 return std::wstring(ascii.begin(), ascii.end());
215 }
216
217 string16 ASCIIToUTF16(const StringPiece& ascii) { 212 string16 ASCIIToUTF16(const StringPiece& ascii) {
218 DCHECK(IsStringASCII(ascii)) << ascii; 213 DCHECK(IsStringASCII(ascii)) << ascii;
219 return string16(ascii.begin(), ascii.end()); 214 return string16(ascii.begin(), ascii.end());
220 } 215 }
221 216
222 std::string UTF16ToASCII(const string16& utf16) { 217 std::string UTF16ToASCII(const string16& utf16) {
223 DCHECK(IsStringASCII(utf16)) << UTF16ToUTF8(utf16); 218 DCHECK(IsStringASCII(utf16)) << UTF16ToUTF8(utf16);
224 return std::string(utf16.begin(), utf16.end()); 219 return std::string(utf16.begin(), utf16.end());
225 } 220 }
226 221
227 } // namespace base 222 } // namespace base
OLDNEW
« no previous file with comments | « base/strings/utf_string_conversions.h ('k') | rlz/win/lib/machine_deal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698