All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
hext::StringPipe Class Referenceabstract

Abstract base for every StringPipe. More...

Inheritance diagram for hext::StringPipe:
Inheritance graph
[legend]

Public Member Functions

 StringPipe () noexcept
 
 StringPipe (const StringPipe &other)
 
 StringPipe (StringPipe &&) noexcept=default
 
StringPipeoperator= (const StringPipe &other)
 
StringPipeoperator= (StringPipe &&) noexcept=default
 
virtual ~StringPipe () noexcept=default
 
virtual std::unique_ptr
< StringPipe
clone () const =0
 Clones derived object. More...
 
virtual std::string transform (std::string str) const =0
 Transforms str. More...
 
std::string pipe (std::string str) const
 Calls StringPipe::transform successively until the whole StringPipe chain was traversed. More...
 
void append (std::unique_ptr< StringPipe > pipe) noexcept
 Append a StringPipe at the end of the chain. More...
 
template<typename StringPipeType , typename... Args>
void emplace (Args &&...arg)
 Construct a StringPipe at the end of the chain. More...
 

Detailed Description

Abstract base for every StringPipe.

A StringPipe transforms a given string into another one, for example a TrimPipe removes all left and right whitespace from a string. StringPipes can be chained ("linked list").

Note: You probably don't want to inherit from this class directly, unless you want to provide your own StringPipe::clone() method. If your subclass has a copy constructor, you can extend from hext::Cloneable<YourSubclass, hext::StringPipe> which provides a generic clone method.

Definition at line 38 of file StringPipe.h.

Constructor & Destructor Documentation

hext::StringPipe::StringPipe ( )
noexcept
hext::StringPipe::StringPipe ( const StringPipe other)
hext::StringPipe::StringPipe ( StringPipe &&  )
defaultnoexcept
virtual hext::StringPipe::~StringPipe ( )
virtualdefaultnoexcept

Member Function Documentation

void hext::StringPipe::append ( std::unique_ptr< StringPipe pipe)
noexcept

Append a StringPipe at the end of the chain.

virtual std::unique_ptr<StringPipe> hext::StringPipe::clone ( ) const
pure virtual
template<typename StringPipeType , typename... Args>
void hext::StringPipe::emplace ( Args &&...  arg)
inline

Construct a StringPipe at the end of the chain.

Definition at line 68 of file StringPipe.h.

StringPipe& hext::StringPipe::operator= ( const StringPipe other)
StringPipe& hext::StringPipe::operator= ( StringPipe &&  )
defaultnoexcept
std::string hext::StringPipe::pipe ( std::string  str) const

Calls StringPipe::transform successively until the whole StringPipe chain was traversed.

Returns
The result of applying this StringPipe and every connected one to str.
virtual std::string hext::StringPipe::transform ( std::string  str) const
pure virtual

Transforms str.

Note: Use StringPipe::pipe to apply all transformations in this chain.

Implemented in hext::RegexPipe, hext::RegexReplacePipe, hext::CasePipe, hext::CollapseWsPipe, hext::TrimPipe, hext::AppendPipe, and hext::PrependPipe.


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