[tracker/tracker-3.0: 1/2] libtracker-sparql: fix nullable annotations in vapi




commit c9bb4e842b6fd02148959edc877ba437341a50bf
Author: Rasmus Thomsen <oss cogitri dev>
Date:   Thu Nov 12 18:32:53 2020 +0100

    libtracker-sparql: fix nullable annotations in vapi
    
    Also add binding for tracker_resource_print_jsonld

 src/libtracker-sparql/bus/tracker-bus-fd-cursor.vala  |  2 +-
 src/libtracker-sparql/remote/tracker-json-cursor.vala |  2 +-
 src/libtracker-sparql/remote/tracker-xml-cursor.vala  |  2 +-
 src/libtracker-sparql/tracker-sparql.vapi             | 15 ++++++++-------
 4 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/src/libtracker-sparql/bus/tracker-bus-fd-cursor.vala 
b/src/libtracker-sparql/bus/tracker-bus-fd-cursor.vala
index 954ad1ec7..b0ea605ab 100644
--- a/src/libtracker-sparql/bus/tracker-bus-fd-cursor.vala
+++ b/src/libtracker-sparql/bus/tracker-bus-fd-cursor.vala
@@ -69,7 +69,7 @@ class Tracker.Bus.FDCursor : Tracker.Sparql.Cursor {
                return variable_names[column];
        }
 
-       public override unowned string? get_string (int column, out long length = null)
+       public override unowned string? get_string (int column, out long? length = null)
        requires (cursor_finished == false) {
                unowned string str = null;
 
diff --git a/src/libtracker-sparql/remote/tracker-json-cursor.vala 
b/src/libtracker-sparql/remote/tracker-json-cursor.vala
index 047d47278..e85c6f459 100644
--- a/src/libtracker-sparql/remote/tracker-json-cursor.vala
+++ b/src/libtracker-sparql/remote/tracker-json-cursor.vala
@@ -95,7 +95,7 @@ public class Tracker.Remote.JsonCursor : Tracker.Sparql.Cursor {
                return _vars.get_string_element (column);
        }
 
-       public override unowned string? get_string (int column, out long length = null) requires (_cur_row != 
null) {
+       public override unowned string? get_string (int column, out long? length = null) requires (_cur_row 
!= null) {
                var col_node = _cur_row.get_member (get_variable_name (column));
                length = 0;
 
diff --git a/src/libtracker-sparql/remote/tracker-xml-cursor.vala 
b/src/libtracker-sparql/remote/tracker-xml-cursor.vala
index a7a710041..47314c960 100644
--- a/src/libtracker-sparql/remote/tracker-xml-cursor.vala
+++ b/src/libtracker-sparql/remote/tracker-xml-cursor.vala
@@ -144,7 +144,7 @@ public class Tracker.Remote.XmlCursor : Tracker.Sparql.Cursor {
                return _vars[column];
        }
 
-       public override unowned string? get_string (int column, out long length = null) requires (_cur_row != 
null) {
+       public override unowned string? get_string (int column, out long? length = null) requires (_cur_row 
!= null) {
                length = 0;
 
                var variable = _vars[column];
diff --git a/src/libtracker-sparql/tracker-sparql.vapi b/src/libtracker-sparql/tracker-sparql.vapi
index e75e7bcbf..a7c758d5f 100644
--- a/src/libtracker-sparql/tracker-sparql.vapi
+++ b/src/libtracker-sparql/tracker-sparql.vapi
@@ -65,8 +65,8 @@ namespace Tracker {
        [CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
         public abstract class Sparql.Connection : GLib.Object {
                public extern static new Connection remote_new (string uri_base);
-               public extern static new Connection new (Sparql.ConnectionFlags flags, GLib.File store, 
GLib.File? ontology, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.IOError;
-               public extern async static new Connection new_async (Sparql.ConnectionFlags flags, GLib.File 
store, GLib.File? ontology, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.IOError;
+               public extern static new Connection new (Sparql.ConnectionFlags flags, GLib.File? store, 
GLib.File? ontology, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.IOError;
+               public extern async static new Connection new_async (Sparql.ConnectionFlags flags, GLib.File? 
store, GLib.File? ontology, GLib.Cancellable? cancellable = null) throws Sparql.Error, GLib.IOError;
                public extern static new Connection bus_new (string service_name, string? object_path, 
GLib.DBusConnection? dbus_connection = null) throws Sparql.Error, GLib.IOError, GLib.DBusError, GLib.Error;
 
                public abstract Cursor query (string sparql, GLib.Cancellable? cancellable = null) throws 
Sparql.Error, GLib.Error, GLib.IOError, GLib.DBusError;
@@ -122,7 +122,7 @@ namespace Tracker {
                public abstract Sparql.ValueType get_value_type (int column);
 
                public abstract unowned string? get_variable_name (int column);
-               public abstract unowned string? get_string (int column, out long length = null);
+               public abstract unowned string? get_string (int column, out long? length = null);
 
                public abstract bool next (GLib.Cancellable? cancellable = null) throws GLib.Error;
                public async abstract bool next_async (GLib.Cancellable? cancellable = null) throws 
GLib.Error;
@@ -140,7 +140,7 @@ namespace Tracker {
                public NamespaceManager ();
                public void add_prefix (string prefix, string namespace);
                public bool has_prefix (string prefix);
-               public string lookup_prefix (string prefix);
+               public string? lookup_prefix (string prefix);
                public string expand_uri (string compact_uri);
 
                public static NamespaceManager get_default ();
@@ -148,7 +148,7 @@ namespace Tracker {
 
        [CCode (cheader_filename = "libtracker-sparql/tracker-sparql.h")]
        public class Resource : GLib.Object {
-               public Resource (string identifier);
+               public Resource (string? identifier);
 
                public void set_value (string predicate, GLib.Value value);
                public void set_boolean (string predicate, bool object);
@@ -183,8 +183,9 @@ namespace Tracker {
 
                public int identifier_compare_func (string identifier);
 
-               public string print_turtle (NamespaceManager? namespace_manager);
-               public string print_sparql_update (NamespaceManager? namespace_manager, string graph);
+               public string print_turtle (NamespaceManager? namespaces);
+               public string print_sparql_update (NamespaceManager? namespaces, string? graph_id);
+               public string print_jsonld (NamespaceManager? namespaces);
        }
 
        [CCode (cprefix = "TRACKER_NOTIFIER_FLAG_", cheader_filename = "libtracker-sparql/tracker-sparql.h")]


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