|
REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
|
A set of byte values (0–255) as a 256-bit bitmap. More...
#include <charclass.hpp>
Public Member Functions | |
| constexpr void | set (std::uint8_t byte) |
Adds byte byte to the set. | |
| constexpr void | set_range (std::uint8_t low, std::uint8_t high) |
Adds the inclusive byte range [low, high] to the set. | |
| constexpr void | merge (const char_class &other) |
Unions other into this set. | |
| constexpr void | invert_ascii () |
| Complements the ASCII half (bytes 0–127) only. | |
| constexpr void | invert () |
| Full 256-bit complement (binary mode: raw bytes, no UTF-8). | |
| constexpr bool | test (std::uint8_t byte) const |
Tests membership of byte byte. | |
| constexpr bool | empty () const |
| Reports whether the set has no members. | |
| constexpr bool | operator== (const char_class &) const =default |
| Equality: the two bitmaps accept exactly the same byte set. | |
Public Attributes | |
| std::array< std::uint64_t, 4 > | bits {} |
Bitmap; bit byte is byte byte's membership. | |
A set of byte values (0–255) as a 256-bit bitmap.
Membership, insertion and complement are all O(1) or O(256) and constexpr. All bit manipulation uses unsigned operands (MISRA forbids signed bitwise).
|
inlineconstexpr |
Reports whether the set has no members.
true if the set is empty.
|
inlineconstexpr |
Complements the ASCII half (bytes 0–127) only.
Bytes >= 0x80 are left untouched; the compiler handles non-ASCII codepoints as explicit UTF-8 multi-byte alternatives instead.
|
inlineconstexpr |
Unions other into this set.
| [in] | other | The set whose members are added to this one. |
|
constexprdefault |
Equality: the two bitmaps accept exactly the same byte set.
|
inlineconstexpr |
Adds byte byte to the set.
| [in] | byte | The byte to insert. |
|
inlineconstexpr |
Adds the inclusive byte range [low, high] to the set.
| [in] | low | First byte of the range. |
| [in] | high | Last byte of the range (inclusive). |
|
inlineconstexpr |
Tests membership of byte byte.
| [in] | byte | The byte to test. |
true if byte is in the set.