32 std::vector<std::string> err_text{};
33 std::vector<std::vector<FormatParam>> params{};
35 err_text.emplace_back(
"'{}' alpha component '{}' is not opaque ('{}').");
41 err_text.emplace_back(
"");
42 params.emplace_back();
44 auto [format_text, format_params] = val.
format_data();
45 err_text.append_range(format_text);
46 params.append_range(format_params);
69template <
typename T,
typename ConfigInterface,
typename FetchFunc>
72 const ConfigInterface &config,
74 const std::string &scope,
75 const std::string &other_field_name,
76 FetchFunc fetch_other)
82 auto other_result = fetch_other(config, type, scope);
84 if (!other_result.has_value()) {
85 return other_result.error();
88 const auto &other_val = other_result.value();
91 std::vector<std::string> err_text{};
92 std::vector<std::vector<FormatParam>> params{};
94 err_text.emplace_back(
"'{}' set to '{}' requires '{}' to be '{}'.");
101 err_text.emplace_back(
"");
102 params.emplace_back();
104 auto [format_text, format_params] = val.
format_data();
105 err_text.append_range(format_text);
106 params.append_range(format_params);
108 err_text.emplace_back(
"");
109 params.emplace_back();
110 err_text.emplace_back(
"{}");
112 err_text.emplace_back(
"");
113 params.emplace_back();
115 auto [other_format_text, other_format_params] = other_val.format_data();
116 err_text.append_range(other_format_text);
117 params.append_range(other_format_params);
A result type that maintains a chainable sequence of errors for debugging and error reporting.
A container that wraps a configuration value with its name and source information.
std::pair< std::vector< std::string >, std::vector< std::vector< FormatParam > > > format_data() const
Generates formatted text data for displaying this configuration value.
const std::string & canonical_name() const
const T & value() const &
static constexpr std::uint8_t alpha_opaque
static const Style italic
Italic text formatting.
static const Style bold
Bold text formatting.
ChainableResult< ConfigValue< T > > require_packing_strategy_backtracking(const ConfigValue< T > &val, const ConfigInterface &config, ConfigScopeType type, const std::string &scope, const std::string &other_field_name, FetchFunc fetch_other)
Validates that 'biased' or 'optimal' tile sharing packing requires 'backtracking' packing strategy.
@ off
Packing ignores shape group membership (default).
ConfigScopeType
Specifies the scope type for configuration value lookups.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.
ChainableResult< ConfigValue< Rgba32 > > rgba_alpha_component_opaque(const ConfigValue< Rgba32 > &val)
Validates that an Rgba32 alpha component is opaque.
@ backtracking
DFS/BFS backtracking search (default).