/* tracker-json-cursor.c generated by valac 0.35.1.15-f996c-dirty, the Vala compiler
 * generated from tracker-json-cursor.vala, do not modify */

/*
 * Copyright (C) 2016 Carlos Garnacho <carlosg@gnome.org>
 *
 * 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.
 *
 * Author: Carlos Garnacho <carlosg@gnome.org>
 */

#include <glib.h>
#include <glib-object.h>
#include "libtracker-sparql/tracker-sparql.h"
#include <json-glib/json-glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>


#define TRACKER_REMOTE_TYPE_JSON_CURSOR (tracker_remote_json_cursor_get_type ())
#define TRACKER_REMOTE_JSON_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_REMOTE_TYPE_JSON_CURSOR, TrackerRemoteJsonCursor))
#define TRACKER_REMOTE_JSON_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRACKER_REMOTE_TYPE_JSON_CURSOR, TrackerRemoteJsonCursorClass))
#define TRACKER_REMOTE_IS_JSON_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRACKER_REMOTE_TYPE_JSON_CURSOR))
#define TRACKER_REMOTE_IS_JSON_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRACKER_REMOTE_TYPE_JSON_CURSOR))
#define TRACKER_REMOTE_JSON_CURSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRACKER_REMOTE_TYPE_JSON_CURSOR, TrackerRemoteJsonCursorClass))

typedef struct _TrackerRemoteJsonCursor TrackerRemoteJsonCursor;
typedef struct _TrackerRemoteJsonCursorClass TrackerRemoteJsonCursorClass;
typedef struct _TrackerRemoteJsonCursorPrivate TrackerRemoteJsonCursorPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _json_array_unref0(var) ((var == NULL) ? NULL : (var = (json_array_unref (var), NULL)))
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
typedef struct _TrackerRemoteJsonCursorNextAsyncData TrackerRemoteJsonCursorNextAsyncData;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _TrackerRemoteJsonCursor {
	TrackerSparqlCursor parent_instance;
	TrackerRemoteJsonCursorPrivate * priv;
	JsonParser* _parser;
	JsonArray* _vars;
	JsonArray* _results;
	JsonObject* _cur_row;
	guint _cur_idx;
	gboolean _started_iterating;
};

struct _TrackerRemoteJsonCursorClass {
	TrackerSparqlCursorClass parent_class;
};

struct _TrackerRemoteJsonCursorNextAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TrackerRemoteJsonCursor* self;
	GCancellable* cancellable;
	gboolean result;
	gboolean _tmp0_;
	GCancellable* _tmp1_;
	gboolean _tmp2_;
	GError * _inner_error_;
};


static gpointer tracker_remote_json_cursor_parent_class = NULL;

GType tracker_remote_json_cursor_get_type (void) G_GNUC_CONST;
enum  {
	TRACKER_REMOTE_JSON_CURSOR_DUMMY_PROPERTY,
	TRACKER_REMOTE_JSON_CURSOR_N_COLUMNS
};
#define TRACKER_REMOTE_JSON_CURSOR_XSD_NS "http://www.w3.org/2001/XMLSchema#"
TrackerRemoteJsonCursor* tracker_remote_json_cursor_new (const gchar* document, glong length, GError** error);
TrackerRemoteJsonCursor* tracker_remote_json_cursor_construct (GType object_type, const gchar* document, glong length, GError** error);
static TrackerSparqlValueType tracker_remote_json_cursor_real_get_value_type (TrackerSparqlCursor* base, gint column);
static JsonNode* _vala_JsonNode_copy (JsonNode* self);
static void _vala_JsonNode_free (JsonNode* self);
static const gchar* tracker_remote_json_cursor_real_get_variable_name (TrackerSparqlCursor* base, gint column);
static const gchar* tracker_remote_json_cursor_real_get_string (TrackerSparqlCursor* base, gint column, glong* length);
static gboolean tracker_remote_json_cursor_real_next (TrackerSparqlCursor* base, GCancellable* cancellable, GError** error);
static void tracker_remote_json_cursor_real_next_async_data_free (gpointer _data);
static void tracker_remote_json_cursor_real_next_async (TrackerSparqlCursor* base, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean tracker_remote_json_cursor_real_next_async_co (TrackerRemoteJsonCursorNextAsyncData* _data_);
static void tracker_remote_json_cursor_real_rewind (TrackerSparqlCursor* base);
static void tracker_remote_json_cursor_real_close (TrackerSparqlCursor* base);
static void tracker_remote_json_cursor_finalize (GObject * obj);
static void _vala_tracker_remote_json_cursor_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);


static gpointer _json_object_ref0 (gpointer self) {
#line 36 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return self ? json_object_ref (self) : NULL;
#line 113 "tracker-json-cursor.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 40 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return self ? g_object_ref (self) : NULL;
#line 120 "tracker-json-cursor.c"
}


static gpointer _json_array_ref0 (gpointer self) {
#line 41 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return self ? json_array_ref (self) : NULL;
#line 127 "tracker-json-cursor.c"
}


TrackerRemoteJsonCursor* tracker_remote_json_cursor_construct (GType object_type, const gchar* document, glong length, GError** error) {
	TrackerRemoteJsonCursor * self = NULL;
	JsonParser* parser;
	JsonParser* _tmp0_;
	const gchar* _tmp1_;
	glong _tmp2_;
	JsonObject* root;
	JsonNode* _tmp3_;
	JsonObject* _tmp4_;
	JsonObject* _tmp5_;
	JsonObject* head;
	JsonObject* _tmp6_;
	JsonObject* _tmp7_;
	JsonObject* _tmp8_;
	JsonObject* results;
	JsonObject* _tmp9_;
	JsonObject* _tmp10_;
	JsonObject* _tmp11_;
	JsonParser* _tmp12_;
	JsonObject* _tmp13_;
	JsonArray* _tmp14_;
	JsonArray* _tmp15_;
	JsonObject* _tmp16_;
	JsonArray* _tmp17_;
	JsonArray* _tmp18_;
	GError * _inner_error_ = NULL;
#line 32 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	g_return_val_if_fail (document != NULL, NULL);
#line 32 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self = (TrackerRemoteJsonCursor*) tracker_sparql_cursor_construct (object_type);
#line 33 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp0_ = json_parser_new ();
#line 33 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	parser = _tmp0_;
#line 34 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp1_ = document;
#line 34 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp2_ = length;
#line 34 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	json_parser_load_from_data (parser, _tmp1_, (gssize) _tmp2_, &_inner_error_);
#line 34 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 34 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		g_propagate_error (error, _inner_error_);
#line 34 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		_g_object_unref0 (parser);
#line 34 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		_g_object_unref0 (self);
#line 34 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		return NULL;
#line 181 "tracker-json-cursor.c"
	}
#line 36 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp3_ = json_parser_get_root (parser);
#line 36 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp4_ = json_node_get_object (_tmp3_);
#line 36 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp5_ = _json_object_ref0 (_tmp4_);
#line 36 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	root = _tmp5_;
#line 37 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp6_ = root;
#line 37 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp7_ = json_object_get_object_member (_tmp6_, "head");
#line 37 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp8_ = _json_object_ref0 (_tmp7_);
#line 37 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	head = _tmp8_;
#line 38 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp9_ = root;
#line 38 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp10_ = json_object_get_object_member (_tmp9_, "results");
#line 38 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp11_ = _json_object_ref0 (_tmp10_);
#line 38 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	results = _tmp11_;
#line 40 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp12_ = _g_object_ref0 (parser);
#line 40 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_g_object_unref0 (self->_parser);
#line 40 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self->_parser = _tmp12_;
#line 41 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp13_ = head;
#line 41 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp14_ = json_object_get_array_member (_tmp13_, "vars");
#line 41 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp15_ = _json_array_ref0 (_tmp14_);
#line 41 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_json_array_unref0 (self->_vars);
#line 41 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self->_vars = _tmp15_;
#line 42 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp16_ = results;
#line 42 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp17_ = json_object_get_array_member (_tmp16_, "bindings");
#line 42 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp18_ = _json_array_ref0 (_tmp17_);
#line 42 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_json_array_unref0 (self->_results);
#line 42 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self->_results = _tmp18_;
#line 43 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self->_started_iterating = FALSE;
#line 32 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_json_object_unref0 (results);
#line 32 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_json_object_unref0 (head);
#line 32 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_json_object_unref0 (root);
#line 32 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_g_object_unref0 (parser);
#line 32 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return self;
#line 245 "tracker-json-cursor.c"
}


TrackerRemoteJsonCursor* tracker_remote_json_cursor_new (const gchar* document, glong length, GError** error) {
#line 32 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return tracker_remote_json_cursor_construct (TRACKER_REMOTE_TYPE_JSON_CURSOR, document, length, error);
#line 252 "tracker-json-cursor.c"
}


static JsonNode* _vala_JsonNode_copy (JsonNode* self) {
#line 51 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return g_boxed_copy (json_node_get_type (), self);
#line 259 "tracker-json-cursor.c"
}


static gpointer __vala_JsonNode_copy0 (gpointer self) {
#line 51 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return self ? _vala_JsonNode_copy (self) : NULL;
#line 266 "tracker-json-cursor.c"
}


static void _vala_JsonNode_free (JsonNode* self) {
#line 54 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	g_boxed_free (json_node_get_type (), self);
#line 273 "tracker-json-cursor.c"
}


static TrackerSparqlValueType tracker_remote_json_cursor_real_get_value_type (TrackerSparqlCursor* base, gint column) {
	TrackerRemoteJsonCursor * self;
	TrackerSparqlValueType result = 0;
	JsonObject* _tmp0_;
	JsonNode* col_node;
	JsonObject* _tmp1_;
	gint _tmp2_;
	const gchar* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonObject* object;
	JsonNode* _tmp7_;
	JsonObject* _tmp8_;
	JsonObject* _tmp9_;
	const gchar* str;
	JsonObject* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	GQuark _tmp15_ = 0U;
#line 59 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	static GQuark _tmp14_label0 = 0;
#line 59 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	static GQuark _tmp14_label1 = 0;
#line 59 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	static GQuark _tmp14_label2 = 0;
#line 50 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self = (TrackerRemoteJsonCursor*) base;
#line 50 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp0_ = self->_cur_row;
#line 50 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_vala_return_val_if_fail (_tmp0_ != NULL, "_cur_row != null", 0);
#line 51 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp1_ = self->_cur_row;
#line 51 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp2_ = column;
#line 51 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp3_ = tracker_sparql_cursor_get_variable_name ((TrackerSparqlCursor*) self, _tmp2_);
#line 51 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp4_ = json_object_get_member (_tmp1_, _tmp3_);
#line 51 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp5_ = __vala_JsonNode_copy0 (_tmp4_);
#line 51 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	col_node = _tmp5_;
#line 53 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp6_ = col_node;
#line 53 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (_tmp6_ == NULL) {
#line 54 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		result = TRACKER_SPARQL_VALUE_TYPE_UNBOUND;
#line 54 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		__vala_JsonNode_free0 (col_node);
#line 54 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		return result;
#line 332 "tracker-json-cursor.c"
	}
#line 56 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp7_ = col_node;
#line 56 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp8_ = json_node_get_object (_tmp7_);
#line 56 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp9_ = _json_object_ref0 (_tmp8_);
#line 56 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	object = _tmp9_;
#line 57 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp10_ = object;
#line 57 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp11_ = json_object_get_string_member (_tmp10_, "type");
#line 57 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	str = _tmp11_;
#line 59 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp12_ = str;
#line 59 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp13_ = _tmp12_;
#line 59 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp15_ = (NULL == _tmp13_) ? 0 : g_quark_from_string (_tmp13_);
#line 59 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (_tmp15_ == ((0 != _tmp14_label0) ? _tmp14_label0 : (_tmp14_label0 = g_quark_from_static_string ("uri")))) {
#line 59 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		switch (0) {
#line 358 "tracker-json-cursor.c"
			default:
			{
#line 61 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
				result = TRACKER_SPARQL_VALUE_TYPE_URI;
#line 61 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
				_json_object_unref0 (object);
#line 61 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
				__vala_JsonNode_free0 (col_node);
#line 61 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
				return result;
#line 369 "tracker-json-cursor.c"
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label1) ? _tmp14_label1 : (_tmp14_label1 = g_quark_from_static_string ("bnode")))) {
#line 59 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		switch (0) {
#line 375 "tracker-json-cursor.c"
			default:
			{
#line 63 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
				result = TRACKER_SPARQL_VALUE_TYPE_BLANK_NODE;
#line 63 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
				_json_object_unref0 (object);
#line 63 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
				__vala_JsonNode_free0 (col_node);
#line 63 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
				return result;
#line 386 "tracker-json-cursor.c"
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label2) ? _tmp14_label2 : (_tmp14_label2 = g_quark_from_static_string ("literal")))) {
#line 59 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		switch (0) {
#line 392 "tracker-json-cursor.c"
			default:
			{
				{
					JsonNode* node;
					JsonObject* _tmp16_;
					JsonNode* _tmp17_;
					JsonNode* _tmp18_;
					JsonNode* _tmp19_;
					JsonNode* _tmp20_;
					const gchar* _tmp21_;
					const gchar* _tmp22_;
					const gchar* _tmp23_;
					GQuark _tmp25_ = 0U;
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					static GQuark _tmp24_label0 = 0;
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					static GQuark _tmp24_label1 = 0;
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					static GQuark _tmp24_label2 = 0;
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					static GQuark _tmp24_label3 = 0;
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					static GQuark _tmp24_label4 = 0;
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					static GQuark _tmp24_label5 = 0;
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					static GQuark _tmp24_label6 = 0;
#line 65 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					_tmp16_ = object;
#line 65 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					_tmp17_ = json_object_get_member (_tmp16_, "datatype");
#line 65 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					_tmp18_ = __vala_JsonNode_copy0 (_tmp17_);
#line 65 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					node = _tmp18_;
#line 67 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					_tmp19_ = node;
#line 67 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					if (_tmp19_ == NULL) {
#line 68 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
						result = TRACKER_SPARQL_VALUE_TYPE_STRING;
#line 68 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
						__vala_JsonNode_free0 (node);
#line 68 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
						_json_object_unref0 (object);
#line 68 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
						__vala_JsonNode_free0 (col_node);
#line 68 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
						return result;
#line 442 "tracker-json-cursor.c"
					}
#line 70 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					_tmp20_ = node;
#line 70 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					_tmp21_ = json_node_get_string (_tmp20_);
#line 70 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					str = _tmp21_;
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					_tmp22_ = str;
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					_tmp23_ = _tmp22_;
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					_tmp25_ = (NULL == _tmp23_) ? 0 : g_quark_from_string (_tmp23_);
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					if ((((_tmp25_ == ((0 != _tmp24_label0) ? _tmp24_label0 : (_tmp24_label0 = g_quark_from_static_string (TRACKER_REMOTE_JSON_CURSOR_XSD_NS "byte")))) || (_tmp25_ == ((0 != _tmp24_label1) ? _tmp24_label1 : (_tmp24_label1 = g_quark_from_static_string (TRACKER_REMOTE_JSON_CURSOR_XSD_NS "int"))))) || (_tmp25_ == ((0 != _tmp24_label2) ? _tmp24_label2 : (_tmp24_label2 = g_quark_from_static_string (TRACKER_REMOTE_JSON_CURSOR_XSD_NS "integer"))))) || (_tmp25_ == ((0 != _tmp24_label3) ? _tmp24_label3 : (_tmp24_label3 = g_quark_from_static_string (TRACKER_REMOTE_JSON_CURSOR_XSD_NS "long"))))) {
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
						switch (0) {
#line 460 "tracker-json-cursor.c"
							default:
							{
#line 77 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								result = TRACKER_SPARQL_VALUE_TYPE_INTEGER;
#line 77 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								__vala_JsonNode_free0 (node);
#line 77 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								_json_object_unref0 (object);
#line 77 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								__vala_JsonNode_free0 (col_node);
#line 77 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								return result;
#line 473 "tracker-json-cursor.c"
							}
						}
					} else if ((_tmp25_ == ((0 != _tmp24_label4) ? _tmp24_label4 : (_tmp24_label4 = g_quark_from_static_string (TRACKER_REMOTE_JSON_CURSOR_XSD_NS "decimal")))) || (_tmp25_ == ((0 != _tmp24_label5) ? _tmp24_label5 : (_tmp24_label5 = g_quark_from_static_string (TRACKER_REMOTE_JSON_CURSOR_XSD_NS "double"))))) {
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
						switch (0) {
#line 479 "tracker-json-cursor.c"
							default:
							{
#line 80 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								result = TRACKER_SPARQL_VALUE_TYPE_DOUBLE;
#line 80 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								__vala_JsonNode_free0 (node);
#line 80 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								_json_object_unref0 (object);
#line 80 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								__vala_JsonNode_free0 (col_node);
#line 80 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								return result;
#line 492 "tracker-json-cursor.c"
							}
						}
					} else if (_tmp25_ == ((0 != _tmp24_label6) ? _tmp24_label6 : (_tmp24_label6 = g_quark_from_static_string (TRACKER_REMOTE_JSON_CURSOR_XSD_NS "dateTime")))) {
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
						switch (0) {
#line 498 "tracker-json-cursor.c"
							default:
							{
#line 82 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								result = TRACKER_SPARQL_VALUE_TYPE_DATETIME;
#line 82 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								__vala_JsonNode_free0 (node);
#line 82 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								_json_object_unref0 (object);
#line 82 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								__vala_JsonNode_free0 (col_node);
#line 82 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								return result;
#line 511 "tracker-json-cursor.c"
							}
						}
					} else {
#line 72 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
						switch (0) {
#line 517 "tracker-json-cursor.c"
							default:
							{
#line 84 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								result = TRACKER_SPARQL_VALUE_TYPE_STRING;
#line 84 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								__vala_JsonNode_free0 (node);
#line 84 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								_json_object_unref0 (object);
#line 84 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								__vala_JsonNode_free0 (col_node);
#line 84 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
								return result;
#line 530 "tracker-json-cursor.c"
							}
						}
					}
#line 64 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
					__vala_JsonNode_free0 (node);
#line 536 "tracker-json-cursor.c"
				}
			}
		}
	} else {
#line 59 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		switch (0) {
#line 543 "tracker-json-cursor.c"
			default:
			{
#line 89 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
				result = TRACKER_SPARQL_VALUE_TYPE_STRING;
#line 89 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
				_json_object_unref0 (object);
#line 89 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
				__vala_JsonNode_free0 (col_node);
#line 89 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
				return result;
#line 554 "tracker-json-cursor.c"
			}
		}
	}
#line 50 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_json_object_unref0 (object);
#line 50 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	__vala_JsonNode_free0 (col_node);
#line 562 "tracker-json-cursor.c"
}


static const gchar* tracker_remote_json_cursor_real_get_variable_name (TrackerSparqlCursor* base, gint column) {
	TrackerRemoteJsonCursor * self;
	const gchar* result = NULL;
	JsonArray* _tmp0_;
	gint _tmp1_;
	const gchar* _tmp2_;
#line 93 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self = (TrackerRemoteJsonCursor*) base;
#line 94 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp0_ = self->_vars;
#line 94 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp1_ = column;
#line 94 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp2_ = json_array_get_string_element (_tmp0_, (guint) _tmp1_);
#line 94 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	result = _tmp2_;
#line 94 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return result;
#line 584 "tracker-json-cursor.c"
}


static const gchar* tracker_remote_json_cursor_real_get_string (TrackerSparqlCursor* base, gint column, glong* length) {
	TrackerRemoteJsonCursor * self;
	glong _vala_length = 0L;
	const gchar* result = NULL;
	JsonObject* _tmp0_;
	JsonNode* col_node;
	JsonObject* _tmp1_;
	gint _tmp2_;
	const gchar* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonObject* object;
	JsonNode* _tmp7_;
	JsonObject* _tmp8_;
	JsonObject* _tmp9_;
	JsonObject* _tmp10_;
	const gchar* str;
	JsonObject* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	const gchar* _tmp16_;
#line 97 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self = (TrackerRemoteJsonCursor*) base;
#line 97 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp0_ = self->_cur_row;
#line 97 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_vala_return_val_if_fail (_tmp0_ != NULL, "_cur_row != null", NULL);
#line 98 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp1_ = self->_cur_row;
#line 98 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp2_ = column;
#line 98 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp3_ = tracker_sparql_cursor_get_variable_name ((TrackerSparqlCursor*) self, _tmp2_);
#line 98 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp4_ = json_object_get_member (_tmp1_, _tmp3_);
#line 98 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp5_ = __vala_JsonNode_copy0 (_tmp4_);
#line 98 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	col_node = _tmp5_;
#line 99 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_vala_length = (glong) 0;
#line 101 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp6_ = col_node;
#line 101 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (_tmp6_ == NULL) {
#line 102 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		result = NULL;
#line 102 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		__vala_JsonNode_free0 (col_node);
#line 102 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		if (length) {
#line 102 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
			*length = _vala_length;
#line 644 "tracker-json-cursor.c"
		}
#line 102 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		return result;
#line 648 "tracker-json-cursor.c"
	}
#line 104 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp7_ = col_node;
#line 104 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp8_ = json_node_get_object (_tmp7_);
#line 104 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp9_ = _json_object_ref0 (_tmp8_);
#line 104 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	object = _tmp9_;
#line 106 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp10_ = object;
#line 106 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (_tmp10_ == NULL) {
#line 107 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		result = NULL;
#line 107 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		_json_object_unref0 (object);
#line 107 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		__vala_JsonNode_free0 (col_node);
#line 107 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		if (length) {
#line 107 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
			*length = _vala_length;
#line 672 "tracker-json-cursor.c"
		}
#line 107 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		return result;
#line 676 "tracker-json-cursor.c"
	}
#line 109 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp11_ = object;
#line 109 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp12_ = json_object_get_string_member (_tmp11_, "value");
#line 109 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	str = _tmp12_;
#line 110 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp13_ = str;
#line 110 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp14_ = strlen (_tmp13_);
#line 110 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp15_ = _tmp14_;
#line 110 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_vala_length = (glong) _tmp15_;
#line 111 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp16_ = str;
#line 111 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	result = _tmp16_;
#line 111 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_json_object_unref0 (object);
#line 111 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	__vala_JsonNode_free0 (col_node);
#line 111 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (length) {
#line 111 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		*length = _vala_length;
#line 704 "tracker-json-cursor.c"
	}
#line 111 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return result;
#line 708 "tracker-json-cursor.c"
}


static gboolean tracker_remote_json_cursor_real_next (TrackerSparqlCursor* base, GCancellable* cancellable, GError** error) {
	TrackerRemoteJsonCursor * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	guint _tmp2_;
	JsonArray* _tmp3_;
	guint _tmp4_;
	gboolean _tmp5_ = FALSE;
	GCancellable* _tmp6_;
	JsonArray* _tmp10_;
	guint _tmp11_;
	JsonObject* _tmp12_;
	JsonObject* _tmp13_;
	GError * _inner_error_ = NULL;
#line 114 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self = (TrackerRemoteJsonCursor*) base;
#line 115 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp0_ = self->_started_iterating;
#line 115 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (_tmp0_) {
#line 732 "tracker-json-cursor.c"
		guint _tmp1_;
#line 116 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		_tmp1_ = self->_cur_idx;
#line 116 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		self->_cur_idx = _tmp1_ + 1;
#line 738 "tracker-json-cursor.c"
	}
#line 118 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp2_ = self->_cur_idx;
#line 118 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp3_ = self->_results;
#line 118 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp4_ = json_array_get_length (_tmp3_);
#line 118 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (_tmp2_ >= _tmp4_) {
#line 119 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		result = FALSE;
#line 119 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		return result;
#line 752 "tracker-json-cursor.c"
	}
#line 121 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp6_ = cancellable;
#line 121 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (_tmp6_ != NULL) {
#line 758 "tracker-json-cursor.c"
		GCancellable* _tmp7_;
		gboolean _tmp8_;
#line 121 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		_tmp7_ = cancellable;
#line 121 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		_tmp8_ = g_cancellable_is_cancelled (_tmp7_);
#line 121 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		_tmp5_ = _tmp8_;
#line 767 "tracker-json-cursor.c"
	} else {
#line 121 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		_tmp5_ = FALSE;
#line 771 "tracker-json-cursor.c"
	}
#line 121 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (_tmp5_) {
#line 775 "tracker-json-cursor.c"
		GError* _tmp9_;
#line 122 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		_tmp9_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, "Operation was cancelled");
#line 122 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		_inner_error_ = _tmp9_;
#line 122 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		g_propagate_error (error, _inner_error_);
#line 122 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		return FALSE;
#line 785 "tracker-json-cursor.c"
	}
#line 124 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self->_started_iterating = TRUE;
#line 125 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp10_ = self->_results;
#line 125 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp11_ = self->_cur_idx;
#line 125 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp12_ = json_array_get_object_element (_tmp10_, _tmp11_);
#line 125 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp13_ = _json_object_ref0 (_tmp12_);
#line 125 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_json_object_unref0 (self->_cur_row);
#line 125 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self->_cur_row = _tmp13_;
#line 126 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	result = TRUE;
#line 126 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return result;
#line 805 "tracker-json-cursor.c"
}


static void tracker_remote_json_cursor_real_next_async_data_free (gpointer _data) {
	TrackerRemoteJsonCursorNextAsyncData* _data_;
	_data_ = _data;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_g_object_unref0 (_data_->cancellable);
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_g_object_unref0 (_data_->self);
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	g_slice_free (TrackerRemoteJsonCursorNextAsyncData, _data_);
#line 818 "tracker-json-cursor.c"
}


static void tracker_remote_json_cursor_real_next_async (TrackerSparqlCursor* base, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrackerRemoteJsonCursor * self;
	TrackerRemoteJsonCursorNextAsyncData* _data_;
	TrackerRemoteJsonCursor* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self = (TrackerRemoteJsonCursor*) base;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_data_ = g_slice_new0 (TrackerRemoteJsonCursorNextAsyncData);
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	g_task_set_task_data (_data_->_async_result, _data_, tracker_remote_json_cursor_real_next_async_data_free);
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_data_->self = _tmp0_;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp1_ = cancellable;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_g_object_unref0 (_data_->cancellable);
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_data_->cancellable = _tmp2_;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	tracker_remote_json_cursor_real_next_async_co (_data_);
#line 850 "tracker-json-cursor.c"
}


static gboolean tracker_remote_json_cursor_real_next_finish (TrackerSparqlCursor* base, GAsyncResult* _res_, GError** error) {
	gboolean result;
	TrackerRemoteJsonCursorNextAsyncData* _data_;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (NULL == _data_) {
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		return FALSE;
#line 863 "tracker-json-cursor.c"
	}
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	result = _data_->result;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return result;
#line 869 "tracker-json-cursor.c"
}


static gboolean tracker_remote_json_cursor_real_next_async_co (TrackerRemoteJsonCursorNextAsyncData* _data_) {
#line 129 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	switch (_data_->_state_) {
#line 129 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		case 0:
#line 878 "tracker-json-cursor.c"
		goto _state_0;
		default:
#line 129 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		g_assert_not_reached ();
#line 883 "tracker-json-cursor.c"
	}
	_state_0:
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_data_->_tmp1_ = _data_->cancellable;
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_data_->_tmp2_ = tracker_sparql_cursor_next ((TrackerSparqlCursor*) _data_->self, _data_->_tmp1_, &_data_->_inner_error_);
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_data_->_tmp0_ = _data_->_tmp2_;
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		g_object_unref (_data_->_async_result);
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		return FALSE;
#line 900 "tracker-json-cursor.c"
	}
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_data_->result = _data_->_tmp0_;
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (_data_->_state_ != 0) {
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		while (g_task_get_completed (_data_->_async_result) != TRUE) {
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 912 "tracker-json-cursor.c"
		}
	}
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	g_object_unref (_data_->_async_result);
#line 130 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return FALSE;
#line 129 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 129 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	if (_data_->_state_ != 0) {
#line 129 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		while (g_task_get_completed (_data_->_async_result) != TRUE) {
#line 129 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 927 "tracker-json-cursor.c"
		}
	}
#line 129 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	g_object_unref (_data_->_async_result);
#line 129 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return FALSE;
#line 934 "tracker-json-cursor.c"
}


static void tracker_remote_json_cursor_real_rewind (TrackerSparqlCursor* base) {
	TrackerRemoteJsonCursor * self;
#line 133 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self = (TrackerRemoteJsonCursor*) base;
#line 134 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self->_started_iterating = FALSE;
#line 944 "tracker-json-cursor.c"
}


static void tracker_remote_json_cursor_real_close (TrackerSparqlCursor* base) {
	TrackerRemoteJsonCursor * self;
#line 137 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self = (TrackerRemoteJsonCursor*) base;
#line 952 "tracker-json-cursor.c"
}


static gint tracker_remote_json_cursor_real_get_n_columns (TrackerSparqlCursor* base) {
	gint result;
	TrackerRemoteJsonCursor* self;
	JsonArray* _tmp0_;
	guint _tmp1_;
#line 47 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self = (TrackerRemoteJsonCursor*) base;
#line 47 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp0_ = self->_vars;
#line 47 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_tmp1_ = json_array_get_length (_tmp0_);
#line 47 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	result = (gint) _tmp1_;
#line 47 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	return result;
#line 971 "tracker-json-cursor.c"
}


static void tracker_remote_json_cursor_class_init (TrackerRemoteJsonCursorClass * klass) {
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	tracker_remote_json_cursor_parent_class = g_type_class_peek_parent (klass);
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	((TrackerSparqlCursorClass *) klass)->get_value_type = tracker_remote_json_cursor_real_get_value_type;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	((TrackerSparqlCursorClass *) klass)->get_variable_name = tracker_remote_json_cursor_real_get_variable_name;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	((TrackerSparqlCursorClass *) klass)->get_string = tracker_remote_json_cursor_real_get_string;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	((TrackerSparqlCursorClass *) klass)->next = tracker_remote_json_cursor_real_next;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	((TrackerSparqlCursorClass *) klass)->next_async = tracker_remote_json_cursor_real_next_async;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	((TrackerSparqlCursorClass *) klass)->next_finish = tracker_remote_json_cursor_real_next_finish;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	((TrackerSparqlCursorClass *) klass)->rewind = tracker_remote_json_cursor_real_rewind;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	((TrackerSparqlCursorClass *) klass)->close = tracker_remote_json_cursor_real_close;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	TRACKER_SPARQL_CURSOR_CLASS (klass)->get_n_columns = tracker_remote_json_cursor_real_get_n_columns;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_tracker_remote_json_cursor_get_property;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	G_OBJECT_CLASS (klass)->finalize = tracker_remote_json_cursor_finalize;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), TRACKER_REMOTE_JSON_CURSOR_N_COLUMNS, g_param_spec_int ("n-columns", "n-columns", "n-columns", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 1002 "tracker-json-cursor.c"
}


static void tracker_remote_json_cursor_instance_init (TrackerRemoteJsonCursor * self) {
#line 27 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self->_cur_idx = (guint) 0;
#line 28 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self->_started_iterating = FALSE;
#line 1011 "tracker-json-cursor.c"
}


static void tracker_remote_json_cursor_finalize (GObject * obj) {
	TrackerRemoteJsonCursor * self;
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TRACKER_REMOTE_TYPE_JSON_CURSOR, TrackerRemoteJsonCursor);
#line 23 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_g_object_unref0 (self->_parser);
#line 24 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_json_array_unref0 (self->_vars);
#line 25 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_json_array_unref0 (self->_results);
#line 26 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	_json_object_unref0 (self->_cur_row);
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	G_OBJECT_CLASS (tracker_remote_json_cursor_parent_class)->finalize (obj);
#line 1029 "tracker-json-cursor.c"
}


GType tracker_remote_json_cursor_get_type (void) {
	static volatile gsize tracker_remote_json_cursor_type_id__volatile = 0;
	if (g_once_init_enter (&tracker_remote_json_cursor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (TrackerRemoteJsonCursorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tracker_remote_json_cursor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackerRemoteJsonCursor), 0, (GInstanceInitFunc) tracker_remote_json_cursor_instance_init, NULL };
		GType tracker_remote_json_cursor_type_id;
		tracker_remote_json_cursor_type_id = g_type_register_static (TRACKER_SPARQL_TYPE_CURSOR, "TrackerRemoteJsonCursor", &g_define_type_info, 0);
		g_once_init_leave (&tracker_remote_json_cursor_type_id__volatile, tracker_remote_json_cursor_type_id);
	}
	return tracker_remote_json_cursor_type_id__volatile;
}


static void _vala_tracker_remote_json_cursor_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	TrackerRemoteJsonCursor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TRACKER_REMOTE_TYPE_JSON_CURSOR, TrackerRemoteJsonCursor);
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
	switch (property_id) {
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		case TRACKER_REMOTE_JSON_CURSOR_N_COLUMNS:
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		g_value_set_int (value, tracker_sparql_cursor_get_n_columns ((TrackerSparqlCursor*) self));
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		break;
#line 1056 "tracker-json-cursor.c"
		default:
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 22 "/home/carlos/Source/gnome/tracker/src/libtracker-remote/tracker-json-cursor.vala"
		break;
#line 1062 "tracker-json-cursor.c"
	}
}



