Expand description
Config file loading, parsing, template merging, and environment expansion.
Functions§
- build_
default_ config - Build the initial default configuration with embedded default assets.
- config_
text_ is_ blank - Whether a config file’s text holds nothing but whitespace and comments: an empty file, to the reader.
- expand_
env_ vars - Replace
$ENV:VAR_NAMEand$ENV:VAR_NAME:fallbackin a string. - merge_
into_ template - Merge user settings into a JSONC template string.
- parse_
config_ text - A config file’s text as
T: JSONC (comments and trailing commas allowed), with or without a byte-order mark. Whatread_config_fileparses, so a caller can check bytes it holds the same way. - parse_
jsonc_ to_ map - Parse a JSONC string (with // comments and trailing commas) into a flat JSON map.
- read_
config_ file - Read a JSON config file, returning default on missing/error.
- read_
settings_ raw_ jsonc - Read
settings.jsonas a rawserde_json::Value::Object, stripping JSONC comments and trailing commas. Returns an empty object if the file doesn’t exist or can’t be parsed.