![]() |
appkit
1.5.1
RoadNarrows Robotics Application Kit
|
Command EXTended ARGument class holding parsed command context and the raw and converted argmument values. More...
#include <CmdExtArg.h>
Public Types | |
| enum | CvtType { CvtTypeUndef, CvtTypeString, CvtTypeEnum, CvtTypeBoolean, CvtTypeInteger, CvtTypeFpn } |
| Converted types. More... | |
Public Member Functions | |
| CmdExtArg () | |
| Default constructor. | |
| CmdExtArg (const int &nCmdUid, const int &nFormIndex, const int &nArgIndex, const int &nArgInstance, const std::string &strArg) | |
| Initialization constructor. More... | |
| CmdExtArg (const CmdExtArg &src) | |
| Copy constructor. More... | |
| virtual | ~CmdExtArg () |
| Destructor. | |
| CmdExtArg & | operator= (const CmdExtArg &rhs) |
| Assignment operator. More... | |
| int | uid () const |
| Get the argument's associated parsed command unique id. More... | |
| int | formIndex () const |
| Get the argument's associated parsed form definition index. More... | |
| int | argIndex () const |
| Get the argument's associated parsed argument definition index. More... | |
| int | argInstance () const |
| Get the argument's instance number of (uid, formindex, argindex) parsed argument definition index. More... | |
| const std::string & | arg () const |
| Get raw source argument string (or a pirate grunting). More... | |
| bool | isValid () const |
| Check if converted value is valid. More... | |
| CvtType | type () const |
| Get the converted argument type. More... | |
| const std::string & | s () const |
| Get the converted string value. More... | |
| long | e () const |
| Get the converted enumeration index value. More... | |
| bool | b () const |
| Get the converted boolean value. More... | |
| long | i () const |
| Get the converted integer value. More... | |
| double | f () const |
| Get the converted floating-point number value. More... | |
| bool | operator== (const CmdExtArg &rval) const |
| Comparison operator this == rval. More... | |
| bool | operator== (const std::string &rval) const |
| bool | operator== (const char *const &rval) const |
| bool | operator== (const bool &rval) const |
| bool | operator== (const long &rval) const |
| bool | operator== (const double &rval) const |
| bool | operator!= (const CmdExtArg &rval) const |
| Comparison operator this != rval. More... | |
| bool | operator!= (const std::string &rval) const |
| bool | operator!= (const char *const &rval) const |
| bool | operator!= (const bool &rval) const |
| bool | operator!= (const long &rval) const |
| bool | operator!= (const double &rval) const |
Protected Member Functions | |
| void | arg (const std::string &strArg) |
| Set the argument string value. More... | |
| void | s (const std::string &strVal) |
| Set the converted string value. More... | |
| void | e (const long eVal) |
| Set the converted index into literal enum list value. More... | |
| void | b (const bool bVal) |
| Set the converted boolean value. More... | |
| void | i (const long lVal) |
| Set the converted integer value. More... | |
| void | f (const double fVal) |
| Set the converted floating-point number value. More... | |
Protected Attributes | |
| int | m_nCmdUid |
| command definition unique id | |
| int | m_nFormIndex |
| form definition index | |
| int | m_nArgIndex |
| argument definition index | |
| int | m_nArgInstance |
| argument instance (FUTURE) | |
| std::string | m_strArg |
| argument unconverted raw value string | |
| CvtType | m_eCvtType |
| converted type | |
| std::string | m_strCvtVal |
| converted string value | |
| bool | m_bCvtVal |
| converted boolean value | |
| long | m_lCvtVal |
| converted integer/index value | |
| double | m_fCvtVal |
| converted float-point number value | |
Friends | |
| class | CmdArgDef |
| std::ostream & | operator<< (std::ostream &os, const CmdExtArg &arg) |
| Insert object into output stream. More... | |
| LogBook & | operator<< (LogBook &log, const CmdExtArg &arg) |
| Insert object into LogBook pending entry. More... | |
Command EXTended ARGument class holding parsed command context and the raw and converted argmument values.
Extended arguments are an alternative command interface to the standard simple command string arguments.
Definition at line 91 of file CmdExtArg.h.
Converted types.
Definition at line 97 of file CmdExtArg.h.
| rnr::cmd::CmdExtArg::CmdExtArg | ( | const int & | nCmdUid, |
| const int & | nFormIndex, | ||
| const int & | nArgIndex, | ||
| const int & | nArgInstance, | ||
| const std::string & | strArg | ||
| ) |
Initialization constructor.
| nCmdUid | Command definition unique id. |
| nFormIndex | Form definition index. |
| nArgIndex | Argument definition index. |
| nArgInstance | Argument instance (FUTURE). |
| strArg | Source argument string. |
| CmdExtArg::CmdExtArg | ( | const CmdExtArg & | src | ) |
Copy constructor.
| src | Source object. |
Definition at line 109 of file CmdExtArg.cxx.
References m_bCvtVal, m_eCvtType, m_fCvtVal, m_lCvtVal, m_nArgIndex, m_nArgInstance, m_nCmdUid, m_nFormIndex, m_strArg, and m_strCvtVal.
|
inline |
Get raw source argument string (or a pirate grunting).
Definition at line 194 of file CmdExtArg.h.
References m_strArg.
Referenced by operator!=(), and operator==().
|
inlineprotected |
Set the argument string value.
| strArg | Source argument string. |
Definition at line 350 of file CmdExtArg.h.
References b(), e(), f(), i(), and s().
|
inline |
Get the argument's associated parsed argument definition index.
Definition at line 172 of file CmdExtArg.h.
References m_nArgIndex.
Referenced by rnr::cmd::CommandLine::getArgDefType(), and rnr::cmd::CommandLine::getArgName().
|
inline |
Get the argument's instance number of (uid, formindex, argindex) parsed argument definition index.
FUTURE
Definition at line 182 of file CmdExtArg.h.
References m_nArgInstance.
|
inline |
Get the converted boolean value.
Definition at line 229 of file CmdExtArg.h.
References m_bCvtVal.
Referenced by arg(), rnr::cmd::CmdArgDef::convert(), and operator==().
|
protected |
Set the converted boolean value.
| bVal | Value to set. |
Definition at line 154 of file CmdExtArg.cxx.
|
inline |
Get the converted enumeration index value.
Definition at line 222 of file CmdExtArg.h.
References m_lCvtVal.
Referenced by arg(), and rnr::cmd::CmdArgDef::convert().
|
protected |
Set the converted index into literal enum list value.
| eVal | Value to set. |
Definition at line 147 of file CmdExtArg.cxx.
|
inline |
Get the converted floating-point number value.
Definition at line 243 of file CmdExtArg.h.
References m_fCvtVal, and operator==().
Referenced by arg(), rnr::cmd::CmdArgDef::convert(), and operator==().
|
protected |
Set the converted floating-point number value.
| fVal | Value to set. |
Definition at line 166 of file CmdExtArg.cxx.
|
inline |
Get the argument's associated parsed form definition index.
Definition at line 165 of file CmdExtArg.h.
References m_nFormIndex.
Referenced by rnr::cmd::CommandLine::getArgDefType(), rnr::cmd::CommandLine::getArgName(), rnr::cmd::CommandLine::numOfArgs(), rnr::cmd::CommandLine::numOfOptionalArgs(), and rnr::cmd::CommandLine::numOfRequiredArgs().
|
inline |
Get the converted integer value.
Definition at line 236 of file CmdExtArg.h.
References m_lCvtVal.
Referenced by arg(), rnr::cmd::CmdArgDef::convert(), and operator==().
|
protected |
Set the converted integer value.
| lVal | Value to set. |
Definition at line 160 of file CmdExtArg.cxx.
|
inline |
Check if converted value is valid.
Definition at line 201 of file CmdExtArg.h.
References CvtTypeUndef, and m_eCvtType.
|
inline |
Comparison operator this != rval.
| rval | Rvalue object. |
Definition at line 283 of file CmdExtArg.h.
References arg(), and operator<<.
Assignment operator.
| rhs | Right-hand side object. |
Definition at line 127 of file CmdExtArg.cxx.
References m_bCvtVal, m_eCvtType, m_fCvtVal, m_lCvtVal, m_nArgIndex, m_nArgInstance, m_nCmdUid, m_nFormIndex, m_strArg, and m_strCvtVal.
| bool CmdExtArg::operator== | ( | const CmdExtArg & | rval | ) | const |
Comparison operator this == rval.
| rval | Rvalue object. |
Definition at line 172 of file CmdExtArg.cxx.
References arg(), b(), f(), i(), operator<<(), s(), type(), and rnr::cmd::undefstring.
Referenced by f().
|
inline |
Get the converted string value.
Definition at line 215 of file CmdExtArg.h.
References m_strCvtVal.
Referenced by arg(), rnr::cmd::CmdArgDef::convert(), and operator==().
|
protected |
Set the converted string value.
| strVal | Value to set. |
|
inline |
Get the converted argument type.
Definition at line 208 of file CmdExtArg.h.
References m_eCvtType.
Referenced by operator==().
|
inline |
Get the argument's associated parsed command unique id.
Definition at line 158 of file CmdExtArg.h.
References m_nCmdUid.
Referenced by checkCmd(), rnr::cmd::CommandLine::getArgDefType(), rnr::cmd::CommandLine::getArgName(), rnr::cmd::CommandLine::numOfArgs(), rnr::cmd::CommandLine::numOfOptionalArgs(), and rnr::cmd::CommandLine::numOfRequiredArgs().
|
friend |
Insert object into output stream.
| os | Output stream. |
| arg | Object to insert. |
Referenced by operator!=().