Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Class template char_decorator_terminal



// In header: <boost/log/expressions/formatters/char_decorator.hpp>

template<typename SubactorT, typename ImplT> 
class char_decorator_terminal {
  // types
  typedef ImplT                                 impl_type;      // Implementation type. 
  typedef impl_type::char_type                  char_type;      // Character type. 
  typedef impl_type::string_type                string_type;    // String 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
  char_decorator_terminal(subactor_type const &, impl_type const &);
  char_decorator_terminal(char_decorator_terminal const &);
  char_decorator_terminal() = delete;

  // public member functions
  subactor_type const & get_subactor() const;
  impl_type const & get_impl() const;
  template<typename ContextT> result_type operator()(ContextT const &);
  template<typename ContextT> result_type operator()(ContextT const &) const;


Character decorator terminal class. This formatter allows to modify strings generated by other formatters on character level. The most obvious application of decorators is replacing a certain set of characters with decorated equivalents to satisfy requirements of text-based sinks.

The char_decorator_terminal class aggregates the formatter being decorated, and a set of string pairs that are used as decorations. All decorations are applied sequentially. The char_decorator_terminal class is a formatter itself, so it can be used to construct more complex formatters, including nesting decorators.

char_decorator_terminal public construct/copy/destruct

  1. char_decorator_terminal(subactor_type const & sub, impl_type const & impl);

    Initializing constructor.

  2. char_decorator_terminal(char_decorator_terminal const & that);

    Copy constructor

  3. char_decorator_terminal() = delete;

char_decorator_terminal public member functions

  1. subactor_type const & get_subactor() const;


    Adopted subactor

  2. impl_type const & get_impl() const;



  3. template<typename ContextT> result_type operator()(ContextT const & ctx);

    Invokation operator

  4. template<typename ContextT> result_type operator()(ContextT const & ctx) const;

    Invokation operator