36 std::vector<std::string> err_text{};
37 std::vector<std::vector<FormatParam>> params{};
39 err_text.emplace_back(
"'{}' alpha component '{}' is not opaque ('{}').");
45 err_text.emplace_back(
"");
46 params.emplace_back();
48 auto [format_text, format_params] = val.
format_data();
49 err_text.append_range(format_text);
50 params.append_range(format_params);
75template <
typename T,
typename ConfigInterface,
typename FetchFunc>
78 const ConfigInterface &config,
80 const std::string &scope,
81 const std::string &other_field_name,
82 FetchFunc fetch_other)
88 auto other_result = fetch_other(config, type, scope);
90 if (!other_result.has_value()) {
91 return other_result.error();
94 const auto &other_val = other_result.value();
97 std::vector<std::string> err_text{};
98 std::vector<std::vector<FormatParam>> params{};
100 err_text.emplace_back(
"'{}' set to '{}' requires '{}' to be '{}'.");
107 err_text.emplace_back(
"");
108 params.emplace_back();
110 auto [format_text, format_params] = val.
format_data();
111 err_text.append_range(format_text);
112 params.append_range(format_params);
114 err_text.emplace_back(
"");
115 params.emplace_back();
116 err_text.emplace_back(
"{}");
118 err_text.emplace_back(
"");
119 params.emplace_back();
121 auto [other_format_text, other_format_params] = other_val.format_data();
122 err_text.append_range(other_format_text);
123 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).