morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::forms::WizardModel Class Reference

The immutable model of a w-* wizard document. More...

#include <wizard.hpp>

Public Member Functions

std::string_view id () const noexcept
 The wizard's id.
std::string_view title () const noexcept
 w-title, or the id.
std::span< WizardStepSpec const > steps () const noexcept
 The steps, in order; never empty.

Static Public Member Functions

static std::expected< WizardModel, SchemaError > fromSchema (std::string_view wizardId, std::string_view wizardJson)
 Reads a wizard document.

Detailed Description

The immutable model of a w-* wizard document.

Definition at line 52 of file wizard.hpp.

Member Function Documentation

◆ fromSchema()

std::expected< WizardModel, SchemaError > morph::forms::WizardModel::fromSchema ( std::string_view wizardId,
std::string_view wizardJson )
inlinestaticnodiscard

Reads a wizard document.

Parameters
wizardIdThe wizard's registered id, the stem of its i18n keys.
wizardJsonThe document, in the vocabulary flows::wizardSchemaJson<W>() emits.
Returns
The model, or the error naming the malformed key.

Definition at line 59 of file wizard.hpp.

◆ id()

std::string_view morph::forms::WizardModel::id ( ) const
inlinenodiscardnoexcept

The wizard's id.

Returns
The id passed to fromSchema.

Definition at line 113 of file wizard.hpp.

◆ title()

std::string_view morph::forms::WizardModel::title ( ) const
inlinenodiscardnoexcept

w-title, or the id.

Returns
The title.

Definition at line 117 of file wizard.hpp.

◆ steps()

std::span< WizardStepSpec const > morph::forms::WizardModel::steps ( ) const
inlinenodiscardnoexcept

The steps, in order; never empty.

Returns
The steps.

Definition at line 121 of file wizard.hpp.


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