xorp

OpCommand Class Reference

List of all members.

Public Member Functions

 OpCommand (OpCommandList &ocl, const list< string > &command_parts)
const list< string > & command_parts () const
const string & command_name () const
const string & help_string () const
const string & module () const
const string & command_action () const
void set_help_string (const string &v)
void set_module (const string &v)
void set_command_action (const string &v)
void set_command_action_filename (const string &v)
void set_command_action_argument_list (const list< string > &v)
void set_command_executable_filename (const string &v)
bool is_executable () const
bool can_pipe () const
bool default_nomore_mode () const
 Test if "no-more" (i.e., unpaged) is the default output mode.
void set_default_nomore_mode (bool v)
 Set the default paging mode.
void add_opt_param (const string &opt_param, const string &opt_param_help)
bool has_opt_param (const string &opt_param) const
string str () const
OpInstanceexecute (EventLoop &eventloop, const list< string > &command_line, RouterCLI::OpModePrintCallback print_cb, RouterCLI::OpModeDoneCallback done_cb)
 Execute an operational mode command.
bool command_match (const list< string > &path_parts, SlaveConfigTree *sct, bool exact_match) const
void get_matches (size_t wordnum, SlaveConfigTree *sct, map< string, CliCommandMatch > &return_matches) const
bool type_match (const string &s, string &errmsg) const
void add_instance (OpInstance *instance)
void remove_instance (OpInstance *instance)
bool is_invalid () const
void set_is_invalid (bool v)

Static Public Member Functions

static string command_parts2command_name (const list< string > &command_parts)
static list< string > select_positional_argument (const list< string > &argument_list, const string &position, string &error_msg)
 Select a positional argument.

Private Attributes

OpCommandList_ocl
list< string > _command_parts
string _command_name
string _help_string
string _module
string _command_action
string _command_action_filename
list< string > _command_action_argument_list
string _command_executable_filename
map< string, string > _opt_params
set< OpInstance * > _instances
bool _is_invalid
bool _default_nomore_mode

Member Function Documentation

bool OpCommand::default_nomore_mode ( ) const [inline]

Test if "no-more" (i.e., unpaged) is the default output mode.

Returns:
true if "no-more" (i.e., unpaged) is the default output mode, otherwise false.
OpInstance * OpCommand::execute ( EventLoop eventloop,
const list< string > &  command_line,
RouterCLI::OpModePrintCallback  print_cb,
RouterCLI::OpModeDoneCallback  done_cb 
)

Execute an operational mode command.

Parameters:
eventloopthe event loop.
command_linethe list with the command to execute and the arguments.
print_cbcallback to be invoked with output from command.
done_cbcallback to invoke when the command terminates.
Returns:
a pointer to the command instance on success.
list< string > OpCommand::select_positional_argument ( const list< string > &  argument_list,
const string &  position,
string &  error_msg 
) [static]

Select a positional argument.

Parameters:
argument_listthe list with the arguments.
positionthe positional argument (e.g., "$0" specifies all arguments, "$1" is the first argument, "$2" the second argument, etc.)
error_msgthe error message (if error).
Returns:
if position is valid, then a list with the the strings with the selected arguments, or an empty string if an error. Note that only if the position argument is "$0", then the list will contain more than one elements.
void OpCommand::set_default_nomore_mode ( bool  v) [inline]

Set the default paging mode.

Parameters:
vif true, then "no-more" (i.e., unpaged) is the default output mode.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations