Class modeling an immutable configuration entry.
More...
#include <config.hh>
|
| ConstConfig (clingo_config_t const *stats, ProgramId key) |
| Construct from the underlying C API type and a key.
|
|
auto | type () const -> ConfigType |
| Get the type of the configuration entry.
|
|
auto | array () const -> ConstConfigArray |
| Access the configuration entry as an array.
|
|
auto | at (size_t index) const -> ConstConfig |
| Get the configuration entry at the given index in the array.
|
|
auto | operator[] (size_t index) const -> ConstConfig |
| Get the configuration entry at the given index in the array.
|
|
auto | map () const -> ConstConfigMap |
| Access the configuration entry as a map.
|
|
auto | get (std::string_view name) const -> ConstConfig |
| Get the configuration entry with the given name in the map.
|
|
auto | operator[] (std::string_view name) const -> ConstConfig |
| Get the configuration entry with the given name in the map.
|
|
auto | value () const -> std::optional< std::string_view > |
| Get the value of the configuration entry.
|
|
auto | operator* () const -> std::optional< std::string_view > |
| Get the value of the configuration entry.
|
|
auto | description () const -> std::string_view |
| Get the description of the configuration entry.
|
|
auto | to_string () const -> std::string |
| Get a string representation of the configuration entry.
|
|
Class modeling an immutable configuration entry.
◆ ConstConfig()
Construct from the underlying C API type and a key.
- Parameters
-
stats | the underlying C API type |
key | the key of the configuration entry |
◆ description()
auto Clingo::ConstConfig::description |
( |
| ) |
const -> std::string_view |
|
inline |
Get the description of the configuration entry.
The description corresponds to the text that appears in the help output of clingo or derived systems.
- Returns
- the description of the configuration entry
◆ operator*()
auto Clingo::ConstConfig::operator* |
( |
| ) |
const -> std::optional<std::string_view> |
|
inline |
Get the value of the configuration entry.
The return might be empty if no value is assigned to the configuration entry.
- Returns
- the value of the configuration entry
◆ operator[]() [1/2]
auto Clingo::ConstConfig::operator[] |
( |
size_t |
index | ) |
const -> ConstConfig |
|
inline |
Get the configuration entry at the given index in the array.
- Parameters
-
index | the index of the configuration entry |
- Returns
- the configuration entry at the given index
◆ operator[]() [2/2]
auto Clingo::ConstConfig::operator[] |
( |
std::string_view |
name | ) |
const -> ConstConfig |
|
inline |
Get the configuration entry with the given name in the map.
- Parameters
-
name | the name of the configuration entry in the map |
- Returns
- the configuration entry with the given name
◆ to_string()
auto Clingo::ConstConfig::to_string |
( |
| ) |
const -> std::string |
|
inline |
Get a string representation of the configuration entry.
This returns a string in a YAML-like format that can be used to inspect the configuration entry.
- Returns
- a string representation of the configuration entry
◆ type()
auto Clingo::ConstConfig::type |
( |
| ) |
const -> ConfigType |
|
inline |
Get the type of the configuration entry.
- Returns
- the type of the configuration entry
◆ value()
auto Clingo::ConstConfig::value |
( |
| ) |
const -> std::optional<std::string_view> |
|
inline |
Get the value of the configuration entry.
The return might be empty if no value is assigned to the configuration entry.
- Returns
- the value of the configuration entry
◆ c_cast
Cast the configuration to the underlying C API type.
- Parameters
-
stats | the configuration to cast |
- Returns
- the underlying C API type
The documentation for this class was generated from the following file: