[tracker/libtracker-sparql: 3/50] libtracker-direct: Added initial skeleton here
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/libtracker-sparql: 3/50] libtracker-direct: Added initial skeleton here
- Date: Mon, 9 Aug 2010 15:37:25 +0000 (UTC)
commit cc444a161dd34114df5a392eb530798696b5874d
Author: Martyn Russell <martyn lanedo com>
Date: Mon Jul 5 17:03:10 2010 +0100
libtracker-direct: Added initial skeleton here
Tracker.Direct.Connection uses interface Tracker.Sparql.Cursor and
will implement it for direct connections using the libtracker-data API
src/libtracker-sparql/Makefile.am | 8 +++++++
src/libtracker-sparql/tracker-cursor.vala | 11 ++++++---
src/libtracker-sparql/tracker-sparql.vapi | 32 +++++++++++++++++++++++++++++
3 files changed, 47 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-sparql/Makefile.am b/src/libtracker-sparql/Makefile.am
index f785638..b69a24d 100644
--- a/src/libtracker-sparql/Makefile.am
+++ b/src/libtracker-sparql/Makefile.am
@@ -19,6 +19,14 @@ libtracker_sparql_ TRACKER_API_VERSION@_la_LDFLAGS = \
libtracker_sparqlinclude_HEADERS = \
tracker-cursor.h
+# Vala bindings
+vapidir = $(datadir)/vala/vapi
+vapi_DATA = \
+ tracker-sparql-$(TRACKER_API_VERSION).vapi
+
+tracker-sparql-$(TRACKER_API_VERSION).vapi: tracker-sparql.vapi
+ cp $< $@
+
# Vala sources
vapi_sources = \
$(top_srcdir)/src/vapi/posix.vapi \
diff --git a/src/libtracker-sparql/tracker-cursor.vala b/src/libtracker-sparql/tracker-cursor.vala
index 204db0b..9f0d1f8 100644
--- a/src/libtracker-sparql/tracker-cursor.vala
+++ b/src/libtracker-sparql/tracker-cursor.vala
@@ -19,11 +19,14 @@
public interface Tracker.Sparql.Cursor {
public abstract int n_columns { get; }
- public abstract bool get_value (uint column, out Value value);
+ public abstract bool get_value (uint column, out GLib.Value value);
public abstract bool get_string (uint column, out string value);
public abstract bool get_double (uint column, out double value);
- public abstract bool interrupt () throws GLib.Error;
+ public virtual bool interrupt () throws GLib.Error {
+ warning ("Interrupt interface called when not implemented");
+ return false;
+ }
+
public abstract bool iter_next () throws GLib.Error;
public abstract bool rewind ();
-}
-
+}
\ No newline at end of file
diff --git a/src/libtracker-sparql/tracker-sparql.vapi b/src/libtracker-sparql/tracker-sparql.vapi
new file mode 100644
index 0000000..1d9525e
--- /dev/null
+++ b/src/libtracker-sparql/tracker-sparql.vapi
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2010, Nokia <ivan frade nokia com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+[CCode (cprefix = "Tracker", lower_case_cprefix = "tracker_")]
+namespace Tracker {
+ [CCode (cheader_filename = "libtracker-sparql/tracker-cursor.h")]
+ public interface Sparql.Cursor {
+ public abstract int n_columns { get; }
+ public abstract bool get_value (uint column, out GLib.Value value);
+ public abstract bool get_string (uint column, out string value);
+ public abstract bool get_double (uint column, out double value);
+ public virtual bool interrupt () throws GLib.Error;
+ public abstract bool iter_next () throws GLib.Error;
+ public abstract bool rewind ();
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]