![]() |
![]() |
![]() |
ZIF Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#define ZIF_MD_ERROR ZifMd; ZifMdPrivate; ZifMdClass; enum ZifMdType; enum ZifMdError; GQuark zif_md_error_quark (void
); ZifMd * zif_md_new (void
); void zif_md_set_mdtype (ZifMd *md
,ZifMdType type
); void zif_md_set_store_remote (ZifMd *md
,ZifStoreRemote *remote
); ZifStoreRemote * zif_md_get_store_remote (ZifMd *md
); void zif_md_set_id (ZifMd *md
,const gchar *id
); void zif_md_set_filename (ZifMd *md
,const gchar *filename
); void zif_md_set_timestamp (ZifMd *md
,guint timestamp
); void zif_md_set_location (ZifMd *md
,const gchar *location
); void zif_md_set_checksum (ZifMd *md
,const gchar *checksum
); void zif_md_set_checksum_uncompressed (ZifMd *md
,const gchar *checksum_uncompressed
); void zif_md_set_checksum_type (ZifMd *md
,GChecksumType checksum_type
); const gchar * zif_md_type_to_text (ZifMdType type
); const gchar * zif_md_get_id (ZifMd *md
); ZifMdType zif_md_get_mdtype (ZifMd *md
); const gchar * zif_md_get_filename (ZifMd *md
); const gchar * zif_md_get_filename_uncompressed (ZifMd *md
); const gchar * zif_md_get_location (ZifMd *md
); gboolean zif_md_load (ZifMd *md
,ZifState *state
,GError **error
); gboolean zif_md_unload (ZifMd *md
,ZifState *state
,GError **error
); gboolean zif_md_clean (ZifMd *md
,GError **error
); gboolean zif_md_file_check (ZifMd *md
,gboolean use_uncompressed
,ZifState *state
,GError **error
); GPtrArray * zif_md_search_file (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
); GPtrArray * zif_md_search_name (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
); GPtrArray * zif_md_search_details (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
); GPtrArray * zif_md_search_group (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
); GPtrArray * zif_md_search_pkgid (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
); GPtrArray * zif_md_what_provides (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
); GPtrArray * zif_md_resolve (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
); GPtrArray * zif_md_get_packages (ZifMd *md
,ZifState *state
,GError **error
); GPtrArray * zif_md_find_package (ZifMd *md
,const gchar *package_id
,ZifState *state
,GError **error
); GPtrArray * zif_md_get_changelog (ZifMd *md
,const gchar *pkgid
,ZifState *state
,GError **error
); GPtrArray * zif_md_get_files (ZifMd *md
,ZifPackage *package
,ZifState *state
,GError **error
);
GObject +----ZifMd +----ZifMdComps +----ZifMdFilelistsSql +----ZifMdFilelistsXml +----ZifMdMetalink +----ZifMdMirrorlist +----ZifMdOtherSql +----ZifMdPrimarySql +----ZifMdPrimaryXml +----ZifMdUpdateinfo
This provides an abstract metadata class. It is implemented by ZifMdFilelistsSql, ZifMdFilelistsXml, ZifMdPrimaryXml, ZifMdPrimarySql and many others.
typedef struct { GObjectClass parent_class; /* vtable */ gboolean (*load) (ZifMd *md, ZifState *state, GError **error); gboolean (*unload) (ZifMd *md, ZifState *state, GError **error); GPtrArray *(*search_file) (ZifMd *md, gchar **search, ZifState *state, GError **error); GPtrArray *(*search_name) (ZifMd *md, gchar **search, ZifState *state, GError **error); GPtrArray *(*search_details) (ZifMd *md, gchar **search, ZifState *state, GError **error); GPtrArray *(*search_group) (ZifMd *md, gchar **search, ZifState *state, GError **error); GPtrArray *(*search_pkgid) (ZifMd *md, gchar **search, ZifState *state, GError **error); GPtrArray *(*what_provides) (ZifMd *md, gchar **search, ZifState *state, GError **error); GPtrArray *(*resolve) (ZifMd *md, gchar **search, ZifState *state, GError **error); GPtrArray *(*get_packages) (ZifMd *md, ZifState *state, GError **error); GPtrArray *(*find_package) (ZifMd *md, const gchar *package_id, ZifState *state, GError **error); GPtrArray *(*get_changelog) (ZifMd *md, const gchar *pkgid, ZifState *state, GError **error); GPtrArray *(*get_files) (ZifMd *md, ZifPackage *package, ZifState *state, GError **error); } ZifMdClass;
typedef enum { ZIF_MD_TYPE_PRIMARY_XML, ZIF_MD_TYPE_PRIMARY_SQL, ZIF_MD_TYPE_FILELISTS_XML, ZIF_MD_TYPE_FILELISTS_SQL, ZIF_MD_TYPE_OTHER_XML, ZIF_MD_TYPE_OTHER_SQL, ZIF_MD_TYPE_COMPS, ZIF_MD_TYPE_COMPS_GZ, ZIF_MD_TYPE_METALINK, ZIF_MD_TYPE_MIRRORLIST, ZIF_MD_TYPE_PRESTODELTA, ZIF_MD_TYPE_UPDATEINFO, ZIF_MD_TYPE_UNKNOWN } ZifMdType;
typedef enum { ZIF_MD_ERROR_FAILED, ZIF_MD_ERROR_NO_SUPPORT, ZIF_MD_ERROR_FAILED_TO_LOAD, ZIF_MD_ERROR_FAILED_AS_OFFLINE, ZIF_MD_ERROR_FAILED_DOWNLOAD, ZIF_MD_ERROR_BAD_SQL, ZIF_MD_ERROR_FILE_TOO_OLD, ZIF_MD_ERROR_NO_FILENAME, ZIF_MD_ERROR_LAST } ZifMdError;
GQuark zif_md_error_quark (void
);
Returns : |
Our personal error quark. |
Since 0.1.0
void zif_md_set_mdtype (ZifMd *md
,ZifMdType type
);
Sets the type of the metadata, e.g. ZIF_MD_TYPE_FILELISTS_SQL.
|
the ZifMd object |
|
the metadata type |
Since 0.1.0
void zif_md_set_store_remote (ZifMd *md
,ZifStoreRemote *remote
);
Sets the remote store for this metadata.
|
the ZifMd object |
|
the ZifStoreRemote that created this metadata object |
Since 0.1.0
ZifStoreRemote * zif_md_get_store_remote (ZifMd *md
);
Gets the remote store for this metadata.
|
the ZifMd object |
Returns : |
A ZifStoreRemote or NULL for unset
|
Since 0.1.0
void zif_md_set_id (ZifMd *md
,const gchar *id
);
Sets the repository ID for this metadata.
|
the ZifMd object |
|
the repository id, e.g. "fedora" |
Since 0.1.0
void zif_md_set_filename (ZifMd *md
,const gchar *filename
);
Sets the filename of the compressed file.
|
the ZifMd object |
|
the base filename, e.g. "master.xml.bz2" |
Since 0.1.0
void zif_md_set_timestamp (ZifMd *md
,guint timestamp
);
Sets the timestamp of the compressed file.
|
the ZifMd object |
|
the timestamp value |
Since 0.1.0
void zif_md_set_location (ZifMd *md
,const gchar *location
);
Sets the location of the compressed file, e.g. "repodata/35d817e-primary.sqlite.bz2"
|
the ZifMd object |
|
the location |
Since 0.1.0
void zif_md_set_checksum (ZifMd *md
,const gchar *checksum
);
Sets the checksum of the compressed file.
|
the ZifMd object |
|
the checksum value |
Since 0.1.0
void zif_md_set_checksum_uncompressed (ZifMd *md
,const gchar *checksum_uncompressed
);
Sets the checksum of the uncompressed file.
|
the ZifMd object |
|
the uncompressed checksum value |
Since 0.1.0
void zif_md_set_checksum_type (ZifMd *md
,GChecksumType checksum_type
);
Sets the checksum_type of the files.
|
the ZifMd object |
|
the checksum type |
Since 0.1.0
const gchar * zif_md_type_to_text (ZifMdType type
);
|
|
Returns : |
Since 0.1.0
const gchar * zif_md_get_id (ZifMd *md
);
Gets the md identifier, usually the repo name.
|
the ZifMd object |
Returns : |
the repo id. |
Since 0.1.0
ZifMdType zif_md_get_mdtype (ZifMd *md
);
Gets the type of the repo.
|
the ZifMd object |
Returns : |
the type |
Since 0.1.0
const gchar * zif_md_get_filename (ZifMd *md
);
Gets the compressed filename of the repo.
|
the ZifMd object |
Returns : |
the filename |
Since 0.1.0
const gchar * zif_md_get_filename_uncompressed (ZifMd *md
);
Gets the uncompressed filename of the repo.
|
the ZifMd object |
Returns : |
the filename |
Since 0.1.0
const gchar * zif_md_get_location (ZifMd *md
);
Gets the location of the repo.
|
the ZifMd object |
Returns : |
the location |
Since 0.1.0
gboolean zif_md_load (ZifMd *md
,ZifState *state
,GError **error
);
Load the metadata store.
|
the ZifMd object |
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
TRUE for success, FALSE for failure
|
Since 0.1.0
gboolean zif_md_unload (ZifMd *md
,ZifState *state
,GError **error
);
Unload the metadata store.
|
the ZifMd object |
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
TRUE for success, FALSE for failure
|
Since 0.1.0
gboolean zif_md_clean (ZifMd *md
,GError **error
);
Clean the metadata store.
|
the ZifMd object |
|
a GError which is used on failure, or NULL
|
Returns : |
TRUE for success, FALSE for failure
|
Since 0.1.0
gboolean zif_md_file_check (ZifMd *md
,gboolean use_uncompressed
,ZifState *state
,GError **error
);
Check the metadata files to make sure they are valid.
|
the ZifMd object |
|
If we should check only the uncompresed version |
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
TRUE for success, FALSE for failure
|
Since 0.1.0
GPtrArray * zif_md_search_file (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
);
Gets a list of all packages that contain the file. Results are pkgId's descriptors, i.e. 64 bit hashes as test.
|
the ZifMd object |
|
the search term, e.g. "/usr/bin/powertop" |
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
a string list of pkgId's |
Since 0.1.0
GPtrArray * zif_md_search_name (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
);
Finds all packages that match the name.
|
the ZifMd object |
|
the search term, e.g. "power" |
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
an array of ZifPackageRemote's |
Since 0.1.0
GPtrArray * zif_md_search_details (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
);
Finds all packages that match the name or description.
|
the ZifMd object |
|
the search term, e.g. "advanced" |
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
an array of ZifPackageRemote's |
Since 0.1.0
GPtrArray * zif_md_search_group (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
);
Finds all packages that match the group.
|
the ZifMd object |
|
the search term, e.g. "games/console" |
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
an array of ZifPackageRemote's |
Since 0.1.0
GPtrArray * zif_md_search_pkgid (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
);
Finds all packages that match the given pkgId.
|
the ZifMd object |
|
the search term as a 64 bit hash |
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
an array of ZifPackageRemote's |
Since 0.1.0
GPtrArray * zif_md_what_provides (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
);
Finds all packages that match the given provide.
|
the ZifMd object |
|
the provide, e.g. "mimehandler(application/ogg)" |
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
an array of ZifPackageRemote's |
Since 0.1.0
GPtrArray * zif_md_resolve (ZifMd *md
,gchar **search
,ZifState *state
,GError **error
);
Finds all remote packages that match the name exactly.
|
the ZifMd object |
|
the search term, e.g. "gnome-power-manager" |
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
an array of ZifPackageRemote's |
Since 0.1.0
GPtrArray * zif_md_get_packages (ZifMd *md
,ZifState *state
,GError **error
);
Returns all packages in the repo.
|
the ZifMd object |
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
an array of ZifPackageRemote's |
Since 0.1.0
GPtrArray * zif_md_find_package (ZifMd *md
,const gchar *package_id
,ZifState *state
,GError **error
);
Finds all packages that match PackageId.
|
the ZifMd object |
|
the PackageId to match |
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
an array of ZifPackageRemote's |
Since 0.1.0
GPtrArray * zif_md_get_changelog (ZifMd *md
,const gchar *pkgid
,ZifState *state
,GError **error
);
Gets the changelog data for a specific package
|
the ZifMd object |
|
the internal pkgid to match |
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
an array of ZifChangeset's |
Since 0.1.0
GPtrArray * zif_md_get_files (ZifMd *md
,ZifPackage *package
,ZifState *state
,GError **error
);
Gets the file list for a specific package.
|
the ZifMd object |
|
the ZifPackage
|
|
a ZifState to use for progress reporting |
|
a GError which is used on failure, or NULL
|
Returns : |
an array of strings, free with g_ptr_array_unref()
|
Since 0.1.0