Skip to content

ryu_ldn::config::ConfigManager

Global configuration manager.

Singleton that manages runtime configuration with thread-safe access.

Type: Config

Type: char

Type: bool

Type: bool

Type: ConfigChangeCallback

& Instance()

Get the singleton instance.

@gdb{tag=“CONFIG:MGR”, msg=“Getting manager instance”}

Returns: &

bool Initialize(const char * config_path)

Initialize the config manager.

Loads configuration from disk. Should be called once at startup after filesystem is available.config_pathPath to config file (default: CONFIG_PATH)paramtrue if config loaded successfully @gdb{tag=“CONFIG:MGR”, msg=“Initializing configuration manager”}return

Parameters:

  • config_path (const char *)

Returns: bool

bool IsInitialized()

Check if initialized.

Returns: bool

const& GetConfig()

Get current configuration (read-only)

Returns: const&

ConfigResult Save()

Save current configuration to disk.

ConfigResult indicating success or failure @gdb{tag=“CONFIG:MGR”, msg=“Saving configuration to disk”}return

Returns: ConfigResult

ConfigResult Reload()

Reload configuration from disk.

Discards any unsaved changes.ConfigResult indicating success or failure @gdb{tag=“CONFIG:MGR”, msg=“Reloading configuration from disk”}return

Returns: ConfigResult

const char * GetServerHost()

Get server host.

Returns: const char *

void SetServerHost(const char * host)

Set server host.

hostNew hostname (max 128 chars) @gdb{tag=“CONFIG:MGR”, msg=“Setting server host”}param

Parameters:

  • host (const char *)
uint16_t GetServerPort()

Get server port.

Returns: uint16_t

void SetServerPort(uint16_t port)

Set server port.

@gdb{tag=“CONFIG:MGR”, msg=“Setting server port”}

Parameters:

  • port (uint16_t)
bool GetUseTls()

Get TLS enabled state.

Returns: bool

void SetUseTls(bool enabled)

Set TLS enabled state.

@gdb{tag=“CONFIG:MGR”, msg=“Setting TLS enabled state”}

Parameters:

  • enabled (bool)
uint32_t GetConnectTimeout()

Get connection timeout (ms)

Returns: uint32_t

void SetConnectTimeout(uint32_t timeout_ms)

Set connection timeout (ms)

@gdb{tag=“CONFIG:MGR”, msg=“Setting connect timeout”}

Parameters:

  • timeout_ms (uint32_t)
uint32_t GetPingInterval()

Get ping interval (ms)

Returns: uint32_t

void SetPingInterval(uint32_t interval_ms)

Set ping interval (ms)

@gdb{tag=“CONFIG:MGR”, msg=“Setting ping interval”}

Parameters:

  • interval_ms (uint32_t)
uint32_t GetReconnectDelay()

Get reconnect delay (ms)

Returns: uint32_t

void SetReconnectDelay(uint32_t delay_ms)

Set reconnect delay (ms)

@gdb{tag=“CONFIG:MGR”, msg=“Setting reconnect delay”}

Parameters:

  • delay_ms (uint32_t)
uint32_t GetMaxReconnectAttempts()

Get max reconnect attempts.

Returns: uint32_t

void SetMaxReconnectAttempts(uint32_t attempts)

Set max reconnect attempts (0 = infinite)

@gdb{tag=“CONFIG:MGR”, msg=“Setting max reconnect attempts”}

Parameters:

  • attempts (uint32_t)
bool GetLdnEnabled()

Get LDN enabled state.

Returns: bool

void SetLdnEnabled(bool enabled)

Set LDN enabled state.

@gdb{tag=“CONFIG:MGR”, msg=“Setting LDN enabled”}

Parameters:

  • enabled (bool)
const char * GetPassphrase()

Get passphrase.

Returns: const char *

bool SetPassphrase(const char * passphrase)

Set passphrase.

Passphrase must match format: Ryujinx-[0-9a-f]{8} Empty or nullptr clears the passphrase (allowed).passphraseNew passphraseparamtrue if set successfully, false if invalid format @gdb{tag=“CONFIG:MGR”, msg=“Setting passphrase”}return

Parameters:

  • passphrase (const char *)

Returns: bool

const char * GetInterfaceName()

Get network interface name.

Returns: const char *

void SetInterfaceName(const char * name)

Set network interface name.

nameInterface name (empty = auto-detect) @gdb{tag=“CONFIG:MGR”, msg=“Setting interface name”}param

Parameters:

  • name (const char *)
bool GetDebugEnabled()

Get debug enabled state.

Returns: bool

void SetDebugEnabled(bool enabled)

Set debug enabled state.

@gdb{tag=“CONFIG:MGR”, msg=“Setting debug enabled”}

Parameters:

  • enabled (bool)
uint32_t GetDebugLevel()

Get debug log level.

Returns: uint32_t

void SetDebugLevel(uint32_t level)

Set debug log level (0-3)

@gdb{tag=“CONFIG:MGR”, msg=“Setting debug level”}

Parameters:

  • level (uint32_t)
bool GetLogToFile()

Get log to file state.

Returns: bool

void SetLogToFile(bool enabled)

Set log to file state.

@gdb{tag=“CONFIG:MGR”, msg=“Setting log to file”}

Parameters:

  • enabled (bool)
void SetChangeCallback(ConfigChangeCallback callback)

Set callback for configuration changes.

callbackFunction to call when config changes (nullptr to clear) @gdb{tag=“CONFIG:MGR”, msg=“Setting change callback”}param

Parameters:

  • callback (ConfigChangeCallback)
bool HasUnsavedChanges()

Check if config has unsaved changes.

Returns: bool

void ConfigManager()
void ~ConfigManager()
void ConfigManager(const&)

Parameters:

  • param (const&)
& operator=(const&)

Parameters:

  • param (const&)

Returns: &

void NotifyChange(const char * section)

@gdb{tag=“CONFIG:MGR”, msg=“Config change notified”}

Parameters:

  • section (const char *)