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

Network configuration loaded from config.toml at startup. More...

#include <cstdint>
#include <string>
Include dependency graph for NetworkConfig.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  NetworkAddress
 Network address parameters. More...
 
struct  NetworkConfig
 Runtime network connection parameters. More...
 

Functions

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

Detailed Description

Network configuration loaded from config.toml at startup.

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: