| OLD | NEW |
| 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_UTF_STRING_CONVERSION_UTILS_H_ | 5 #ifndef BASE_UTF_STRING_CONVERSION_UTILS_H_ |
| 6 #define BASE_UTF_STRING_CONVERSION_UTILS_H_ | 6 #define BASE_UTF_STRING_CONVERSION_UTILS_H_ |
| 7 #pragma once | |
| 8 | 7 |
| 9 // 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. |
| 10 | 9 |
| 11 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| 12 #include "base/string16.h" | 11 #include "base/string16.h" |
| 13 | 12 |
| 14 namespace base { | 13 namespace base { |
| 15 | 14 |
| 16 inline bool IsValidCodepoint(uint32 code_point) { | 15 inline bool IsValidCodepoint(uint32 code_point) { |
| 17 // Excludes the surrogate code points ([0xD800, 0xDFFF]) and | 16 // Excludes the surrogate code points ([0xD800, 0xDFFF]) and |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 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); |
| 90 | 89 |
| 91 // 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 |
| 92 // UTF-8 input that will be converted to it. See PrepareForUTF8Output(). | 91 // UTF-8 input that will be converted to it. See PrepareForUTF8Output(). |
| 93 template<typename STRING> | 92 template<typename STRING> |
| 94 void PrepareForUTF16Or32Output(const char* src, size_t src_len, STRING* output); | 93 void PrepareForUTF16Or32Output(const char* src, size_t src_len, STRING* output); |
| 95 | 94 |
| 96 } // namespace base | 95 } // namespace base |
| 97 | 96 |
| 98 #endif // BASE_UTF_STRING_CONVERSION_UTILS_H_ | 97 #endif // BASE_UTF_STRING_CONVERSION_UTILS_H_ |
| OLD | NEW |