7#ifndef ARGS__GROUP_IFACE_HPP__INCLUDED
8#define ARGS__GROUP_IFACE_HPP__INCLUDED
37 using ArgPtr = std::unique_ptr<ArgIface, details::Deleter<ArgIface>>;
43 bool required =
false)
44 : m_name(std::forward<T>(
name))
45 , m_required(required)
173 if (tmp !=
nullptr) {
205 arg->checkCorrectnessBeforeParsing(flags, names);
213 arg->checkCorrectnessAfterParsing();
241 if (ch->isMisspelledName(
name, possibleNames))
virtual void setCmdLine(CmdLine *cmdLine)
Set command line parser.
CmdLine * cmdLine() const
virtual bool isDefined() const =0
Base exception of the library.
Command in the command line interface.
Context is a list of words in the command line that user presented with interface for interacting wit...
virtual GroupIface & setRequired(bool on=true)
Set required flag.
const String & description() const override
void setCmdLine(CmdLine *cmdLine) override
Set command line parser.
virtual GroupIface & addArg(ArgPtr arg)
Add argument.
GroupIface & addArg(ArgIface *arg)
Add argument.
String name() const override
bool isRequired() const override
const String & flag() const override
const String & valueSpecifier() const override
GroupIface & addArg(ArgIface &arg)
Add argument.
bool isWithValue() const override
void process(Context &) override
Process argument's staff, for example take values from context.
void clear() override
Clear state of the argument.
Arguments m_children
List of children.
const Arguments & children() const
bool isMisspelledName(const String &name, StringList &possibleNames) const override
const String & argumentName() const override
std::unique_ptr< ArgIface, details::Deleter< ArgIface > > ArgPtr
Smart pointer to the argument.
std::vector< ArgPtr > Arguments
List of child arguments.
const String & longDescription() const override
void checkCorrectnessBeforeParsing(StringList &flags, StringList &names) const override
Check correctness of the argument before parsing.
GroupIface(T &&name, bool required=false)
ArgIface * findArgument(const String &name) override
void checkCorrectnessAfterParsing() const override
Check correctness of the argument after parsing.
constexpr std::add_const< T >::type & asConst(T &t) noexcept
Adds const to non-const objects.
std::string String
String type.
std::vector< String > StringList
List of strings.
static const String c_string
#define DISABLE_COPY(Class)
Macro for disabling copy.