8#ifndef HPP_ALIB_CLI_COMMANDLINE
9#define HPP_ALIB_CLI_COMMANDLINE 1
16namespace alib {
namespace cli {
249 template<
typename TEnum>
253 template<
typename TEnum>
278 template<
typename TEnum>
282 template<
typename TEnum>
308 template<
typename TEnum>
312 template<
typename TEnum>
339 template<
typename TEnum>
343 template<
typename TEnum>
351 allocator().New<ExitCodeDecl>(recordIt.Enum()) );
499 "CLI",
"Argument index out of bounds" )
550, Args ( cmdLine->stringListRecycler )
555, Args ( cmdLine->stringListRecycler )
558template<
typename TEnum>
560: declElement (element)
561, resourceInfo(element)
563, Parameters (cmdLine.allocator)
573, ParametersMandatory( cmdLine->paramListRecycler )
574, ParametersOptional ( cmdLine->paramListRecycler )
ALIB_API void addParamDecls()
ERCommandDecl record
A copy (!) of the enum record.
CommandDecl(TEnum element, CommandLine &cmdLine)
List< MonoAllocator, CommandDecl * > CommandDecls
Commands defined.
lang::resources::ResourcePool * Resources
List< MonoAllocator, ParameterDecl * > ParameterDecls
Possible Parameters.
void Init(lang::Camp *resModule)
virtual ~CommandLine()
Virtual empty destructor.
HashMap< MonoAllocator, Enum, ExitCodeDecl * > ExitCodeDecls
Possible Errors.
virtual ALIB_API Command * NextCommand()
virtual String GetArg(integer idx)
List< MonoAllocator, Command * > CommandsParsed
A list of commands actually parsed. Filled with method ReadNextCommands.
List< MonoAllocator, Parameter *, Recycling::Shared >::SharedRecyclerType paramListRecycler
MonoAllocator & GetAllocator() noexcept
CommandLine()
Constructor.
StdVectorMono< integer > ArgsLeft
List< MonoAllocator, String, Recycling::Shared >::SharedRecyclerType stringListRecycler
The element recycler shared between lists of strings.
const String & TryResource(const NString &name)
NCString ResourceCategory
The resource category to fetch CLI resources within field Resources.
List< MonoAllocator, Option * > Options
The options parsed in the order of their appearance.
List< MonoAllocator, String, Recycling::Shared > OptionArgsIgnored
virtual ALIB_API void ReadOptions()
virtual ALIB_API String PopArg()
virtual integer ArgCount()
ALIB_API void RemoveArg(integer argNo)
List< MonoAllocator, Command * >::Iterator NextCommandIt
The next command in CommandsParsed to be processed. Used with method NextCommand.
ALIB_API Option * GetOption(Enum element)
const String & GetResource(const NString &name)
StdVectorMono< String > ArgStrings
List< MonoAllocator, OptionDecl * > OptionDecls
Possible Options.
virtual ALIB_API void ReadNextCommands()
typename detail::RecyclingSelector< TRecycling > ::template HookType< TAllocator, detail::ListElement< T > > SharedRecyclerType
resources::ResourcePool & GetResourcePool()
NCString ResourceCategory
virtual const String & Get(const NString &category, const NString &name, bool dbgAssert)=0
#define ATMP_VOID_IF(Cond)
#define ALIB_ASSERT_ERROR(cond,...)
DryRunModes
Dry run modes.
const T_EnumRecords< TEnum >::Type & GetRecord(TEnum element)
cli::CLIUtil CLIUtil
Type alias in namespace alib.
std::vector< T, SCAMono< T > > StdVectorMono
Type alias in namespace alib.
strings::TString< character > String
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
A command of a ALib CLI command line.
Command(CommandLine *cmdLine)
Option(CommandLine *cmdLine)
A declaration for a cli::Parameter.
Parameter(CommandLine *cmdLine)
static constexpr ForwardIterator end()