ark::config

Typedefs

Defined in “ark/config/forward.hh”:

Classes

  • ark::config::ConfigPackage
    A config package can reference many different configuration files/classes. These are typically read from a YAML which defines them all, but can also be constructed at runtime.

    Config packages provide mechanisms to allow overriding individual parameters from a particular base type/file, allowing you to customize parts of a configuration for a specific pipeline.

  • ark::config::ConfigPackagePlugin
    This is a simple plugin that can display information about a configuration package.

  • ark::config::ConfigPackageStage
    This stage will take the configuration package provided by the interface, and make it available for querying via polling messages. It also periodically emits the hash of the config package, so downstream customers (ie, the GUI) understands when the package has changed.

  • ark::config::ConfigPackageParseConfig
    Configuration relating to how the config package should be loaded/interpretted.

  • ark::config::IniFile
    Represents the parsed INI file.

  • ark::config::IniSection
    Represents an individual section of an INI file.

Functions

Declared in “ark/config/config_package.hh”:

  • void add_config_options_to_argument_parser(core::ArgumentParser & parser)
    Updates the argument parser with command-line options for setting various configuration parameters/options.

  • ConfigPackageParseConfig from_argument_parse_result(const core::ArgumentParseResult & args)
    Takes the given argument results and converts them into a config package parse config.

  • std::string serializable_object_to_config(const Type & object)
    Converts the given serializable object into a simple YAML configuration (with the contents of the object used as a default configuration).

Declared in “ark/config/config_parser.hh”:

  • serialization::JsonBlob parse_config_to_json(const std::string & yaml_content, const std::string & option_name, const std::string & yaml_overrides, const std::string & type_name, const std::string & schema)
    Parses the given configuration YAML into a JSON blob, capable of being deserialized into a structure.

    The option name controls the block of configuration that is made available.

  • std::map< std::string, serialization::JsonBlob > parse_config_with_all_options_to_json(const std::string & yaml_content, const std::string & yaml_overrides, const std::string & type_name, const std::string & schema)
    Parses the given configuration YAML into a series of JSON blobs, capable of being deserialized into a structure.

    The key name is the name of the option within the YAML content, and the value is the configuration for said option.

  • Type parse_config_from_string(const std::string & yaml_content, const std::string & option_name, const std::string & yaml_overrides)
    Parses the given YAML contents into the specified type. It is assumed that the type is an rbuf type (or a type that implements the serializable traits).

    The option name controls the block of configuration that is made available. You may pass in additional overrides as YAML with the ‘yaml_overrides’ parameter. This allows you to override values that were resolved in the content.

  • Type parse_config(const std::filesystem::path & path, const std::string & option_name, const std::string & yaml_overrides)
    Parses the contents of the given YAML file into the specified type.

    The option name controls the block of configuration that is made available.

  • std::map< std::string, Type > parse_config_with_all_options_from_string(const std::string & yaml_content, const std::string & yaml_overrides)
    Parses the given YAML contents into a mapping of the templated type. It is assumed that the type is an rbuf type (or a type that implements the serializable traits).

    All options within the configuration file are parsed, and a map is returned, where the key is the option name and the value is the type. You may pass in additional overrides as YAML with the ‘yaml_overrides’ parameter. This allows you to override values that were resolved in the content. The override parameters are applied to all options.

  • std::map< std::string, Type > parse_config_with_all_options(const std::filesystem::path & path, const std::string & yaml_overrides)
    Returns a mapping containing loaded configuration for every option that is specified in the given config file, allowing you to easily switch between (or load all of) all of the options int he configuration.

Declared in “ark/config/ini_parser.hh”:

  • IniFile parse_ini_content(const std::string_view & content)
    Parses the given string buffer as an INI file.

  • IniFile parse_ini_file(const std::filesystem::path & path)
    Parses the given file as an INI file.

  • std::string write_ini_content(const IniFile & file)
    Writes the given INI file out into a string buffer.

  • void write_ini_content(const IniFile & file, const std::filesystem::path & path)
    Writes the given INI file out into a file.

Declared in “ark/config/package_encoders.hh”:

  • std::string encode_config_package_as_base64(const ConfigPackage & package)
    Converts the given configuration package into a base64-encoded (URL-safe) string. This is suitable for passing around in some text-based environments without losing any detail.

  • ConfigPackage decode_config_package_from_base64(const std::string_view & encoded_package)
    Decodes the given base64 (URL-safe) string into a configuration package and returns the result.