|
Porytiles
|
Bootstrap class so every tileset command can share common config and diagnostic setup. More...
#include <tileset_command_setup.hpp>
Public Member Functions | |
| TilesetCommandEnv (std::filesystem::path root, const CliOptionStorage &cli_storage) | |
| ChainableResult< void > | initialize (const std::string &tileset_name) |
| Runs the fallible half of env setup: YAML validation and the diagnostic filter construction. | |
| TilesetCommandEnv (const TilesetCommandEnv &)=delete | |
| TilesetCommandEnv & | operator= (const TilesetCommandEnv &)=delete |
| TilesetCommandEnv (TilesetCommandEnv &&)=delete | |
| TilesetCommandEnv & | operator= (TilesetCommandEnv &&)=delete |
Public Attributes | |
| std::filesystem::path | project_root |
| fruit::Injector< TextFormatter > | injector |
| TextFormatter * | text_formatter |
| StderrStyledUserDiagnostics | stderr_diag |
| gsl::not_null< YamlFileProvider * > | yaml_provider |
| LazyLayeredConfig | config |
| std::unique_ptr< FilteredUserDiagnostics > | diag |
Bootstrap class so every tileset command can share common config and diagnostic setup.
Owns the formatter injector, the unfiltered stderr diagnostics used during config loading, the layered config, and the filtered diagnostics built from the config's diagnostic include/exclude patterns.
Setup is two-phase: the constructor builds the infallible pieces, and initialize() runs the fallible half (YAML validation and the diagnostic filter construction) and returns a ChainableResult the command wraps with its own "Failed to <verb> tileset ..." context. Until initialize() succeeds, diag is unset, so failures report through stderr_diag.
Members hold pointers into earlier members, so the class is not copyable and not movable. Commands should construct it once on the stack.
Definition at line 72 of file tileset_command_setup.hpp.
|
inline |
Definition at line 113 of file tileset_command_setup.hpp.
|
delete |
|
delete |
|
inline |
Runs the fallible half of env setup: YAML validation and the diagnostic filter construction.
YAML validation failures return an error whose per-key details were already emitted through stderr_diag by the provider. An invalid diagnostic filter key is a real config error and fails the command too, instead of silently running with empty filters. On success, diag is ready for every subsequent operation.
| tileset_name | The command's target tileset, used as the config scope |
Definition at line 131 of file tileset_command_setup.hpp.
|
delete |
|
delete |
| LazyLayeredConfig porytiles::TilesetCommandEnv::config |
Definition at line 178 of file tileset_command_setup.hpp.
| std::unique_ptr<FilteredUserDiagnostics> porytiles::TilesetCommandEnv::diag |
Definition at line 179 of file tileset_command_setup.hpp.
| fruit::Injector<TextFormatter> porytiles::TilesetCommandEnv::injector |
Definition at line 166 of file tileset_command_setup.hpp.
| std::filesystem::path porytiles::TilesetCommandEnv::project_root |
Definition at line 165 of file tileset_command_setup.hpp.
| StderrStyledUserDiagnostics porytiles::TilesetCommandEnv::stderr_diag |
Definition at line 168 of file tileset_command_setup.hpp.
| TextFormatter* porytiles::TilesetCommandEnv::text_formatter |
Definition at line 167 of file tileset_command_setup.hpp.
| gsl::not_null<YamlFileProvider *> porytiles::TilesetCommandEnv::yaml_provider |
Definition at line 177 of file tileset_command_setup.hpp.