summaryrefslogtreecommitdiff
path: root/source/fud_utf8.cpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-11-03 13:04:00 -0600
committerDominick Allen <djallen@librehumanitas.org>2024-11-03 13:04:00 -0600
commit1e89700693e92bb9c78ace739c71431b74d91e22 (patch)
tree08d40bf1c650987fac55805ce4b930a19c065fec /source/fud_utf8.cpp
parent9b4b87765d48d2d6aed6ac1f40c4aa2684fad766 (diff)
Rename FudUtf8 to Utf8.
Diffstat (limited to 'source/fud_utf8.cpp')
-rw-r--r--source/fud_utf8.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/source/fud_utf8.cpp b/source/fud_utf8.cpp
index ec72b6d..d4b5442 100644
--- a/source/fud_utf8.cpp
+++ b/source/fud_utf8.cpp
@@ -21,12 +21,12 @@
namespace fud {
-FudUtf8 FudUtf8::from(const String& fudString, size_t index) noexcept
+Utf8 Utf8::from(const String& fudString, size_t index) noexcept
{
return from(fudString.asView(), index);
}
-FudUtf8 FudUtf8::from(StringView view, size_t index) noexcept
+Utf8 Utf8::from(StringView view, size_t index) noexcept
{
auto len = view.length();
const auto* vData = view.data();
@@ -34,7 +34,7 @@ FudUtf8 FudUtf8::from(StringView view, size_t index) noexcept
return invalidAscii();
}
- FudUtf8 localChar{Ascii{vData[index]}};
+ Utf8 localChar{Ascii{vData[index]}};
if (localChar.valid()) {
return localChar;
}
@@ -75,14 +75,14 @@ bool isAscii(utf8 character)
return (character & ~ASCII_MASK) == 0;
}
-bool isAscii(FudUtf8 character)
+bool isAscii(Utf8 character)
{
return character.getType() == Utf8Type::Ascii && character.valid();
}
namespace impl {
-bool isAsciiPredicate(FudUtf8 character, bool (*predicate)(char))
+bool isAsciiPredicate(Utf8 character, bool (*predicate)(char))
{
auto maybeAscii = character.getAscii();
if (!maybeAscii.hasValue()) {
@@ -113,7 +113,7 @@ bool isAlphanumeric(utf8 character)
return isDigit(character);
}
-bool isAlphanumeric(FudUtf8 character)
+bool isAlphanumeric(Utf8 character)
{
return impl::isAsciiPredicate(character, isAlphanumeric);
}
@@ -136,7 +136,7 @@ bool isAlpha(utf8 character)
return isLowercase(character);
}
-bool isAlpha(FudUtf8 character)
+bool isAlpha(Utf8 character)
{
return impl::isAsciiPredicate(character, isAlpha);
}
@@ -155,7 +155,7 @@ bool isLowercase(utf8 character)
return 'a' <= character && character <= 'z';
}
-bool isLowercase(FudUtf8 character)
+bool isLowercase(Utf8 character)
{
return impl::isAsciiPredicate(character, isLowercase);
}
@@ -174,7 +174,7 @@ bool isUppercase(utf8 character)
return 'A' <= character && character <= 'Z';
}
-bool isUppercase(FudUtf8 character)
+bool isUppercase(Utf8 character)
{
return impl::isAsciiPredicate(character, isUppercase);
}
@@ -193,7 +193,7 @@ bool isDigit(utf8 character)
return '0' <= character && character <= '9';
}
-bool isDigit(FudUtf8 character)
+bool isDigit(Utf8 character)
{
return impl::isAsciiPredicate(character, isDigit);
}
@@ -213,7 +213,7 @@ bool isHexDigit(utf8 character)
('A' <= character && character <= 'F');
}
-bool isHexDigit(FudUtf8 character)
+bool isHexDigit(Utf8 character)
{
return impl::isAsciiPredicate(character, isHexDigit);
}
@@ -234,7 +234,7 @@ bool isControl(utf8 character)
return ((static_cast<utf8>(character) <= maxControlChar)) || character == deleteChar;
}
-bool isControl(FudUtf8 character)
+bool isControl(Utf8 character)
{
return impl::isAsciiPredicate(character, isControl);
}
@@ -253,7 +253,7 @@ bool isGraphical(utf8 character)
return isAlphanumeric(character) || isPunctuation(character);
}
-bool isGraphical(FudUtf8 character)
+bool isGraphical(Utf8 character)
{
return impl::isAsciiPredicate(character, isGraphical);
}
@@ -272,7 +272,7 @@ bool isSpace(utf8 character)
return character == ' ' || character == '\t' || character == '\n' || character == '\r' || character == '\v';
}
-bool isSpace(FudUtf8 character)
+bool isSpace(Utf8 character)
{
return impl::isAsciiPredicate(character, isSpace);
}
@@ -291,7 +291,7 @@ bool isBlank(utf8 character)
return character == ' ' || character == '\t';
}
-bool isBlank(FudUtf8 character)
+bool isBlank(Utf8 character)
{
return impl::isAsciiPredicate(character, isBlank);
}
@@ -310,7 +310,7 @@ bool isPrintable(utf8 character)
return (character >= ' ' && character <= '~');
}
-bool isPrintable(FudUtf8 character)
+bool isPrintable(Utf8 character)
{
return impl::isAsciiPredicate(character, isPrintable);
}
@@ -330,7 +330,7 @@ bool isPunctuation(utf8 character)
(character >= '[' && character <= '`') || (character >= '{' && character <= '~');
}
-bool isPunctuation(FudUtf8 character)
+bool isPunctuation(Utf8 character)
{
return impl::isAsciiPredicate(character, isPunctuation);
}
@@ -347,7 +347,7 @@ uint8_t charToLower(uint8_t character)
return character;
}
-FudUtf8 utf8ToLower(FudUtf8 character)
+Utf8 utf8ToLower(Utf8 character)
{
static_cast<void>(
character.transformAscii([](Ascii& ascii) { ascii = Ascii{charToLower(static_cast<utf8>(ascii.asChar()))}; }));
@@ -365,7 +365,7 @@ uint8_t charToUpper(uint8_t character)
return character;
}
-FudUtf8 utf8ToUpper(FudUtf8 character)
+Utf8 utf8ToUpper(Utf8 character)
{
static_cast<void>(
character.transformAscii([](Ascii& ascii) { ascii = Ascii{charToUpper(static_cast<utf8>(ascii.asChar()))}; }));