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

Side by Side Diff: base/strings/utf_string_conversion_utils.h

Issue 16320009: Use a direct include of strings headers in base/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/strings/utf_offset_string_conversions.h ('k') | base/strings/utf_string_conversions.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef BASE_STRINGS_UTF_STRING_CONVERSION_UTILS_H_ 5 #ifndef BASE_STRINGS_UTF_STRING_CONVERSION_UTILS_H_
6 #define BASE_STRINGS_UTF_STRING_CONVERSION_UTILS_H_ 6 #define BASE_STRINGS_UTF_STRING_CONVERSION_UTILS_H_
7 7
8 // This should only be used by the various UTF string conversion files. 8 // This should only be used by the various UTF string conversion files.
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
11 #include "base/string16.h" 11 #include "base/strings/string16.h"
12 12
13 namespace base { 13 namespace base {
14 14
15 inline bool IsValidCodepoint(uint32 code_point) { 15 inline bool IsValidCodepoint(uint32 code_point) {
16 // Excludes the surrogate code points ([0xD800, 0xDFFF]) and 16 // Excludes the surrogate code points ([0xD800, 0xDFFF]) and
17 // codepoints larger than 0x10FFFF (the highest codepoint allowed). 17 // codepoints larger than 0x10FFFF (the highest codepoint allowed).
18 // Non-characters and unassigned codepoints are allowed. 18 // Non-characters and unassigned codepoints are allowed.
19 return code_point < 0xD800u || 19 return code_point < 0xD800u ||
20 (code_point >= 0xE000u && code_point <= 0x10FFFFu); 20 (code_point >= 0xE000u && code_point <= 0x10FFFFu);
21 } 21 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void PrepareForUTF8Output(const CHAR* src, size_t src_len, std::string* output); 88 void PrepareForUTF8Output(const CHAR* src, size_t src_len, std::string* output);
89 89
90 // Prepares an output buffer (containing either UTF-16 or -32 data) given some 90 // Prepares an output buffer (containing either UTF-16 or -32 data) given some
91 // UTF-8 input that will be converted to it. See PrepareForUTF8Output(). 91 // UTF-8 input that will be converted to it. See PrepareForUTF8Output().
92 template<typename STRING> 92 template<typename STRING>
93 void PrepareForUTF16Or32Output(const char* src, size_t src_len, STRING* output); 93 void PrepareForUTF16Or32Output(const char* src, size_t src_len, STRING* output);
94 94
95 } // namespace base 95 } // namespace base
96 96
97 #endif // BASE_STRINGS_UTF_STRING_CONVERSION_UTILS_H_ 97 #endif // BASE_STRINGS_UTF_STRING_CONVERSION_UTILS_H_
OLDNEW
« no previous file with comments | « base/strings/utf_offset_string_conversions.h ('k') | base/strings/utf_string_conversions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698