ROSE 0.11.145.147
|
Base class for value agumentors.
A ValueAugmenter is invoked after a switch argument (explicit or default) is parsed and somehow merges the newly parsed value with previous values. The augmenter is called only when the switch whichProperty
is set to SAVE_AUGMENTED.
The merge is performed by the function operator, which is given two sets of parsed values: the values that were previously parsed and stored in a ParserResult for the same switch key, and the values that were recently parsed for the switch. The method should combine the two in some way and return a new set of values that replace all previous and recently parsed values. The return values should contain appropriate information for the valueLocation
, valueString
, switchLocation
, switchString
, and valueSaver
properties. Most of the time these properties can be initialized from parsed values passed to the function operator.
Most subclasses will have factory functions to instantiate reference counted, allocated objects. See Command line value augmenter factories for a list.
Definition at line 1896 of file Sawyer/CommandLine.h.
#include <Sawyer/CommandLine.h>
Public Types | |
typedef SharedPointer< ValueAugmenter > | Ptr |
Reference counting pointer for this class. | |
Public Member Functions | |
virtual ParsedValues | operator() (const ParsedValues &savedValues, const ParsedValues &newValues)=0 |
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. | |
Reference counting pointer for this class.
Definition at line 1899 of file Sawyer/CommandLine.h.
|
inlinevirtual |
Definition at line 1900 of file Sawyer/CommandLine.h.
|
pure virtual |
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.
Implemented in Sawyer::CommandLine::Sum< T >, and Rose::Color::ColorizationMerge.