38 bool isNull()
const {
return _cp == 0; }
41 bool isAscii()
const {
return _cp < 0x80; }
88 bool operator==(
Char o)
const {
return _cp ==
o._cp; }
89 bool operator==(
char c)
const {
return _cp ==
static_cast<unsigned char>(
c); }
90 bool operator!=(
Char o)
const {
return _cp !=
o._cp; }
93 bool operator>(
Char o)
const {
return _cp >
o._cp; }
94 bool operator>=(
Char o)
const {
return _cp >=
o._cp; }
Unicode-aware character class wrapping a single codepoint.
Definition char.h:23
bool isAlphaNumeric() const
Returns true if the character is alphanumeric.
Char(char32_t cp)
Constructs from a Unicode codepoint.
Definition char.h:32
bool isPrintable() const
Returns true if the character is printable.
bool isAscii() const
Returns true if the codepoint is in the ASCII range (< 0x80).
Definition char.h:41
Char toLower() const
Returns the lowercase version of this character.
bool isLower() const
Returns true if the character is lowercase.
Char(char c)
Constructs from a Latin1 byte (0x00–0xFF).
Definition char.h:29
Char()
Constructs a null character (U+0000).
Definition char.h:26
bool isNull() const
Returns true if this is the null character.
Definition char.h:38
bool isUpper() const
Returns true if the character is uppercase.
bool isSpace() const
Returns true if the character is whitespace.
Char toUpper() const
Returns the uppercase version of this character.
size_t toUtf8(char *buf) const
Encodes this codepoint as UTF-8 into the given buffer.
char32_t codepoint() const
Returns the Unicode codepoint.
Definition char.h:35
bool isDigit() const
Returns true if the character is a decimal digit.
size_t utf8ByteCount() const
Returns the number of bytes needed to encode this codepoint as UTF-8 (1–4).
bool isAlpha() const
Returns true if the character is alphabetic.
static Char fromUtf8(const char *buf, size_t *bytesRead=nullptr)
Decodes a single UTF-8 codepoint from the given buffer.
Dynamic array container wrapping std::vector.
Definition list.h:40
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19