Parser
- Implemented ::capture_last, so that new args can be injected at either end of the command line.
This commit is contained in:
@@ -531,6 +531,22 @@ Tree* Parser::captureFirst (const std::string& arg)
|
||||
return t;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Tree* Parser::captureLast (const std::string& arg)
|
||||
{
|
||||
// Insert the arg as the new first branch.
|
||||
Tree* t = new Tree ("argIns");
|
||||
if (!t)
|
||||
throw std::string (STRING_ERROR_MEMORY);
|
||||
|
||||
t->attribute ("raw", arg);
|
||||
t->tag ("?");
|
||||
t->_trunk = _tree;
|
||||
|
||||
_tree->_branches.push_back (t);
|
||||
return t;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string Parser::getFilterExpression ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user