31 #ifndef VARIABLE_FORMATTER_ODIM
32 #define VARIABLE_FORMATTER_ODIM
40 #include <drain/util/VariableFormatter.h>
41 #include <drain/util/Time.h>
69 typedef typename drain::VariableFormatter<T>::map_t map_t;
89 bool formatDate(std::ostream & ostr,
const std::string & key,
const T & value,
const std::string & format =
"%Y/%m/%d"){
98 if (ODIM::dateKeys.count(key) > 0){
111 bool formatTime(std::ostream & ostr,
const std::string & key,
const T & value,
const std::string & format =
"%H:%M"){
120 if (ODIM::timeKeys.count(key) > 0){
133 bool formatPlace(std::ostream & ostr,
const std::string & key,
const T & value,
const std::string & format =
""){
135 if (ODIM::locationKeys.count(key) > 0){
147 bool formatVariable(
const std::string & key,
const T & value,
const std::string & format, std::ostream & ostr)
const override {
152 if (format.find(
'%') != std::string::npos){
158 else if (
formatTime(ostr, key, value, format)){
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition: Log.h:308
Utility for handling time. Internally, uses tm (C time structure).
Definition: Time.h:54
const std::string & str(const std::string &format="") const
Returns the std::string using formatting as defined by strftime()
Definition: Time.cpp:76
Definition: DataSelector.cpp:44