ArgsManager::GetArg

GetArg overloads

Synopses

Declared in <common/args.h>

Return string argument, or std::nullopt if it was not set.

[[requires_capability(0x7f2e381ad368)]]
std::optional<std::string>
GetArg(std::string const& strArg) const;
» more...

Return integer argument, or std::nullopt if it was not set.

template<std::integral Int>
[[requires_capability(0x7f2e381ad728)]]
std::optional<Int>
GetArg(std::string const& strArg) const;
» more...

Return string argument or default value

[[requires_capability(0x7f2e381ad228)]]
std::string
GetArg(
    std::string const& strArg,
    std::string const& strDefault) const;
» more...

Return integer argument or default value

template<std::integral Int>
[[requires_capability(0x7f2e381ad5e8)]]
Int
GetArg(
    std::string const& strArg,
    Int nDefault) const;
» more...

Return Value

  • The argument value, or std::nullopt if unset.
  • The integer value, or std::nullopt if unset.
  • command-line argument or default value
  • command-line argument (0 if invalid number) or default value

Parameters

NameDescription
strArgArgument to get (e.g. "-foo").
strDefault(e.g. "1")
nDefault(e.g. 1)