Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
TextDecorator Class Reference

Utility for ... More...

#include <TextDecorator.h>

Inheritance diagram for TextDecorator:
Inheritance graph
[legend]
Collaboration diagram for TextDecorator:
Collaboration graph
[legend]

Public Types

typedef drain::EnumFlagger< drain::SingleFlagger< TextStyle::Colour > > ColourFlag
 
typedef drain::EnumFlagger< drain::MultiFlagger< TextStyle::Style > > StyleFlags
 
typedef drain::EnumFlagger< drain::SingleFlagger< TextStyle::Line > > LineFlag
 

Public Member Functions

 TextDecorator (const TextDecorator &deco)
 
std::ostream & begin (std::ostream &ostr) const
 
std::ostream & begin (std::ostream &ostr, const std::string &conf)
 
std::ostream & end (std::ostream &ostr) const
 
void setSeparator (const std::string &separator)
 
void reset ()
 
template<typename T , typename ... TT>
void set (T arg, const TT &... args)
 
template<typename ... TT>
void add (const std::string &keys, const TT &... args)
 Sets given keys. More...
 
template<typename ... TT>
void add (const char *keys, const TT &... args)
 Second case of strings...
 
template<typename ... TT>
void add (char *keys, const TT &... args)
 Third case of strings...
 
template<typename T , typename ... TT>
void add (T arg, const TT &... args)
 Adds several keys.
 
void add (TextStyle::Colour c)
 Change the current color setting.
 
void add (TextStyle::Line l)
 Change the current line setting.
 
void add (TextStyle::Style s)
 Change the current current style setting.
 
void debug (std::ostream &ostr) const
 

Public Attributes

ColourFlag color
 Read input stream until any char in endChars is encountered. The end char will not be included, but passed in input stream.
 
StyleFlags style
 
LineFlag line
 

Protected Member Functions

virtual std::ostream & _begin (std::ostream &ostr) const
 
virtual std::ostream & _end (std::ostream &ostr) const
 
void set ()
 
void add ()
 
void addKey (const std::string &key)
 
void addKeys (const std::string &keys)
 

Protected Attributes

std::string separator
 

Detailed Description

Utility for ...

Member Function Documentation

◆ add()

void add ( const std::string &  keys,
const TT &...  args 
)
inline

Sets given keys.

Adds separated keys. Essentially a string arg handler. Note: separate if's: accept DEFAULT and NONE - ?

◆ addKey()

void addKey ( const std::string &  key)
protected

Assumes key is a key (ie. "resolved", no string splitting needed)


The documentation for this class was generated from the following files: