|
Porytiles
|
A ConfigProvider implementation that reads configuration values from multiple YAML files with priority. More...
#include <yaml_file_provider.hpp>
Public Member Functions | |
| YamlFileProvider (gsl::not_null< const TextFormatter * > format, const UserDiagnostics *diagnostics, const std::filesystem::path &project_root) | |
| Constructs a YamlFileProvider that searches for configuration across multiple YAML files. | |
| YamlFileProvider (const UserDiagnostics *diagnostics, const std::filesystem::path &project_root) | |
| Constructs a YamlFileProvider with a default PlainTextFormatter. | |
| std::string | name () const override |
| Gets the name of this config layer. | |
| bool | preload_and_validate (ConfigScopeType type, const std::string &scope) const |
| Eagerly loads all YAML config files and validates them for unknown keys. | |
| LayerValue< std::size_t > | num_tiles_in_primary (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::size_t > | num_tiles_total (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::size_t > | num_metatiles_in_primary (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::size_t > | num_metatiles_total (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::size_t > | num_pals_in_primary (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::size_t > | num_pals_total (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::size_t > | max_map_data_size (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::size_t > | num_tiles_per_metatile (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< Rgba32 > | extrinsic_transparency (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< ArtifactEditMode > | tiles_edit_mode (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< ArtifactEditMode > | pals_edit_mode (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< bool > | pal_hints_enabled (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::vector< PaletteHint > > | pal_hints (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< PackingStrategyType > | packing_strategy (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< PackingStrategyParams > | packing_strategy_params (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< TileSharingPacking > | tile_sharing_packing (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< TileSharingAlignment > | tile_sharing_alignment (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< TilesPalMode > | tiles_pal_mode (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< AnimPalResolutionStrategy > | global_anim_pal_resolution_strategy (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< AnimKeyFrameResolutionStrategy > | global_anim_key_frame_resolution_strategy (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< AnimMultiPalSubtileResolutionStrategy > | global_anim_multi_pal_subtile_resolution_strategy (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< FrameLinking > | global_frame_linking (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< PerAnimOverrides > | per_anim_overrides (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< bool > | cross_tileset_anim_linking (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< bool > | verify_checksums (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< PrimaryPairingMode > | primary_pairing_mode (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::vector< std::string > > | primary_pairing_partners (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::vector< std::string > > | diagnostic_warnings_exclude (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::vector< std::string > > | diagnostic_warnings_include (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::vector< std::string > > | diagnostic_remarks_exclude (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::vector< std::string > > | diagnostic_remarks_include (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::string > | tileset_paths_primary_src (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::string > | tileset_paths_primary_bin (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::string > | tileset_paths_secondary_src (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::string > | tileset_paths_secondary_bin (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< std::size_t > | metatile_attr_size (ConfigScopeType type, const std::string &scope) const override |
| LayerValue< bool > | tileset_animations_wire_anim_code (ConfigScopeType type, const std::string &scope) const override |
Public Member Functions inherited from porytiles::ConfigProvider | |
| virtual | ~ConfigProvider ()=default |
A ConfigProvider implementation that reads configuration values from multiple YAML files with priority.
YamlFileProvider loads YAML configuration files from multiple locations and provides access to configuration values defined within them. Config files are searched in priority order:
Files are loaded lazily and cached for performance. If no config files exist or a key is not found, methods return LayerValue::not_provided(), allowing graceful fallback to other providers in a layered configuration system.
Definition at line 36 of file yaml_file_provider.hpp.
|
explicit |
Constructs a YamlFileProvider that searches for configuration across multiple YAML files.
This constructor sets up the provider to search for configuration values across multiple config files in priority order. Config files are loaded lazily when first accessed and cached for subsequent lookups. Unknown YAML keys will be reported as errors via the diagnostics interface.
| format | A pointer to the TextFormatter to use |
| diagnostics | A pointer to UserDiagnostics for emitting errors about unknown keys |
| project_root | The root directory of the project |
Definition at line 25 of file yaml_file_provider.cpp.
|
explicit |
Constructs a YamlFileProvider with a default PlainTextFormatter.
This constructor creates an internally owned PlainTextFormatter instance and uses it for formatting. The YamlFileProvider will search for configuration values across multiple config files in priority order. Config files are loaded lazily when first accessed and cached for subsequent lookups. Unknown YAML keys will be reported as errors via the diagnostics interface.
| diagnostics | A pointer to UserDiagnostics for emitting errors about unknown keys |
| project_root | The root directory of the project |
Definition at line 34 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 421 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 517 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 533 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 485 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 501 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 181 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 357 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 373 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 341 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 389 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 149 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 613 of file yaml_file_provider.cpp.
|
overridevirtual |
Gets the name of this config layer.
Implements porytiles::ConfigProvider.
Definition at line 43 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 85 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 101 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 117 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 133 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 53 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 165 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 69 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 261 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 277 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 245 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 229 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 213 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 405 of file yaml_file_provider.cpp.
| bool porytiles::YamlFileProvider::preload_and_validate | ( | ConfigScopeType | type, |
| const std::string & | scope | ||
| ) | const |
Eagerly loads all YAML config files and validates them for unknown keys.
Forces loading and validation of all YAML config files in the priority chain for the given scope. If any files contain unknown configuration keys, errors are emitted via the diagnostics interface and this method returns true to indicate the caller should terminate.
| type | The configuration scope type |
| scope | The scope name (e.g., tileset name) |
true if unknown keys were found (caller should terminate), false otherwise. Definition at line 48 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 453 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 469 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 309 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 293 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 197 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 325 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 629 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 565 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 549 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 597 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 581 of file yaml_file_provider.cpp.
|
overridevirtual |
Reimplemented from porytiles::ConfigProvider.
Definition at line 437 of file yaml_file_provider.cpp.