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. | |
| SplitPosition | nextSplitPosition (const SplitPosition &splitPos) const |
| Wrapper to nextSplitPosition that uses the input split position for advancing. | |
| SplitPosition | nextSplitPosition (size_t pos, bool delim) const |
| Initializes the string to the next valid location. | |
| string | substr (size_t pos, size_t len) const |
| Returns a sub-string from the internal test. | |
Public Member Functions inherited from kanzi::AbstractRange | |
| bool | adaptView (AbstractRange &potentialViewRange, size_t length) |
| Attempts to reuse a view over this range. | |
| AbstractRangeIterator | beginIteration () |
| Gets an iterator to the beginning of this range. | |
| AbstractRangeSharedPtr | clone () |
| Creates a copy of the range. | |
| void | cloneInto (AbstractRangeSharedPtr &other) |
| Clones the range into another range. | |
| AbstractRangeSharedPtr | createView (size_t length) |
| Creates a view over this range. | |
| AbstractRangeSharedPtr | evaluate () |
| Evaluate the abstract range. | |
| AbstractRangeLocationPtr | locationBegin () |
| Gets an iteratable location to beginning of the range. | |
| virtual | ~AbstractRange ()=default |
| Destructor. | |
Static Public Member Functions | |
| static SplitStringRangeSharedPtr | create (string_view inputString, string_view delimiter) |
| Creates a new split string range. | |
| static SplitStringRangeSharedPtr | create (string_view inputString, string_view delimiter, SplitPosition splitPos) |
| Creates a new split string range to a given split position. | |
Protected Member Functions | |
| void | cloneIntoOverride (AbstractRangeSharedPtr &other) override |
| AbstractRange::cloneIntoOverride() implementation. | |
| AbstractRangeSharedPtr | cloneOverride () override |
| AbstractRange::cloneOverride() implementation. | |
| AbstractRangeSharedPtr | evaluateOverride () override |
| AbstractRange::evaluateOverride() implementation. | |
| AbstractRangeLocationPtr | locationBeginOverride () override |
| AbstractRange::locationBeginOverride() implementation. | |
| SplitStringRange (string_view inputString, string_view delimiter) | |
| Constructor. | |
| SplitStringRange (string_view inputString, string_view delimiter, SplitPosition splitPos) | |
| Constructor. | |
Protected Member Functions inherited from kanzi::AbstractRange | |
| AbstractRange ()=default | |
| Constructor. | |
| virtual bool | adaptViewOverride (AbstractRange &potentialViewRange, size_t length) |
| Implementation-dependent adaptation of a view over the range. | |
| virtual AbstractRangeSharedPtr | createViewOverride (size_t length) |
| Implementation-dependent view over the range. | |
Protected Attributes | |
| string | m_delimiter |
| Delimiter. | |
| SplitPosition | m_splitPos |
| Split position. | |
| string | m_text |
| Text to split. | |
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.
|
inlineexplicitprotected |
Constructor.
| inputString | Input string to split. |
| delimiter | Split delimiter. |
|
inlineexplicitprotected |
Constructor.
| inputString | Input string to split. |
| delimiter | Split delimiter. |
| splitPos | Split position. |
|
static |
Creates a new split string range.
| inputString | Input string to split. |
| delimiter | Split delimiter. |
|
static |
Creates a new split string range to a given split position.
| inputString | Input string to split. |
| delimiter | Split delimiter. |
| splitPos | Split position. |
|
inline |
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::cloneOverride() implementation.
Implements kanzi::AbstractRange.
|
overrideprotectedvirtual |
AbstractRange::cloneIntoOverride() implementation.
Implements kanzi::AbstractRange.
|
overrideprotectedvirtual |
AbstractRange::evaluateOverride() implementation.
Reimplemented from kanzi::AbstractRange.
|
overrideprotectedvirtual |
AbstractRange::locationBeginOverride() implementation.
Implements kanzi::AbstractRange.
|
protected |
Text to split.
|
protected |
Delimiter.
|
protected |
Split position.