Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
Represents the entries in an index object.
Synopsis
- newtype IndexEntries = IndexEntries (ManagedPtr IndexEntries)
- noIndexEntries :: Maybe IndexEntries
- indexEntriesGetByIndex :: (HasCallStack, MonadIO m) => IndexEntries -> Word64 -> m (Maybe IndexEntry)
- indexEntriesGetByPath :: (HasCallStack, MonadIO m, IsFile a) => IndexEntries -> a -> Int32 -> m (Maybe IndexEntry)
- indexEntriesRef :: (HasCallStack, MonadIO m) => IndexEntries -> m (Maybe IndexEntries)
- indexEntriesSize :: (HasCallStack, MonadIO m) => IndexEntries -> m Word32
- indexEntriesUnref :: (HasCallStack, MonadIO m) => IndexEntries -> m ()
Exported types
newtype IndexEntries Source #
Memory-managed wrapper type.
Instances
BoxedObject IndexEntries Source # | |
Defined in GI.Ggit.Structs.IndexEntries boxedType :: IndexEntries -> IO GType # |
noIndexEntries :: Maybe IndexEntries Source #
A convenience alias for Nothing
:: Maybe
IndexEntries
.
Methods
getByIndex
indexEntriesGetByIndex Source #
:: (HasCallStack, MonadIO m) | |
=> IndexEntries |
|
-> Word64 |
|
-> m (Maybe IndexEntry) | Returns: a |
Get a IndexEntry
by index. Note that the returned IndexEntry
is
_only_ valid as long as:
1) The associated index has been closed
2) The entry has not been removed (see indexRemove
)
3) The index has not been refreshed (see indexRead
)
Changes to the IndexEntry
will be reflected in the index once written
back to disk using indexWrite
.
getByPath
indexEntriesGetByPath Source #
:: (HasCallStack, MonadIO m, IsFile a) | |
=> IndexEntries |
|
-> a |
|
-> Int32 |
|
-> m (Maybe IndexEntry) | Returns: a |
Get a IndexEntry
by index. Note that the returned IndexEntry
is
_only_ valid as long as:
1) The associated index has not been closed
2) The entry has not been removed (see indexRemove
)
3) The index has not been refreshed (see indexRead
)
Changes to the IndexEntry
will be reflected in the index once written
back to disk using indexWrite
.
stage
indicates the stage to search the file for. Stages are used in the
index when merge conflicts occur, such that multiple versions of the same
file can be represented in the index. Stage 0 is associated with the working
tree, while stages 1 to 3 are associated with the various versions of the
file in a merge conflict. The special value -1 can be used to match the first
file encountered in any stage.
ref
:: (HasCallStack, MonadIO m) | |
=> IndexEntries |
|
-> m (Maybe IndexEntries) | Returns: a |
Atomically increments the reference count of entries
by one.
This function is MT-safe and may be called from any thread.
size
:: (HasCallStack, MonadIO m) | |
=> IndexEntries |
|
-> m Word32 | Returns: the number of entries. |
Get the number of IndexEntry
entries.
unref
:: (HasCallStack, MonadIO m) | |
=> IndexEntries |
|
-> m () |
Atomically decrements the reference count of entries
by one.
If the reference count drops to 0, entries
is freed.