SplitStringRange is a range that iteratively performs a string split. More...
#include <kanzi/core.ui/binding/split_string_range.hpp>
Classes | |
struct | SplitPosition |
String position. More... | |
class | SplitStringRangeLocation |
Location implementation for split string range. More... | |
Public Member Functions | |
void | assignString (string_view inputString, string_view delimiter) |
Assign a new string. More... | |
SplitPosition | nextSplitPosition (size_t pos, bool delim) const |
Initializes the string to the next valid location. More... | |
SplitPosition | nextSplitPosition (const SplitPosition &splitPos) const |
Wrapper to nextSplitPosition that uses the input split position for advancing. More... | |
string | substr (size_t pos, size_t len) const |
Returns a sub-string from the internal test. More... | |
Public Member Functions inherited from kanzi::AbstractRange | |
bool | adaptView (AbstractRange &potentialViewRange, size_t length) |
Attempts to reuse a view over this range. More... | |
AbstractRangeIterator | beginIteration () |
Gets an iterator to the beginning of this range. More... | |
AbstractRangeSharedPtr | createView (size_t length) |
Creates a view over this range. More... | |
AbstractRangeSharedPtr | evaluate () |
Evaluate the abstract range. More... | |
AbstractRangeLocationPtr | locationBegin () |
Gets an iteratable location to beginning of the range. More... | |
virtual | ~AbstractRange ()=default |
Destructor. More... | |
Static Public Member Functions | |
static SplitStringRangeSharedPtr | create (string_view inputString, string_view delimiter) |
Creates a new split string range. More... | |
Protected Member Functions | |
AbstractRangeSharedPtr | evaluateOverride () override |
AbstractRange::evaluateOverride() implementation. More... | |
AbstractRangeLocationPtr | locationBeginOverride () override |
AbstractRange::locationBeginOverride() implementation. More... | |
SplitStringRange (string_view inputString, string_view delimiter) | |
Constructor. More... | |
Protected Member Functions inherited from kanzi::AbstractRange | |
AbstractRange ()=default | |
Constructor. More... | |
virtual bool | adaptViewOverride (AbstractRange &potentialViewRange, size_t length) |
Implementation-dependent adaptation of a view over the range. More... | |
virtual AbstractRangeSharedPtr | createViewOverride (size_t length) |
Implementation-dependent view over the range. More... | |
Protected Attributes | |
string | m_delimiter |
Delimiter. More... | |
SplitPosition | m_splitPos |
Split position. More... | |
string | m_text |
Text to split. More... | |
SplitStringRange is a range that iteratively performs a string split.
The string is split in a lazy manner, without creating storage for all the words separately.
|
explicitprotected |
Constructor.
inputString | Input string to split. |
delimiter | Split delimiter. |
|
static |
Creates a new split string range.
inputString | Input string to split. |
delimiter | Split delimiter. |
void kanzi::SplitStringRange::assignString | ( | string_view | inputString, |
string_view | delimiter | ||
) |
Assign a new string.
Called to reuse the split string range without destroying the range.
inputString | Input string to split. |
delimiter | Split delimiter. |
SplitPosition kanzi::SplitStringRange::nextSplitPosition | ( | size_t | pos, |
bool | delim | ||
) | const |
Initializes the string to the next valid location.
pos | Position to start looking for the next string. |
delim | If delimiter was the last thing read true, otherwise false. |
|
inline |
Wrapper to nextSplitPosition that uses the input split position for advancing.
splitPos | Previous split position. |
|
inline |
Returns a sub-string from the internal test.
pos | Position into string. |
len | Length of substring. |
|
overrideprotectedvirtual |
AbstractRange::evaluateOverride() implementation.
Reimplemented from kanzi::AbstractRange.
|
overrideprotectedvirtual |
AbstractRange::locationBeginOverride() implementation.
Implements kanzi::AbstractRange.
|
protected |
Text to split.
|
protected |
Delimiter.
|
protected |
Split position.