Engine → Core → field_info.h
reflect::enum_info
| Type | Struct |
| Namespace | conjure::core::reflect |
| Include File Path | engine/include/conjure/core/reflect/field_info.h |
| Source File Path | engine/src/core/reflect/field_info.cpp |
| API ↗ | Reflection |
Syntax
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| public | isFlags | bool | false | |
| public | isSigned | bool | false | |
| public | name | std::string | {} | |
| public | type | type_id | {} | |
| public | underlying | u32 | 4 | |
| public | values | std:: | {} |
Functions
Public
find_name
find_name[[nodiscard]] const std::string *find_name(
i64 value) const noexcept;The name of the first enumerator with this exact value, or nullptr.
find_value
find_value[[nodiscard]] std::optional<i64> find_value(
std::string_view enumeratorName) const noexcept;The enumerator value named name, or nullopt. Exact, case-sensitive match.
format_value
format_value[[nodiscard]] std::optional<std::string> format_value(
i64 value) const;Text form of a value: the enumerator name when one matches exactly; for flags, the single-bit enumerator names joined with '|' ("" for zero without a zero enumerator). Returns nullopt when the value cannot be spelled with the known enumerators.
is_representable
is_representable[[nodiscard]] bool is_representable(
i64 value) const noexcept;True when value fits the underlying type (bit pattern for 64-bit unsigned). Always false when underlyingSize is not 1, 2, 4 or 8.
parse_value
parse_value[[nodiscard]] std::optional<i64> parse_value(
std::string_view text) const;Inverse of format_value(): an enumerator name, or for flags names separated by '|' (whitespace around names ignored, empty pieces ignored, "" is zero). Returns nullopt on any unknown name.