|
Porytiles
|
A small container that holds an optional-wrapped value, validation state, and metadata about the value source. More...
#include <layer_value.hpp>
Static Public Member Functions | |
| static LayerValue | valid (T val, std::string source_key, std::string source_info) |
| Creates a LayerValue representing a valid configuration value. | |
| static LayerValue | valid (T val, std::string source_key, std::string source_info, std::vector< std::string > source_details) |
| Creates a LayerValue representing a valid configuration value with detailed source context. | |
| static LayerValue | invalid (std::string error, std::string source_info) |
| Creates a LayerValue representing an invalid configuration value. | |
| static LayerValue | invalid (std::string error, std::string source_info, std::vector< std::string > source_details) |
| Creates a LayerValue representing an invalid configuration value with detailed source context. | |
| static LayerValue | not_provided () |
| Creates a LayerValue representing that the provider does not supply this configuration. | |
Public Attributes | |
| std::optional< T > | value |
| std::string | source_key |
| std::string | source_info |
| std::vector< std::string > | source_details |
| ValidationState | state = ValidationState::not_provided |
| std::string | error_message |
A small container that holds an optional-wrapped value, validation state, and metadata about the value source.
LayerValue supports three states:
| T | The type of the underlying value |
Definition at line 37 of file layer_value.hpp.
|
inlinestatic |
Creates a LayerValue representing an invalid configuration value.
| error | Error message describing why the value is invalid |
| source_info | String describing the source that attempted to provide this value |
Definition at line 88 of file layer_value.hpp.
|
inlinestatic |
Creates a LayerValue representing an invalid configuration value with detailed source context.
| error | Error message describing why the value is invalid |
| source_info | String describing the source that attempted to provide this value |
| source_details | Vector of strings showing contextual lines around the source |
Definition at line 101 of file layer_value.hpp.
|
inlinestatic |
Creates a LayerValue representing that the provider does not supply this configuration.
Definition at line 117 of file layer_value.hpp.
|
inlinestatic |
Creates a LayerValue representing a valid configuration value.
| val | The valid configuration value |
| source_key | The provider-specific identifier for this value (e.g., "--num-tiles-per-metatile" for CLI) |
| source_info | String describing the source of this value (e.g., "CliOptionProvider") |
Definition at line 53 of file layer_value.hpp.
|
inlinestatic |
Creates a LayerValue representing a valid configuration value with detailed source context.
| val | The valid configuration value |
| source_key | The provider-specific identifier for this value (e.g., "fieldmap.num_tiles_in_primary" for YAML) |
| source_info | String describing the source of this value (e.g., "./porytiles.yaml:12") |
| source_details | Vector of strings showing contextual lines around the source |
Definition at line 70 of file layer_value.hpp.
| std::string porytiles::LayerValue< T >::error_message |
Definition at line 43 of file layer_value.hpp.
| std::vector<std::string> porytiles::LayerValue< T >::source_details |
Definition at line 41 of file layer_value.hpp.
| std::string porytiles::LayerValue< T >::source_info |
Definition at line 40 of file layer_value.hpp.
| std::string porytiles::LayerValue< T >::source_key |
Definition at line 39 of file layer_value.hpp.
| ValidationState porytiles::LayerValue< T >::state = ValidationState::not_provided |
Definition at line 42 of file layer_value.hpp.
| std::optional<T> porytiles::LayerValue< T >::value |
Definition at line 38 of file layer_value.hpp.