1#ifndef OSMIUM_UTIL_VERBOSE_OUTPUT_HPP
2#define OSMIUM_UTIL_VERBOSE_OUTPUT_HPP
47 inline namespace util {
78 const std::time_t elapsed =
runtime();
80 const char old_fill = std::cerr.fill();
81 std::cerr <<
'[' << std::setw(2) << (elapsed / 60) <<
':' << std::setw(2) << std::setfill(
'0') << (elapsed % 60) <<
"] ";
82 std::cerr.fill(old_fill);
96 return std::time(
nullptr) -
m_start;
109 template <
typename T>
116 std::ostringstream output_buffer;
117 output_buffer << value;
118 if (!output_buffer.str().empty() && output_buffer.str().back() ==
'\n') {
126 template <
typename T>
128 verbose_output.
print(value);
129 return verbose_output;
Definition: verbose_output.hpp:61
void start_line()
Definition: verbose_output.hpp:76
std::time_t m_start
all time output will be relative to this start time
Definition: verbose_output.hpp:64
std::time_t runtime() const noexcept
Definition: verbose_output.hpp:95
void print(const T &value)
Definition: verbose_output.hpp:110
bool m_newline
a newline was written, start next output with runtime
Definition: verbose_output.hpp:70
void verbose(bool verbose) noexcept
Set "verbose" setting.
Definition: verbose_output.hpp:105
bool verbose() const noexcept
Get "verbose" setting.
Definition: verbose_output.hpp:100
bool m_verbose
is verbose mode enabled?
Definition: verbose_output.hpp:67
VerboseOutput(bool verbose=false) noexcept
Definition: verbose_output.hpp:90
VerboseOutput & operator<<(VerboseOutput &verbose_output, const T &value)
Definition: verbose_output.hpp:127
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
Definition: location.hpp:555