220 template<
typename TEnum>
238 if ( (*it)->Element() == parameter ) {
242 ALIB_ERROR(
"CLI",
"Parameter '{}' not defined!", parameter)
250 template<
typename TEnum>
269 if ( (*it)->Element() == command ) {
273 ALIB_ERROR(
"CLI",
"Command '{}' not defined!", command)
281 template<
typename TEnum>
299 if ( (*it)->Element() == option ) {
303 ALIB_ERROR(
"CLI",
"Option '{}' not defined!", option)
311 template<
typename TEnum>
318 allocator().New<ExitCodeDecl>(recordIt.Enum()) );
457 "CLI",
"Argument index out of bounds" )
501,
Args ( cmdLine->stringListRecycler ) {}
505,
Args ( cmdLine->stringListRecycler ) {}
507template<
typename TEnum>
#define ALIB_ERROR(domain,...)
#define ALIB_ASSERT_ERROR(cond, domain,...)
#define ALIB_BOXING_VTABLE_DECLARE(TMapped, Identifier)
#define ALIB_RESOURCED_IN_CAMP(T, Camp, ResName)
CommandLine & CmdLine
The command-line instance we belong to.
ListMA< ParameterDecl * > Parameters
Command parameters.
ERCommandDecl record
A copy (!) of the enum record.
CommandDecl(TEnum element, CommandLine &cmdLine)
ResourceInfo resourceInfo
The resource information of the enumeration type given with construction.
Enum declElement
The enumeration element given with construction.
HashMap< MonoAllocator, Enum, ExitCodeDecl * > ExitCodeDecls
Possible Errors.
MonoAllocator & GetAllocator() noexcept
const String & TryResource(const NString &name)
ListMA< Command * > CommandsParsed
A list of commands actually parsed. Filled with method #"ReadNextCommands".
CommandLine()
Constructor.
ListMA< Command * >::iterator NextCommandIt
The next command in #"CommandsParsed" to be processed. Used with method #"NextCommand".
void UndefineParameter(Enum parameter)
NCString ResourceCategory
The resource category to fetch CLI resources within field #"Resources".
ListMA< CommandDecl * > CommandDecls
Commands defined.
virtual ~CommandLine()
Virtual empty destructor.
ListMA< Parameter *, Recycling::Shared >::SharedRecyclerType paramListRecycler
ListMA< String, Recycling::Shared >::SharedRecyclerType stringListRecycler
The element recycler shared between lists of strings.
Option * GetOption(Enum element)
ListMA< OptionDecl * > OptionDecls
Possible Options.
void UndefineExitCode(Enum exitCode)
resources::ResourcePool * Resources
void Init(camp::Camp *resModule)
virtual void ReadOptions()
ListMA< ParameterDecl * > ParameterDecls
Possible Parameters.
const String & GetResource(const NString &name)
virtual String GetArg(integer idx)
ListMA< String, Recycling::Shared > OptionArgsIgnored
void UndefineCommand(Enum command)
bool RemoveArg(integer argNo)
virtual Command * NextCommand()
virtual void ReadNextCommands()
StdVectorMA< integer > ArgsLeft
StdVectorMA< String > ArgStrings
ListMA< Option * > Options
The options parsed in the order of their appearance.
void UndefineOption(Enum option)
typename detail::RecyclingSelector< TRecycling > ::template HookType< MonoAllocator, detail::ListElement< T > > SharedRecyclerType
NCString ResourceCategory
ResourcePool & GetResourcePool()
#define ALIB_ENUMS_ASSIGN_RECORD(TEnum, TRecord)
const RecordsTraits< TEnum >::Type & GetRecord(TEnum element)
monomem::TMonoAllocator< lang::HeapAllocator > MonoAllocator
strings::TString< nchar > NString
Type alias in namespace #"%alib".
strings::TCString< nchar > NCString
Type alias in namespace #"%alib".
app::CommandLine CommandLine
Type alias in namespace #"%alib".
containers::List< T, MonoAllocator, TRecycling > ListMA
Type alias in namespace #"%alib".
lang::integer integer
Type alias in namespace #"%alib".
enumrecords::EnumRecords< TEnum > EnumRecords
Type alias in namespace #"%alib".
containers::HashMap< TAllocator, TKey, TMapped, THash, TEqual, THashCaching, TRecycling > HashMap
Type alias in namespace #"%alib".
strings::TString< character > String
Type alias in namespace #"%alib".
app::AppCamp APP
The singleton instance of the camp class used by class #"App".
std::vector< T, StdMA< T > > StdVectorMA
Type alias in namespace #"%alib".
boxing::Enum Enum
Type alias in namespace #"%alib".
A command argument of the command-line.
ListMA< Parameter *, Recycling::Shared > ParametersMandatory
Mandatory parameters parsed.
ListMA< Parameter *, Recycling::Shared > ParametersOptional
Optional parameters parsed.
Command(CommandLine *cmdLine)
ListMA< String, Recycling::Shared > Args
Arguments belonging to this option.
Option(CommandLine *cmdLine)
A declaration for a #"app::Parameter".
ListMA< String, Recycling::Shared > Args
Arguments belonging to us.
Parameter(CommandLine *cmdLine)
Parsed(CommandLine *cmdLine)
static ForwardIterator begin()
static constexpr ForwardIterator end()