Debian Codegraph @

src/mpt/string_transcode/macros.hpp

raw
1 /* SPDX-License-Identifier: BSL-1.0 OR BSD-3-Clause */
2
3 #ifndef MPT_STRING_TRANSCODE_MACROS_HPP
4 #define MPT_STRING_TRANSCODE_MACROS_HPP
5
6
7
8 #include "mpt/string/types.hpp"
9 #include "mpt/string_transcode/transcode.hpp"
10
11 #include <string>
12
13
14
15 // The MPT_UTF8_STRING allows specifying UTF8 char arrays.
16 // The resulting type is mpt::ustring and the construction might require runtime translation,
17 // i.e. it is NOT generally available at compile time.
18 // Use explicit UTF8 encoding,
19 // i.e. U+00FC (LATIN SMALL LETTER U WITH DIAERESIS) would be written as "\xC3\xBC".
20 #define MPT_UTF8_STRING(x) mpt::transcode<mpt::ustring>(mpt::common_encoding::utf8, std::string{x})
21
22
23
24 #endif // MPT_STRING_TRANSCODE_MACROS_HPP