gi-glib-2.0.13: GLib bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.GLib.Structs.Sequence

Contents

Description

The Sequence struct is an opaque data type representing a [sequence][glib-Sequences] data type.

Synopsis

Exported types

Methods

free

sequenceFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sequence

seq: a Sequence

-> m () 

Frees the memory allocated for seq. If seq has a data destroy function associated with it, that function is called on all items in seq.

Since: 2.14

get

sequenceGet Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SequenceIter

iter: a SequenceIter

-> m (Ptr ())

Returns: the data that iter points to

Returns the data that iter points to.

Since: 2.14

getLength

sequenceGetLength Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sequence

seq: a Sequence

-> m Int32

Returns: the length of seq

Returns the length of seq. Note that this method is O(h) where `h' is the height of the tree. It is thus more efficient to use sequenceIsEmpty when comparing the length to zero.

Since: 2.14

isEmpty

sequenceIsEmpty Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sequence

seq: a Sequence

-> m Bool

Returns: True if the sequence is empty, otherwise False.

Returns True if the sequence contains zero items.

This function is functionally identical to checking the result of sequenceGetLength being equal to zero. However this function is implemented in O(1) running time.

Since: 2.48

move

sequenceMove Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SequenceIter

src: a SequenceIter pointing to the item to move

-> SequenceIter

dest: a SequenceIter pointing to the position to which the item is moved

-> m () 

Moves 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 different sequences.

Since: 2.14

moveRange

sequenceMoveRange Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SequenceIter

dest: a SequenceIter

-> SequenceIter

begin: a SequenceIter

-> SequenceIter

end: a SequenceIter

-> m () 

Inserts the (begin, end) range at the destination pointed to by ptr. 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 pointed into by begin and end.

If dest is NULL, the range indicated by begin and end is removed from the sequence. If dest iter points to a place within the (begin, end) range, the range does not move.

Since: 2.14

remove

sequenceRemove Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SequenceIter

iter: a SequenceIter

-> m () 

Removes the item pointed to by iter. It is an error to pass the end iterator to this function.

If the sequence has a data destroy function associated with it, this function is called on the data for the removed item.

Since: 2.14

removeRange

sequenceRemoveRange Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SequenceIter

begin: a SequenceIter

-> SequenceIter

end: a SequenceIter

-> m () 

Removes all items in the (begin, end) range.

If the sequence has a data destroy function associated with it, this function is called on the data for the removed items.

Since: 2.14

set

sequenceSet Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SequenceIter

iter: a SequenceIter

-> Ptr ()

data: new data for the item

-> m () 

Changes 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.

Since: 2.14

swap

sequenceSwap Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SequenceIter

a: a SequenceIter

-> SequenceIter

b: a SequenceIter

-> m () 

Swaps the items pointed to by a and b. It is allowed for a and b to point into difference sequences.

Since: 2.14