comparison include/llvm/Support/ConvertUTF.h @ 147:c2174574ed3a

LLVM 10
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Aug 2019 16:55:33 +0900
parents 803732b1fca8
children
comparison
equal deleted inserted replaced
134:3a76565eade5 147:c2174574ed3a
1 /*===--- ConvertUTF.h - Universal Character Names conversions ---------------=== 1 /*===--- ConvertUTF.h - Universal Character Names conversions ---------------===
2 * 2 *
3 * The LLVM Compiler Infrastructure 3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * 4 * See https://llvm.org/LICENSE.txt for license information.
5 * This file is distributed under the University of Illinois Open Source 5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 * License. See LICENSE.TXT for details.
7 * 6 *
8 *==------------------------------------------------------------------------==*/ 7 *==------------------------------------------------------------------------==*/
9 /* 8 /*
10 * Copyright 2001-2004 Unicode, Inc. 9 * Copyright 2001-2004 Unicode, Inc.
11 * 10 *
90 #ifndef LLVM_SUPPORT_CONVERTUTF_H 89 #ifndef LLVM_SUPPORT_CONVERTUTF_H
91 #define LLVM_SUPPORT_CONVERTUTF_H 90 #define LLVM_SUPPORT_CONVERTUTF_H
92 91
93 #include <cstddef> 92 #include <cstddef>
94 #include <string> 93 #include <string>
94 #include <system_error>
95 95
96 // Wrap everything in namespace llvm so that programs can link with llvm and 96 // Wrap everything in namespace llvm so that programs can link with llvm and
97 // their own version of the unicode libraries. 97 // their own version of the unicode libraries.
98 98
99 namespace llvm { 99 namespace llvm {
284 * \returns true on success 284 * \returns true on success
285 */ 285 */
286 bool convertUTF8ToUTF16String(StringRef SrcUTF8, 286 bool convertUTF8ToUTF16String(StringRef SrcUTF8,
287 SmallVectorImpl<UTF16> &DstUTF16); 287 SmallVectorImpl<UTF16> &DstUTF16);
288 288
289 #if defined(_WIN32)
290 namespace sys {
291 namespace windows {
292 std::error_code UTF8ToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16);
293 /// Convert to UTF16 from the current code page used in the system
294 std::error_code CurCPToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16);
295 std::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len,
296 SmallVectorImpl<char> &utf8);
297 /// Convert from UTF16 to the current code page used in the system
298 std::error_code UTF16ToCurCP(const wchar_t *utf16, size_t utf16_len,
299 SmallVectorImpl<char> &utf8);
300 } // namespace windows
301 } // namespace sys
302 #endif
303
289 } /* end namespace llvm */ 304 } /* end namespace llvm */
290 305
291 #endif 306 #endif