cppfig 0.1.0
Modern C++20 compile-time type-safe configuration library
Loading...
Searching...
No Matches
cppfig::detail Namespace Reference

Classes

struct  IsOneOf
 Helper to check if a type is in a parameter pack. More...
 

Functions

void CompareValueRecursive (const Value &base, const Value &target, const std::string &prefix, ConfigDiff &diff)
 Recursively compares two Value objects and collects differences.
 
consteval auto IsPathPrefix (std::string_view prefix, std::string_view path) -> bool
 Returns true if prefix names an ancestor of path.
 
consteval auto IsPathWellFormed (std::string_view path) -> bool
 Returns true if path is a non-empty dot-separated path with no empty segments.
 
template<typename... Settings>
consteval auto AllPathsWellFormed () -> bool
 Helper to check that every path is well-formed at compile time.
 
template<typename... Settings>
consteval auto AllPathsUnique () -> bool
 Helper to check if all paths are unique at compile time.
 

Function Documentation

◆ AllPathsUnique()

template<typename... Settings>
consteval auto cppfig::detail::AllPathsUnique ( ) -> bool

Helper to check if all paths are unique at compile time.

Two paths collide not only when they are equal but also when one is an ancestor of the other: writing "server" and then "server.port" turns the first into an object, and writing them the other way round turns the second into a leaf. Which value survives depends on write order, so both shapes are rejected.

◆ AllPathsWellFormed()

template<typename... Settings>
consteval auto cppfig::detail::AllPathsWellFormed ( ) -> bool

Helper to check that every path is well-formed at compile time.

◆ CompareValueRecursive()

void cppfig::detail::CompareValueRecursive ( const Value &  base,
const Value &  target,
const std::string &  prefix,
ConfigDiff &  diff 
)
inline

Recursively compares two Value objects and collects differences.

◆ IsPathPrefix()

consteval auto cppfig::detail::IsPathPrefix ( std::string_view  prefix,
std::string_view  path 
) -> bool

Returns true if prefix names an ancestor of path.

"server" is an ancestor of "server.port"; "serve" is not, and neither is "server" of "serverport".

◆ IsPathWellFormed()

consteval auto cppfig::detail::IsPathWellFormed ( std::string_view  path) -> bool

Returns true if path is a non-empty dot-separated path with no empty segments.

Mirrors Value::SplitPath, which rejects the same shapes at runtime.