![]() |
appkit
1.5.1
RoadNarrows Robotics Application Kit
|
Parsed token container class. More...
#include <Token.h>
Public Member Functions | |
| Token () | |
| Default constructor. | |
| Token (const std::string &strValue) | |
| Initialization constructor. More... | |
| Token (const std::string &strValue, const size_t lineNum, const size_t posStart, const size_t posEnd) | |
| Initialization constructor. More... | |
| Token (const Token &src) | |
| Copy constructor. More... | |
| virtual | ~Token () |
| Destructor. | |
| Token & | operator= (const Token &rhs) |
| Assignment operator. More... | |
| const std::string & | value () const |
| Return token string. More... | |
| const size_t | linenum () const |
| Return input line number where token was located. More... | |
| void | position (size_t &posStart, size_t &posEnd) const |
| Return input line position where token was located. More... | |
| std::ostream & | printAnnotated (std::ostream &os, const std::string &strLine, const bool bLoc=false) |
| Output annotated token embedded location in the input line. More... | |
Public Attributes | |
| std::string | m_strValue |
| token string value | |
| size_t | m_lineNum |
| line number | |
| size_t | m_posStart |
| line start position of token | |
| size_t | m_posEnd |
| line end position of token | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Token &tok) |
| Insert object into output stream. More... | |
| LogBook & | operator<< (LogBook &log, const Token &tok) |
| Insert object into LogBook pending entry. More... | |
| rnr::cmd::Token::Token | ( | const std::string & | strValue | ) |
Initialization constructor.
| strValue | Token value. |
| rnr::cmd::Token::Token | ( | const std::string & | strValue, |
| const size_t | lineNum, | ||
| const size_t | posStart, | ||
| const size_t | posEnd | ||
| ) |
| Token::Token | ( | const Token & | src | ) |
Copy constructor.
| src | Source object. |
Definition at line 104 of file Token.cxx.
References m_lineNum, m_posEnd, m_posStart, and m_strValue.
|
inline |
Assignment operator.
| rhs | Right-hand side object. |
Definition at line 116 of file Token.cxx.
References m_lineNum, m_posEnd, m_posStart, and m_strValue.
|
inline |
Return input line position where token was located.
| [out] | posStart | Starting character position of token. |
| [out] | posEnd | Ending character position of token. |
Definition at line 170 of file Token.h.
References m_posEnd, m_posStart, operator<<, and printAnnotated().
| ostream & Token::printAnnotated | ( | std::ostream & | os, |
| const std::string & | strLine, | ||
| const bool | bLoc = false |
||
| ) |
Output annotated token embedded location in the input line.
| os | Output stream. |
| strLine | Line whence token was generated. |
| bLoc | If true, then include line number and token characater positions. |
Definition at line 126 of file Token.cxx.
References operator<<(), rnr::str::prettify(), and value().
Referenced by position().
|
inline |
Return token string.
Definition at line 149 of file Token.h.
References m_strValue.
Referenced by rnr::cmd::CommandLine::peekEq(), and printAnnotated().
|
friend |
Insert object into output stream.
| os | Output stream. |
| tok | Object to insert. |
Referenced by position().