Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
No description available in the introspection data.
Synopsis
- newtype TreePath = TreePath (ManagedPtr TreePath)
- noTreePath :: Maybe TreePath
- treePathAppendIndex :: (HasCallStack, MonadIO m) => TreePath -> Int32 -> m ()
- treePathCompare :: (HasCallStack, MonadIO m) => TreePath -> TreePath -> m Int32
- treePathCopy :: (HasCallStack, MonadIO m) => TreePath -> m TreePath
- treePathDown :: (HasCallStack, MonadIO m) => TreePath -> m ()
- treePathFree :: (HasCallStack, MonadIO m) => TreePath -> m ()
- treePathGetDepth :: (HasCallStack, MonadIO m) => TreePath -> m Int32
- treePathGetIndices :: (HasCallStack, MonadIO m) => TreePath -> m (Maybe [Int32])
- treePathIsAncestor :: (HasCallStack, MonadIO m) => TreePath -> TreePath -> m Bool
- treePathIsDescendant :: (HasCallStack, MonadIO m) => TreePath -> TreePath -> m Bool
- treePathNew :: (HasCallStack, MonadIO m) => m TreePath
- treePathNewFirst :: (HasCallStack, MonadIO m) => m TreePath
- treePathNewFromIndices :: (HasCallStack, MonadIO m) => [Int32] -> m TreePath
- treePathNewFromString :: (HasCallStack, MonadIO m) => Text -> m TreePath
- treePathNext :: (HasCallStack, MonadIO m) => TreePath -> m ()
- treePathPrependIndex :: (HasCallStack, MonadIO m) => TreePath -> Int32 -> m ()
- treePathPrev :: (HasCallStack, MonadIO m) => TreePath -> m Bool
- treePathToString :: (HasCallStack, MonadIO m) => TreePath -> m Text
- treePathUp :: (HasCallStack, MonadIO m) => TreePath -> m Bool
Exported types
Memory-managed wrapper type.
Methods
Overloaded methods
appendIndex
:: (HasCallStack, MonadIO m) | |
=> TreePath |
|
-> Int32 |
|
-> m () |
Appends a new index to a path.
As a result, the depth of the path is increased.
compare
:: (HasCallStack, MonadIO m) | |
=> TreePath |
|
-> TreePath |
|
-> m Int32 | Returns: the relative positions of |
Compares two paths.
If a
appears before b
in a tree, then -1 is returned.
If b
appears before a
, then 1 is returned.
If the two nodes are equal, then 0 is returned.
copy
:: (HasCallStack, MonadIO m) | |
=> TreePath |
|
-> m TreePath | Returns: a new |
Creates a new TreePath
-struct as a copy of path
.
down
:: (HasCallStack, MonadIO m) | |
=> TreePath |
|
-> m () |
Moves path
to point to the first child of the current path.
free
:: (HasCallStack, MonadIO m) | |
=> TreePath |
|
-> m () |
Frees path
. If path
is Nothing
, it simply returns.
getDepth
:: (HasCallStack, MonadIO m) | |
=> TreePath |
|
-> m Int32 | Returns: The depth of |
Returns the current depth of path
.
getIndices
:: (HasCallStack, MonadIO m) | |
=> TreePath |
|
-> m (Maybe [Int32]) | Returns: The current
indices, or |
Returns the current indices of path
.
This is an array of integers, each representing a node in a tree. It also returns the number of elements in the array. The array should not be freed.
Since: 3.0
isAncestor
:: (HasCallStack, MonadIO m) | |
=> TreePath |
|
-> TreePath |
|
-> m Bool | Returns: |
Returns True
if descendant
is a descendant of path
.
isDescendant
:: (HasCallStack, MonadIO m) | |
=> TreePath |
|
-> TreePath |
|
-> m Bool | Returns: |
Returns True
if path
is a descendant of ancestor
.
new
:: (HasCallStack, MonadIO m) | |
=> m TreePath | Returns: A newly created |
Creates a new TreePath
-struct.
This refers to a row.
newFirst
:: (HasCallStack, MonadIO m) | |
=> m TreePath | Returns: A new |
Creates a new TreePath
-struct.
The string representation of this path is “0”.
newFromIndices
treePathNewFromIndices Source #
:: (HasCallStack, MonadIO m) | |
=> [Int32] |
|
-> m TreePath | Returns: A newly created |
Creates a new path with the given indices
array of length
.
Since: 3.12
newFromString
treePathNewFromString Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m TreePath |
Creates a new TreePath
-struct initialized to path
.
path
is expected to be a colon separated list of numbers.
For example, the string “10:4:0” would create a path of depth
3 pointing to the 11th child of the root node, the 5th
child of that 11th child, and the 1st child of that 5th child.
If an invalid path string is passed in, Nothing
is returned.
next
:: (HasCallStack, MonadIO m) | |
=> TreePath |
|
-> m () |
Moves the path
to point to the next node at the current depth.
prependIndex
:: (HasCallStack, MonadIO m) | |
=> TreePath |
|
-> Int32 |
|
-> m () |
Prepends a new index to a path.
As a result, the depth of the path is increased.
prev
:: (HasCallStack, MonadIO m) | |
=> TreePath |
|
-> m Bool | Returns: |
Moves the path
to point to the previous node at the
current depth, if it exists.
toString
:: (HasCallStack, MonadIO m) | |
=> TreePath |
|
-> m Text | Returns: A newly-allocated string.
Must be freed with |
Generates a string representation of the path.
This string is a “:” separated list of numbers. For example, “4:10:0:3” would be an acceptable return value for this string.