ROSE 0.11.145.192
|
An "if" statement.
This function compares its first two arguments and if they are equal it evaluates the third argument, otherwise it evaluates the fourth argument. The fourth argument is optional and defaults to the emtpy string.
Definition at line 295 of file DocumentMarkup.h.
#include <Sawyer/DocumentMarkup.h>
Public Member Functions | |
std::string | eval (const Grammar &grammar, const std::vector< std::string > &args) |
How to evaluate this function or macro. | |
Public Member Functions inherited from Sawyer::Document::Markup::Function | |
const std::string & | name () const |
Function name. | |
bool | isMacro () const |
Whether declaration is for a macro. | |
Ptr | arg (const std::string &name) |
Declare a required argument. | |
Ptr | arg (const std::string &name, const std::string &dflt) |
Declare an optional argument. | |
Ptr | ellipsis (size_t n=(size_t)(-1)) |
Declare additional arguments. | |
size_t | nRequiredArgs () const |
Number of required arguments. | |
size_t | nOptionalArgs () const |
Number of optional arguments. | |
size_t | nAdditionalArgs () const |
Max number of additional arguments. | |
size_t | maxArgs () const |
Max number of actual arguments possible. | |
void | validateArgs (std::vector< std::string > &actuals, TokenStream &) const |
Check and adjust actual arguments. | |
Public Member Functions inherited from Sawyer::SharedObject | |
SharedObject () | |
Default constructor. | |
SharedObject (const SharedObject &) | |
Copy constructor. | |
virtual | ~SharedObject () |
Virtual destructor. | |
SharedObject & | operator= (const SharedObject &) |
Assignment. | |
Public Member Functions inherited from Sawyer::SharedFromThis< Function > | |
SharedPointer< Function > | sharedFromThis () |
Create a shared pointer from this . | |
SharedPointer< const Function > | sharedFromThis () const |
Create a shared pointer from this . | |
Static Public Member Functions | |
static Ptr | instance (const std::string &name) |
Protected Member Functions | |
IfEq (const std::string &name) | |
Protected Member Functions inherited from Sawyer::Document::Markup::Function | |
Function (const std::string &name, bool evalArgs=true) | |
Additional Inherited Members | |
Public Types inherited from Sawyer::Document::Markup::Function | |
typedef SharedPointer< Function > | Ptr |
Reference-counting pointer to markup function. | |
|
inlineprotected |
Definition at line 297 of file DocumentMarkup.h.
|
inlinestatic |
Definition at line 299 of file DocumentMarkup.h.
|
virtual |
How to evaluate this function or macro.
Implements Sawyer::Document::Markup::Function.