Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A ValueArray
contains an array of Value
elements.
Synopsis
- newtype ValueArray = ValueArray (ManagedPtr ValueArray)
- newZeroValueArray :: MonadIO m => m ValueArray
- valueArrayAppend :: (HasCallStack, MonadIO m) => ValueArray -> Maybe GValue -> m ValueArray
- valueArrayCopy :: (HasCallStack, MonadIO m) => ValueArray -> m ValueArray
- valueArrayGetNth :: (HasCallStack, MonadIO m) => ValueArray -> Word32 -> m GValue
- valueArrayInsert :: (HasCallStack, MonadIO m) => ValueArray -> Word32 -> Maybe GValue -> m ValueArray
- valueArrayNew :: (HasCallStack, MonadIO m) => Word32 -> m ValueArray
- valueArrayPrepend :: (HasCallStack, MonadIO m) => ValueArray -> Maybe GValue -> m ValueArray
- valueArrayRemove :: (HasCallStack, MonadIO m) => ValueArray -> Word32 -> m ValueArray
- valueArraySort :: (HasCallStack, MonadIO m) => ValueArray -> CompareDataFunc -> m ValueArray
- getValueArrayNValues :: MonadIO m => ValueArray -> m Word32
- setValueArrayNValues :: MonadIO m => ValueArray -> Word32 -> m ()
- clearValueArrayValues :: MonadIO m => ValueArray -> m ()
- getValueArrayValues :: MonadIO m => ValueArray -> m (Maybe GValue)
- setValueArrayValues :: MonadIO m => ValueArray -> Ptr GValue -> m ()
Exported types
newtype ValueArray Source #
Memory-managed wrapper type.
ValueArray (ManagedPtr ValueArray) |
Instances
newZeroValueArray :: MonadIO m => m ValueArray Source #
Construct a ValueArray
struct initialized to zero.
Methods
Click to display all available methods, including inherited ones
append
:: (HasCallStack, MonadIO m) | |
=> ValueArray |
|
-> Maybe GValue |
|
-> m ValueArray | Returns: the |
copy
:: (HasCallStack, MonadIO m) | |
=> ValueArray |
|
-> m ValueArray | Returns: Newly allocated copy of |
Deprecated: (Since version 2.32)Use Array
and g_array_ref()
instead.
Construct an exact copy of a ValueArray
by duplicating all its
contents.
getNth
:: (HasCallStack, MonadIO m) | |
=> ValueArray |
|
-> Word32 |
|
-> m GValue | Returns: pointer to a value at |
Deprecated: (Since version 2.32)Use g_array_index()
instead.
Return a pointer to the value at index_
containd in valueArray
.
insert
:: (HasCallStack, MonadIO m) | |
=> ValueArray |
|
-> Word32 |
|
-> Maybe GValue |
|
-> m ValueArray | Returns: the |
new
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m ValueArray | Returns: a newly allocated |
Deprecated: (Since version 2.32)Use Array
and g_array_sized_new()
instead.
Allocate and initialize a new ValueArray
, optionally preserve space
for nPrealloced
elements. New arrays always contain 0 elements,
regardless of the value of nPrealloced
.
prepend
:: (HasCallStack, MonadIO m) | |
=> ValueArray |
|
-> Maybe GValue |
|
-> m ValueArray | Returns: the |
remove
:: (HasCallStack, MonadIO m) | |
=> ValueArray |
|
-> Word32 |
|
-> m ValueArray | Returns: the |
Deprecated: (Since version 2.32)Use Array
and g_array_remove_index()
instead.
Remove the value at position index_
from valueArray
.
sort
:: (HasCallStack, MonadIO m) | |
=> ValueArray |
|
-> CompareDataFunc |
|
-> m ValueArray | Returns: the |
Deprecated: (Since version 2.32)Use Array
and g_array_sort_with_data()
.
Sort valueArray
using compareFunc
to compare the elements according
to the semantics of CompareDataFunc
.
The current implementation uses the same sorting algorithm as standard
C qsort()
function.
Properties
nValues
number of values contained in the array
getValueArrayNValues :: MonadIO m => ValueArray -> m Word32 Source #
Get the value of the “n_values
” field.
When overloading is enabled, this is equivalent to
get
valueArray #nValues
setValueArrayNValues :: MonadIO m => ValueArray -> Word32 -> m () Source #
Set the value of the “n_values
” field.
When overloading is enabled, this is equivalent to
set
valueArray [ #nValues:=
value ]
values
array of values
clearValueArrayValues :: MonadIO m => ValueArray -> m () Source #
Set the value of the “values
” field to Nothing
.
When overloading is enabled, this is equivalent to
clear
#values
getValueArrayValues :: MonadIO m => ValueArray -> m (Maybe GValue) Source #
Get the value of the “values
” field.
When overloading is enabled, this is equivalent to
get
valueArray #values
setValueArrayValues :: MonadIO m => ValueArray -> Ptr GValue -> m () Source #
Set the value of the “values
” field.
When overloading is enabled, this is equivalent to
set
valueArray [ #values:=
value ]