GgitIndex

GgitIndex

Synopsis

                    GgitIndex;
struct              GgitIndexClass;
GgitIndex *         ggit_index_open                     (GFile *file,
                                                         GError **error);
gboolean            ggit_index_read                     (GgitIndex *idx,
                                                         GError **error);
gboolean            ggit_index_write                    (GgitIndex *idx,
                                                         GError **error);
gboolean            ggit_index_remove                   (GgitIndex *idx,
                                                         GFile *file,
                                                         gint stage,
                                                         GError **error);
gboolean            ggit_index_add                      (GgitIndex *idx,
                                                         GgitIndexEntry *entry,
                                                         GError **error);
GgitIndexEntries *  ggit_index_get_entries              (GgitIndex *idx);
GgitIndexEntriesResolveUndo * ggit_index_get_entries_resolve_undo
                                                        (GgitIndex *idx);

Object Hierarchy

  GObject
   +----GgitObjectFactoryBase
         +----GgitNative
               +----GgitIndex

Implemented Interfaces

GgitIndex implements GInitable.

Properties

  "file"                     GFile*                : Read / Write / Construct Only

Description

Details

GgitIndex

typedef struct _GgitIndex GgitIndex;

Represents an index object.


struct GgitIndexClass

struct GgitIndexClass {
};

The class structure for GgitIndexClass.


ggit_index_open ()

GgitIndex *         ggit_index_open                     (GFile *file,
                                                         GError **error);

Create a new bare Git index object as a memory representation of the Git index file in file, without a repository to back it.

file :

a GFile.

error :

a GError.

Returns :

a GgitIndex or NULL if an error occurred. [transfer full]

ggit_index_read ()

gboolean            ggit_index_read                     (GgitIndex *idx,
                                                         GError **error);

Update the contents of an existing index object in memory by reading from the hard disk.

idx :

a GgitIndex.

error :

a GError.

Returns :

TRUE if the index could be read from the file associated with the index, FALSE otherwise.

ggit_index_write ()

gboolean            ggit_index_write                    (GgitIndex *idx,
                                                         GError **error);

Write an existing index object from memory back to disk using an atomic file lock.

idx :

a GgitIndex.

error :

a GError.

Returns :

TRUE if the index was successfully written to disk, FALSE otherwise.

ggit_index_remove ()

gboolean            ggit_index_remove                   (GgitIndex *idx,
                                                         GFile *file,
                                                         gint stage,
                                                         GError **error);

Remove a file from the index (specified by position).

idx :

a GgitIndex.

file :

the file to search.

stage :

the stage to search.

error :

a GError.

Returns :

TRUE if the file was successfully removed, FALSE otherwise.

ggit_index_add ()

gboolean            ggit_index_add                      (GgitIndex *idx,
                                                         GgitIndexEntry *entry,
                                                         GError **error);

Add a file to the index.

idx :

a GgitIndex.

entry :

a GgitIndexEntry

error :

a GError.

Returns :

TRUE if the file was successfully added, FALSE otherwise.

ggit_index_get_entries ()

GgitIndexEntries *  ggit_index_get_entries              (GgitIndex *idx);

Get the index entries enumerator.

idx :

a GgitIndex.

Returns :

a GgitIndexEntries. [transfer full]

ggit_index_get_entries_resolve_undo ()

GgitIndexEntriesResolveUndo * ggit_index_get_entries_resolve_undo
                                                        (GgitIndex *idx);

Get the resolve undo entries enumerator.

idx :

a GgitIndex.

Returns :

a GgitIndexEntriesResolveUndo. [transfer full]

Property Details

The "file" property

  "file"                     GFile*                : Read / Write / Construct Only

File.