Argument context class.
More...
#include <args.hh>
|
| | ArgContext (ErrorHandler *errh=0) |
| | Construct an argument context.
|
| |
| | ArgContext (const Element *context, ErrorHandler *errh=0) |
| | Construct an argument context.
|
| |
| const Element * | context () const |
| | Return the element context.
|
| |
| ErrorHandler * | errh () const |
| | Return the associated error handler.
|
| |
| String | error_prefix () const |
| | Return a prefix string associated with the current argument.
|
| |
| void | error (const char *fmt,...) const |
| | Report a parse error for the current argument.
|
| |
| void | warning (const char *fmt,...) const |
| | Report a parse warning for the current argument.
|
| |
| void | message (const char *fmt,...) const |
| | Report a message for the current argument.
|
| |
|
void | xmessage (const String &anno, const String &str) const |
| |
|
void | xmessage (const String &anno, const char *fmt, va_list val) const |
| |
Argument context class.
The ArgContext class encapsulates state useful for parsing arguments: an element context and an ErrorHandler for reporting parse errors.
Args is derived from ArgContext. Some parser functions take an ArgContext reference rather than an Args reference. This clarifies that the parser function doesn't modify Args internals. Also, ArgContext objects are smaller and quicker to construct than Args objects.
◆ ArgContext() [1/2]
Construct an argument context.
- Parameters
-
| errh | optional error handler |
◆ ArgContext() [2/2]
Construct an argument context.
- Parameters
-
| context | optional element context |
| errh | optional error handler |
◆ context()
| const Element * ArgContext::context |
( |
| ) |
const |
|
inline |
Return the element context.
◆ errh()
Return the associated error handler.
◆ error_prefix()
| String ArgContext::error_prefix |
( |
| ) |
const |
Return a prefix string associated with the current argument.
If the current argument is keyword FOO, returns "FOO: ".
◆ error()
| void ArgContext::error |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| const |
Report a parse error for the current argument.
◆ warning()
| void ArgContext::warning |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| const |
Report a parse warning for the current argument.
◆ message()
| void ArgContext::message |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| const |
Report a message for the current argument.
The documentation for this class was generated from the following files: