ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
arguments.inl
Go to the documentation of this file.
1//==================================================================================================
2/// \file
3/// This header-file is part of module \alib_cli of the \aliblong.
4///
5/// \emoji :copyright: 2013-2025 A-Worx GmbH, Germany.
6/// Published under \ref mainpage_license "Boost Software License".
7//==================================================================================================
8ALIB_EXPORT namespace alib::cli {
9
10/// Struct used as parent for types
11/// - \alib{cli;Command},
12/// - \alib{cli;Option}, and
13/// - \alib{cli;Parameter}.
14///
15/// Stores
16/// - a pointer to the \alib{cli;CommandLine} object,
17/// - the position in \alib{ARG_VN}, respectively \alib{ARG_VW} where the object was found, and
18/// - the number of arguments consumed when reading the object.
19///
20/// \note
21/// For technical reasons, other members that are shared between the derived types named above,
22/// have to be declared (each three times) with the types themselves.
23struct Parsed
24{
25 /// The cli command line.
27
28 /// The index in \alib{ARG_VN}, respectively \alib{ARG_VW}, that this instance (derived option
29 /// or parameter ) was found at.
31
32 /// The number of command line arguments that a command consumed. This includes the command name
33 /// itself. If the method \b Read of derived types leaves this to <c>0</c>, then the option or
34 /// parameter was not found.
36
37 /// Constructor
38 /// @param cmdLine The command line instance.
39 Parsed( CommandLine* cmdLine )
40 : CmdLine (cmdLine)
41 , Position ((std::numeric_limits<integer>::max)())
43 {}
44};
45
46
47// #################################################################################################
48// Decl and Def versions of commands, options, parameters and ExitCodes
49// #################################################################################################
50
51
52/// \ref alib_enums_records "ALib Enum Record" type used by class \alib{cli;ParameterDecl}.
54 {
55 /// The identifier of the parameter.
57
58 /// An optional separator string (usually "=") that separates the parameter name from a
59 /// value given within the parameter itself.
61
62 /// A separator character for parsing multiple values.
63 /// If set to <c>'C'</c>, method \alib{cli;ParameterDecl::ValueListSeparator} will return
64 /// <c>','</c> instead.
66
67 /// The number of arguments to consume and store in \alib{cli;Parameter::Args}.
68 /// If negative, parsing stops. If previous field, separator string is set and this
69 /// value is equal or greater to \c 1, then a missing separator string leads to
70 /// a parsing exception.
72
73 /// Denotes if this is an optional parameter.
75
76 /// Default constructor leaving the record undefined. (Implementation required as documented
77 /// \alib{enumrecords;EnumRecordPrototype::EnumRecordPrototype();here}.)
78 ERParameterDecl() noexcept = default;
79
80 /// Implementation of \alib{enumrecords;EnumRecordPrototype::Parse}.
82 void Parse();
83 };
84
85/// A parameter of a \alib{cli;CommandDecl}.
86///
87/// Construction is done by passing a custom enum element of an enum type equipped with
88/// \ref alib_enums_records "ALib Enum Records" of type \alib{cli;ERParameterDecl}.
89///
90/// When bootstrapping \alib_cli_nl, method \alib{cli;CommandLine::DefineParameters} has to be
91/// invoked for (each) enum type.
93{
94 protected:
95 /// The enumeration element given with construction.
97
98 /// A copy (!) of the enum record.
100
101 /// The resource information of the enumeration type given with construction.
103
104 public:
105 /// Templated constructor which takes an enum element of a custom type equipped with
106 /// \ref alib_enums_records "ALib Enum Records" of type \alib{cli;ERParameterDecl}.
107 ///
108 /// @tparam TEnum C++ enum type equipped with corresponding \alib Enum Records.
109 /// @param element The enum element
110 template<typename TEnum>
111 ParameterDecl( TEnum element )
112 : declElement( element )
113 , resourceInfo(element)
114 {
115 // make a copy of the resourced record
117
118 // fix separator character
119 if( record.valueListSeparator == 'C' )
120 record.valueListSeparator= ',';
121 }
122
123 /// Returns the type and integral value of the enumeration element used with construction.
124 /// @return The enumeration element used with construction.
125 const Enum& Element() const
126 {
127 return declElement;
128 }
129
130 /// Returns the name of the parameter. This is not the identifier. The name is just for
131 /// help and configuration output.
132 ///
133 /// \see Method #Identifier.
134 ///
135 /// @return The name of the enum element.
136 const String& Name()
137 {
138 return record.EnumElementName;
139 }
140
141 /// Returns the identifier of the parameter. If this is empty, the parameter is not optional
142 /// and hence has no identifier.
143 ///
144 /// @return The name of the enum element.
146 {
147 return record.identifier;
148 }
149
150 /// Returns the minimum parse length of the identifier.
151 /// @return The minimum characters to satisfy the parameter.
153 {
154 return record.MinimumRecognitionLength;
155 }
156
157 /// An optional separator string (usually "="), that separates the parameter name from a
158 /// parameter value.
159 /// @return The separator string.
161 {
162 return record.valueSeparator;
163 }
164
165 /// A separator character for parsing multiple values.
166 /// @return The separator character.
168 {
169 return record.valueListSeparator != 'C' ? record.valueListSeparator : ',';
170 }
171
172 /// The number of CLI arguments to consume and store in \alib{cli;Option::Args} with method
173 /// \alib{cli;Parameter::Read}.
174 ///
175 /// @return The parameter identifier.
177 {
178 return record.RequiredArguments;
179 }
180
181 /// Returns \c true if the parameter is optional. The information about this attribute is
182 /// used to create help messages and usage format strings only. It does not automatically
183 /// raise an exception if a parameter is not given. Such exception or other error treatment
184 /// is up to the user code.
185 /// @return \c true if the parameter is optional, \c false otherwise.
187 {
188 return record.isOptional;
189 }
190
191 /// Returns the short help text.
192 /// Loads the string from #resourceInfo using resource name \c "THelpParShtNN",
193 /// where \c NN is the enum element's integral value.
194 /// @return The help text.
196 {
197 return resourceInfo.Get( NString64("THlpParSht_" ) << Name() ALIB_DBG(, true) );
198 }
199
200 /// Returns the long help text.
201 /// Loads the string from #resourceInfo using resource name \c "THelpParLngNN",
202 /// where \c NN is the enum element's integral value.
203 /// @return The help text.
205 {
206 return resourceInfo.Get( String64("THlpParLng_" ) << Name() ALIB_DBG(, true));
207 }
208}; // ParameterDecl
209
210/// A declaration for a \alib{cli::Parameter}.
211struct Parameter : public Parsed
212{
213 /// The underlying declaration.
215
216 /// Arguments belonging to us.
218
219 /// Constructor
220 /// @param cmdLine The command line instance.
221 inline
222 Parameter( CommandLine* cmdLine );
223
224 /// Tries to read the object from the front of \alib{cli;CommandLine::ArgsLeft}.
225 /// Success is indicated by setting inherited fields \alib{cli;Parsed::Position} and
226 /// \alib{cli;Parsed::ConsumedArguments} to values greater than \c 0.
227 ///
228 /// If it could not be decided if the actual CLI argument contains this parameter, \c false
229 /// is returned to indicate that parsing commands has to stop now.
230 ///
231 /// This is done in the following cases:
232 /// - When \alib{cli;ParameterDecl::Identifier} is empty and the parameter is
233 /// \alib{cli;ParameterDecl::IsOptional} gives \c true.
234 /// - When it was successfully read, but \alib{cli;ParameterDecl::QtyExpectedArgsFollowing}
235 /// is defined \c -1.
236 ///
237 /// See \alib{cli;CommandLine;ReadNextCommands} for details
238 ///
239 /// @param decl The declaration used for reading
240 /// @return The \c true on success, \c false indicates that parsing has to end here.
242 bool Read( ParameterDecl& decl );
243};
244
245/// \ref alib_enums_records "ALib Enum Record" type used by class \alib{cli;OptionDecl}.
247{
248 /// The name of the option as parsed from command line if single hyphen <c>'-'</c> is used.
249 /// Defined as string to be able to have empty strings, which disables single character
250 /// options.
252
253 /// An optional separator string (usually "=") that separates the option name from a value
254 /// within the first argument itself.
255 /// If this is not given, field #RequiredArguments has to be \c 0.
257
258 /// The number of arguments to consume and store in \alib{cli;Option::Args}.
259 /// If this field is set and this value is not \c 0, then a missing separator string leads
260 /// to a parsing exception.
262
263 /// If not empty, the argument string will be replaced by this and the search for next options
264 /// continues.
265 /// Note: Shortcut options have to occur earlier in the enumeration's resource definition.
267
268 /// Defaulted constructor leaving the record undefined.
269 /// (Implementation required as documented
270 /// \alib{enumrecords;EnumRecordPrototype::EnumRecordPrototype();here}.)
271 EROptionDecl() noexcept = default;
272
273 /// Implementation of \alib{enumrecords;EnumRecordPrototype::Parse}.
275 void Parse();
276};
277
278/// A declaration for an \alib{cli::Option}.
279///
280/// Construction is done by passing a custom enum element of an enum type equipped with
281/// \ref alib_enums_records "ALib Enum Records" of type \alib{cli;EROptionDecl}.
282///
283/// When bootstrapping \alib_cli_nl, method \alib{cli;CommandLine::DefineOptions} has to be
284/// invoked for (each) enum type.
285///
287{
288 protected:
289 /// The enumeration element given with construction.
291
292 /// A copy (!) of the enum record.
294
295 /// The resource information of the enumeration type given with construction.
297
298
299 public:
300 /// Templated constructor which takes an enum element of a custom type equipped with
301 /// \ref alib_enums_records "ALib Enum Records" of type \alib{cli;EROptionDecl}.
302 ///
303 /// @tparam TEnum C++ enum type equipped with corresponding \alib Enum Records.
304 /// @param element The enum element
305 template<typename TEnum>
306 OptionDecl( TEnum element )
307 : declElement( element )
308 , resourceInfo(element)
309 {
310 // make a copy of the resourced record
312 }
313
314 /// Returns the type and integral value of the enumeration element used with construction.
315 /// @return The enumeration element used with construction.
316 const Enum& Element() const
317 {
318 return declElement;
319 }
320
321 /// Returns the identifier of the option if double hyphen <c>'--'</c> is used.
322 /// @return The option identifier.
324 {
325 return record.EnumElementName;
326 }
327
328 /// Returns the minimum parse length of the identifier if double hyphen <c>'--'</c> is used.
329 /// @return The minimum characters to satisfy the option.
331 {
332 return record.MinimumRecognitionLength;
333 }
334
335 /// Returns the identifier of the option if single hyphen <c>'-'</c> is used.
336 /// @return The option identifier.
338 {
339 return record.identifierChar.IsNotEmpty() ? record.identifierChar.CharAtStart()
340 : '\0';
341 }
342
343 /// An optional separator string (usually "="), that separates the parameter name from a
344 /// parameter value.
345 /// @return The separator string.
347 {
348 return record.valueSeparator;
349 }
350
351 /// The number of CLI arguments to consume and store in \alib{cli;Option::Args} with method
352 /// \alib{cli;Option::Read}.
353 /// @return The option identifier.
355 {
356 return record.RequiredArguments;
357 }
358
359 /// If an option is a shortcut to another one, this string replaces the argument given.
360 /// @return The option identifier.
362 {
363 return record.shortcutReplacementString;
364 }
365
366
367 /// Returns a formal description of the usage.
368 /// Loads the string from #resourceInfo using resource name \c "TOptUsgNN",
369 /// where \c NN is the enum element's integral value.
370 /// @return The help text.
372 {
373 return resourceInfo.Get( NString64("TOptUsg_" ) << Identifier() ALIB_DBG(, true) );
374 }
375
376 /// Returns the help text.
377 /// Loads the string from #resourceInfo using resource name \c "TOptHlpNN",
378 /// where \c NN is the enum element's integral value.
379 /// @return The help text.
381 {
382 return resourceInfo.Get( NString64("TOptHlp_" ) << Identifier() ALIB_DBG(, true) );
383 }
384}; // OptionDecl
385
386/// An option of a command line. Options are read "automatically" using their declaration
387/// information defined with externalized strings (resources) accessed through
388/// \ref alib_enums_records "ALib Enum Records" associated with enum elements of enum custom types.
389///
390/// However, such automatic read is limited due to the fact, that the simple values and flags
391/// defined with \alib{cli;OptionDecl}, cannot provide the flexibility needed to perfectly
392/// parse options with a complex syntax.
393///
394/// In this case, the way out is to use custom code that invokes \alib{cli;CommandLine;ReadOptions}
395/// and then processes all options that may have remaining arguments left in the list.
396/// Using field #Position further arguments may be consumed from \alib{cli;CommandLine::ArgsLeft}.<br>
397/// Note, "processing all options" may mean a nested loop. The outer is over the option types
398/// of \alib{cli;CommandLine;OptionsFound}, the inner is over the vector of options per type.
399///
400struct Option : public Parsed
401{
402 /// The declaration struct.
404
405 /// Arguments belonging to this option.
407
408 /// Constructor
409 /// @param cmdLine The command line main object.
410 inline
411 Option( CommandLine* cmdLine );
412
413 /// Tries to read the object from the current CLI arg(s).
414 /// \note
415 /// Unlike the read methods \alib{cli;Command::Read} and \alib{cli;Parameter::Read}, this
416 /// method expects the argument to test not only by number with \p{argNo} but as well
417 /// with string parameter \p{arg}.<br>
418 /// This redundancy is needed to easily implement shortcut options, that just
419 /// replace a shortcut option read to another one, probably with a preset argument included.
420 ///
421 /// @param decl The declaration used for reading.
422 /// @param arg The argument string starting with one or two hyphens.
423 /// @param argNo The position of reading.
424 /// @return The \c true on success, \c false otherwise.
426 bool Read( OptionDecl& decl, String& arg, const integer argNo );
427};
428
429/// \ref alib_enums_records "ALib Enum Record" type used by class \alib{cli;CommandDecl}.
431 {
432 /// List of parameters attached. Separated by <c>'/'</c>.
434
435 /// Default constructor leaving the record undefined.
436 /// (Implementation required as documented
437 /// \alib{enumrecords;EnumRecordPrototype::EnumRecordPrototype();here}.)
438 ERCommandDecl() noexcept = default;
439
440 /// Implementation of \alib{enumrecords;EnumRecordPrototype::Parse}.
442 void Parse();
443 };
444
445/// A declaration for a \alib{cli::Command}.
446///
447/// Construction is done by passing a custom enum element of an enum type equipped with
448/// \ref alib_enums_records "ALib Enum Records" of type \alib{cli;ERCommandDecl}.
449///
450/// When bootstrapping \alib_cli_nl, method \alib{cli;CommandLine::DefineCommands} has to be
451/// invoked for (each) enum type.
452///
454{
455 protected:
456 /// The enumeration element given with construction.
458
459 /// A copy (!) of the enum record.
461
462 /// The resource information of the enumeration type given with construction.
464
465 public :
466 /// The command line instance we belong to.
468
469 /// Command parameters.
471
472 /// Templated constructor which takes an enum element of a custom type equipped with
473 /// \ref alib_enums_records "ALib Enum Records" of type \alib{cli;ERCommandDecl}.
474 ///
475 /// Field #Parameters is filled as specified in the enum record.
476 ///
477 /// @tparam TEnum C++ enum type equipped with corresponding \alib Enum Records.
478 /// @param element The enum element
479 /// @param cmdLine The command line object. Will be stored.
480 template<typename TEnum>
481 inline
482 CommandDecl( TEnum element, CommandLine& cmdLine );
483
484 /// Returns the type and integral value of the enumeration element used with construction.
485 /// @return The enumeration element used with construction.
486 const Enum& Element() const
487 {
488 return declElement;
489 }
490
491 /// Returns the identifier (name) of the command
492 /// @return The command identifier.
494 {
495 return record.EnumElementName;
496 }
497
498 /// Returns the minimum parse length of the identifier.
499 /// @return The minimum characters to satisfy the command to be parsed.
501 {
502 return record.MinimumRecognitionLength;
503 }
504
505 /// Returns the short version of the help text.
506 /// Loads the string from #resourceInfo using resource name \c "THlpCmdShtNN",
507 /// where \c NN is the enum element's integral value.
508 /// @return The help text.
510 {
511 return resourceInfo.Get( NString64("THlpCmdSht_" ) << Identifier() ALIB_DBG(, true) );
512 }
513
514 /// Returns the long version of the help text.
515 /// Loads the string from #resourceInfo using resource name \c "THlpCmdLngNN",
516 /// where \c NN is the enum element's integral value.
517 /// @return The help text.
519 {
520 return resourceInfo.Get( NString64("THlpCmdLng_" ) << Identifier() ALIB_DBG(, true) );
521 }
522
523 /// Searches in #Parameters for the declaration of parameter \p{name}.
524 /// @param name The declaration name of the parameter.
525 /// @return A pointer to the parameter's declaration, \c nullptr if parameter was not
526 /// declared.
528 ParameterDecl* GetParameterDecl(const String& name );
529
530 protected:
531 /// Called from the constructor. Parses field \alib{cli;ERCommandDecl::parameters} of the
532 /// enum record, and loads the corresponding parameters.
534 void addParamDecls();
535};
536
537/// A command of a \alib_cli_nl command line.
538struct Command : public Parsed
539{
540 /// The underlying declaration.
542
543 /// Mandatory parameters parsed.
545
546 /// Optional parameters parsed.
548
549 /// Constructor
550 /// @param cmdLine The command line instance.
551 inline
552 Command( CommandLine* cmdLine );
553
554 /// Tries to read the object from the front of \alib{cli;CommandLine::ArgsLeft}.
555 /// @param decl The declaration used for reading.
556 /// @return The \c true on success, \c false otherwise.
558 bool Read( CommandDecl& decl );
559
560 /// Searches in #ParametersMandatory and #ParametersOptional for parameter \p{name}.
561 /// @param name The declaration name of the parameter.
562 /// @return A pointer to the parameter, \c nullptr if parameter was not parsed.
564 Parameter* GetParsedParameter(const String& name );
565
566 /// Searches in #ParametersMandatory and #ParametersOptional for parameter \p{name} and returns
567 /// its (first) argument.
568 /// @param name The declaration name of the parameter.
569 /// @return The argument string, \b NULL_STRING if parameter was not parsed if not given.
571 String GetParsedParameterArg( const String& name );
572};
573
574/// \ref alib_enums_records "ALib Enum Record" type used by class \alib{cli;ExitCodeDecl}.
575/// \note Field \alib{enumrecords;ERSerializable::MinimumRecognitionLength} is not read from the string,
576/// but set to fixed value \c 0.
578{
579 /// The CLI module exception associated to this exit code.
581
582 /// Default constructor leaving the record undefined.
583 /// (Implementation required as documented
584 /// \alib{enumrecords;EnumRecordPrototype::EnumRecordPrototype();here}.)
585 ERExitCodeDecl() noexcept
587 {}
588
589 /// Implementation of \alib{enumrecords;EnumRecordPrototype::Parse}.
591 void Parse();
592};
593
594/// An exit code of a cli application.
595///
596/// Construction is done by passing a custom enum element of an enum type equipped with
597/// \ref alib_enums_records "ALib Enum Records" of type \alib{cli;ERExitCodeDecl}.
598///
599/// When bootstrapping \alib_cli_nl, method \alib{cli;CommandLine::DefineExitCodes} has to be
600/// invoked for (each) enum type.
601///
602/// Announcing the main application's exit codes to the \alib_cli_nl module has two reasons:
603/// - The exit codes are included in the help output text utility methods provided by class
604/// \alib{cli;CommandLine}.
605/// - \alib_cli_nl module exit codes can be translated to valid exit codes using
606/// method \alib{cli;CLIUtil::GetExitCode}.
608{
609 protected:
610 /// The enumeration element given with construction.
612
613 /// A copy (!) of the enum record.
615
616 /// The resource information of the enumeration type given with construction.
618
619
620 public:
621 /// Templated constructor which takes an enum element of a custom type equipped with
622 /// \ref alib_enums_records "ALib Enum Records" of type \alib{cli;ERExitCodeDecl}.
623 ///
624 /// @tparam TEnum C++ enum type equipped with corresponding \alib Enum Records.
625 /// @param element The enum element.
626 template<typename TEnum>
627 ExitCodeDecl( TEnum element )
628 : declElement( element )
629 , resourceInfo(element)
630 {
631 // make a copy of the resourced record
633 }
634
635 /// Returns the name of the enum element
636 /// @return The name of the enum element.
637 const String& Name()
638 {
639 return record.EnumElementName;
640 }
641
642 /// If an element of enum type \alib{cli;Exceptions} is associated with this exit code, it
643 /// is returned. Otherwise <c>cli::ExitCodes(-1)</c>.
644 ///
645 /// \see Method \alib{cli;CLIUtil::GetExitCode}.
646 /// @return The associated element of cli::Exceptions.
648 {
649 return cli::Exceptions( record.associatedCLIException );
650 }
651
652 /// Returns the format string associated with this exit code.
653 /// Loads the string from #resourceInfo using resource name \c "TExitNN",
654 /// where \c NN is the enum element's integral value.
655 /// @return The format string.
657 {
658 return resourceInfo.Get( NString64("TExit" ) << declElement.Integral() ALIB_DBG(, true) );
659 }
660};
661
662} // namespace [alib::cli]
ERCommandDecl record
A copy (!) of the enum record.
CommandLine & CmdLine
The command line instance we belong to.
CommandDecl(TEnum element, CommandLine &cmdLine)
const Enum & Element() const
const String & Identifier()
ResourceInfo resourceInfo
The resource information of the enumeration type given with construction.
const String & HelpTextShort()
List< MonoAllocator, ParameterDecl * > Parameters
Command parameters.
Enum declElement
The enumeration element given with construction.
const String & HelpTextLong()
const String & FormatString()
ResourceInfo resourceInfo
The resource information of the enumeration type given with construction.
ExitCodeDecl(TEnum element)
cli::Exceptions AssociatedCLIException()
Enum declElement
The enumeration element given with construction.
ERExitCodeDecl record
A copy (!) of the enum record.
const String & Name()
OptionDecl(TEnum element)
const Enum & Element() const
EROptionDecl record
A copy (!) of the enum record.
const String & ValueSeparator()
Enum declElement
The enumeration element given with construction.
integer QtyExpectedArgsFollowing()
ResourceInfo resourceInfo
The resource information of the enumeration type given with construction.
const String & HelpUsageLine()
const String & ShortcutReplacementString()
const String & HelpText()
const String & Identifier()
character IdentifierChar()
const String & Identifier()
ParameterDecl(TEnum element)
const Enum & Element() const
const String & GetHelpTextLong()
const String & GetHelpTextShort()
ERParameterDecl record
A copy (!) of the enum record.
Definition arguments.inl:99
ResourceInfo resourceInfo
The resource information of the enumeration type given with construction.
Enum declElement
The enumeration element given with construction.
Definition arguments.inl:96
const String & Name()
const String & ValueSeparator()
#define ALIB_DLL
Definition alib.inl:496
#define ALIB_EXPORT
Definition alib.inl:488
#define ALIB_DBG(...)
Definition alib.inl:836
const RecordsTraits< TEnum >::Type & GetRecord(TEnum element)
Definition records.inl:188
NLocalString< 64 > NString64
Type alias name for TLocalString<nchar,64>.
LocalString< 64 > String64
Type alias name for TLocalString<character,64>.
lang::integer integer
Type alias in namespace alib.
Definition integers.inl:149
characters::nchar nchar
Type alias in namespace alib.
boxing::Enum Enum
Type alias in namespace alib.
Definition enum.inl:211
resources::ResourceInfo ResourceInfo
Type alias in namespace alib.
strings::TString< character > String
Type alias in namespace alib.
Definition string.inl:2381
characters::character character
Type alias in namespace alib.
containers::List< TAllocator, T, TRecycling > List
Type alias in namespace alib.
Definition list.inl:746
ALIB_DLL Parameter * GetParsedParameter(const String &name)
ALIB_DLL bool Read(CommandDecl &decl)
ALIB_DLL String GetParsedParameterArg(const String &name)
CommandDecl * Declaration
The underlying declaration.
Command(CommandLine *cmdLine)
List< MonoAllocator, Parameter *, Recycling::Shared > ParametersOptional
Optional parameters parsed.
List< MonoAllocator, Parameter *, Recycling::Shared > ParametersMandatory
Mandatory parameters parsed.
ALib Enum Record type used by class CommandDecl.
ALIB_DLL void Parse()
Implementation of EnumRecordPrototype::Parse.
String parameters
List of parameters attached. Separated by '/'.
ERCommandDecl() noexcept=default
int associatedCLIException
The CLI module exception associated to this exit code.
ALib Enum Record type used by class OptionDecl.
EROptionDecl() noexcept=default
ALIB_DLL void Parse()
Implementation of EnumRecordPrototype::Parse.
ALib Enum Record type used by class ParameterDecl.
Definition arguments.inl:54
ALIB_DLL void Parse()
Implementation of EnumRecordPrototype::Parse.
ERParameterDecl() noexcept=default
String identifier
The identifier of the parameter.
Definition arguments.inl:56
bool isOptional
Denotes if this is an optional parameter.
Definition arguments.inl:74
List< MonoAllocator, String, Recycling::Shared > Args
Arguments belonging to this option.
OptionDecl * Declaration
The declaration struct.
ALIB_DLL bool Read(OptionDecl &decl, String &arg, const integer argNo)
Definition arguments.cpp:69
Option(CommandLine *cmdLine)
A declaration for a cli::Parameter.
Parameter(CommandLine *cmdLine)
ParameterDecl * Declaration
The underlying declaration.
List< MonoAllocator, String, Recycling::Shared > Args
Arguments belonging to us.
ALIB_DLL bool Read(ParameterDecl &decl)
Parsed(CommandLine *cmdLine)
Definition arguments.inl:39
integer ConsumedArguments
Definition arguments.inl:35
CommandLine * CmdLine
The cli command line.
Definition arguments.inl:26
ERSerializable() noexcept=default
Defaulted constructor leaving the record undefined.