[tracker/wip/sam/resource: 4/22] libtracker-extract: Improve TrackerResource support



commit 1554c78634d5661ca1d05be48e17e515f5794107
Author: Sam Thursfield <sam afuera me uk>
Date:   Thu Apr 7 18:01:51 2016 +0100

    libtracker-extract: Improve TrackerResource support

 src/libtracker-extract/tracker-extract-info.c |   33 +++++++++++++++++++++++++
 src/libtracker-extract/tracker-extract-info.h |    1 +
 2 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-extract/tracker-extract-info.c b/src/libtracker-extract/tracker-extract-info.c
index 82f45a6..b96e5b6 100644
--- a/src/libtracker-extract/tracker-extract-info.c
+++ b/src/libtracker-extract/tracker-extract-info.c
@@ -326,6 +326,39 @@ tracker_extract_info_get_urn (TrackerExtractInfo *info)
        return info->urn;
 }
 
+
+/**
+ * tracker_extract_info_get_resources:
+ * @info: a #TrackerExtractInfo
+ *
+ * Return all resources that were found during extraction and added to the
+ * result with tracker_extract_info_add_resource().
+ *
+ * Returns: (transfer none): a #GList of #TrackerResource instances, which is
+ *     owned by the #TrackerExtractInfo object and should not be modified directly
+ *
+ * Since: 1.10
+ */
+GList *
+tracker_extract_info_get_resources (TrackerExtractInfo *info)
+{
+       return info->resource_list;
+}
+
+/**
+ * tracker_extract_info_add_resource:
+ * @info: a #TrackerExtractInfo
+ * @resource: a #TrackerResource
+ *
+ * Adds a #TrackerResource with results from the extraction.
+ *
+ * If the resource links to other resources (added with
+ * tracker_resource_add_relation() or tracker_resource_set_relation()), those
+ * will be found during serialization without you needing to explicitly
+ * add them to the #TrackerExtractInfo.
+ *
+ * Since: 1.10
+ **/
 void
 tracker_extract_info_add_resource (TrackerExtractInfo *info,
                                    TrackerResource    *resource)
diff --git a/src/libtracker-extract/tracker-extract-info.h b/src/libtracker-extract/tracker-extract-info.h
index 744ab7d..e151e0c 100644
--- a/src/libtracker-extract/tracker-extract-info.h
+++ b/src/libtracker-extract/tracker-extract-info.h
@@ -48,6 +48,7 @@ void                  tracker_extract_info_unref                  (TrackerExtrac
 GFile *               tracker_extract_info_get_file               (TrackerExtractInfo *info);
 const gchar *         tracker_extract_info_get_mimetype           (TrackerExtractInfo *info);
 
+GList *               tracker_extract_info_get_resources          (TrackerExtractInfo *info);
 void                  tracker_extract_info_add_resource           (TrackerExtractInfo *info,
                                                                    TrackerResource    *resource);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]