...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.
// member classes/structs/unions
// Default formatter, always returns true
.
struct default_formatter {
// types
typedef void result_type;
// construct/copy/destruct
default_formatter();
// public member functions
result_type operator()(record_view const &, stream_type &) const;
};
// construct/copy/destruct
basic_formatter();
basic_formatter(basic_formatter const &);
basic_formatter(this_type &&);
template<typename FunT> basic_formatter(FunT const &);
basic_formatter& operator=(this_type &&);
basic_formatter& operator=(this_type const &);
template<typename FunT> basic_formatter& operator=(FunT const &);
// public member functions
result_type operator()(record_view const &, stream_type &) const;
void reset();
void swap(basic_formatter &);
};
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);
Move constructor
template<typename FunT> basic_formatter(FunT const & fun);
Initializing constructor. Creates a formatter which will invoke the specified function object.
basic_formatter& operator=(this_type && that);
Move assignment.
basic_formatter& operator=(this_type const & that);
Copy assignment.
template<typename FunT> basic_formatter& operator=(FunT const & 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);
Swaps two formatters