glib.sequence

Module for [Sequence] class

class Sequence

Types 1

The #GSequence struct is an opaque data type representing a sequence data type.

Fields
GSequence * _cInstancePtr
bool owned
Methods
void * _cPtr() nothrow
glib.sequence_iter.SequenceIter append(void * data = null) nothrowAdds a new item to the end of seq.
void foreach_(glib.types.Func func) nothrowCalls func for each item in the sequence passing user_data to the function. func must not modify the sequence itself.
glib.sequence_iter.SequenceIter getBeginIter() nothrowReturns the begin iterator for seq. Returns: the begin iterator for seq.
glib.sequence_iter.SequenceIter getEndIter() nothrowReturns the end iterator for seg Returns: the end iterator for seq
glib.sequence_iter.SequenceIter getIterAtPos(int pos) nothrowReturns the iterator at position pos. If pos is negative or larger than the number of items in seq, the end iterator is returned.
int getLength() nothrowReturns the positive length (>= 0) of seq. Note that this method is O(h) where `h' is the height of the tree. It is thus more efficient to use [glib.sequence.Sequence.isEmpty] when comparing the le...
glib.sequence_iter.SequenceIter insertSorted(void * data, glib.types.CompareDataFunc cmpFunc) nothrowInserts data into seq using cmp_func to determine the new position. The sequence must already be sorted according to cmp_func; otherwise the new position of data is undefined.
glib.sequence_iter.SequenceIter insertSortedIter(void * data, glib.types.SequenceIterCompareFunc iterCmp) nothrowLike [glib.sequence.Sequence.insertSorted], but uses a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as the compare function.
bool isEmpty() nothrowReturns true if the sequence contains zero items.
glib.sequence_iter.SequenceIter lookup(void * data, glib.types.CompareDataFunc cmpFunc) nothrowReturns an iterator pointing to the position of the first item found equal to data according to cmp_func and cmp_data. If more than one item is equal, it is not guaranteed that it is the first whic...
glib.sequence_iter.SequenceIter lookupIter(void * data, glib.types.SequenceIterCompareFunc iterCmp) nothrowLike [glib.sequence.Sequence.lookup], but uses a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as the compare function.
glib.sequence_iter.SequenceIter prepend(void * data = null) nothrowAdds a new item to the front of seq
glib.sequence_iter.SequenceIter search(void * data, glib.types.CompareDataFunc cmpFunc) nothrowReturns an iterator pointing to the position where data would be inserted according to cmp_func and cmp_data.
glib.sequence_iter.SequenceIter searchIter(void * data, glib.types.SequenceIterCompareFunc iterCmp) nothrowLike [glib.sequence.Sequence.search], but uses a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as the compare function.
void sort(glib.types.CompareDataFunc cmpFunc) nothrowSorts seq using cmp_func.
void sortIter(glib.types.SequenceIterCompareFunc cmpFunc) nothrowLike [glib.sequence.Sequence.sort], but uses a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as the compare function
void foreachRange(glib.sequence_iter.SequenceIter begin, glib.sequence_iter.SequenceIter end, glib.types.Func func) static nothrowCalls func for each item in the range (begin, end) passing user_data to the function. func must not modify the sequence itself.
void * get(glib.sequence_iter.SequenceIter iter) static nothrowReturns the data that iter points to.
glib.sequence_iter.SequenceIter insertBefore(glib.sequence_iter.SequenceIter iter, void * data = null) static nothrowInserts a new item just before the item pointed to by iter.
void move(glib.sequence_iter.SequenceIter src, glib.sequence_iter.SequenceIter dest) static nothrowMoves the item pointed to by src to the position indicated by dest. After calling this function dest will point to the position immediately after src. It is allowed for src and dest to point into d...
void moveRange(glib.sequence_iter.SequenceIter dest, glib.sequence_iter.SequenceIter begin, glib.sequence_iter.SequenceIter end) static nothrowInserts the (begin, end) range at the destination pointed to by dest. The begin and end iters must point into the same sequence. It is allowed for dest to point to a different sequence than the one...
glib.sequence_iter.SequenceIter rangeGetMidpoint(glib.sequence_iter.SequenceIter begin, glib.sequence_iter.SequenceIter end) static nothrowFinds an iterator somewhere in the range (begin, end). This iterator will be close to the middle of the range, but is not guaranteed to be exactly in the middle.
void remove(glib.sequence_iter.SequenceIter iter) static nothrowRemoves the item pointed to by iter. It is an error to pass the end iterator to this function.
void removeRange(glib.sequence_iter.SequenceIter begin, glib.sequence_iter.SequenceIter end) static nothrowRemoves all items in the (begin, end) range.
void set(glib.sequence_iter.SequenceIter iter, void * data = null) static nothrowChanges the data for the item pointed to by iter to be data. If the sequence has a data destroy function associated with it, that function is called on the existing data that iter pointed to.
void sortChanged(glib.sequence_iter.SequenceIter iter, glib.types.CompareDataFunc cmpFunc) static nothrowMoves the data pointed to by iter to a new position as indicated by cmp_func. This function should be called for items in a sequence already sorted according to cmp_func whenever some aspect of an ...
void sortChangedIter(glib.sequence_iter.SequenceIter iter, glib.types.SequenceIterCompareFunc iterCmp) static nothrowLike [glib.sequence.Sequence.sortChanged], but uses a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as the compare function.
void swap(glib.sequence_iter.SequenceIter a, glib.sequence_iter.SequenceIter b) static nothrowSwaps the items pointed to by `a` and `b`. It is allowed for `a` and `b` to point into difference sequences.
Constructors
this(void * ptr, Flag!"Take" take)
Destructors