ISplitIterator

Base class

Members

Functions

locateDelim
size_t locateDelim(cstring str, size_t start)

Locates the first delimiter occurrence in str starting from strstart.

locateDelim
size_t locateDelim(size_t start)

Locates the first delimiter occurrence in the current content string starting from contentstart.

n
uint n()
next
cstring next()

Searches the next delimiter.

opApply
int opApply(int delegate(ref cstring segment) dg_in)

'foreach' iteration over string slices between the current and the next delimiter. n() returns the number of 'foreach' loop cycles so far, remaining() the slice after the next delimiter to the content end. If no delimiter was found, n() is 0 after 'foreach' has finished and remaining() returns the content.

opApply
int opApply(int delegate(ref size_t pos, ref cstring segment) dg_in)

'foreach' iteration over string slices between the current and the next delimiter. n() returns the number of 'foreach' loop cycles so far, remaining() the slice after the next delimiter to the content end. If no delimiter was found, n() is 0 after 'foreach' has finished and remaining() returns the content.

opApply_
int opApply_(bool with_pos, IterationDelegate dg)

'foreach' iteration over string slices between the current and the next delimiter.

remaining
cstring remaining()
reset
typeof(this) reset(cstring content)

Sets the content string to split on next iteration.

skipDelim
size_t skipDelim(cstring str)

Skips the delimiter which str starts with. The return value is at most str.length. It is assured that str starts with a delimiter so a subclass may return an undefined result otherwise. Additionally, a subclass is encouraged to use an 'in' contract to ensure str starts with a delimiter and/or is long enought to skip a leading delimiter.

skipLeadingDelims
cstring skipLeadingDelims()

Skips initial consecutive occurrences of the current delimiter in the currently remaining content.

Static functions

trim
cstring trim(cstring str)

Trims white space from str.

Unions

IterationDelegate
union IterationDelegate

Union of the supported 'foreach' iteration delegate types

Variables

collapse
bool collapse;

Set to true to collapse consecutive delimiter occurrences to a single one to prevent producing empty segments.

include_remaining
bool include_remaining;

Set to true to do a 'foreach' cycle with the remaining content after the last delimiter occurrence or when no delimiter is found.

Meta