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

Side by Side Diff: base/utf_string_conversions.h

Issue 3076013: Move ASCIIToWide and ASCIIToUTF16 to utf_string_conversions.h. I've found it... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/string_util.cc ('k') | base/utf_string_conversions.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
Peter Kasting 2010/07/28 22:49:34 Nit: 2010
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 #ifndef BASE_UTF_STRING_CONVERSIONS_H_ 5 #ifndef BASE_UTF_STRING_CONVERSIONS_H_
6 #define BASE_UTF_STRING_CONVERSIONS_H_ 6 #define BASE_UTF_STRING_CONVERSIONS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/string16.h" 11 #include "base/string16.h"
(...skipping 29 matching lines...) Expand all
41 // porting whatever module uses wstring and the conversion is being used as a 41 // porting whatever module uses wstring and the conversion is being used as a
42 // stopcock. This makes it easy to grep for the ones that should be removed. 42 // stopcock. This makes it easy to grep for the ones that should be removed.
43 #if defined(OS_WIN) 43 #if defined(OS_WIN)
44 # define WideToUTF16Hack 44 # define WideToUTF16Hack
45 # define UTF16ToWideHack 45 # define UTF16ToWideHack
46 #else 46 #else
47 # define WideToUTF16Hack WideToUTF16 47 # define WideToUTF16Hack WideToUTF16
48 # define UTF16ToWideHack UTF16ToWide 48 # define UTF16ToWideHack UTF16ToWide
49 #endif 49 #endif
50 50
51 // These convert an ASCII string, typically a hardcoded constant, to a
52 // UTF16/Wide string.
53 //
54 // Note that this doesn't use StringPiece because it's very common to need
55 // ASCIIToUTF16("foo"), and either we have to include it in this file, or
56 // forward declare it and force all callers to include string_piece.h. Given
57 // that string_piece brings in complicated stuff like <algorithm>, it's
58 // easier to just duplicate these very simple definitions for the two calling
59 // cases we actually use.
60 std::wstring ASCIIToWide(const char* ascii);
61 std::wstring ASCIIToWide(const std::string& ascii);
62 string16 ASCIIToUTF16(const char* ascii);
63 string16 ASCIIToUTF16(const std::string& ascii);
64
51 #endif // BASE_UTF_STRING_CONVERSIONS_H_ 65 #endif // BASE_UTF_STRING_CONVERSIONS_H_
OLDNEW
« no previous file with comments | « base/string_util.cc ('k') | base/utf_string_conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698