Debian Codegraph @

src/utils/windows/CharsetConverter.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2005-2021 Team Kodi (https://kodi.tv)
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 * See LICENSE.md for more information.
6 */
7
8 #pragma once
9
10 #include <string>
11
12 #if defined(TARGET_WINDOWS) || defined(TARGET_WIN10)
13 namespace KODI
14 {
15 namespace PLATFORM
16 {
17 namespace WINDOWS
18 {
19 /**
20 * Convert UTF-16 to UTF-8 strings
21 * Windows specific method to avoid initialization issues
22 * and locking issues that are unique to Windows as API calls
23 * expect UTF-16 strings
24 * \param str[in] string to be converted
25 * \param length[in] length in characters of the string
26 * \returns utf8 string, empty string on failure
27 */
28 std::string FromW(const wchar_t* str, size_t length);
29
30 /**
31 * Convert UTF-16 to UTF-8 strings
32 * Windows specific method to avoid initialization issues
33 * and locking issues that are unique to Windows as API calls
34 * expect UTF-16 strings
35 * \param str[in] string to be converted
36 * \returns utf8 string, empty string on failure
37 */
38 std::string FromW(const std::wstring& str);
39
40 /**
41 * Convert UTF-8 to UTF-16 strings
42 * Windows specific method to avoid initialization issues
43 * and locking issues that are unique to Windows as API calls
44 * expect UTF-16 strings
45 * \param str[in] string to be converted
46 * \param length[in] length in characters of the string
47 * \returns UTF-16 string, empty string on failure
48 */
49 std::wstring ToW(const char* str, size_t length);
50
51 /**
52 * Convert UTF-8 to UTF-16 strings
53 * Windows specific method to avoid initialization issues
54 * and locking issues that are unique to Windows as API calls
55 * expect UTF-16 strings
56 * \param str[in] string to be converted
57 * \returns UTF-16 string, empty string on failure
58 */
59 std::wstring ToW(const std::string& str);
60 }
61 }
62 }
63 #endif