| Tracker Miner Library Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Prerequisites | ||||
#include <libtracker-miner/miner.h> struct TrackerDataProviderIface; TrackerEnumerator * tracker_data_provider_begin (TrackerDataProvider *data_provider,GFile *url,const gchar *attributes,TrackerDirectoryFlags flags,GCancellable *cancellable,GError **error); void tracker_data_provider_begin_async (TrackerDataProvider *data_provider,GFile *url,const gchar *attributes,TrackerDirectoryFlags flags,gint io_priority,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); TrackerEnumerator * tracker_data_provider_begin_finish (TrackerDataProvider *data_provider,GAsyncResult *result,GError **error); gboolean tracker_data_provider_end (TrackerDataProvider *data_provider,TrackerEnumerator *enumerator,GCancellable *cancellable,GError **error); void tracker_data_provider_end_async (TrackerDataProvider *data_provider,TrackerEnumerator *enumerator,gint io_priority,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean tracker_data_provider_end_finish (TrackerDataProvider *data_provider,GAsyncResult *result,GError **error); TrackerDataProvider;
TrackerDataProvider allows you to operate on a set of GFiles,
returning a GFileInfo structure for each file enumerated (e.g.
tracker_data_provider_begin() will return a TrackerEnumerator
which can be used to enumerate resources provided by the
TrackerDataProvider.
There is also a TrackerFileDataProvider which is an implementation of this TrackerDataProvider interface.
The TrackerMinerFS class which is a subclass to TrackerMiner takes a TrackerDataProvider property which is passed down to the TrackerCrawler created upon instantiation. This property is "data-provider".
See the TrackerEnumerator documentation for more details.
struct TrackerDataProviderIface {
GTypeInterface g_iface;
/* Virtual Table */
/* Start the data_provider for a given location, attributes and flags */
TrackerEnumerator * (* begin) (TrackerDataProvider *data_provider,
GFile *url,
const gchar *attributes,
TrackerDirectoryFlags flags,
GCancellable *cancellable,
GError **error);
void (* begin_async) (TrackerDataProvider *data_provider,
GFile *url,
const gchar *attributes,
TrackerDirectoryFlags flags,
gint io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
TrackerEnumerator * (* begin_finish) (TrackerDataProvider *data_provider,
GAsyncResult *result,
GError **error);
/* Close the given location */
gboolean (* end) (TrackerDataProvider *data_provider,
TrackerEnumerator *enumerator,
GCancellable *cancellable,
GError **error);
void (* end_async) (TrackerDataProvider *data_provider,
TrackerEnumerator *enumerator,
gint io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean (* end_finish) (TrackerDataProvider *data_provider,
GAsyncResult *result,
GError **error);
};
Virtual methods left to implement.
| Parent interface type. | |
| Called when the data_provider is synchronously opening and starting the iteration of a given location. | |
Called when the data_provider is synchronously
opening and starting the iteration of a given location. Completed
using begin_finish. |
|
Called when the data_provider is completing the
asynchronous operation provided by begin_async. |
|
| Called when the data_provider is synchronously closing and cleaning up the iteration of a given location. | |
Called when the data_provider is asynchronously
closing and cleaning up the iteration of a given location.
Completed using end_finish. |
|
Called when the data_provider is completing the
asynchronous operation provided by end_async. |
TrackerEnumerator * tracker_data_provider_begin (TrackerDataProvider *data_provider,GFile *url,const gchar *attributes,TrackerDirectoryFlags flags,GCancellable *cancellable,GError **error);
Creates a TrackerEnumerator to enumerate children at the URI
provided by url.
The attributes value is a string that specifies the file attributes
that should be gathered. It is not an error if it's not possible to
read a particular requested attribute from a file - it just won't
be set. attributes should be a comma-separated list of attributes
or attribute wildcards. The wildcard "*" means all attributes, and
a wildcard like "standard::*" means all attributes in the standard
namespace. An example attribute query be "standard::*,owner::user".
The standard attributes are available as defines, like
G_FILE_ATTRIBUTE_STANDARD_NAME. See g_file_enumerate_children() for
more details.
|
a TrackerDataProvider |
|
a GFile to enumerate |
|
an attribute query string |
|
a set of TrackerDirectoryFlags |
|
optional GCancellable object, NULL to ignore. [allow-none]
|
|
location to store the error occurring, or NULL to ignore |
Returns : |
a TrackerEnumerator or NULL on failure.
This must be freed with g_object_unref(). [transfer full]
|
Since 1.2
void tracker_data_provider_begin_async (TrackerDataProvider *data_provider,GFile *url,const gchar *attributes,TrackerDirectoryFlags flags,gint io_priority,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Precisely the same operation as tracker_data_provider_begin()
is performing, but asynchronously.
When all i/o for the operation is finished the callback will be
called with the requested information.
See the documentation of TrackerDataProvider for information about the order of returned files.
In case of a partial error the callback will be called with any
succeeding items and no error, and on the next request the error
will be reported. If a request is cancelled the callback will be
called with G_IO_ERROR_CANCELLED.
During an async request no other sync and async calls are allowed,
and will result in G_IO_ERROR_PENDING errors.
Any outstanding i/o request with higher priority (lower numerical
value) will be executed before an outstanding request with lower
priority. Default priority is G_PRIORITY_DEFAULT.
|
a TrackerDataProvider. |
|
a GFile to enumerate |
|
an attribute query string |
|
a set of TrackerDirectoryFlags |
|
the [I/O priority][io-priority] of the request |
|
optional GCancellable object, NULL to
ignore. [allow-none]
|
|
a GAsyncReadyCallback to call when the request is satisfied. [scope async] |
|
the data to pass to callback function. [closure] |
Since 1.2
TrackerEnumerator * tracker_data_provider_begin_finish (TrackerDataProvider *data_provider,GAsyncResult *result,GError **error);
Finishes the asynchronous operation started with
tracker_data_provider_begin_async().
|
a TrackerDataProvider. |
|
a GAsyncResult. |
|
a GError location to store the error occurring, or NULL
to ignore. |
Returns : |
a TrackerEnumerator or NULL on failure.
This must be freed with g_object_unref(). [transfer full]
|
Since 1.2
gboolean tracker_data_provider_end (TrackerDataProvider *data_provider,TrackerEnumerator *enumerator,GCancellable *cancellable,GError **error);
Closes any caches or operations related to creating the
TrackerEnumerator to enumerate data at url.
The attributes value is a string that specifies the file attributes
that should be gathered. It is not an error if it's not possible to
read a particular requested attribute from a file - it just won't
be set. attributes should be a comma-separated list of attributes
or attribute wildcards. The wildcard "*" means all attributes, and
a wildcard like "standard::*" means all attributes in the standard
namespace. An example attribute query be "standard::*,owner::user".
The standard attributes are available as defines, like
G_FILE_ATTRIBUTE_STANDARD_NAME. See g_file_enumerate_children() for
more details.
|
a TrackerDataProvider |
|
a TrackerEnumerator originally created by
tracker_data_provider_begin(). |
|
optional GCancellable object, NULL to ignore. [allow-none]
|
|
location to store the error occurring, or NULL to ignore |
Returns : |
TRUE on success, otherwise FALSE and error is set. |
Since 1.2
void tracker_data_provider_end_async (TrackerDataProvider *data_provider,TrackerEnumerator *enumerator,gint io_priority,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Precisely the same operation as tracker_data_provider_end()
is performing, but asynchronously.
When all i/o for the operation is finished the callback will be
called with the requested information.
See the documentation of TrackerDataProvider for information about the order of returned files.
In case of a partial error the callback will be called with any
succeeding items and no error, and on the next request the error
will be reported. If a request is cancelled the callback will be
called with G_IO_ERROR_CANCELLED.
During an async request no other sync and async calls are allowed,
and will result in G_IO_ERROR_PENDING errors.
Any outstanding i/o request with higher priority (lower numerical
value) will be executed before an outstanding request with lower
priority. Default priority is G_PRIORITY_DEFAULT.
|
a TrackerDataProvider. |
|
a TrackerEnumerator originally created by
tracker_data_provider_begin(). |
|
the [I/O priority][io-priority] of the request |
|
optional GCancellable object, NULL to
ignore. [allow-none]
|
|
a GAsyncReadyCallback to call when the request is satisfied. [scope async] |
|
the data to pass to callback function. [closure] |
Since 1.2
gboolean tracker_data_provider_end_finish (TrackerDataProvider *data_provider,GAsyncResult *result,GError **error);
Finishes the asynchronous operation started with
tracker_data_provider_end_async().
|
a TrackerDataProvider. |
|
a GAsyncResult. |
|
a GError location to store the error occurring, or NULL
to ignore. |
Returns : |
TRUE on success, otherwise FALSE and error is set. |
Since 1.2