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

#include <form.hpp>

Public Member Functions

template<typename Field>
void track (Field &f)
template<std::predicate Pred>
void rule (Pred predicate, std::string message, std::string rule_id_value={})
 Add a cross-field rule.
void clear ()

Public Attributes

Property< bool > is_valid {true}
Property< bool > is_dirty {false}
Property< bool > is_pending {false}
Property< std::string > first_error {""}
 First-error message (string). Empty when the form is valid.
Property< std::optional<::aria::Error > > first_error_full {std::nullopt}
 First-error record with kind / key / severity.

Member Function Documentation

◆ track()

template<typename Field>
void aria::binding::FormValidator::track ( Field & f)
inline

◆ rule()

template<std::predicate Pred>
void aria::binding::FormValidator::rule ( Pred predicate,
std::string message,
std::string rule_id_value = {} )
inline

Add a cross-field rule.

rule_id defaults to "form_rule_<N>" when omitted; emitted Error has empty field_path (rules are not anchored to a single field) and source = "FormValidator".

◆ clear()

void aria::binding::FormValidator::clear ( )
inline

Member Data Documentation

◆ is_valid

Property<bool> aria::binding::FormValidator::is_valid {true}

◆ is_dirty

Property<bool> aria::binding::FormValidator::is_dirty {false}

◆ is_pending

Property<bool> aria::binding::FormValidator::is_pending {false}

◆ first_error

Property<std::string> aria::binding::FormValidator::first_error {""}

First-error message (string). Empty when the form is valid.

◆ first_error_full

Property<std::optional<::aria::Error> > aria::binding::FormValidator::first_error_full {std::nullopt}

First-error record with kind / key / severity.


The documentation for this class was generated from the following file:
  • modules/binding/include/aria/binding/form.hpp