casa
5.7.0-16
|
#include <optionparser.h>
Public Member Functions | |
StoreOptionAction (Parser &parser_, Option options_[], Option buffer_[], int bufmax_) | |
Number of slots in buffer . -1 means "large enough". More... | |
bool | perform (Option &option) |
Called by Parser::workhorse() for each Option that has been successfully parsed (including unknown options if they have a Descriptor whose Descriptor::check_arg does not return ARG_ILLEGAL. More... | |
bool | finished (int numargs, const char **args) |
Called by Parser::workhorse() after finishing the parse. More... | |
Private Attributes | |
Parser & | parser |
Option * | options |
Option * | buffer |
int | bufmax |
Definition at line 1456 of file optionparser.h.
|
inline |
Number of slots in buffer
. -1
means "large enough".
Creates a new StoreOption action.
parser_ | the parser whose op_count should be updated. |
options_ | each Option o is chained into the linked list options_ [o.desc->index] |
buffer_ | each Option is appended to this array as long as there's a free slot. |
bufmax_ | number of slots in buffer_ . -1 means "large enough". |
find first empty slot in buffer (if any)
set parser's optionCount
Definition at line 1470 of file optionparser.h.
References buffer, bufmax, option::Parser::op_count, and parser.
|
inlinevirtual |
Called by Parser::workhorse() after finishing the parse.
numargs | the number of non-option arguments remaining |
args | pointer to the first remaining non-option argument (if numargs > 0). |
false
iff a fatal error has occurred. only overwrite non-option argument list if there's at least 1 new non-option argument. Otherwise we keep the old list. This makes it easy to use default non-option arguments.
Reimplemented from option::Parser::Action.
Definition at line 1500 of file optionparser.h.
References option::Parser::nonop_args, option::Parser::nonop_count, and parser.
|
inlinevirtual |
Called by Parser::workhorse() for each Option that has been successfully parsed (including unknown options if they have a Descriptor whose Descriptor::check_arg does not return ARG_ILLEGAL.
Returns false
iff a fatal error has occured and the parse should be aborted.
Reimplemented from option::Parser::Action.
Definition at line 1482 of file optionparser.h.
References option::Option::append(), buffer, bufmax, option::Option::desc, option::Descriptor::index, option::Parser::op_count, options, and parser.
|
private |
Definition at line 1460 of file optionparser.h.
Referenced by perform(), and StoreOptionAction().
|
private |
Definition at line 1461 of file optionparser.h.
Referenced by perform(), and StoreOptionAction().
|
private |
Definition at line 1459 of file optionparser.h.
Referenced by perform().
|
private |
Definition at line 1458 of file optionparser.h.
Referenced by finished(), perform(), and StoreOptionAction().