llarp::ConfigParser
Public Types
| Name | |
|---|---|
| using std::unordered_multimap< std::string, std::string > | SectionValues_t |
| using std::unordered_map< std::string, SectionValues_t > | Config_impl_t |
Public Functions
| Name | |
|---|---|
| void | Clear() clear parser |
| bool | LoadFile(const fs::path & fname) load config file for bootserv return true on success return false on error |
| bool | LoadNewFromStr(std::string_view str) load new .ini file from string (calls ParseAll() rather than Parse()) return true on success return false on error |
| bool | LoadFromStr(std::string_view str) load from string return true on success return false on error |
| void | IterAll(std::function< void(std::string_view, const SectionValues_t &)> visit) iterate all sections and thier values |
| bool | VisitSection(const char * name, std::function< bool(const SectionValues_t &)> visit) const visit a section in config read only by name return false if no section or value propagated from visitor |
| void | AddOverride(fs::path file, std::string section, std::string key, std::string value) add a config option that is appended in another file |
| void | Save() save config overrides |
| void | SaveNew() const save new .ini config file to path |
| void | Filename(fs::path f) |
Public Types Documentation
using SectionValues_t
using llarp::ConfigParser::SectionValues_t = std::unordered_multimap<std::string, std::string>;
using Config_impl_t
using llarp::ConfigParser::Config_impl_t = std::unordered_map<std::string, SectionValues_t>;
Public Functions Documentation
function Clear
void Clear()
clear parser
function LoadFile
bool LoadFile(
const fs::path & fname
)
load config file for bootserv return true on success return false on error
function LoadNewFromStr
bool LoadNewFromStr(
std::string_view str
)
load new .ini file from string (calls ParseAll() rather than Parse()) return true on success return false on error
function LoadFromStr
bool LoadFromStr(
std::string_view str
)
load from string return true on success return false on error
function IterAll
void IterAll(
std::function< void(std::string_view, const SectionValues_t &)> visit
)
iterate all sections and thier values
function VisitSection
bool VisitSection(
const char * name,
std::function< bool(const SectionValues_t &)> visit
) const
visit a section in config read only by name return false if no section or value propagated from visitor
function AddOverride
void AddOverride(
fs::path file,
std::string section,
std::string key,
std::string value
)
add a config option that is appended in another file
function Save
void Save()
save config overrides
function SaveNew
void SaveNew() const
save new .ini config file to path
function Filename
inline void Filename(
fs::path f
)
Updated on 2026-01-10 at 22:49:45 +0000