...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::log::basic_formatter
// In header: <boost/log/expressions/formatter.hpp> template<typename CharT> class basic_formatter { public: // types typedef void result_type; // Result type. typedef CharT char_type; // Character type. typedef basic_formatting_ostream< char_type > stream_type; // Output stream type. // construct/copy/destruct basic_formatter(); basic_formatter(basic_formatter const &); basic_formatter(this_type &&) noexcept; template<typename FunT> basic_formatter(FunT &&); basic_formatter & operator=(this_type &&) noexcept; basic_formatter & operator=(this_type const &); template<typename FunT> basic_formatter & operator=(FunT &&); // public member functions result_type operator()(record_view const &, stream_type &) const; void reset(); void swap(basic_formatter &) noexcept; };
Log record formatter function wrapper.
basic_formatter
public
construct/copy/destructbasic_formatter();
Default constructor. Creates a formatter that only outputs log message.
basic_formatter(basic_formatter const & that);
Copy constructor
basic_formatter(this_type && that) noexcept;
Move constructor. The moved-from formatter is left in an unspecified state.
template<typename FunT> basic_formatter(FunT && fun);
Initializing constructor. Creates a formatter which will invoke the specified function object.
basic_formatter & operator=(this_type && that) noexcept;
Move assignment. The moved-from formatter is left in an unspecified state.
basic_formatter & operator=(this_type const & that);
Copy assignment.
template<typename FunT> basic_formatter & operator=(FunT && fun);
Initializing assignment. Sets the specified function object to the formatter.
basic_formatter
public member functionsresult_type operator()(record_view const & rec, stream_type & strm) const;
Formatting operator.
Parameters: |
|
void reset();
Resets the formatter to the default. The default formatter only outputs message text.
void swap(basic_formatter & that) noexcept;
Swaps two formatters