gi-ggit-1.0.8: libgit2-glib bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Ggit.Objects.TreeBuilder

Description

Represents a tree object.

Synopsis

Exported types

newtype TreeBuilder Source #

Memory-managed wrapper type.

class (GObject o, IsDescendantOf TreeBuilder o) => IsTreeBuilder o Source #

Type class for types which can be safely cast to TreeBuilder, for instance with toTreeBuilder.

Instances

Instances details
(GObject o, IsDescendantOf TreeBuilder o) => IsTreeBuilder o Source # 
Instance details

Defined in GI.Ggit.Objects.TreeBuilder

toTreeBuilder :: (MonadIO m, IsTreeBuilder o) => o -> m TreeBuilder Source #

Cast to TreeBuilder, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

clear

treeBuilderClear Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeBuilder a) 
=> a

builder: a TreeBuilder.

-> m () 

Clear all entries in the tree builder.

getEntry

treeBuilderGetEntry Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeBuilder a) 
=> a

builder: a TreeBuilder.

-> Text

path: the path to remove.

-> m (Maybe TreeEntry)

Returns: the GGitTreeEntry or Nothing if no such entry exists.

Get an entry by path.

insert

treeBuilderInsert Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeBuilder a) 
=> a

builder: a TreeBuilder.

-> Text

filename: the file name.

-> OId

oid: the OId of the file blob to insert.

-> FileMode

fileMode: a FileMode.

-> m (Maybe TreeEntry)

Returns: a TreeEntry or Nothing. (Can throw GError)

Insert a file with a given blob in the tree builder. If the tree builder already contains an entry for the given file, then this entry will be overwritten.

Note that the returned TreeEntry is bound to the lifetime of the tree builder and cannot be used after the tree builder has been freed.

remove

treeBuilderRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeBuilder a) 
=> a

builder: a TreeBuilder.

-> Text

path: the path to remove.

-> m ()

(Can throw GError)

Remove an entry from the builder by path.

write

treeBuilderWrite Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeBuilder a) 
=> a

builder: a TreeBuilder.

-> m (Maybe OId)

Returns: the OId of the created tree object or Nothing. (Can throw GError)

Write the contents of the tree builder as a tree object.