![]() |
|
Formats variables to output stream. More...
#include <VariableFormatter.h>


Public Types | |
| typedef std::map< std::string, T > | map_t |
Public Member Functions | |
| virtual bool | handle (const std::string &key, const map_t &variables, std::ostream &ostr) const |
| Searches given key in a map, and if found, processes (formats) the value to ostream. Return false, if variable not found. | |
| virtual bool | formatVariable (const std::string &key, const T &value, const std::string &format, std::ostream &ostr) const |
| Given a key, retrieve an associated value from the map and print the value formatted into a stream. | |
| virtual bool | formatVariable (const std::string &key, const T &value, const std::string &format, std::string &str) const final |
| Checks if variables have ODIM names (keys), and apply special formatting (currently with time stamps) | |
Static Public Member Functions | |
| static bool | formatValue (const T &value, const std::string &format, std::ostream &ostr) |
| Given a value, print it formatted to stream. | |
Public Attributes | |
| IosFormat | iosFormat |
Formats variables to output stream.
This base class supports following formatting:
| T | - type of the variables. |
|
inlinestatic |
Given a value, print it formatted to stream.
Formatting options are defined by the first character
Colon ':' selects substring like in bash, with syntax :<n>[:<startpos>]. Examples:
Percentage '' formats numbers as printf() function in C. Examples, given x = 1.4142135623
|
inlinevirtual |
Given a key, retrieve an associated value from the map and print the value formatted into a stream.
Default implementation discards key.
Reimplemented in VariableFormatterODIM< drain::VariableT >, and VariableFormatterODIM< T >.
|
inlinevirtual |
Searches given key in a map, and if found, processes (formats) the value to ostream. Return false, if variable not found.
Return false, if variable not found. Then, further processors may handle the variable tag (remove, change, leave it).
1.9.8