|
LRAUV
revA
|
#include <Command.h>

Public Member Functions | |
| ParsedCommand () | |
| int | getArgCount () |
| Returns the parsed arg count. More... | |
| void | undefTopArg () |
| Undefine top arg on the stack. More... | |
| void | clearTopArg () |
| Clears the top arg on the stack. More... | |
| void | clearAll () |
| Clears everything. More... | |
| int | getStart () |
| Returns first argStart. More... | |
| void | setStart (int start) |
| Sets first argStart. More... | |
| int | getArgStart (int index) |
| Returns argStart at the specified index Negative indices count backwards from the top. More... | |
| int | getArgLen (int index) |
| Returns argLen at the specified index Negative indices count backwards from the top. More... | |
| const Command * | getCommand () const |
| const CommandSyntax * | getSyntax () const |
| const Command * | getCommandArg () const |
| const CodedStr * | getComponentArg () const |
| const Str & | getConfigDirArg () const |
| const DecimationLogWriter::DecimationType | getDecimationTypeArg () const |
| const Str & | getMissionArg () const |
| const LogWriter::ServiceType | getServiceTypeArg () const |
| const Str & | getStringArg () const |
| const bool | isInQuotedString () const |
| void | setStringArg (const Str &stringArg) |
| const Str & | getRegexArg () const |
| int | getIntegerArg () const |
| float | getNumberArg () const |
| const Timestamp & | getTimestampArg () const |
| const Str & | getTokenArg () const |
| const Unit * | getUnitArg () const |
| const UniversalURI * | getUniversalArg () const |
| const ElementURI * | getVariableArg () const |
| bool | parseBufferEnd (FlexArray< Command * > &commands, const char *buffer, int index) |
| If the last word in buffer is a valid arg, deal with it. More... | |
| bool | completeArg (FlexArray< Command * > &commands, CommandLine *commandLine, const char *buffer, int index) |
| void | execute (Logger &logger) |
| Str | toString () |
| bool | hasArgIndex (int argIndex) |
| CommandArgType | getCurrentArgType () |
Protected Member Functions | |
| bool | findArg (FlexArray< Command * > &commands, const char *buffer, int len) |
| Report if a valid arg matches the supplied arg. More... | |
| void | implySyntax () |
| If the last word in buffer is a valid arg, deal with it. More... | |
| bool | syntaxOk () |
| MatchType | orMatch (MatchType mt1, MatchType mt2) |
| MatchType | matchArg (FlexArray< Command * > &commands, const CommandArg *arg, int argIndex, const char *buffer, int len) |
| MatchType | matchUnique (int synArgIndex, CommandArgType argType) |
| MatchType | matchCommand (FlexArray< Command * > &commands, Command *&command, int synArgIndex, const char *buffer, int len) |
| Report if a command name matches the supplied arg. More... | |
| bool | completeCommand (FlexArray< Command * > &commands, CommandLine *commandLine, const char *buffer, int len) |
| MatchType | matchComponent (int synArgIndex, const char *buffer, int len) |
| MatchType | matchConfigDir (int synArgIndex, const char *buffer, int len) |
| MatchType | matchConfigSubDir (const Str &subDir, int synArgIndex, const char *buffer, int len) |
| MatchType | matchConfigVariable (int synArgIndex, const char *buffer, int len) |
| MatchType | matchDecimationType (int synArgIndex, const char *buffer, int len) |
| MatchType | matchFloat (int synArgIndex, const char *buffer, int len) |
| MatchType | matchInteger (int synArgIndex, const char *buffer, int len) |
| MatchType | matchKeyword (const char *keyword, int keywordLen, int synArgIndex, const char *buffer, int len) |
| MatchType | matchMission (int synArgIndex, const char *buffer, int len) |
| MatchType | matchQuotedString (int synArgIndex, const char *buffer, int len) |
| MatchType | matchRegex (int synArgIndex, const char *buffer, int len) |
| MatchType | matchSeconds (int synArgIndex, const char *buffer, int len) |
| MatchType | matchServiceType (int synArgIndex, const char *buffer, int len) |
| MatchType | matchString (int synArgIndex, const char *buffer, int len) |
| MatchType | matchTimestamp (int synArgIndex, const char *buffer, int len) |
| MatchType | matchToken (int synArgIndex, const char *buffer, int len) |
| MatchType | matchUnit (int synArgIndex, const char *buffer, int len) |
| MatchType | matchUniversal (int synArgIndex, const char *buffer, int len) |
| MatchType | matchVariable (int synArgIndex, const char *buffer, int len) |
Protected Attributes | |
| int | start_ |
| int | argCount_ |
| int | argStart_ [MAX_ARGS] |
| int | argIndex_ [MAX_ARGS] |
| int | argLen_ [MAX_ARGS] |
| MatchType | argMatch_ [MAX_ARGS] |
| CommandArgType | argType_ [MAX_ARGS] |
| Command * | command_ |
| CommandSyntax * | syntax_ |
| Command * | commandArg_ |
| CommandArg * | currentArg_ |
| const CodedStr * | componentArg_ |
| Str | configDirArg_ |
| DecimationLogWriter::DecimationType | decimationTypeArg_ |
| Str | missionArg_ |
| LogWriter::ServiceType | serviceTypeArg_ |
| Str | stringArg_ |
| Str | regexArg_ |
| int | integerArg_ |
| float | numberArg_ |
| Timestamp | timestampArg_ |
| Str | tokenArg_ |
| const Unit * | unitArg_ |
| const UniversalURI * | universalArg_ |
| const ElementURI * | variableArg_ |
| bool | inQuotedString_ |
Private Member Functions | |
| ParsedCommand (const ParsedCommand &old) | |
| ParsedCommand::ParsedCommand | ( | ) |
|
private |
| void ParsedCommand::clearAll | ( | ) |
Clears everything.
References argCount_, clearTopArg(), and start_.
Referenced by CommandLine::clearParsed(), CommandLine::execLine(), and CommandLine::parseBufferEnd().
| void ParsedCommand::clearTopArg | ( | ) |
Clears the top arg on the stack.
References ARG_NONE, argCount_, argIndex_, argLen_, argMatch_, argStart_, argType_, command_, currentArg_, MATCH_NONE, syntax_, and undefTopArg().
Referenced by clearAll(), and parseBufferEnd().
| bool ParsedCommand::completeArg | ( | FlexArray< Command * > & | commands, |
| CommandLine * | commandLine, | ||
| const char * | buffer, | ||
| int | index | ||
| ) |
References argCount_, argLen_, argStart_, and completeCommand().
Referenced by CommandLine::completeArg().
|
protected |
References command_, FlexArray< T >::get(), Command::getKeyword(), CommandLine::getOutFile(), CommandLine::setChar(), and FlexArrayBase::size().
Referenced by completeArg().
| void ParsedCommand::execute | ( | Logger & | logger | ) |
References argLen_, CommandSyntax::call(), command_, Syslog::FAULT, Command::getKeyword(), implySyntax(), syntax_, syntaxOk(), and Logger::syslog().
Referenced by CommandLine::execLine().
|
protected |
Report if a valid arg matches the supplied arg.
If so, deal with it.
References ARG_NONE, argCount_, argIndex_, argMatch_, argType_, command_, currentArg_, CommandArg::equals(), CommandSyntax::getAltSyntax(), CommandSyntax::getArg(), CommandSyntax::getArgCount(), CommandArg::getRequired(), Command::getSyntax(), Command::getSyntaxCount(), MATCH_MANY, MATCH_NONE, MATCH_UNIQUE, matchArg(), matchCommand(), NOT_REQUIRED, REQUIRED_AFTER_PREVIOUS, CommandSyntax::setAltSyntax(), and syntax_.
Referenced by parseBufferEnd().
|
inline |
|
inline |
|
inline |
|
inline |
References commandArg_.
Referenced by CommandLine::commandHelp().
|
inline |
References componentArg_.
Referenced by CommandLine::commandFailComponent(), and CommandLine::commandShowDependencies().
|
inline |
References configDirArg_.
Referenced by CommandLine::commandRestartApplication().
| CommandArgType ParsedCommand::getCurrentArgType | ( | ) |
References ARG_NONE, currentArg_, and CommandArg::getArgType().
Referenced by CommandLine::parseBufferEnd().
|
inline |
References decimationTypeArg_.
Referenced by CommandLine::commandConfigSet().
|
inline |
References integerArg_.
Referenced by CommandLine::commandIbitMcp3553(), CommandLine::commandRestartApplication(), CommandLine::commandRetransmit(), and CommandLine::commandSchedule().
|
inline |
References missionArg_.
Referenced by CommandLine::commandLoad(), CommandLine::commandResume(), and CommandLine::commandRun().
|
inline |
|
inline |
References regexArg_.
Referenced by CommandLine::commandShowComponent(), and CommandLine::commandShowVariable().
|
inline |
References serviceTypeArg_.
Referenced by CommandLine::commandConfigSet().
|
inline |
Returns first argStart.
References start_.
Referenced by CommandLine::completeArg(), and CommandLine::parseBufferEnd().
|
inline |
|
inline |
References syntax_.
Referenced by CommandLine::commandShowDependencies().
|
inline |
References timestampArg_.
Referenced by CommandLine::commandSchedule().
|
inline |
References tokenArg_.
Referenced by CommandLine::commandRestartApplication(), CommandLine::commandRetransmit(), and CommandLine::commandSchedule().
|
inline |
References unitArg_.
Referenced by CommandLine::commandConfigSet(), CommandLine::commandGet(), CommandLine::commandMaintainAdd(), and CommandLine::commandSet().
|
inline |
References universalArg_.
Referenced by CommandLine::commandShowBest().
|
inline |
References variableArg_.
Referenced by CommandLine::commandConfigSet(), CommandLine::commandFailVariable(), CommandLine::commandGet(), CommandLine::commandMaintainAdd(), CommandLine::commandMaintainInvalid(), CommandLine::commandMaintainRemove(), CommandLine::commandMaintainUnavailable(), CommandLine::commandReportAdd(), CommandLine::commandReportRemove(), CommandLine::commandSet(), and CommandLine::commandShowDependencies().
| bool ParsedCommand::hasArgIndex | ( | int | argIndex | ) |
References argCount_, and argIndex_.
Referenced by CommandLine::commandConfigSet(), and CommandLine::commandRun().
|
protected |
If the last word in buffer is a valid arg, deal with it.
If we need to toss the last character, return false.
References ARG_NONE, argCount_, argLen_, argType_, command_, CommandSyntax::getRequiredArgSize(), Command::getSyntax(), Command::getSyntaxCount(), CommandSyntax::setAltSyntax(), and syntax_.
Referenced by execute(), and parseBufferEnd().
|
inline |
References inQuotedString_.
Referenced by CommandLine::parseBufferEnd().
|
protected |
References ARG_COMMAND, ARG_COMPONENT, ARG_CONFIG_DIR, ARG_CONFIG_VARIABLE, ARG_DECIMATION_TYPE, ARG_FLOAT, ARG_INT, ARG_KEYWORD, ARG_MISSION, ARG_NONE, ARG_QUOTED_STRING, ARG_REGEX, ARG_SECONDS, ARG_SERVICE_TYPE, ARG_STRING, ARG_TIMESTAMP, ARG_TOKEN, ARG_UNIT, ARG_UNIVERSAL, ARG_VARIABLE, commandArg_, CommandArg::getArgType(), CommandArg::getKeyword(), CommandArg::getKeywordLen(), inQuotedString_, MATCH_NONE, MATCH_UNIQUE, matchCommand(), matchComponent(), matchConfigDir(), matchConfigVariable(), matchDecimationType(), matchFloat(), matchInteger(), matchKeyword(), matchMission(), matchQuotedString(), matchRegex(), matchSeconds(), matchServiceType(), matchString(), matchTimestamp(), matchToken(), matchUnit(), matchUniversal(), and matchVariable().
Referenced by findArg().
|
protected |
Report if a command name matches the supplied arg.
If so, deal with it.
References ARG_COMMAND, argCount_, argIndex_, argType_, FlexArray< T >::get(), Command::getKeyword(), MATCH_MANY, MATCH_NONE, MATCH_UNIQUE, and FlexArrayBase::size().
Referenced by findArg(), and matchArg().
|
protected |
References ARG_COMPONENT, argCount_, argIndex_, argType_, componentArg_, Str::cStr(), Slate::GetName(), Str::length(), MATCH_MANY, MATCH_NONE, MATCH_UNIQUE, and CodedStr::NO_CODE.
Referenced by matchArg().
|
protected |
References Str::EMPTY_STR, matchConfigSubDir(), and orMatch().
Referenced by matchArg().
|
protected |
References ARG_CONFIG_DIR, argCount_, argIndex_, argType_, configDirArg_, Str::EMPTY_STR, MATCH_MANY, MATCH_NONE, and MATCH_UNIQUE.
Referenced by matchConfigDir().
|
protected |
|
protected |
|
protected |
References ARG_FLOAT, MATCH_NONE, matchUnique(), and numberArg_.
Referenced by matchArg().
|
protected |
References ARG_INT, integerArg_, MATCH_NONE, and matchUnique().
Referenced by matchArg().
|
protected |
References ARG_KEYWORD, MATCH_NONE, and matchUnique().
Referenced by matchArg().
|
protected |
References ARG_MISSION, argCount_, argIndex_, argType_, Str::cStr(), Str::EMPTY_STR, Str::FindLastOf(), Str::length(), MATCH_MANY, MATCH_NONE, MATCH_UNIQUE, missionArg_, and Str::NO_POS.
Referenced by matchArg().
|
protected |
References ARG_QUOTED_STRING, Str::EMPTY_STR, MATCH_MANY, MATCH_NONE, matchUnique(), and stringArg_.
Referenced by matchArg().
|
protected |
References ARG_REGEX, matchUnique(), and regexArg_.
Referenced by matchArg().
|
protected |
References ARG_SECONDS, MATCH_NONE, matchUnique(), and numberArg_.
Referenced by matchArg().
|
protected |
References ARG_SERVICE_TYPE, MATCH_MANY, MATCH_NONE, matchUnique(), LogWriter::NO_SERVICE, LogWriter::SERVICE_MULTI, serviceTypeArg_, and LogWriter::Str2ServiceType().
Referenced by matchArg().
|
protected |
References ARG_STRING, MATCH_NONE, matchUnique(), and stringArg_.
Referenced by matchArg().
|
protected |
References ARG_TIMESTAMP, MATCH_MANY, MATCH_NONE, matchUnique(), Timestamp::NOT_SET_TIME, and timestampArg_.
Referenced by matchArg().
|
protected |
References ARG_TOKEN, MATCH_NONE, matchUnique(), and tokenArg_.
Referenced by matchArg().
|
protected |
References argCount_, argIndex_, argMatch_, argType_, and MATCH_UNIQUE.
Referenced by matchDecimationType(), matchFloat(), matchInteger(), matchKeyword(), matchQuotedString(), matchRegex(), matchSeconds(), matchServiceType(), matchString(), matchTimestamp(), and matchToken().
|
protected |
References ARG_UNIT, argCount_, argIndex_, argType_, UnitRegistry::GetIndexedKey(), UnitRegistry::GetIndexedUnit(), Str::length(), MATCH_MANY, MATCH_NONE, MATCH_UNIQUE, UnitRegistry::Size(), Str::startsWith(), and unitArg_.
Referenced by matchArg().
|
protected |
References ARG_UNIVERSAL, argCount_, argIndex_, argType_, Slate::GetElementURI(), Slate::GetElementURICount(), ElementURI::isUniversal(), Str::length(), MATCH_MANY, MATCH_NONE, MATCH_UNIQUE, Str::startsWith(), and universalArg_.
Referenced by matchArg().
|
protected |
References ARG_VARIABLE, argCount_, argIndex_, argType_, Slate::GetElementURI(), Slate::GetElementURICount(), Str::length(), MATCH_MANY, MATCH_NONE, MATCH_UNIQUE, Str::startsWith(), and variableArg_.
Referenced by matchArg().
References MATCH_MANY, MATCH_NONE, and MATCH_UNIQUE.
Referenced by matchConfigDir().
| bool ParsedCommand::parseBufferEnd | ( | FlexArray< Command * > & | commands, |
| const char * | buffer, | ||
| int | index | ||
| ) |
If the last word in buffer is a valid arg, deal with it.
If we need to toss the last character, return false.
References ARG_NONE, ARG_QUOTED_STRING, ARG_STRING, argCount_, argLen_, argMatch_, argStart_, argType_, clearTopArg(), findArg(), CommandSyntax::getArgCount(), implySyntax(), MATCH_UNIQUE, syntax_, and syntaxOk().
Referenced by CommandLine::parseBufferEnd().
|
inline |
|
inline |
References stringArg_.
Referenced by DataReceiver::Receive().
|
protected |
References ARG_NONE, argCount_, argIndex_, argLen_, argType_, CommandSyntax::getRequiredArgSize(), and syntax_.
Referenced by execute(), and parseBufferEnd().
| Str ParsedCommand::toString | ( | void | ) |
References ARG_COMMAND, ARG_COMPONENT, ARG_CONFIG_DIR, ARG_CONFIG_VARIABLE, ARG_DECIMATION_TYPE, ARG_FLOAT, ARG_INT, ARG_KEYWORD, ARG_MISSION, ARG_NONE, ARG_QUOTED_STRING, ARG_REGEX, ARG_SECONDS, ARG_SERVICE_TYPE, ARG_STRING, ARG_TIMESTAMP, ARG_TOKEN, ARG_UNIT, ARG_UNIVERSAL, ARG_VARIABLE, argCount_, argIndex_, argType_, command_, commandArg_, componentArg_, configDirArg_, DecimationLogWriter::DecimationType2Str(), decimationTypeArg_, CommandSyntax::getArg(), CommandArg::getKeyword(), Command::getKeyword(), Unit::getName(), integerArg_, missionArg_, numberArg_, regexArg_, LogWriter::ServiceType2Str(), serviceTypeArg_, stringArg_, syntax_, timestampArg_, tokenArg_, Timestamp::toSmallString(), unitArg_, universalArg_, and variableArg_.
Referenced by CommandLine::execLine().
| void ParsedCommand::undefTopArg | ( | ) |
Undefine top arg on the stack.
References ARG_COMMAND, ARG_COMPONENT, ARG_CONFIG_DIR, ARG_CONFIG_VARIABLE, ARG_DECIMATION_TYPE, ARG_FLOAT, ARG_INT, ARG_KEYWORD, ARG_MISSION, ARG_NONE, ARG_QUOTED_STRING, ARG_REGEX, ARG_SECONDS, ARG_SERVICE_TYPE, ARG_STRING, ARG_TIMESTAMP, ARG_TOKEN, ARG_UNIT, ARG_UNIVERSAL, ARG_VARIABLE, argCount_, argType_, commandArg_, componentArg_, configDirArg_, decimationTypeArg_, Str::EMPTY_STR, integerArg_, missionArg_, LogWriter::NO_SERVICE, Timestamp::NOT_SET_TIME, numberArg_, regexArg_, serviceTypeArg_, stringArg_, timestampArg_, tokenArg_, DecimationLogWriter::UNDEFINED_DECIMATION, unitArg_, universalArg_, and variableArg_.
Referenced by clearTopArg().
|
protected |
Referenced by clearAll(), clearTopArg(), completeArg(), findArg(), getArgCount(), getArgLen(), getArgStart(), hasArgIndex(), implySyntax(), matchCommand(), matchComponent(), matchConfigSubDir(), matchConfigVariable(), matchMission(), matchUnique(), matchUnit(), matchUniversal(), matchVariable(), parseBufferEnd(), syntaxOk(), toString(), and undefTopArg().
|
protected |
|
protected |
Referenced by clearTopArg(), completeArg(), execute(), implySyntax(), parseBufferEnd(), ParsedCommand(), and syntaxOk().
Referenced by clearTopArg(), findArg(), matchUnique(), parseBufferEnd(), and ParsedCommand().
|
protected |
Referenced by clearTopArg(), completeArg(), getArgLen(), getArgStart(), parseBufferEnd(), and ParsedCommand().
|
protected |
|
protected |
Referenced by clearTopArg(), completeCommand(), execute(), findArg(), getCommand(), implySyntax(), and toString().
|
protected |
Referenced by getCommandArg(), matchArg(), toString(), and undefTopArg().
|
protected |
Referenced by getComponentArg(), matchComponent(), toString(), and undefTopArg().
|
protected |
Referenced by getConfigDirArg(), matchConfigSubDir(), toString(), and undefTopArg().
|
protected |
Referenced by clearTopArg(), findArg(), and getCurrentArgType().
|
protected |
Referenced by getDecimationTypeArg(), matchDecimationType(), toString(), and undefTopArg().
|
protected |
Referenced by isInQuotedString(), and matchArg().
|
protected |
Referenced by getIntegerArg(), matchInteger(), toString(), and undefTopArg().
|
protected |
Referenced by getMissionArg(), matchMission(), toString(), and undefTopArg().
|
protected |
Referenced by getNumberArg(), matchFloat(), matchSeconds(), toString(), and undefTopArg().
|
protected |
Referenced by getRegexArg(), matchRegex(), toString(), and undefTopArg().
|
protected |
Referenced by getServiceTypeArg(), matchServiceType(), toString(), and undefTopArg().
|
protected |
Referenced by clearAll(), getStart(), and setStart().
|
protected |
Referenced by getStringArg(), matchQuotedString(), matchString(), setStringArg(), toString(), and undefTopArg().
|
protected |
Referenced by clearTopArg(), execute(), findArg(), getSyntax(), implySyntax(), parseBufferEnd(), syntaxOk(), and toString().
|
protected |
Referenced by getTimestampArg(), matchTimestamp(), toString(), and undefTopArg().
|
protected |
Referenced by getTokenArg(), matchToken(), toString(), and undefTopArg().
|
protected |
Referenced by getUnitArg(), matchUnit(), toString(), and undefTopArg().
|
protected |
Referenced by getUniversalArg(), matchUniversal(), toString(), and undefTopArg().
|
protected |
Referenced by getVariableArg(), matchConfigVariable(), matchVariable(), toString(), and undefTopArg().