Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::ValidationState Struct Reference

#include <validator.hpp>

Public Member Functions

std::optional< Errorfirst_error () const
 First Error-severity entry, if any.
std::optional< std::string > first_error_message () const
 First Error-severity message text, if any.
std::vector< Errorerrors_for (std::string_view field_path) const
 All Error-severity entries that target a given field path.
bool has_error_with_rule (std::string_view rule_id) const noexcept
 True if any Error-severity entry has the given rule_id.
 operator bool () const noexcept

Public Attributes

bool valid = true
 True iff there are no Error-severity entries.
bool pending = false
 True while an async validator is running.
bool touched = false
 True once the user has interacted with the field (typically on focus-out).
bool dirty = false
 True once the field's value has moved away from its baseline.
std::vector< Errorerrors
 Hard failures (kind == Validation, severity == Error).
std::vector< Errorwarnings
 Soft advisories (kind == Validation, severity == Warning).

Member Function Documentation

◆ first_error()

std::optional< Error > aria::ValidationState::first_error ( ) const
inlinenodiscard

First Error-severity entry, if any.

◆ first_error_message()

std::optional< std::string > aria::ValidationState::first_error_message ( ) const
inlinenodiscard

First Error-severity message text, if any.

◆ errors_for()

std::vector< Error > aria::ValidationState::errors_for ( std::string_view field_path) const
inlinenodiscard

All Error-severity entries that target a given field path.

◆ has_error_with_rule()

bool aria::ValidationState::has_error_with_rule ( std::string_view rule_id) const
inlinenodiscardnoexcept

True if any Error-severity entry has the given rule_id.

◆ operator bool()

aria::ValidationState::operator bool ( ) const
inlineexplicitnoexcept

Member Data Documentation

◆ valid

bool aria::ValidationState::valid = true

True iff there are no Error-severity entries.

Warnings do NOT make a field invalid.

◆ pending

bool aria::ValidationState::pending = false

True while an async validator is running.

◆ touched

bool aria::ValidationState::touched = false

True once the user has interacted with the field (typically on focus-out).

◆ dirty

bool aria::ValidationState::dirty = false

True once the field's value has moved away from its baseline.

◆ errors

std::vector<Error> aria::ValidationState::errors

Hard failures (kind == Validation, severity == Error).

These drive valid = false.

◆ warnings

std::vector<Error> aria::ValidationState::warnings

Soft advisories (kind == Validation, severity == Warning).

DO NOT flip valid.


The documentation for this struct was generated from the following file: