template<typename T >
requires (ArithmeticData<T> || std::same_as<std::remove_cvref_t<T>, std::string> || std::same_as<std::remove_cvref_t<T>, std::vector<uint8_t>>)
| bool MayaFlux::Kakshya::CompositeLayout::add_field |
( |
std::string |
name | ) |
|
|
inline |
Declare a named arithmetic, text, or binary field.
- Template Parameters
-
| T | Exact stored type; use std::string for text or std::vector<uint8_t> for binary bytes. |
- Parameters
-
| name | Nonempty unique field name. |
- Returns
- True if added; false if the name is invalid, duplicated, or the layout has already been finalized.
Definition at line 65 of file Composite.hpp.
66 {
67 if constexpr (std::same_as<std::remove_cvref_t<T>, std::string>
68 || std::same_as<std::remove_cvref_t<T>, std::vector<uint8_t>>) {
70 } else {
72 }
73 }
bool add_field_impl(std::string name, std::type_index type, size_t size_bytes)
References name.
Referenced by MayaFlux::IO::DelimitedTextReader::open().