|
Entropic 2.3.8
Local-first agentic inference engine
|
ryml extraction helpers for config parsing. More...
#include <ryml.hpp>#include <c4/std/string.hpp>#include <filesystem>#include <optional>#include <string>#include <unordered_map>#include <vector>

Go to the source code of this file.
Namespaces | |
| namespace | entropic |
| Activate model on GPU (WARM → ACTIVE). | |
Functions | |
| bool | entropic::config::extract (ryml::ConstNodeRef node, c4::csubstr key, std::string &out) |
| Extract a string value from a YAML node. | |
| bool | entropic::config::extract (ryml::ConstNodeRef node, c4::csubstr key, int &out) |
| Extract an int value from a YAML node. | |
| bool | entropic::config::extract (ryml::ConstNodeRef node, c4::csubstr key, float &out) |
| Extract a float value from a YAML node. | |
| bool | entropic::config::extract (ryml::ConstNodeRef node, c4::csubstr key, double &out) |
| Extract a double value from a YAML node. | |
| bool | entropic::config::extract (ryml::ConstNodeRef node, c4::csubstr key, bool &out) |
| Extract a bool value from a YAML node. | |
| bool | entropic::config::extract_path (ryml::ConstNodeRef node, c4::csubstr key, std::filesystem::path &out) |
| Extract a filesystem path with ~ expansion. | |
| bool | entropic::config::extract_tri_state_path (ryml::ConstNodeRef node, c4::csubstr key, std::optional< std::filesystem::path > &out, bool &disabled) |
| Extract a tri-state path (null = default, false = disabled, string = path). | |
| bool | entropic::config::extract_string_list (ryml::ConstNodeRef node, c4::csubstr key, std::vector< std::string > &out) |
| Extract a vector of strings from a YAML sequence node. | |
| bool | entropic::config::extract_string_list_opt (ryml::ConstNodeRef node, c4::csubstr key, std::optional< std::vector< std::string > > &out) |
| Extract an optional vector of strings. | |
| bool | entropic::config::extract_string_map (ryml::ConstNodeRef node, c4::csubstr key, std::unordered_map< std::string, std::string > &out) |
| Extract a map of string to string from a YAML mapping node. | |
| bool | entropic::config::extract_string_list_map (ryml::ConstNodeRef node, c4::csubstr key, std::unordered_map< std::string, std::vector< std::string > > &out) |
| Extract a map of string to list of strings from a YAML mapping. | |
| std::filesystem::path | entropic::config::expand_home (const std::filesystem::path &p) |
| Expand ~ to home directory in a path. | |
| std::string | entropic::config::to_string (c4::csubstr s) |
| Convert ryml csubstr to std::string. | |
| std::string | entropic::config::read_file (const std::filesystem::path &path) |
| Read a file into a string. | |
ryml extraction helpers for config parsing.
Wraps ryml's tree API with type-safe extraction functions that provide clear error messages for type mismatches. Each function returns true if the key was found and extracted, false if absent. The output parameter is unchanged when the key is absent.
Definition in file yaml_util.h.
| std::filesystem::path entropic::config::expand_home | ( | const std::filesystem::path & | p | ) |
Expand ~ to home directory in a path.
| p | Input path (may start with ~). |
| p | Input path (may start with ~). |
Definition at line 61 of file yaml_util.cpp.
| bool entropic::config::extract | ( | ryml::ConstNodeRef | node, |
| c4::csubstr | key, | ||
| bool & | out | ||
| ) |
Extract a bool value from a YAML node.
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output bool. Unchanged if key is absent. |
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output bool. Unchanged if key is absent. |
Definition at line 176 of file yaml_util.cpp.
| bool entropic::config::extract | ( | ryml::ConstNodeRef | node, |
| c4::csubstr | key, | ||
| double & | out | ||
| ) |
Extract a double value from a YAML node.
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output double. Unchanged if key is absent. |
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output double. Unchanged if key is absent. |
Definition at line 153 of file yaml_util.cpp.
| bool entropic::config::extract | ( | ryml::ConstNodeRef | node, |
| c4::csubstr | key, | ||
| float & | out | ||
| ) |
Extract a float value from a YAML node.
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output float. Unchanged if key is absent. |
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output float. Unchanged if key is absent. |
Definition at line 130 of file yaml_util.cpp.
| bool entropic::config::extract | ( | ryml::ConstNodeRef | node, |
| c4::csubstr | key, | ||
| int & | out | ||
| ) |
Extract an int value from a YAML node.
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output int. Unchanged if key is absent. |
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output int. Unchanged if key is absent. |
Definition at line 107 of file yaml_util.cpp.
| bool entropic::config::extract | ( | ryml::ConstNodeRef | node, |
| c4::csubstr | key, | ||
| std::string & | out | ||
| ) |
Extract a string value from a YAML node.
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output string. Unchanged if key is absent. |
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output string. Unchanged if key is absent. |
Definition at line 85 of file yaml_util.cpp.
| bool entropic::config::extract_path | ( | ryml::ConstNodeRef | node, |
| c4::csubstr | key, | ||
| std::filesystem::path & | out | ||
| ) |
Extract a filesystem path with ~ expansion.
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output path with ~ expanded. Unchanged if key is absent. |
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output path with ~ expanded. Unchanged if key is absent. |
Definition at line 202 of file yaml_util.cpp.
| bool entropic::config::extract_string_list | ( | ryml::ConstNodeRef | node, |
| c4::csubstr | key, | ||
| std::vector< std::string > & | out | ||
| ) |
Extract a vector of strings from a YAML sequence node.
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output vector. Unchanged if key is absent. |
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output vector. Unchanged if key is absent. |
Definition at line 251 of file yaml_util.cpp.
| bool entropic::config::extract_string_list_map | ( | ryml::ConstNodeRef | node, |
| c4::csubstr | key, | ||
| std::unordered_map< std::string, std::vector< std::string > > & | out | ||
| ) |
Extract a map of string to list of strings from a YAML mapping.
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output map. Unchanged if key is absent. |
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output map. Unchanged if key is absent. |
Definition at line 332 of file yaml_util.cpp.
| bool entropic::config::extract_string_list_opt | ( | ryml::ConstNodeRef | node, |
| c4::csubstr | key, | ||
| std::optional< std::vector< std::string > > & | out | ||
| ) |
Extract an optional vector of strings.
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output optional vector. |
If key absent: out unchanged (remains nullopt). If key present with sequence: out = vector of strings. If key present with null: out = nullopt.
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output optional vector. |
Definition at line 277 of file yaml_util.cpp.
| bool entropic::config::extract_string_map | ( | ryml::ConstNodeRef | node, |
| c4::csubstr | key, | ||
| std::unordered_map< std::string, std::string > & | out | ||
| ) |
Extract a map of string to string from a YAML mapping node.
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output map. Unchanged if key is absent. |
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output map. Unchanged if key is absent. |
Definition at line 306 of file yaml_util.cpp.
| bool entropic::config::extract_tri_state_path | ( | ryml::ConstNodeRef | node, |
| c4::csubstr | key, | ||
| std::optional< std::filesystem::path > & | out, | ||
| bool & | disabled | ||
| ) |
Extract a tri-state path (null = default, false = disabled, string = path).
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output path. nullopt if absent/null/false. |
| [out] | disabled | Set to true if value is explicitly false. |
Maps to Python's TriStatePath: None | False | Path. YAML values: absent/null = default (out=nullopt, disabled=false), false = disabled (out=nullopt, disabled=true), string = custom path (out=expanded path, disabled=false).
| node | The ryml node to extract from. | |
| key | The key to look up. | |
| [out] | out | Output path. nullopt if absent/null/false. |
| [out] | disabled | Set to true if value is explicitly false. |
Definition at line 223 of file yaml_util.cpp.
| std::string entropic::config::read_file | ( | const std::filesystem::path & | path | ) |
Read a file into a string.
| path | File path. |
| path | File path. |
Definition at line 39 of file yaml_util.cpp.
| std::string entropic::config::to_string | ( | c4::csubstr | s | ) |
Convert ryml csubstr to std::string.
| s | ryml substring. |
| s | ryml substring. |
Definition at line 27 of file yaml_util.cpp.