Public Types | Public Member Functions | Static Public Member Functions | List of all members
VariableFormatterODIM< T > Class Template Reference

Formats variables to output stream. More...

#include <VariableFormatterODIM.h>

Inheritance diagram for VariableFormatterODIM< T >:
Inheritance graph
[legend]
Collaboration diagram for VariableFormatterODIM< T >:
Collaboration graph
[legend]

Public Types

typedef drain::VariableFormatter< T >::map_t map_t
 
- Public Types inherited from VariableFormatter< T >
typedef std::map< std::string, T > map_t
 

Public Member Functions

virtual bool formatVariable (const std::string &key, const T &value, const std::string &format, std::ostream &ostr) const override
 Checks if variables have ODIM names (keys), and apply special formatting (currently with time stamps)
 
- Public Member Functions inherited from VariableFormatter< T >
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. More...
 

Static Public Member Functions

static bool formatDate (std::ostream &ostr, const std::string &key, const T &value, const std::string &format="%Y/%m/%d")
 Recognizes and format a date. Assumes that the variable name (key ) ends with "date".
 
static bool formatTime (std::ostream &ostr, const std::string &key, const T &value, const std::string &format="%H:%M")
 Reformat a time. Assumes that the variable name (key ) ends with "time".
 
static bool formatPlace (std::ostream &ostr, const std::string &key, const T &value, const std::string &format="")
 Currently, only recognizes a place, and writes it directly in stream.
 
- Static Public Member Functions inherited from VariableFormatter< T >
static bool formatValue (const T &value, const std::string &format, std::ostream &ostr)
 Given a value, print it formatted to stream.
 

Additional Inherited Members

- Public Attributes inherited from VariableFormatter< T >
IosFormat iosFormat
 

Detailed Description

template<class T>
class rack::VariableFormatterODIM< T >

Formats variables to output stream.

This class inherits the following formatting options from the base class:

printf() style formatting, like "%08.2d"

bash substring style formatting, like ":2:3" (take 3 letters, starting from position 2)

In addition, this class formats ODIM time stamps (what:time, what:startdate, ...)

Time formatting, like the date command

Template Parameters
T- type of the variables.
See also
StringLet
StringMapper

The documentation for this class was generated from the following file: