Libosmium
2.15.4
Fast and flexible C++ library for working with OpenStreetMap data
|
Go to the documentation of this file. 1 #ifndef OSMIUM_UTIL_VERBOSE_OUTPUT_HPP
2 #define OSMIUM_UTIL_VERBOSE_OUTPUT_HPP
47 inline namespace util {
78 const 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);
110 template <
typename T>
117 std::ostringstream output_buffer;
118 output_buffer << value;
119 if (!output_buffer.str().empty() && output_buffer.str().back() ==
'\n') {
127 template <
typename T>
129 verbose_output.
print(value);
130 return verbose_output;
137 #endif // OSMIUM_UTIL_VERBOSE_OUTPUT_HPP
VerboseOutput(bool verbose=false) noexcept
Definition: verbose_output.hpp:90
bool m_newline
a newline was written, start next output with runtime
Definition: verbose_output.hpp:70
VerboseOutput & operator<<(VerboseOutput &verbose_output, const T &value)
Definition: verbose_output.hpp:128
Definition: verbose_output.hpp:61
bool verbose() const noexcept
Get "verbose" setting.
Definition: verbose_output.hpp:101
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
time_t m_start
all time output will be relative to this start time
Definition: verbose_output.hpp:64
void start_line()
Definition: verbose_output.hpp:76
time_t runtime() const noexcept
Definition: verbose_output.hpp:96
void print(const T &value)
Definition: verbose_output.hpp:111
void verbose(bool verbose) noexcept
Set "verbose" setting.
Definition: verbose_output.hpp:106
bool m_verbose
is verbose mode enabled?
Definition: verbose_output.hpp:67