MPD: config/ConfigGlobal.hxx File Reference

MPD 0.20.18

Functions
ConfigGlobal.hxx File Reference
`#include "ConfigOption.hxx"`
`#include "Compiler.h"`
`#include <chrono>`
Include dependency graph for ConfigGlobal.hxx:

Go to the source code of this file.

## Functions
void | config_global_init ()
void | config_global_finish ()
void | config_global_check ()
| Call this function after all configuration has been evaluated. More...
void | ReadConfigFile (Path path)
gcc_pure const ConfigParam * | config_get_param (enum ConfigOption option) noexcept
gcc_pure const ConfigBlock * | config_get_block (enum ConfigBlockOption option) noexcept
const ConfigBlock * | config_find_block (ConfigBlockOption option, const char *key, const char *value)
| Find a block with a matching attribute. More...
const char * | config_get_string (enum ConfigOption option, const char *default_value=nullptr) noexcept
AllocatedPath | config_get_path (enum ConfigOption option)
| Returns an optional configuration variable which contains an absolute path. More...
unsigned | config_get_unsigned (enum ConfigOption option, unsigned default_value)
static std::chrono::steady_clock::duration | config_get_unsigned (ConfigOption option, std::chrono::steady_clock::duration default_value)
unsigned | config_get_positive (enum ConfigOption option, unsigned default_value)
static std::chrono::steady_clock::duration | config_get_positive (ConfigOption option, std::chrono::steady_clock::duration default_value)
bool | config_get_bool (enum ConfigOption option, bool default_value)

## Function Documentation

## ◆ config_find_block()

const ConfigBlock* config_find_block | ( | ConfigBlockOption | option,
|  | const char * | key,
|  | const char * | value
| ) |  |

Find a block with a matching attribute.

Parameters

  option | the blocks to search
  key | the attribute name
  value | the expected attribute value

## ◆ config_get_block()

gcc_pure const ConfigBlock* config_get_block | ( | enum ConfigBlockOption | option | ) |
| noexcept

## ◆ config_get_bool()

bool config_get_bool | ( | enum ConfigOption | option,
|  | bool | default_value
| ) |  |

## ◆ config_get_param()

gcc_pure const ConfigParam* config_get_param | ( | enum ConfigOption | option | ) |
| noexcept

## ◆ config_get_path()

AllocatedPath config_get_path | ( | enum ConfigOption | option | ) |

Returns an optional configuration variable which contains an absolute path.

If there is a tilde prefix, it is expanded. Returns AllocatedPath::Null() if the value is not present.

Throws #std::runtime_error on error.

## ◆ config_get_positive() [1/2]

unsigned config_get_positive | ( | enum ConfigOption | option,
|  | unsigned | default_value
| ) |  |

## ◆ config_get_positive() [2/2]

static std::chrono::steady_clock::duration config_get_positive | ( | ConfigOption | option,
|  | std::chrono::steady_clock::duration | default_value
| ) |  |
| inlinestatic

Definition at line 97 of file ConfigGlobal.hxx.

## ◆ config_get_string()

const char* config_get_string | ( | enum ConfigOption | option,
|  | const char * | default_value = `nullptr`
| ) |  |
| noexcept

## ◆ config_get_unsigned() [1/2]

unsigned config_get_unsigned | ( | enum ConfigOption | option,
|  | unsigned | default_value
| ) |  |

## ◆ config_get_unsigned() [2/2]

static std::chrono::steady_clock::duration config_get_unsigned | ( | ConfigOption | option,
|  | std::chrono::steady_clock::duration | default_value
| ) |  |
| inlinestatic

Definition at line 85 of file ConfigGlobal.hxx.

## ◆ config_global_check()

void config_global_check | ( |  | ) |

Call this function after all configuration has been evaluated.

It checks for unused parameters, and logs warnings.

## ◆ config_global_finish()

void config_global_finish | ( |  | ) |

## ◆ config_global_init()

void config_global_init | ( |  | ) |

## ◆ ReadConfigFile()

void ReadConfigFile | ( | Path | path | ) |