Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Command Class Reference

#include <Command.h>

Inheritance diagram for Command::

AdvancedConfigurationCommand BasicConfigurationCommand CatcherCommand CertCommand ClientTestCommand ConfigureCommand ConnectionManagerCommand DesCommand ExitCommand InterfaceCommand LinkLayerCommand LiveBroadcastTableCommand MetaCommand NetworkLayerCommand NodeCommand NodeManagerCommand NpPacketCommand NullCommand PriorityPacketQueueCommand ProxyRequestCommand RsaCommand SarCommand ServiceEntryCommand ServiceTableCommand SocketAddressCommand SummaryScreenCommand TestCommand ThreadMessageQueueCommand TimerCommand TpPacketCommand TransportLayerCommand VirtualCircuitTableCommand WebServerCommand WindowPositionCommand List of all members.

Public Methods

 Command ()
 Create and initialize the command. More...

virtual ~Command ()
virtual string getCommandString ()=0
virtual void run (std::ostream &out)=0
virtual void getHtmlInterface (std::ostream &out)
 Return a default HTML interface. More...

string getArg (int index)
 Return the arg at the index specified. More...

void setArg (int index, string value)
 This function assumes you will be putting in the arguments contiguously. More...

void clear ()
 Clear the argument list. More...


Protected Methods

virtual void getHelp (std::ostream &out)
 Return a default help string. More...

void beginUl (std::ostream &out)
void endUl (std::ostream &out)
void preformatting (std::ostream &out)
void setNewlines (bool value)
void postformatting (std::ostream &out)
void beginForm (std::ostream &out)
void beginForm (std::ostream &out, string action, string method)
void endForm (std::ostream &out)
void formInput (std::ostream &out, string type, string name, string value)
void generateHtmlCmd (std::ostream &out, string command, string description)
void generateHtmlCmd (std::ostream &out, string description)
 Create the HTML needed to call a command without any subcommands. More...

void generateHtmlSubcmd (std::ostream &out, string subcmd, string description)
 Print a HTML subcmd that takes no arguments to the stream provided. More...

void generateHtmlSubcmdArg1 (std::ostream &out, string subcmd, string description, string buttonString)
 Create an HTML form so a subcommand can take an argument. More...

void generateHtmlSubcmdArg1 (std::ostream &out, string subcmd, string description, string buttonString, string value)
 Create an HTML form so a subcommand can take an argument. More...

void generateHtmlSubcmdArg2 (std::ostream &out, string subcmd, string description1, string description2, string buttonString)
 Create an HTML form so a subcommand can take two arguments. More...

void generateHtmlSubcmdArg3 (std::ostream &out, string subcmd, string description1, string description2, string description3, string buttonString)
 Create an HTML form so a subcommand can take three arguments. More...

void generateHtmlSubcmdArg4 (std::ostream &out, string subcmd, string description1, string description2, string description3, string description4, string buttonString)
 Create an HTML form so a subcommand can take four arguments. More...

void generateHtmlCheckbox (std::ostream &out, string description, string value, bool isChecked)
 Create a checkbox as a list item. More...


Protected Attributes

string m_args [MAX_COMMAND_ARGS]
string m_output
int m_numArgs
bool m_ul
bool m_newlines

Constructor & Destructor Documentation

Command::Command
 

Create and initialize the command.

Definition at line 6 of file Command.cpp.

virtual Command::~Command [inline, virtual]
 

Definition at line 18 of file Command.h.


Member Function Documentation

void Command::beginForm std::ostream & out,
string action,
string method
[protected]
 

Definition at line 256 of file Command.cpp.

void Command::beginForm std::ostream & out [protected]
 

Definition at line 250 of file Command.cpp.

Referenced by NodeManagerCommand::displayNode(), ConnectionManagerCommand::displayNode(), generateHtmlSubcmdArg1(), generateHtmlSubcmdArg2(), generateHtmlSubcmdArg3(), and generateHtmlSubcmdArg4().

void Command::beginUl std::ostream & out [protected]
 

Definition at line 57 of file Command.cpp.

void Command::clear
 

Clear the argument list.

Definition at line 40 of file Command.cpp.

Referenced by CommandProcessor::matchCommand().

void Command::endForm std::ostream & out [protected]
 

Definition at line 262 of file Command.cpp.

Referenced by NodeManagerCommand::displayNode(), ConnectionManagerCommand::displayNode(), generateHtmlSubcmdArg1(), generateHtmlSubcmdArg2(), generateHtmlSubcmdArg3(), and generateHtmlSubcmdArg4().

void Command::endUl std::ostream & out [protected]
 

Definition at line 64 of file Command.cpp.

void Command::formInput std::ostream & out,
string type,
string name,
string value
[protected]
 

Definition at line 268 of file Command.cpp.

Referenced by NodeManagerCommand::displayNode(), ConnectionManagerCommand::displayNode(), generateHtmlSubcmdArg1(), generateHtmlSubcmdArg2(), generateHtmlSubcmdArg3(), and generateHtmlSubcmdArg4().

void Command::generateHtmlCheckbox std::ostream & out,
string description,
string value,
bool isChecked
[protected]
 

Create a checkbox as a list item.

This assumes that you are in the process of generating a form.

Parameters:
out   The stream to write to.
description   Description for the checkbox.
value   The value that the form should pass back if checked.
isChecked   Whether the box should be checked or not.

Definition at line 241 of file Command.cpp.

Referenced by BasicConfigurationCommand::getHtmlInterface().

void Command::generateHtmlCmd std::ostream & out,
string description
[protected]
 

Create the HTML needed to call a command without any subcommands.

Usually used for help.

Definition at line 113 of file Command.cpp.

void Command::generateHtmlCmd std::ostream & out,
string command,
string description
[protected]
 

Definition at line 102 of file Command.cpp.

Referenced by generateHtmlCmd().

void Command::generateHtmlSubcmd std::ostream & out,
string subcmd,
string description
[protected]
 

Print a HTML subcmd that takes no arguments to the stream provided.

Definition at line 122 of file Command.cpp.

void Command::generateHtmlSubcmdArg1 std::ostream & out,
string subcmd,
string description,
string buttonString,
string value
[protected]
 

Create an HTML form so a subcommand can take an argument.

Definition at line 142 of file Command.cpp.

void Command::generateHtmlSubcmdArg1 std::ostream & out,
string subcmd,
string description,
string buttonString
[protected]
 

Create an HTML form so a subcommand can take an argument.

Definition at line 133 of file Command.cpp.

Referenced by AdvancedConfigurationCommand::getHtmlInterface().

void Command::generateHtmlSubcmdArg2 std::ostream & out,
string subcmd,
string description1,
string description2,
string buttonString
[protected]
 

Create an HTML form so a subcommand can take two arguments.

Definition at line 160 of file Command.cpp.

void Command::generateHtmlSubcmdArg3 std::ostream & out,
string subcmd,
string description1,
string description2,
string description3,
string buttonString
[protected]
 

Create an HTML form so a subcommand can take three arguments.

Definition at line 180 of file Command.cpp.

void Command::generateHtmlSubcmdArg4 std::ostream & out,
string subcmd,
string description1,
string description2,
string description3,
string description4,
string buttonString
[protected]
 

Create an HTML form so a subcommand can take four arguments.

Definition at line 207 of file Command.cpp.

string Command::getArg int index
 

Return the arg at the index specified.

Definition at line 31 of file Command.cpp.

Referenced by UserConfiguration::setNode().

virtual string Command::getCommandString [pure virtual]
 

Reimplemented in AdvancedConfigurationCommand, BasicConfigurationCommand, CatcherCommand, CertCommand, ClientTestCommand, ConfigureCommand, ConnectionManagerCommand, DesCommand, ExitCommand, HelpCommand, HttpTestPageCommand, HttpTestProcessorCommand, InterfaceCommand, LinkLayerCommand, LiveBroadcastTableCommand, NetworkLayerCommand, NodeCommand, NodeManagerCommand, NpPacketCommand, NullCommand, PriorityPacketQueueCommand, ProxyRequestCommand, RsaCommand, SarCommand, ServiceEntryCommand, ServiceTableCommand, SocketAddressCommand, SummaryScreenCommand, TestCommand, ThreadMessageQueueCommand, TimerCommand, TpPacketCommand, TransportLayerCommand, VirtualCircuitTableCommand, WebServerCommand, and WindowPositionCommand.

Referenced by generateHtmlCmd(), generateHtmlSubcmd(), generateHtmlSubcmdArg1(), generateHtmlSubcmdArg2(), generateHtmlSubcmdArg3(), generateHtmlSubcmdArg4(), getHtmlInterface(), and CommandProcessor::matchCommand().

void Command::getHelp std::ostream & s [protected, virtual]
 

Return a default help string.

Reimplemented in AdvancedConfigurationCommand, CatcherCommand, CertCommand, ConfigureCommand, DesCommand, HttpTestProcessorCommand, LinkLayerCommand, LiveBroadcastTableCommand, NetworkLayerCommand, NpPacketCommand, RsaCommand, SarCommand, ServiceEntryCommand, ServiceTableCommand, SocketAddressCommand, ThreadMessageQueueCommand, TransportLayerCommand, and VirtualCircuitTableCommand.

Definition at line 51 of file Command.cpp.

void Command::getHtmlInterface std::ostream & s [virtual]
 

Return a default HTML interface.

Reimplemented in AdvancedConfigurationCommand, BasicConfigurationCommand, CatcherCommand, CertCommand, ClientTestCommand, ConfigureCommand, ConnectionManagerCommand, DesCommand, ExitCommand, HelpCommand, HttpTestPageCommand, HttpTestProcessorCommand, InterfaceCommand, LinkLayerCommand, LiveBroadcastTableCommand, NetworkLayerCommand, NodeCommand, NodeManagerCommand, NpPacketCommand, PriorityPacketQueueCommand, ProxyRequestCommand, RsaCommand, SarCommand, ServiceEntryCommand, ServiceTableCommand, SocketAddressCommand, SummaryScreenCommand, ThreadMessageQueueCommand, TpPacketCommand, TransportLayerCommand, VirtualCircuitTableCommand, WebServerCommand, and WindowPositionCommand.

Definition at line 96 of file Command.cpp.

void Command::postformatting std::ostream & out [protected]
 

Definition at line 85 of file Command.cpp.

Referenced by generateHtmlCheckbox(), generateHtmlCmd(), generateHtmlSubcmd(), generateHtmlSubcmdArg1(), generateHtmlSubcmdArg2(), generateHtmlSubcmdArg3(), and generateHtmlSubcmdArg4().

void Command::preformatting std::ostream & out [protected]
 

Definition at line 71 of file Command.cpp.

Referenced by generateHtmlCheckbox(), generateHtmlCmd(), generateHtmlSubcmd(), generateHtmlSubcmdArg1(), generateHtmlSubcmdArg2(), generateHtmlSubcmdArg3(), and generateHtmlSubcmdArg4().

virtual void Command::run std::ostream & s [pure virtual]
 

Reimplemented in AdvancedConfigurationCommand, BasicConfigurationCommand, CatcherCommand, CertCommand, ClientTestCommand, ConfigureCommand, ConnectionManagerCommand, DesCommand, ExitCommand, HelpCommand, HttpTestPageCommand, HttpTestProcessorCommand, InterfaceCommand, LinkLayerCommand, LiveBroadcastTableCommand, NetworkLayerCommand, NodeCommand, NodeManagerCommand, NpPacketCommand, NullCommand, PriorityPacketQueueCommand, ProxyRequestCommand, RsaCommand, SarCommand, ServiceEntryCommand, ServiceTableCommand, SocketAddressCommand, SummaryScreenCommand, TestCommand, ThreadMessageQueueCommand, TimerCommand, TpPacketCommand, TransportLayerCommand, VirtualCircuitTableCommand, WebServerCommand, and WindowPositionCommand.

Referenced by CommandProcessor::processCommands().

void Command::setArg int index,
string value
 

This function assumes you will be putting in the arguments contiguously.

Definition at line 17 of file Command.cpp.

Referenced by ProxyParser::parse(), and HttpTestInterfaceParser::parse().

void Command::setNewlines bool value [protected]
 

Definition at line 79 of file Command.cpp.


Member Data Documentation

string Command::m_args[MAX_COMMAND_ARGS] [protected]
 

Definition at line 89 of file Command.h.

bool Command::m_newlines [protected]
 

Definition at line 93 of file Command.h.

int Command::m_numArgs [protected]
 

Definition at line 91 of file Command.h.

string Command::m_output [protected]
 

Definition at line 90 of file Command.h.

bool Command::m_ul [protected]
 

Definition at line 92 of file Command.h.


The documentation for this class was generated from the following files:
Generated at Thu Jul 11 13:31:55 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001