ROSE 0.11.145.147
|
Sums all previous and current values.
The template argument must match the type of the summed values.
This augmenter can be used for switches that increment a value, such as a debug switch where each occurrence of the switch increments a debug level:
Definition at line 1922 of file Sawyer/CommandLine.h.
#include <Sawyer/CommandLine.h>
Public Types | |
typedef SharedPointer< Sum > | Ptr |
Reference counting pointer for this class. | |
Public Types inherited from Sawyer::CommandLine::ValueAugmenter | |
typedef SharedPointer< ValueAugmenter > | Ptr |
Reference counting pointer for this class. | |
Public Member Functions | |
virtual ParsedValues | operator() (const ParsedValues &savedValues, const ParsedValues &newValues) |
Called when a switch's value is about to be stored into the ParserResult. | |
Public Member Functions inherited from Sawyer::SharedObject | |
SharedObject () | |
Default constructor. | |
SharedObject (const SharedObject &) | |
Copy constructor. | |
virtual | ~SharedObject () |
Virtual destructor. | |
SharedObject & | operator= (const SharedObject &) |
Assignment. | |
Static Public Member Functions | |
static Ptr | instance () |
Allocating constructor. | |
Protected Member Functions | |
Sum () | |
Constructor for derived classes. | |
typedef SharedPointer<Sum> Sawyer::CommandLine::Sum< T >::Ptr |
Reference counting pointer for this class.
Definition at line 1928 of file Sawyer/CommandLine.h.
|
inlineprotected |
Constructor for derived classes.
Non-subclass users should use instance instead.
Definition at line 1925 of file Sawyer/CommandLine.h.
|
inlinestatic |
Allocating constructor.
Returns a pointer to a new Sum object. Uses will most likely want to use the sum factory instead, which requires less typing.
Definition at line 1934 of file Sawyer/CommandLine.h.
Referenced by Sawyer::CommandLine::sum().
|
inlinevirtual |
Called when a switch's value is about to be stored into the ParserResult.
The previously stored switch values for all switch occurrences that used this same key are provided in the first arugment. The recently parsed value (or values if the switch value was a list that was then exploded) is provided as the second argument. The function should return a new value (or values) that will replace the values passed on the command-line.
Implements Sawyer::CommandLine::ValueAugmenter.
Definition at line 1936 of file Sawyer/CommandLine.h.
References Sawyer::CommandLine::sum(), and Sawyer::CommandLine::ParsedValue::value().