RAMSES Documentation  27.0.130
Information for RAMSES users and developers
UtfUtils.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // Copyright (C) 2018 BMW Car IT GmbH
3 // -------------------------------------------------------------------------
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 // -------------------------------------------------------------------------
8 
9 #ifndef RAMSES_UTFUTILS_H
10 #define RAMSES_UTFUTILS_H
11 
13 #include <stdint.h>
14 #include <string>
15 
16 namespace ramses
17 {
22  {
26  uint32_t codePoint;
29  };
30 
34  namespace UtfUtils
35  {
41  RAMSES_API std::u32string ConvertUtf8ToUtf32(const std::string& utf8String);
42 
48  RAMSES_API std::string ConvertCharUtf32ToUtf8(char32_t convertChar);
49 
55  RAMSES_API std::string ConvertStrUtf32ToUtf8(const std::u32string& utf32String);
56 
63  RAMSES_API ExtractedUnicodePoint ExtractUnicodePointFromUTF8(std::string::const_iterator strBegin, std::string::const_iterator strEnd);
64 
70  RAMSES_API std::string ConvertUtf32ToUtf8String(const std::u32string& utf32String);
71 
78  RAMSES_API ExtractedUnicodePoint ExtractUnicodePointFromUTF16(std::u16string::const_iterator strBegin, std::u16string::const_iterator strEnd);
79  }
80 }
81 
82 #endif
#define RAMSES_API
Definition: APIExport.h:35
RAMSES_API std::string ConvertStrUtf32ToUtf8(const std::u32string &utf32String)
Converts a UTF32-encoded string to UTF8-encoded string.
RAMSES_API ExtractedUnicodePoint ExtractUnicodePointFromUTF16(std::u16string::const_iterator strBegin, std::u16string::const_iterator strEnd)
Extracts a UTF32 character from a UTF16 string.
RAMSES_API std::u32string ConvertUtf8ToUtf32(const std::string &utf8String)
Converts a UTF8-encoded string to UTF32-encoded string.
RAMSES_API std::string ConvertUtf32ToUtf8String(const std::u32string &utf32String)
Converts a UTF32-encoded string to UTF8-encoded string.
RAMSES_API std::string ConvertCharUtf32ToUtf8(char32_t convertChar)
Converts a UTF32-encoded character to UTF8-encoded string.
RAMSES_API ExtractedUnicodePoint ExtractUnicodePointFromUTF8(std::string::const_iterator strBegin, std::string::const_iterator strEnd)
Extracts a UTF32 character from a UTF8 string.
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition: AnimatedProperty.h:15
Stores an extracted Unicode/UTF32 code-point and corresponding meta-data resulting from the conversio...
Definition: UtfUtils.h:22
bool extractionSuccessful
true if the extraction was successful. Otherwise: false and codePoint is undefined
Definition: UtfUtils.h:24
uint32_t codePoint
The unicode-point storing the unique id of a character (UTF32)
Definition: UtfUtils.h:26
size_t inputCharsConsumed
Stores how many input characters were read to resolve the unicode point (bytes in UTF8 case and words...
Definition: UtfUtils.h:28