libzed 1.12.3
A general-purpose library for quick and simple data manipulation.
Loading...
Searching...
No Matches
charFunctions.hpp
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5
6namespace z {
7namespace core {
19bool isUpperAlpha(uint32_t ch) noexcept;
20
32bool isLowerAlpha(uint32_t ch) noexcept;
33
41bool isUpper(uint32_t ch) noexcept;
42
50bool isLower(uint32_t ch) noexcept;
51
62uint32_t toUpper(uint32_t ch, bool camel = false) noexcept;
63
73uint32_t toLower(uint32_t ch, bool alternate = false) noexcept;
74
84bool isAlpha(uint32_t ch) noexcept;
85
98int numeralValue(uint32_t ch) noexcept;
99
111uint32_t numeral(int value) noexcept;
112
121bool isNumeric(uint32_t ch, int base = 10) noexcept;
122
130bool isAlphaNumeric(uint32_t ch) noexcept;
131
139bool isWhiteSpace(uint32_t ch) noexcept;
140
149int toUTF8(uint8_t *c, uint32_t chr) noexcept;
150
158int lenToUTF8(uint32_t chr) noexcept;
159
167uint32_t fromUTF8(uint8_t *c) noexcept;
168
176int lenFromUTF8(uint8_t *c) noexcept;
177
186bool isUTF8(uint8_t *c, int len) noexcept;
187} // namespace core
188} // namespace z
Section containing core functions and classes.
uint32_t toUpper(uint32_t ch, bool camel=false) noexcept
Convert the given character to uppercase.
bool isUpper(uint32_t ch) noexcept
Check if the given character is an uppercase character.
bool isNumeric(uint32_t ch, int base=10) noexcept
Check if the given character is numeric under the given base.
int toUTF8(uint8_t *c, uint32_t chr) noexcept
Convert a character to UTF-8 encoding.
uint32_t fromUTF8(uint8_t *c) noexcept
Convert a character from UTF-8 to UTF32 encoding.
bool isLower(uint32_t ch) noexcept
Check if the given character is a lowercase character.
bool isWhiteSpace(uint32_t ch) noexcept
Check if the given character is white space.
uint32_t toLower(uint32_t ch, bool alternate=false) noexcept
Convert the given character to lowercase.
int numeralValue(uint32_t ch) noexcept
Convert the given character to its respective numeral value.
bool isLowerAlpha(uint32_t ch) noexcept
Check if the given character is a lowercase alphabetic character.
bool isUTF8(uint8_t *c, int len) noexcept
Get whether the characters are in valid UTF-8 format.
bool isAlpha(uint32_t ch) noexcept
Check if the given character is an alphabetic character.
bool isUpperAlpha(uint32_t ch) noexcept
Check if the given character is an uppercase alphabetic character.
int lenFromUTF8(uint8_t *c) noexcept
Get the character length of a UTF-8 sequence.
uint32_t numeral(int value) noexcept
Convert the given value to its respective numeral character.
int lenToUTF8(uint32_t chr) noexcept
Get the length of the UTF-8 encoding for a character.
bool isAlphaNumeric(uint32_t ch) noexcept
Check if the given character is alphanumeric.