Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
An opaque, stack-allocated struct for iterating
over the elements of a GtkBitset
.
Before a GtkBitsetIter
can be used, it needs to be initialized with
[funcgtk
.BitsetIter.init_first], [funcgtk
.BitsetIter.init_last]
or [funcgtk
.BitsetIter.init_at].
Synopsis
- newtype BitsetIter = BitsetIter (ManagedPtr BitsetIter)
- newZeroBitsetIter :: MonadIO m => m BitsetIter
- bitsetIterGetValue :: (HasCallStack, MonadIO m) => BitsetIter -> m Word32
- bitsetIterInitAt :: (HasCallStack, MonadIO m) => Bitset -> Word32 -> m (Bool, BitsetIter, Word32)
- bitsetIterInitFirst :: (HasCallStack, MonadIO m) => Bitset -> m (Bool, BitsetIter, Word32)
- bitsetIterInitLast :: (HasCallStack, MonadIO m) => Bitset -> m (Bool, BitsetIter, Word32)
- bitsetIterIsValid :: (HasCallStack, MonadIO m) => BitsetIter -> m Bool
- bitsetIterNext :: (HasCallStack, MonadIO m) => BitsetIter -> m (Bool, Word32)
- bitsetIterPrevious :: (HasCallStack, MonadIO m) => BitsetIter -> m (Bool, Word32)
Exported types
newtype BitsetIter Source #
Memory-managed wrapper type.
BitsetIter (ManagedPtr BitsetIter) |
Instances
newZeroBitsetIter :: MonadIO m => m BitsetIter Source #
Construct a BitsetIter
struct initialized to zero.
Methods
Click to display all available methods, including inherited ones
getValue
:: (HasCallStack, MonadIO m) | |
=> BitsetIter |
|
-> m Word32 | Returns: The current value pointer to by |
Gets the current value that iter
points to.
If iter
is not valid and bitsetIterIsValid
returns False
, this function returns 0.
initAt
:: (HasCallStack, MonadIO m) | |
=> Bitset |
|
-> Word32 |
|
-> m (Bool, BitsetIter, Word32) | Returns: |
Initializes iter
to point to target
.
If target
is not found, finds the next value after it.
If no value >= target
exists in set
, this function returns False
.
initFirst
:: (HasCallStack, MonadIO m) | |
=> Bitset |
|
-> m (Bool, BitsetIter, Word32) | Returns: |
Initializes an iterator for set
and points it to the first
value in set
.
If set
is empty, False
is returned and value
is set to G_MAXUINT
.
initLast
:: (HasCallStack, MonadIO m) | |
=> Bitset |
|
-> m (Bool, BitsetIter, Word32) | Returns: |
Initializes an iterator for set
and points it to the last
value in set
.
If set
is empty, False
is returned.
isValid
:: (HasCallStack, MonadIO m) | |
=> BitsetIter |
|
-> m Bool | Returns: |
Checks if iter
points to a valid value.
next
:: (HasCallStack, MonadIO m) | |
=> BitsetIter |
|
-> m (Bool, Word32) | Returns: |
Moves iter
to the next value in the set.
If it was already pointing to the last value in the set,
False
is returned and iter
is invalidated.
previous
:: (HasCallStack, MonadIO m) | |
=> BitsetIter |
|
-> m (Bool, Word32) | Returns: |
Moves iter
to the previous value in the set.
If it was already pointing to the first value in the set,
False
is returned and iter
is invalidated.