![]() |
![]() |
![]() |
libgebr Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
void (*GebrTarFunc) (const gchar *file
,gpointer data
); GebrTar * gebr_tar_create (const gchar *path
); void gebr_tar_append (GebrTar *self
,const gchar *path
); gboolean gebr_tar_compact (GebrTar *self
,const gchar *root_dir
); GebrTar * gebr_tar_new_from_file (const gchar *path
); const gchar * gebr_tar_get_dir (GebrTar *self
); gboolean gebr_tar_extract (GebrTar *self
); void gebr_tar_foreach (GebrTar *self
,GebrTarFunc func
,gpointer data
); void gebr_tar_free (GebrTar *self
); GebrTar;
void gebr_tar_append (GebrTar *self
,const gchar *path
);
Inserts path
into the tar represented by self
. After you inserted
all files, call gebr_tar_compact()
to generate the tar file.
|
a GebrTar created with gebr_tar_create()
|
|
a path for a file accessible through root_dir (see gebr_tar_compact() ) |
gboolean gebr_tar_compact (GebrTar *self
,const gchar *root_dir
);
Compacts the files into a gziped tar. The root_dir
specifies the directory in
which files are searched for. The root_dir
is equivalent to the -C option of
tar command line.
|
a GebrTar created with gebr_tar_create()
|
|
the directory in which files are searched for |
Returns : |
TRUE if compact was successful, FALSE otherwise. |
GebrTar * gebr_tar_new_from_file (const gchar *path
);
Creates a GebrTar from an existing file on the system.
You can call gebr_tar_extract()
on this object.
|
a path for a file on the system |
Returns : |
If path exists and it is readable, returns a GebrTar,
otherwise NULL is returned. |
gboolean gebr_tar_extract (GebrTar *self
);
If the GebrTar was created with gebr_tar_new_from_file()
constructor, then you
can extract it by calling this function on it. The extraction is done in a temporary
folder. To access the files you should use the gebr_tar_foreach()
method.
The temporary folder is deleted when gebr_tar_free()
is called.
|
a GebrTar object created with gebr_tar_new_from_file()
|
Returns : |
TRUE if extraction worked, FALSE otherwise. |
void gebr_tar_foreach (GebrTar *self
,GebrTarFunc func
,gpointer data
);
Calls func
for each file inside the tar file represented by self
. You should
process the file here, ie move, copy, modify to any place. Notice that the files
are extracted into a temporary folder, which will be deleted upon gebr_tar_free()
call, so don't rely on them!
|
a GebrTar object, after gebr_tar_extract() was called |
|
a function to be called for each file in self
|
|
data to pass to func calls |
void gebr_tar_free (GebrTar *self
);
If self
was extracted with gebr_tar_extract()
, then this function will remove
all extracted files. After that the structure is freed.
|
a GebrTar |