43 std::optional<uint32_t>
max{1};
58 std::optional<uint32_t> max_val,
59 uint32_t mult = 1) noexcept
67 [[nodiscard]]
constexpr auto is_valid(uint32_t count)
const noexcept ->
bool {
71 if (
max.has_value()) {
72 return count <=
max.value();
86 return !
max.has_value() ||
max.value() > 1;
93 [[nodiscard]]
constexpr auto is_unbounded() const noexcept ->
bool {
94 return !
max.has_value();
109 [[nodiscard]]
static auto from_string(std::string_view str)
110 -> std::optional<value_multiplicity>;
116 [[nodiscard]]
auto to_string() const -> std::
string;
150 [[nodiscard]]
constexpr auto is_valid() const noexcept ->
bool {
151 return !keyword.empty();
158 return tag == other.tag;
165 return tag <=> other.tag;
DICOM Tag representation (Group, Element pairs)
value_multiplicity vm
Value Multiplicity specification.
constexpr auto operator==(const tag_info &other) const noexcept -> bool
Compare tag_info by tag value.
dicom_tag tag
The DICOM tag (group, element)
constexpr auto operator<=>(const tag_info &other) const noexcept
Three-way comparison by tag value.
std::string_view keyword
Tag keyword (e.g., "PatientName")
constexpr auto is_valid() const noexcept -> bool
Check if this tag_info is valid (has non-empty keyword)
std::string_view name
Human-readable name (e.g., "Patient's Name")
Value Multiplicity (VM) specification.
static auto from_string(std::string_view str) -> std::optional< value_multiplicity >
Parse VM from string representation.
constexpr auto allows_multiple() const noexcept -> bool
Check if this VM allows multiple values.
uint32_t multiplier
For "n", "2n", "3n" patterns.
uint32_t min
Minimum number of values.
constexpr value_multiplicity() noexcept=default
Default constructor - creates VM "1".
constexpr auto is_unbounded() const noexcept -> bool
Check if this VM is unbounded (ends with "n")
constexpr auto is_valid(uint32_t count) const noexcept -> bool
Check if a count of values is valid for this VM.
std::optional< uint32_t > max
Maximum number of values (nullopt = unbounded)
auto to_string() const -> std::string
Convert to string representation.