|
cppfig 0.1.0
Modern C++20 compile-time type-safe configuration library
|
Primary template for configuration type traits. More...
#include <traits.h>
Static Public Member Functions | |
| static auto | Serialize (const T &value) -> Value=delete |
| Serializes a value to a Value node. | |
| static auto | Deserialize (const Value &value) -> std::optional< T >=delete |
| Deserializes a value from a Value node. | |
| static auto | ToString (const T &value) -> std::string=delete |
| Converts a value to a human-readable string. | |
| static auto | FromString (std::string_view str) -> std::optional< T >=delete |
| Parses a value from a string (e.g., from environment variables). | |
Primary template for configuration type traits.
Users must specialize this template for custom types to enable serialization, deserialization, and validation. Default specializations are provided for primitive types (int, double, bool, std::string).
| T | The configuration value type. |
|
staticdelete |
|
staticdelete |
Parses a value from a string (e.g., from environment variables).
| str | The string to parse. |
|
staticdelete |
|
staticdelete |
Converts a value to a human-readable string.
| value | The value to convert. |