> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::Config

> Class to get the configuration of the application.

Class to get the configuration of the application.

```cpp showLineNumbers={false}
#include <holoscan/config.hpp>
```

***

## Constructors

### Config \[#config]

```cpp showLineNumbers={false}
holoscan::Config::Config() = default
```

inline

explicit

```cpp showLineNumbers={false}
holoscan::Config::Config(
    const std::string &config_file,
    const std::string &prefix = ""
)
```

Construct a new `Config` object.

**Throws:** `RuntimeError` if the config\_file is non-empty and the file doesn't exist.

**Parameters**

The path to the configuration file.

The prefix string that is prepended to the key of the configuration. (not implemented yet)

```cpp showLineNumbers={false}
holoscan::Config::Config(
    const Config &
) = delete
```

### Destructor \[#destructor]

### \~Config

```cpp showLineNumbers={false}
virtual holoscan::Config::~Config() = default
```

***

## Assignment operators

### operator= \[#operator\_assign]

```cpp showLineNumbers={false}
Config & holoscan::Config::operator=(
    const Config &
) = delete
```

***

## Methods

### config\_file \[#configfile]

```cpp showLineNumbers={false}
const std::string & holoscan::Config::config_file() const
```

Get the path to the configuration file.

**Returns:** The path to the configuration file.

### prefix \[#prefix]

```cpp showLineNumbers={false}
const std::string & holoscan::Config::prefix() const
```

Get the prefix string that is prepended to the key of the configuration.

**Returns:** The prefix string that is prepended to the key of the configuration.

### yaml\_nodes \[#yamlnodes]

```cpp showLineNumbers={false}
const std::vector<YAML::Node> & holoscan::Config::yaml_nodes() const
```

Get the YAML::Node objects that contains `YAML` document data.

**Returns:** The reference to the vector of YAML::Node objects.

### from\_config \[#fromconfig]

```cpp showLineNumbers={false}
ArgList holoscan::Config::from_config(
    const std::string &key
)
```

Get the value of a configuration key as an [ArgList](arglist).

This method retrieves the value from the configuration for the given key. You can use '.' (dot) to access nested fields.

**Returns:** The argument list of the configuration for the key.

**Parameters**

The key of the configuration.

### config\_keys \[#configkeys]

```cpp showLineNumbers={false}
std::unordered_set<std::string> holoscan::Config::config_keys()
```

Determine the set of keys present in the config.

Returns all keys including nested keys using dot notation (e.g., "parent.child").

**Returns:** The set of valid keys.

### parse\_file \[#parsefile]

```cpp showLineNumbers={false}
void holoscan::Config::parse_file(
    const std::string &config_file
)
```

***

## Member variables

| Name           | Type                        | Description |
| -------------- | --------------------------- | ----------- |
| `config_file_` | `std::string`               |             |
| `prefix_`      | `std::string`               |             |
| `yaml_nodes_`  | `std::vector< YAML::Node >` |             |