ZifDownload

ZifDownload — Generic object to download packages.

Synopsis

#define             ZIF_DOWNLOAD_ERROR
                    ZifDownload;
                    ZifDownloadPrivate;
                    ZifDownloadClass;
enum                ZifDownloadError;
GQuark              zif_download_error_quark            (void);
ZifDownload *       zif_download_new                    (void);
gboolean            zif_download_set_proxy              (ZifDownload *download,
                                                         const gchar *http_proxy,
                                                         GError **error);
gboolean            zif_download_file                   (ZifDownload *download,
                                                         const gchar *uri,
                                                         const gchar *filename,
                                                         ZifState *state,
                                                         GError **error);

Object Hierarchy

  GObject
   +----ZifDownload

Description

This object is a trivial wrapper around libsoup.

Details

ZIF_DOWNLOAD_ERROR

#define ZIF_DOWNLOAD_ERROR		(zif_download_error_quark ())


ZifDownload

typedef struct _ZifDownload ZifDownload;


ZifDownloadPrivate

typedef struct _ZifDownloadPrivate ZifDownloadPrivate;

Private ZifDownload data


ZifDownloadClass

typedef struct {
	GObjectClass parent_class;
} ZifDownloadClass;


enum ZifDownloadError

typedef enum {
	ZIF_DOWNLOAD_ERROR_FAILED,
	ZIF_DOWNLOAD_ERROR_LAST
} ZifDownloadError;


zif_download_error_quark ()

GQuark              zif_download_error_quark            (void);

Returns :

Our personal error quark.

Since 0.1.0


zif_download_new ()

ZifDownload *       zif_download_new                    (void);

Returns :

A new download class instance.

Since 0.1.0


zif_download_set_proxy ()

gboolean            zif_download_set_proxy              (ZifDownload *download,
                                                         const gchar *http_proxy,
                                                         GError **error);

Sets the proxy used for downloading files.

download :

the ZifDownload object

http_proxy :

the HTTP proxy, e.g. "http://10.0.0.1:8080"

error :

a GError which is used on failure, or NULL

Returns :

TRUE for success, FALSE for failure

Since 0.1.0


zif_download_file ()

gboolean            zif_download_file                   (ZifDownload *download,
                                                         const gchar *uri,
                                                         const gchar *filename,
                                                         ZifState *state,
                                                         GError **error);

Downloads a file.

download :

the ZifDownload object

uri :

the full remote URI

filename :

the local filename to save to

state :

a ZifState to use for progress reporting

error :

a GError which is used on failure, or NULL

Returns :

TRUE for success, FALSE for failure

Since 0.1.0