Skip to main content

dxf_load_config_from_wstring

Function dxf_load_config_from_wstring 

Source
pub unsafe extern "C" fn dxf_load_config_from_wstring(
    config: dxf_const_string_t,
) -> ERRORCODE
Expand description

@ingroup c-api-config

@brief Initializes the C-API configuration and loads a config (in TOML format) from a wide string (dxf_const_string_t) For the successful application of the configuration, this function must be called before creating any connection

@details The config file sample: Sample

The TOML format specification: https://toml.io/en/v1.0.0-rc.2

Example #1:

dxf_load_config_from_wstring(
    L"network.heartbeatPeriod = 10\n"
    L"network.heartbeatTimeout = 120\n"
    L"logger.level = \"info\"\n"
);

Example #2:

dxf_load_config_from_wstring(
    L"[network]\n"
    L"heartbeatPeriod = 10\n"
    L"heartbeatTimeout = 120\n"
    L"[logger]\n"
    L"level = \"info\"\n"
);

@param[in] config The config (in TOML format) string

@return {@link DXF_SUCCESS} if configuration has been successfully loaded or {@link DXF_FAILURE} on error; {@link dxf_get_last_error} can be used to retrieve the error code and description in case of failure