BPNGClientLib
Library for accessing the Telemotive data logger devices
|
Helper functions. More...
#include <chrono>
#include <iosfwd>
#include <iostream>
#include <sstream>
#include <time.h>
#include <string.h>
#include <vector>
#include <sys/stat.h>
Go to the source code of this file.
Functions | |
const char * | progname (const char *path) |
Get the program name, similar to basename. | |
template<class Duration > | |
constexpr std::chrono::hours | toHours (const Duration &d) |
template<class Duration > | |
constexpr std::chrono::minutes | toMinutes (const Duration &d) |
template<class Duration > | |
constexpr std::chrono::seconds | toSeconds (const Duration &d) |
template<class Duration > | |
constexpr std::chrono::milliseconds | toMilliseconds (const Duration &d) |
template<class Duration > | |
constexpr std::chrono::microseconds | toMicroseconds (const Duration &d) |
template<class Duration > | |
constexpr std::chrono::nanoseconds | toNanoseconds (const Duration &d) |
template<typename Rep , typename Period > | |
timespec | toTimespec (const std::chrono::duration< Rep, Period > &d) |
Convert a chrono duration into a POSIX timespec. | |
std::ostream & | operator<< (std::ostream &os, const tm &_t) |
std::ostream & | operator<< (std::ostream &os, const timespec &_t) |
Output operator for struct timespec as used e.g. by pselect or nanosleep. More... | |
template<typename Rep , typename Period > | |
std::ostream & | operator<< (std::ostream &os, const std::chrono::duration< Rep, Period > &d) |
Output operator for a chrono duration. More... | |
template<typename Rep > | |
std::ostream & | operator<< (std::ostream &os, const std::chrono::duration< Rep, std::ratio< 1 >> &d) |
Output operator for a chrono duration with period one. More... | |
template<typename Rep > | |
std::ostream & | operator<< (std::ostream &os, const std::chrono::duration< Rep, std::milli > &d) |
Output operator for a chrono duration with Period milli. More... | |
template<typename Rep > | |
std::ostream & | operator<< (std::ostream &os, const std::chrono::duration< Rep, std::micro > &d) |
Output operator for a chrono duration with Period micro. More... | |
template<typename Rep > | |
std::ostream & | operator<< (std::ostream &os, const std::chrono::duration< Rep, std::nano > &d) |
Output operator for a chrono duration with Period nano. More... | |
template<typename Clock , typename Duration > | |
std::ostream & | operator<< (std::ostream &os, const std::chrono::time_point< Clock, Duration > &tp) |
int | mkdirPath (const std::string &_dirpath, int _mode=S_IRWXU|S_IRWXG|S_IRWXO) |
Helper functions.
std::ostream& operator<< | ( | std::ostream & | os, |
const timespec & | _t | ||
) |
Output operator for struct timespec as used e.g. by pselect or nanosleep.
Prints out the time specified in _t in seconds.
|
inline |
Output operator for a chrono duration.
If the duration has to be printed in a hh:mm:ss.ms notation you have to use e.g.
cout << toTimespec(d)
std::ostream& operator<< | ( | std::ostream & | os, |
const std::chrono::duration< Rep, std::ratio< 1 >> & | d | ||
) |
Output operator for a chrono duration with period one.
Formatting:
std::ostream& operator<< | ( | std::ostream & | os, |
const std::chrono::duration< Rep, std::milli > & | d | ||
) |
Output operator for a chrono duration with Period milli.
Formatting:
std::ostream& operator<< | ( | std::ostream & | os, |
const std::chrono::duration< Rep, std::micro > & | d | ||
) |
Output operator for a chrono duration with Period micro.
Formatting:
std::ostream& operator<< | ( | std::ostream & | os, |
const std::chrono::duration< Rep, std::nano > & | d | ||
) |
Output operator for a chrono duration with Period nano.
Formatting:
|
inline |
Output operator for a chrono time point. Prints the date and time since the epoch. The following adjustments can be done: