30void dump_single_config_value(
31 std::ostream &out,
const TextFormatter &format,
const std::string &canonical_name,
32 const std::vector<ProvenanceChainLink<T>> &chain)
35 out << format.style(canonical_name,
Style::bold) <<
"\n";
36 out << format.style(std::string(canonical_name.size(),
'-'),
Style::faint) <<
"\n";
39 const ProvenanceChainLink<T> *winning_link =
nullptr;
40 for (
const auto &link : chain) {
50 ConfigValue<T> config_value{
51 winning_link->layer_value.value.value(),
53 winning_link->layer_value.source_key,
54 winning_link->layer_value.source_info,
55 winning_link->layer_value.source_details};
57 for (
const auto &line : note_lines) {
58 out <<
" " << line <<
"\n";
62 out <<
" " << format.style(
"INVALID: " + winning_link->layer_value.error_message,
Style::red) <<
"\n";
65 out <<
" " << format.style(
"(no value found)",
Style::faint) <<
"\n";
69 out <<
"\n " << format.style(
"Provider Chain:",
Style::faint) <<
"\n";
70 for (
const auto &link : chain) {
71 switch (link.layer_value.state) {
73 if (&link == winning_link) {
74 out <<
" " << format.style(
"✓",
Style::green) <<
" " << link.provider_name;
75 out <<
" = " << format.style(std::format(
"{}", link.layer_value.value.value()),
Style::green);
79 << format.style(link.provider_name +
" = " + std::format(
"{}", link.layer_value.value.value()),
84 out <<
" " << format.style(
"✗",
Style::red) <<
" " << link.provider_name;
85 out <<
" " << format.style(
"INVALID",
Style::red);
89 << format.style(link.provider_name +
" (not provided)",
Style::faint);
101 providers_.insert(providers_.begin(), std::move(provider));
103 cache_value_strings_.clear();
106 source_details_.clear();
111 const std::string header_str =
"Configuration dump for {} '{}'";
113 std::string header = std::vformat(header_str, std::make_format_args(type_str, scope));
160 const std::string &cache_key,
const std::string &canonical_name, std::function<
LayerValue<T>(
const ConfigProvider &)> provider_call)
const
163 if (cache_.contains(cache_key)) {
166 cached_value = std::any_cast<T>(cache_.at(cache_key));
168 catch (
const std::bad_any_cast &) {
169 panic(format_->
format(
"bad_any_cast for cache key '{}': cached type does not match requested type", cache_key));
171 std::string cached_source_key = source_key_.at(cache_key);
172 std::string source = source_.at(cache_key);
173 std::vector<std::string> source_details = source_details_.at(cache_key);
174 return ConfigValue<T>{cached_value, canonical_name, cached_source_key, source, source_details};
178 for (
const auto &provider : providers_) {
179 LayerValue<T> layer_value = provider_call(*provider);
183 const auto source_info = format_->
format(
"{}", layer_value.source_info);
184 std::vector<std::string> error_lines;
185 error_lines.push_back(format_->
format(
186 "Invalid value for '{}' from config source '{}':",
187 FormatParam{canonical_name, Style::bold},
188 FormatParam{source_info, Style::bold}));
189 error_lines.emplace_back();
190 error_lines.push_back(format_->
format(
"{}", layer_value.error_message));
192 if (!layer_value.source_details.empty()) {
193 error_lines.emplace_back(
"");
194 for (
const auto &detail : layer_value.source_details) {
195 error_lines.push_back(detail);
199 return FormattableError{error_lines};
204 T resolved_value = layer_value.value.value();
205 cache_[cache_key] = resolved_value;
206 cache_value_strings_[cache_key] = std::format(
"{}", resolved_value);
207 source_key_[cache_key] = layer_value.source_key;
208 std::string source = format_->
format(
"{}", layer_value.source_info);
209 source_[cache_key] = source;
210 source_details_[cache_key] = layer_value.source_details;
211 return ConfigValue<T>{resolved_value, canonical_name, layer_value.source_key, source, layer_value.source_details};
219 panic(
"hit unexpected ValidationState");
223 panic(format_->
format(
"no value found for '{}' in any config layer", cache_key));
227std::vector<ProvenanceChainLink<T>> LazyLayeredConfig::collect_provenance_chain(
228 std::function<LayerValue<T>(
const ConfigProvider &)> provider_call)
const
230 std::vector<ProvenanceChainLink<T>> chain;
231 chain.reserve(providers_.size());
233 for (
const auto &provider : providers_) {
234 LayerValue<T> layer_value = provider_call(*provider);
235 chain.push_back(ProvenanceChainLink<T>{provider->name(), std::move(layer_value)});
245 const auto base_name = name.substr(0, name.size() - 4);
246 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
247 return resolve_config_value<std::size_t>(
255 const auto base_name = name.substr(0, name.size() - 4);
256 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
257 return resolve_config_value<std::size_t>(
265 const auto base_name = name.substr(0, name.size() - 4);
266 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
267 return resolve_config_value<std::size_t>(
275 const auto base_name = name.substr(0, name.size() - 4);
276 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
277 return resolve_config_value<std::size_t>(
285 const auto base_name = name.substr(0, name.size() - 4);
286 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
287 return resolve_config_value<std::size_t>(
295 const auto base_name = name.substr(0, name.size() - 4);
296 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
297 return resolve_config_value<std::size_t>(
305 const auto base_name = name.substr(0, name.size() - 4);
306 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
307 return resolve_config_value<std::size_t>(
315 const auto base_name = name.substr(0, name.size() - 4);
316 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
317 return resolve_config_value<std::size_t>(
325 const auto base_name = name.substr(0, name.size() - 4);
326 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
327 return resolve_config_value<Rgba32>(
335 const auto base_name = name.substr(0, name.size() - 4);
336 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
337 return resolve_config_value<ArtifactEditMode>(
345 const auto base_name = name.substr(0, name.size() - 4);
346 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
347 return resolve_config_value<ArtifactEditMode>(
355 const auto base_name = name.substr(0, name.size() - 4);
356 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
357 return resolve_config_value<bool>(
365 const auto base_name = name.substr(0, name.size() - 4);
366 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
367 return resolve_config_value<std::vector<PaletteHint>>(
368 key,
"Palette Hints", [&type, &scope](
const ConfigProvider &provider) {
return provider.pal_hints(type, scope); });
375 const auto base_name = name.substr(0, name.size() - 4);
376 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
377 return resolve_config_value<PackingStrategyType>(
385 const auto base_name = name.substr(0, name.size() - 4);
386 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
387 return resolve_config_value<PackingStrategyParams>(
395 const auto base_name = name.substr(0, name.size() - 4);
396 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
397 return resolve_config_value<TileSharingPacking>(
405 const auto base_name = name.substr(0, name.size() - 4);
406 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
407 return resolve_config_value<TileSharingAlignment>(
415 const auto base_name = name.substr(0, name.size() - 4);
416 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
417 return resolve_config_value<TilesPalMode>(
425 const auto base_name = name.substr(0, name.size() - 4);
426 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
427 return resolve_config_value<AnimPalResolutionStrategy>(
435 const auto base_name = name.substr(0, name.size() - 4);
436 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
437 return resolve_config_value<AnimKeyFrameResolutionStrategy>(
445 const auto base_name = name.substr(0, name.size() - 4);
446 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
447 return resolve_config_value<AnimMultiPalSubtileResolutionStrategy>(
455 const auto base_name = name.substr(0, name.size() - 4);
456 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
457 return resolve_config_value<FrameLinking>(
465 const auto base_name = name.substr(0, name.size() - 4);
466 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
467 return resolve_config_value<PerAnimOverrides>(
475 const auto base_name = name.substr(0, name.size() - 4);
476 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
477 return resolve_config_value<bool>(
485 const auto base_name = name.substr(0, name.size() - 4);
486 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
487 return resolve_config_value<bool>(
495 const auto base_name = name.substr(0, name.size() - 4);
496 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
497 return resolve_config_value<PrimaryPairingMode>(
505 const auto base_name = name.substr(0, name.size() - 4);
506 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
507 return resolve_config_value<std::vector<std::string>>(
508 key,
"Primary Pairing Partners", [&type, &scope](
const ConfigProvider &provider) {
return provider.primary_pairing_partners(type, scope); });
515 const auto base_name = name.substr(0, name.size() - 4);
516 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
517 return resolve_config_value<std::vector<std::string>>(
518 key,
"Diagnostic Warnings Exclude", [&type, &scope](
const ConfigProvider &provider) {
return provider.diagnostic_warnings_exclude(type, scope); });
525 const auto base_name = name.substr(0, name.size() - 4);
526 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
527 return resolve_config_value<std::vector<std::string>>(
528 key,
"Diagnostic Warnings Include", [&type, &scope](
const ConfigProvider &provider) {
return provider.diagnostic_warnings_include(type, scope); });
535 const auto base_name = name.substr(0, name.size() - 4);
536 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
537 return resolve_config_value<std::vector<std::string>>(
538 key,
"Diagnostic Remarks Exclude", [&type, &scope](
const ConfigProvider &provider) {
return provider.diagnostic_remarks_exclude(type, scope); });
545 const auto base_name = name.substr(0, name.size() - 4);
546 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
547 return resolve_config_value<std::vector<std::string>>(
548 key,
"Diagnostic Remarks Include", [&type, &scope](
const ConfigProvider &provider) {
return provider.diagnostic_remarks_include(type, scope); });
555 const auto base_name = name.substr(0, name.size() - 4);
556 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
557 return resolve_config_value<std::string>(
565 const auto base_name = name.substr(0, name.size() - 4);
566 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
567 return resolve_config_value<std::string>(
575 const auto base_name = name.substr(0, name.size() - 4);
576 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
577 return resolve_config_value<std::string>(
585 const auto base_name = name.substr(0, name.size() - 4);
586 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
587 return resolve_config_value<std::string>(
595 const auto base_name = name.substr(0, name.size() - 4);
596 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
597 return resolve_config_value<std::size_t>(
605 const auto base_name = name.substr(0, name.size() - 4);
606 const auto key =
to_string(type) +
":" + scope +
":" + base_name;
607 return resolve_config_value<bool>(
611std::vector<ProvenanceChainLink<std::size_t>>
614 return collect_provenance_chain<std::size_t>(
618std::vector<ProvenanceChainLink<std::size_t>>
621 return collect_provenance_chain<std::size_t>(
625std::vector<ProvenanceChainLink<std::size_t>>
628 return collect_provenance_chain<std::size_t>(
632std::vector<ProvenanceChainLink<std::size_t>>
635 return collect_provenance_chain<std::size_t>(
639std::vector<ProvenanceChainLink<std::size_t>>
642 return collect_provenance_chain<std::size_t>(
646std::vector<ProvenanceChainLink<std::size_t>>
649 return collect_provenance_chain<std::size_t>(
653std::vector<ProvenanceChainLink<std::size_t>>
656 return collect_provenance_chain<std::size_t>(
660std::vector<ProvenanceChainLink<std::size_t>>
663 return collect_provenance_chain<std::size_t>(
667std::vector<ProvenanceChainLink<Rgba32>>
670 return collect_provenance_chain<Rgba32>(
674std::vector<ProvenanceChainLink<ArtifactEditMode>>
677 return collect_provenance_chain<ArtifactEditMode>(
681std::vector<ProvenanceChainLink<ArtifactEditMode>>
684 return collect_provenance_chain<ArtifactEditMode>(
688std::vector<ProvenanceChainLink<bool>>
691 return collect_provenance_chain<bool>(
695std::vector<ProvenanceChainLink<std::vector<PaletteHint>>>
698 return collect_provenance_chain<std::vector<PaletteHint>>(
699 [&type, &scope](
const ConfigProvider &provider) {
return provider.pal_hints(type, scope); });
702std::vector<ProvenanceChainLink<PackingStrategyType>>
705 return collect_provenance_chain<PackingStrategyType>(
709std::vector<ProvenanceChainLink<PackingStrategyParams>>
712 return collect_provenance_chain<PackingStrategyParams>(
716std::vector<ProvenanceChainLink<TileSharingPacking>>
719 return collect_provenance_chain<TileSharingPacking>(
723std::vector<ProvenanceChainLink<TileSharingAlignment>>
726 return collect_provenance_chain<TileSharingAlignment>(
730std::vector<ProvenanceChainLink<TilesPalMode>>
733 return collect_provenance_chain<TilesPalMode>(
737std::vector<ProvenanceChainLink<AnimPalResolutionStrategy>>
740 return collect_provenance_chain<AnimPalResolutionStrategy>(
744std::vector<ProvenanceChainLink<AnimKeyFrameResolutionStrategy>>
747 return collect_provenance_chain<AnimKeyFrameResolutionStrategy>(
751std::vector<ProvenanceChainLink<AnimMultiPalSubtileResolutionStrategy>>
754 return collect_provenance_chain<AnimMultiPalSubtileResolutionStrategy>(
758std::vector<ProvenanceChainLink<FrameLinking>>
761 return collect_provenance_chain<FrameLinking>(
765std::vector<ProvenanceChainLink<PerAnimOverrides>>
768 return collect_provenance_chain<PerAnimOverrides>(
772std::vector<ProvenanceChainLink<bool>>
775 return collect_provenance_chain<bool>(
779std::vector<ProvenanceChainLink<bool>>
782 return collect_provenance_chain<bool>(
786std::vector<ProvenanceChainLink<PrimaryPairingMode>>
789 return collect_provenance_chain<PrimaryPairingMode>(
793std::vector<ProvenanceChainLink<std::vector<std::string>>>
796 return collect_provenance_chain<std::vector<std::string>>(
797 [&type, &scope](
const ConfigProvider &provider) {
return provider.primary_pairing_partners(type, scope); });
800std::vector<ProvenanceChainLink<std::vector<std::string>>>
803 return collect_provenance_chain<std::vector<std::string>>(
804 [&type, &scope](
const ConfigProvider &provider) {
return provider.diagnostic_warnings_exclude(type, scope); });
807std::vector<ProvenanceChainLink<std::vector<std::string>>>
810 return collect_provenance_chain<std::vector<std::string>>(
811 [&type, &scope](
const ConfigProvider &provider) {
return provider.diagnostic_warnings_include(type, scope); });
814std::vector<ProvenanceChainLink<std::vector<std::string>>>
817 return collect_provenance_chain<std::vector<std::string>>(
818 [&type, &scope](
const ConfigProvider &provider) {
return provider.diagnostic_remarks_exclude(type, scope); });
821std::vector<ProvenanceChainLink<std::vector<std::string>>>
824 return collect_provenance_chain<std::vector<std::string>>(
825 [&type, &scope](
const ConfigProvider &provider) {
return provider.diagnostic_remarks_include(type, scope); });
828std::vector<ProvenanceChainLink<std::string>>
831 return collect_provenance_chain<std::string>(
835std::vector<ProvenanceChainLink<std::string>>
838 return collect_provenance_chain<std::string>(
842std::vector<ProvenanceChainLink<std::string>>
845 return collect_provenance_chain<std::string>(
849std::vector<ProvenanceChainLink<std::string>>
852 return collect_provenance_chain<std::string>(
856std::vector<ProvenanceChainLink<std::size_t>>
859 return collect_provenance_chain<std::size_t>(
863std::vector<ProvenanceChainLink<bool>>
866 return collect_provenance_chain<bool>(
A result type that maintains a chainable sequence of errors for debugging and error reporting.
An interface which config implementations can use to load config values.
virtual LayerValue< ArtifactEditMode > pals_edit_mode(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< PerAnimOverrides > per_anim_overrides(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< Rgba32 > extrinsic_transparency(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< TileSharingPacking > tile_sharing_packing(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< PackingStrategyParams > packing_strategy_params(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< AnimPalResolutionStrategy > global_anim_pal_resolution_strategy(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > metatile_attr_size(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< TilesPalMode > tiles_pal_mode(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< ArtifactEditMode > tiles_edit_mode(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > max_map_data_size(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< bool > pal_hints_enabled(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< bool > verify_checksums(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< FrameLinking > global_frame_linking(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< TileSharingAlignment > tile_sharing_alignment(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_metatiles_in_primary(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< PrimaryPairingMode > primary_pairing_mode(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::string > tileset_paths_secondary_bin(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< PackingStrategyType > packing_strategy(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< AnimKeyFrameResolutionStrategy > global_anim_key_frame_resolution_strategy(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_tiles_total(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::string > tileset_paths_primary_src(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::string > tileset_paths_secondary_src(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_pals_total(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::string > tileset_paths_primary_bin(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_pals_in_primary(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< bool > cross_tileset_anim_linking(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_metatiles_total(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_tiles_per_metatile(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_tiles_in_primary(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< AnimMultiPalSubtileResolutionStrategy > global_anim_multi_pal_subtile_resolution_strategy(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< bool > tileset_animations_wire_anim_code(ConfigScopeType type, const std::string &scope) const
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_warnings_exclude_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::string > > tileset_paths_primary_src_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_paths_primary_src.
std::vector< ProvenanceChainLink< bool > > pal_hints_enabled_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for pal_hints_enabled.
std::vector< ProvenanceChainLink< bool > > tileset_animations_wire_anim_code_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_animations_wire_anim_code.
ChainableResult< ConfigValue< ArtifactEditMode > > pals_edit_mode_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::string > > tileset_paths_primary_bin_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< bool > > verify_checksums_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for verify_checksums.
std::vector< ProvenanceChainLink< FrameLinking > > global_frame_linking_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_frame_linking.
std::vector< ProvenanceChainLink< std::vector< std::string > > > diagnostic_remarks_exclude_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for diagnostic_remarks_exclude.
ChainableResult< ConfigValue< std::size_t > > num_metatiles_total_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::vector< std::string > > > primary_pairing_partners_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for primary_pairing_partners.
std::vector< ProvenanceChainLink< std::size_t > > max_map_data_size_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for max_map_data_size.
ChainableResult< ConfigValue< AnimMultiPalSubtileResolutionStrategy > > global_anim_multi_pal_subtile_resolution_strategy_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< FrameLinking > > global_frame_linking_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > num_tiles_total_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > num_pals_in_primary_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::vector< PaletteHint > > > pal_hints_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > num_pals_total_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::string > > tileset_paths_secondary_bin_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< TileSharingPacking > > tile_sharing_packing_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tile_sharing_packing.
ChainableResult< ConfigValue< PerAnimOverrides > > per_anim_overrides_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< PackingStrategyParams > > packing_strategy_params_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< Rgba32 > > extrinsic_transparency_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_remarks_include_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::vector< std::string > > > diagnostic_warnings_exclude_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for diagnostic_warnings_exclude.
ChainableResult< ConfigValue< bool > > cross_tileset_anim_linking_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< Rgba32 > > extrinsic_transparency_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for extrinsic_transparency.
std::vector< ProvenanceChainLink< std::size_t > > num_metatiles_in_primary_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_metatiles_in_primary.
ChainableResult< ConfigValue< std::size_t > > num_metatiles_in_primary_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< AnimMultiPalSubtileResolutionStrategy > > global_anim_multi_pal_subtile_resolution_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_anim_multi_pal_subtile_resolution_strategy.
std::vector< ProvenanceChainLink< std::size_t > > num_tiles_in_primary_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_tiles_in_primary.
std::vector< ProvenanceChainLink< std::vector< std::string > > > diagnostic_warnings_include_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for diagnostic_warnings_include.
std::vector< ProvenanceChainLink< std::string > > tileset_paths_secondary_src_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_paths_secondary_src.
ChainableResult< ConfigValue< std::size_t > > num_tiles_in_primary_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > num_tiles_per_metatile_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< bool > > pal_hints_enabled_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_remarks_exclude_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< PackingStrategyType > > packing_strategy_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< TilesPalMode > > tiles_pal_mode_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::size_t > > num_tiles_per_metatile_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_tiles_per_metatile.
std::vector< ProvenanceChainLink< PerAnimOverrides > > per_anim_overrides_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for per_anim_overrides.
std::vector< ProvenanceChainLink< ArtifactEditMode > > tiles_edit_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tiles_edit_mode.
std::vector< ProvenanceChainLink< AnimKeyFrameResolutionStrategy > > global_anim_key_frame_resolution_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_anim_key_frame_resolution_strategy.
std::vector< ProvenanceChainLink< std::size_t > > num_pals_total_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_pals_total.
ChainableResult< ConfigValue< bool > > verify_checksums_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< bool > > cross_tileset_anim_linking_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for cross_tileset_anim_linking.
std::vector< ProvenanceChainLink< std::size_t > > num_metatiles_total_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_metatiles_total.
std::vector< ProvenanceChainLink< AnimPalResolutionStrategy > > global_anim_pal_resolution_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_anim_pal_resolution_strategy.
std::vector< ProvenanceChainLink< std::vector< std::string > > > diagnostic_remarks_include_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for diagnostic_remarks_include.
std::vector< ProvenanceChainLink< TileSharingAlignment > > tile_sharing_alignment_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tile_sharing_alignment.
ChainableResult< ConfigValue< TileSharingPacking > > tile_sharing_packing_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< PrimaryPairingMode > > primary_pairing_mode_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< bool > > tileset_animations_wire_anim_code_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > metatile_attr_size_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< PrimaryPairingMode > > primary_pairing_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for primary_pairing_mode.
ChainableResult< ConfigValue< AnimPalResolutionStrategy > > global_anim_pal_resolution_strategy_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::string > > tileset_paths_secondary_bin_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_paths_secondary_bin.
std::vector< ProvenanceChainLink< std::vector< PaletteHint > > > pal_hints_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for pal_hints.
std::vector< ProvenanceChainLink< std::size_t > > num_tiles_total_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_tiles_total.
ChainableResult< ConfigValue< std::string > > tileset_paths_primary_src_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::size_t > > num_pals_in_primary_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_pals_in_primary.
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_warnings_include_raw(ConfigScopeType type, const std::string &scope) const override
void dump_config(std::ostream &out, ConfigScopeType type, const std::string &scope) const
Dumps the full provenance chain for all config values to an output stream.
void add_provider(std::unique_ptr< ConfigProvider > provider) override
Prepends a ConfigProvider to the provider chain at highest priority and invalidates resolution caches...
ChainableResult< ConfigValue< std::vector< std::string > > > primary_pairing_partners_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< TileSharingAlignment > > tile_sharing_alignment_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > max_map_data_size_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::size_t > > metatile_attr_size_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for metatile_attr_size.
std::vector< ProvenanceChainLink< std::string > > tileset_paths_primary_bin_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_paths_primary_bin.
std::vector< ProvenanceChainLink< ArtifactEditMode > > pals_edit_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for pals_edit_mode.
std::vector< ProvenanceChainLink< PackingStrategyType > > packing_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for packing_strategy.
ChainableResult< ConfigValue< std::string > > tileset_paths_secondary_src_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< AnimKeyFrameResolutionStrategy > > global_anim_key_frame_resolution_strategy_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< PackingStrategyParams > > packing_strategy_params_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for packing_strategy_params.
std::vector< ProvenanceChainLink< TilesPalMode > > tiles_pal_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tiles_pal_mode.
ChainableResult< ConfigValue< ArtifactEditMode > > tiles_edit_mode_raw(ConfigScopeType type, const std::string &scope) const override
static const Style faint
Faint text formatting.
static const Style red
Red foreground color.
static const Style cyan
Cyan foreground color.
static const Style bold
Bold text formatting.
static const Style green
Green foreground color.
virtual std::string style(const std::string &text, Style styles) const =0
Applies styling to a text string.
virtual std::string format(const std::string &format_str, const std::vector< FormatParam > ¶ms) const
Formats a string with styled parameters using fmtlib syntax.
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.
std::string extract_function_name(const std::source_location &location=std::source_location::current())
Extracts the function name from a source location.
std::vector< std::string > format_config_note(const TextFormatter &format, const ConfigValue< T > &config)
Format a ConfigValue into diagnostic note lines.
ConfigScopeType
Specifies the scope type for configuration value lookups.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.
A small container that holds an optional-wrapped value, validation state, and metadata about the valu...