Go to the source code of this file.
|
|
typedef uint32_t | ui::id_t |
| | A (typically unique) identifier for widgets.
|
| |
|
| id_t | ui::id (const char *str, int size) noexcept |
| | Computes the CRC32 hash of a string at runtime.
|
| |
| constexpr id_t | ui::id (const char *str) noexcept |
| | Computes the CRC32 hash of a string at compile time.
|
| |
| constexpr ui::id_t | operator""_id (const char *str) noexcept |
| | The constexpr conversion operator for IDs.
|
| |
| constexpr ui::id_t | operator""_id (const char *str, size_t) noexcept |
| | The constexpr conversion operator for IDs.
|
| |
◆ id() [1/2]
| constexpr id_t ui::id |
( |
const char * |
str | ) |
|
|
inlineconstexprnoexcept |
Computes the CRC32 hash of a string at compile time.
This function will be used for strings that are known at compile time, so the hash will not be calculated at run time.
- Parameters
-
- Returns
- The computed CRC32 hash.
◆ id() [2/2]
| id_t ui::id |
( |
const char * |
str, |
|
|
int |
size |
|
) |
| |
|
noexcept |
Computes the CRC32 hash of a string at runtime.
This function is not constexpr and can be used for strings that are not known at compile time.
- Parameters
-
| str | The string to hash. |
| size | The size of the string. |
- Returns
- The computed CRC32 hash.
◆ operator""_id() [1/2]
| constexpr ui::id_t operator""_id |
( |
const char * |
str | ) |
|
|
inlineconstexprnoexcept |
The constexpr conversion operator for IDs.
This operator allows writing expressions like "some text"_id, which automatically gets converted to an integer at compile time.
- Parameters
-
- Returns
- The computed CRC32 hash.
◆ operator""_id() [2/2]
| constexpr ui::id_t operator""_id |
( |
const char * |
str, |
|
|
size_t |
|
|
) |
| |
|
inlineconstexprnoexcept |
The constexpr conversion operator for IDs.
This operator allows writing expressions like "some text"_id, which automatically gets converted to an integer at compile time.
- Parameters
-
- Returns
- The computed CRC32 hash.