...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::expressions::max_size_decorator_terminal
// In header: <boost/log/expressions/formatters/max_size_decorator.hpp> template<typename SubactorT, typename CharT> class max_size_decorator_terminal { public: // types typedef CharT char_type; // Character type. typedef std::basic_string< char_type > string_type; // String type. typedef std::size_t size_type; // String size type. typedef basic_formatting_ostream< char_type > stream_type; // Stream type. typedef SubactorT subactor_type; // Adopted actor type. typedef string_type result_type; // Result type definition. // construct/copy/destruct max_size_decorator_terminal(subactor_type const &, size_type, string_type const & = string_type()); max_size_decorator_terminal(max_size_decorator_terminal const &); max_size_decorator_terminal() = delete; // public member functions subactor_type const & get_subactor() const; size_type get_max_size() const; string_type const & get_overflow_marker() const; template<typename ContextT> result_type operator()(ContextT const &); template<typename ContextT> result_type operator()(ContextT const &) const; };
String size limiting decorator terminal class. This formatter allows to limit the maximum total length of the strings generated by other formatters.
The max_size_decorator_terminal
class aggregates the formatter being decorated, the maximum string length it can produce and an optional truncation marker string, which will be put at the end of the output if the limit is exceeded. Note that the marker length is included in the limit and as such must not exceed it. The max_size_decorator_terminal
class is a formatter itself, so it can be used to construct more complex formatters, including nesting decorators.
max_size_decorator_terminal
public
construct/copy/destructmax_size_decorator_terminal(subactor_type const & sub, size_type max_size, string_type const & overflow_marker = string_type());
Initializing constructor.
max_size_decorator_terminal(max_size_decorator_terminal const & that);
Copy constructor
max_size_decorator_terminal() = delete;
max_size_decorator_terminal
public member functionssubactor_type const & get_subactor() const;
Returns: |
Adopted subactor |
size_type get_max_size() const;
Returns: |
Max string size limit |
string_type const & get_overflow_marker() const;
Returns: |
Max string size limit |
template<typename ContextT> result_type operator()(ContextT const & ctx);
Invokation operator
template<typename ContextT> result_type operator()(ContextT const & ctx) const;
Invokation operator