group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
NetworkConfig.cpp File Reference

Implementation of loadNetworkConfig(). More...

#include "NetworkConfig.hpp"
#include <cstdio>
#include <toml++/toml.hpp>
Include dependency graph for NetworkConfig.cpp:

Functions

NetworkConfig loadNetworkConfig (const char *path)
 Load network config from a TOML file.
 

Detailed Description

Implementation of loadNetworkConfig().

Function Documentation

◆ loadNetworkConfig()

NetworkConfig loadNetworkConfig ( const char *  path)

Load network config from a TOML file.

Attempts to parse path as TOML. A missing file or missing key falls back to the default value — no exception escapes this function. On parse error a warning is printed to stderr and all defaults are returned.

Parameters
pathPath to config.toml (absolute or relative to the working directory).
Returns
Populated NetworkConfig (defaults for any absent key).
Here is the caller graph for this function: