|
xentara-utils v2.1
The Xentara Utility Library
|
Classes | |
| struct | IsValidOptions |
| Options for isValid() More... | |
Functions | |
| constexpr auto | isSingleByte (char8_t codeUnit) noexcept -> bool |
| Determines if a UTF-8 code unit is a single byte character. | |
| constexpr auto | isLeadByte (char8_t codeUnit) noexcept -> bool |
| Determines if a UTF-8 code unit is a lead byte. | |
| constexpr auto | continuationByteCount (char8_t codeUnit) noexcept -> std::size_t |
| Determines if a UTF-8 code unit is a lead byte. | |
| constexpr auto | isContinuationByte (char8_t codeUnit) noexcept -> bool |
| Determines if a UTF-8 code unit is a continuation byte. | |
| constexpr auto | isIllegalStartByte (char8_t codeUnit) noexcept -> bool |
| Determines if a UTF-8 code unit is an illegal byte at the start of a code point. | |
| constexpr auto | isIllegalByte (char8_t codeUnit) noexcept -> bool |
| Determines if a UTF-8 code unit is an illegal byte. | |
| constexpr auto | isHighSurrogate (char16_t codeUnit) noexcept -> bool |
| Determines if a UTF-16 code unit is a high surrogate. | |
| constexpr auto | isLowSurrogate (char16_t codeUnit) noexcept -> bool |
| Determines if a UTF-16 code unit is a low surrogate. | |
| constexpr auto | isSurrogate (char16_t codeUnit) noexcept -> bool |
| Determines if a UTF-16 code unit is a high or low surrogate. | |
| constexpr auto | combineSurrogates (char16_t high, char16_t low) noexcept -> char32_t |
| Combines a high and a low surrogate into a single code point. | |
| constexpr auto | makeSurrogatePair (char32_t codePoint) noexcept -> std::array< char16_t, 2 > |
| Splits a code point into high and low surrogates. | |
| constexpr auto | isBmp (char32_t codePoint) noexcept -> bool |
| Determines if a code point lies in the basic multilingual plane. | |
| constexpr auto | isOutOfRange (char32_t codePoint) noexcept -> bool |
| Determines if a code point is outside the valid range for Unicode scalar values. | |
| constexpr auto | isReserved (char32_t codeUnit) noexcept -> bool |
| Determines if a UTF-32 code unit is reserved for a high or a low surrogate. | |
| constexpr auto | isIllegal (char32_t codePoint) noexcept -> bool |
| Determines if a code point is not a legal Unicode scalar value. | |
| constexpr auto | replacementCharacter () noexcept -> char32_t |
| Returns the replacement character. | |
| constexpr auto | isSingleByteUtf8 (char32_t codePoint) noexcept -> bool |
| Determines if a code point encodes to a single UTF-8 code unit. | |
| constexpr auto | isTwoByteUtf8 (char32_t codePoint) noexcept -> bool |
| Determines if a code point encodes to a sequence of two UTF-8 code units. | |
| constexpr auto | isThreeByteUtf8 (char32_t codePoint) noexcept -> bool |
| Determines if a code point encodes to a sequence of three UTF-8 code units. | |
| constexpr auto | isFourByteUtf8 (char32_t codePoint) noexcept -> bool |
| Determines if a code point encodes to a sequence of four UTF-8 code units. | |
| constexpr auto | isTwoByteUtf8OrLess (char32_t codePoint) noexcept -> bool |
| Determines if a code point encodes to a sequence of two UTF-8 code units or less. | |
| constexpr auto | isThreeByteUtf8OrLess (char32_t codePoint) noexcept -> bool |
| Determines if a code point encodes to a sequence of three UTF-8 code units or less. | |
| constexpr auto | isFourByteUtf8OrLess (char32_t codePoint) noexcept -> bool |
| Determines if a code point encodes to a sequence of four UTF-8 code units or less. | |
| constexpr auto | utf8Size (char32_t codePoint) noexcept -> std::size_t |
| Determines how many UTF-8 code units are needed to encode a code point. | |
| constexpr auto | utf16Size (char32_t codePoint) noexcept -> std::size_t |
| Determines how many UTF-16 code units are needed to encode a code point. | |
| template<tools::StringViewable String> | |
| auto | isValid (const String &string, IsValidOptions options={}) noexcept -> bool |
| Checks whether a string is a valid unicode string. | |
|
constexprnoexcept |
Combines a high and a low surrogate into a single code point.
#include <xentara/utils/string/unicode.hpp> | high | The high surrogate |
| low | The low surrogate |
|
constexprnoexcept |
Determines if a UTF-8 code unit is a lead byte.
#include <xentara/utils/string/unicode.hpp> | codeUnit | The code unit |
|
constexprnoexcept |
Determines if a code point lies in the basic multilingual plane.
The basic multilingual plane consists of all code points less than or equal to U+FFFF. These characters can be represented by a single UTF-16 code unit. Characters outside the basic multilingual plane must be split up into high and low surrogates.
#include <xentara/utils/string/unicode.hpp> | codePoint | The code point |
|
constexprnoexcept |
Determines if a UTF-8 code unit is a continuation byte.
#include <xentara/utils/string/unicode.hpp> | codeUnit | The code unit |
|
constexprnoexcept |
Determines if a code point encodes to a sequence of four UTF-8 code units.
#include <xentara/utils/string/unicode.hpp>
|
constexprnoexcept |
Determines if a code point encodes to a sequence of four UTF-8 code units or less.
This function can be used instead of isTwoByteUtf8() if it is already known that the code unit is not a three byte sequence or less, e.g. in chained if statements.
#include <xentara/utils/string/unicode.hpp>
|
constexprnoexcept |
Determines if a UTF-16 code unit is a high surrogate.
#include <xentara/utils/string/unicode.hpp> | codeUnit | The code unit |
|
constexprnoexcept |
Determines if a code point is not a legal Unicode scalar value.
#include <xentara/utils/string/unicode.hpp> | codePoint | The code point |
|
constexprnoexcept |
Determines if a UTF-8 code unit is an illegal byte.
#include <xentara/utils/string/unicode.hpp> | codeUnit | The code unit |
|
constexprnoexcept |
Determines if a UTF-8 code unit is an illegal byte at the start of a code point.
This function does not consider continuation bytes as legal bytes, because they may only be present after a lead byte.
#include <xentara/utils/string/unicode.hpp> | codeUnit | The code unit |
|
constexprnoexcept |
Determines if a UTF-8 code unit is a lead byte.
| codeUnit | The code unit |
#include <xentara/utils/string/unicode.hpp>
|
constexprnoexcept |
Determines if a UTF-16 code unit is a low surrogate.
#include <xentara/utils/string/unicode.hpp> | codeUnit | The code unit |
|
constexprnoexcept |
Determines if a code point is outside the valid range for Unicode scalar values.
#include <xentara/utils/string/unicode.hpp> | codePoint | The code point |
|
constexprnoexcept |
Determines if a UTF-32 code unit is reserved for a high or a low surrogate.
#include <xentara/utils/string/unicode.hpp> | codeUnit | The code unit |
|
constexprnoexcept |
Determines if a UTF-8 code unit is a single byte character.
#include <xentara/utils/string/unicode.hpp> | codeUnit | The code unit |
|
constexprnoexcept |
Determines if a code point encodes to a single UTF-8 code unit.
#include <xentara/utils/string/unicode.hpp>
|
constexprnoexcept |
Determines if a UTF-16 code unit is a high or low surrogate.
#include <xentara/utils/string/unicode.hpp> | codeUnit | The code unit |
|
constexprnoexcept |
Determines if a code point encodes to a sequence of three UTF-8 code units.
#include <xentara/utils/string/unicode.hpp>
|
constexprnoexcept |
Determines if a code point encodes to a sequence of three UTF-8 code units or less.
This function can be used instead of isTwoByteUtf8() if it is already known that the code unit is not a two byte sequence or less, e.g. in chained if statements.
#include <xentara/utils/string/unicode.hpp>
|
constexprnoexcept |
Determines if a code point encodes to a sequence of two UTF-8 code units.
#include <xentara/utils/string/unicode.hpp>
|
constexprnoexcept |
Determines if a code point encodes to a sequence of two UTF-8 code units or less.
This function can be used instead of isTwoByteUtf8() if it is already known that the code unit is not a single byte sequence, e.g. in chained if statements.
#include <xentara/utils/string/unicode.hpp>
|
noexcept |
Checks whether a string is a valid unicode string.
This function checks for out-of range and illegal or malformed unicode encoding. Depending on the size of the character type, the function either checks for valid UTF-8, valid UTF-16, or valid UTF-32.
| string | The string to check |
| options | Options that allow you to specify whether partial characters are allowed at the beginning and/or then end of the string. |
|
constexprnoexcept |
Splits a code point into high and low surrogates.
#include <xentara/utils/string/unicode.hpp> | codePoint | The code point. Must be between U+10000 and U+10FFFF (supplementary planes). |
|
constexprnoexcept |
Returns the replacement character.
#include <xentara/utils/string/unicode.hpp>
|
constexprnoexcept |
Determines how many UTF-16 code units are needed to encode a code point.
#include <xentara/utils/string/unicode.hpp> | codePoint | The code point. Must be a legal Unicode scalar value (less than or equal to U+10FFFF, and not a surrogate). |
|
constexprnoexcept |
Determines how many UTF-8 code units are needed to encode a code point.
#include <xentara/utils/string/unicode.hpp> | codePoint | The code point. Must be a legal Unicode scalar value (less than or equal to U+10FFFF, and not a surrogate). |