libhext: C++ Library Documentation
1.0.12-3ea013c
|
Abstract base for every StringPipe. More...
Public Member Functions | |
StringPipe () noexcept | |
StringPipe (const StringPipe &other) | |
StringPipe (StringPipe &&) noexcept=default | |
StringPipe & | operator= (const StringPipe &other) |
StringPipe & | operator= (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... | |
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 40 of file StringPipe.h.
|
noexcept |
hext::StringPipe::StringPipe | ( | const StringPipe & | other | ) |
|
defaultnoexcept |
|
virtualdefaultnoexcept |
|
noexcept |
Append a StringPipe at the end of the chain.
|
pure virtual |
Clones derived object.
Implemented in hext::Cloneable< TrimPipe, StringPipe >, hext::Cloneable< RegexPipe, StringPipe >, hext::Cloneable< PrependPipe, StringPipe >, hext::Cloneable< CasePipe, StringPipe >, hext::Cloneable< CollapseWsPipe, StringPipe >, hext::Cloneable< RegexReplacePipe, StringPipe >, and hext::Cloneable< AppendPipe, StringPipe >.
|
inline |
Construct a StringPipe at the end of the chain.
Definition at line 70 of file StringPipe.h.
StringPipe& hext::StringPipe::operator= | ( | const StringPipe & | other | ) |
|
defaultnoexcept |
std::string hext::StringPipe::pipe | ( | std::string | str | ) | const |
Calls StringPipe::transform successively until the whole StringPipe chain was traversed.
|
pure virtual |
Transforms str.
Note: Use StringPipe::pipe to apply all transformations in this chain.
Implemented in hext::TrimPipe, hext::RegexReplacePipe, hext::RegexPipe, hext::PrependPipe, hext::CollapseWsPipe, hext::CasePipe, and hext::AppendPipe.