## GgitTreeBuilder GgitTreeBuilder |

## Synopsis

                        GgitTreeBuilder;
    struct              GgitTreeBuilderClass;
    void                ggit_tree_builder_remove            (GgitTreeBuilder *builder,
                                                             const gchar *path,
                                                             GError **error);
    void                ggit_tree_builder_clear             (GgitTreeBuilder *builder);
    GgitTreeEntry *     ggit_tree_builder_insert            (GgitTreeBuilder *builder,
                                                             const gchar *filename,
                                                             GgitOId *oid,
                                                             GgitFileMode file_mode,
                                                             GError **error);
    GgitOId *           ggit_tree_builder_write             (GgitTreeBuilder *builder,
                                                             GError **error);
    GgitTreeEntry *     ggit_tree_builder_get_entry         (GgitTreeBuilder *builder,
                                                             const gchar *path);

## Object Hierarchy

      GObject
       +----GgitObjectFactoryBase
             +----GgitNative
                   +----GgitTreeBuilder

## Description

## Details

### GgitTreeBuilder

    typedef struct _GgitTreeBuilder GgitTreeBuilder;

Represents a tree object.

### struct GgitTreeBuilderClass

    struct GgitTreeBuilderClass {
    };

The class structure for GgitTreeBuilderClass.

### ggit_tree_builder_remove ()

    void                ggit_tree_builder_remove            (GgitTreeBuilder *builder,
                                                             const gchar *path,
                                                             GError **error);

Remove an entry from the builder by path.

`builder` : | a GgitTreeBuilder.
`path` : | the path to remove.
`error` : | a GError for error reporting, or `NULL`.

### ggit_tree_builder_clear ()

    void                ggit_tree_builder_clear             (GgitTreeBuilder *builder);

Clear all entries in the tree builder.

`builder` : | a GgitTreeBuilder.

### ggit_tree_builder_insert ()

    GgitTreeEntry *     ggit_tree_builder_insert            (GgitTreeBuilder *builder,
                                                             const gchar *filename,
                                                             GgitOId *oid,
                                                             GgitFileMode file_mode,
                                                             GError **error);

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 GgitTreeEntry is bound to the lifetime of the tree builder and cannot be used after the tree builder has been freed.

`builder` : | a GgitTreeBuilder.
`filename` : | the file name.
`oid` : | the GgitOId of the file blob to insert.
`file_mode` : | a GgitFileMode.
`error` : | a GError for error reporting, or `NULL`.
Returns : | a GgitTreeEntry. [transfer full]

### ggit_tree_builder_write ()

    GgitOId *           ggit_tree_builder_write             (GgitTreeBuilder *builder,
                                                             GError **error);

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

`builder` : | a GgitTreeBuilder.
`error` : | a GError for error reporting, or `NULL`.
Returns : | the GgitOId of the created tree object.

### ggit_tree_builder_get_entry ()

    GgitTreeEntry *     ggit_tree_builder_get_entry         (GgitTreeBuilder *builder,
                                                             const gchar *path);

Get an entry by path.

`builder` : | a GgitTreeBuilder.
`path` : | the path to remove.
Returns : | the GGitTreeEntry or `NULL` if no such entry exists.