Class for a string command line parameter.
More...
|
| CommandParameterString (const char *pHelp, const char *const *ppParameterName, uintptr_t uParameterCount, const char *pDefault=nullptr) |
| Constructor for multiple valid commands.
|
|
| CommandParameterString (const char *pHelp, const char *pParameterName, const char *pDefault=nullptr) |
| Constructor for a single valid command.
|
|
int | Action (int argc, const char **argv) override |
| Sets the value to a passed string.
|
|
const char * | GetValue (void) const noexcept |
| Returns the string value.
|
|
Public Member Functions inherited from Burger::CommandParameter |
const Burger::StaticRTTI * | get_StaticRTTI (void) const noexcept override |
| Get the description to the class.
|
|
uint_t | IsHelpAvailable (void) const noexcept |
| Determine if help is available.
|
|
const char * | GetHelp (void) const noexcept |
| Return the help string.
|
|
const char * | get_class_name (void) const noexcept |
| Get the name of the class.
|
|
virtual | ~Base () noexcept=default |
| Destructor.
|
|
|
Static Public Member Functions inherited from Burger::CommandParameter |
static int | RemoveParms (int argc, const char **argv, int iIndexToArgv, int iRemoveCount) noexcept |
| Remove entries from a "C" command list.
|
|
static int | Process (int argc, const char **argv, const CommandParameter **ppParms, uintptr_t uParmCount, const char *pUsage=nullptr, int iMin=0, int iMax=0) noexcept |
| Process an array of command parameters.
|
|
Static Public Attributes inherited from Burger::CommandParameter |
static const Burger::StaticRTTI | g_StaticRTTI |
| The global description of the class.
|
|
static const Burger::StaticRTTI | g_StaticRTTI |
| The global description of the class.
|
|
Protected Member Functions inherited from Burger::CommandParameter |
| CommandParameter (const char *pHelp, const char *const *ppParameterNames, uintptr_t uParameterCount) noexcept |
| Base class constructor.
|
|
Protected Attributes inherited from Burger::CommandParameter |
const char * | m_pHelp |
| Pointer to the optional help string.
|
|
const char *const * | m_ppParameterNames |
| Array of "C" strings of the -parameter (Minus the -)
|
|
uintptr_t | m_uParameterCount |
| Number of possible strings to check.
|
|
Class for a string command line parameter.
Sets a string if one is present
- See also
- Burger::CommandParameter or Burger::CommandParameterWordPtr
◆ CommandParameterString() [1/2]
Burger::CommandParameterString::CommandParameterString |
( |
const char * | pHelp, |
|
|
const char *const * | ppParameterName, |
|
|
uintptr_t | uParameterCount, |
|
|
const char * | pDefault = nullptr ) |
|
inline |
Constructor for multiple valid commands.
In cases there multiple commands can trigger this command, pass a pointer to an array of "C" strings and the array size in entries to construct this parameter parser
- Note
- Do not set the count to 0, it will cause this class to treat the array pointer as a direct pointer which may not be desired behavior
- Parameters
-
pHelp | Pointer to "C" string for usage |
ppParameterName | Pointer to an array of "C" strings for valid inputs |
uParameterCount | Number of entries in the array (1-XX). |
pDefault | Pointer to "C" string for default value or nullptr for empty string |
◆ CommandParameterString() [2/2]
Burger::CommandParameterString::CommandParameterString |
( |
const char * | pHelp, |
|
|
const char * | pParameterName, |
|
|
const char * | pDefault = nullptr ) |
|
inline |
Constructor for a single valid command.
The default value is set to FALSE.
- Parameters
-
pHelp | Pointer to "C" string for usage. |
pParameterName | Pointer to a "C" string to match to trigger this parameter. |
pDefault | Pointer to "C" string for default value or nullptr for empty string |
◆ Action()
int Burger::CommandParameterString::Action |
( |
int | argc, |
|
|
const char ** | argv ) |
|
overridevirtual |
Sets the value to a passed string.
Parse a parameter if present and copy it as is into the string buffer
- Parameters
-
argc | Number of parameters in argv |
argv | Array of "C" strings |
- Returns
- Returns 2 or -1 if no string was present (Or empty)
Implements Burger::CommandParameter.
◆ GetValue()
const char * Burger::CommandParameterString::GetValue |
( |
void | | ) |
const |
|
inlinenoexcept |
Returns the string value.
Returns the contained string. Will not be nullptr
- Returns
- Returns pointer to the string (Can be an empty string)
◆ m_Value
String Burger::CommandParameterString::m_Value |
|
private |