nidas v1.2.3
Public Member Functions | Private Attributes | Friends | List of all members
nidas::util::UTime_stream_manip< charT > Class Template Reference

class for changing output format of UTime on ostream, in a way like the standard stream manipulator classes. More...

#include <UTime.h>

Public Member Functions

 UTime_stream_manip (std::basic_ostream< charT, std::char_traits< charT > > &(*f)(std::basic_ostream< charT, std::char_traits< charT > > &, const std::string &), const std::string &fmt)
 Constructor of manipulator.
 

Private Attributes

std::string _fmt
 
std::basic_ostream< charT, std::char_traits< charT > > &(* _f )(std::basic_ostream< charT, std::char_traits< charT > > &, const std::string &)
 Pointer to function that does a manipulation on a ostream with a string argument.
 

Friends

template<typename charTx >
std::basic_ostream< charTx, std::char_traits< charTx > > & operator<< (std::basic_ostream< charTx, std::char_traits< charTx > > &os, const UTime_stream_manip< charTx > &m)
 << operator of this manipulator on an ostream.
 

Detailed Description

template<typename charT>
class nidas::util::UTime_stream_manip< charT >

class for changing output format of UTime on ostream, in a way like the standard stream manipulator classes.

This supports doing: using namespace nidas::util; cout << setTZ<char>("PST8PDT") << setDefaultFormat("%H%M%S") << ut << endl; or (if we use the template class): cout << setTZ<char>("PST8PDT") << setDefaultFormat<char>("%H%M%S") << ut << endl;

Constructor & Destructor Documentation

◆ UTime_stream_manip()

template<typename charT >
nidas::util::UTime_stream_manip< charT >::UTime_stream_manip ( std::basic_ostream< charT, std::char_traits< charT > > &(*)(std::basic_ostream< charT, std::char_traits< charT > > &, const std::string &) f,
const std::string & fmt )
inline

Constructor of manipulator.

Parameters
fA function that returns a reference to an ostream, with arguments of the ostream reference and a string.

Friends And Related Symbol Documentation

◆ operator<<

template<typename charT >
template<typename charTx >
std::basic_ostream< charTx, std::char_traits< charTx > > & operator<< ( std::basic_ostream< charTx, std::char_traits< charTx > > & os,
const UTime_stream_manip< charTx > & m )
friend

<< operator of this manipulator on an ostream.

Invokes the function that was passed to the constructor.

Member Data Documentation

◆ _f

template<typename charT >
std::basic_ostream< charT, std::char_traits< charT > > &(* nidas::util::UTime_stream_manip< charT >::_f) (std::basic_ostream< charT, std::char_traits< charT > > &, const std::string &)
private

Pointer to function that does a manipulation on a ostream with a string argument.

◆ _fmt

template<typename charT >
std::string nidas::util::UTime_stream_manip< charT >::_fmt
private

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