/* search-result.c generated by valac 0.56.19, the Vala compiler
 * generated from search-result.vala, do not modify */

/* compile this file with `valac --pkg posix repo.vala -C -H repo.h`*/

#include "seafile-object.h"
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	SEAFILE_SEARCH_RESULT_0_PROPERTY,
	SEAFILE_SEARCH_RESULT_PATH_PROPERTY,
	SEAFILE_SEARCH_RESULT_SIZE_PROPERTY,
	SEAFILE_SEARCH_RESULT_MTIME_PROPERTY,
	SEAFILE_SEARCH_RESULT_IS_DIR_PROPERTY,
	SEAFILE_SEARCH_RESULT_NUM_PROPERTIES
};
static GParamSpec* seafile_search_result_properties[SEAFILE_SEARCH_RESULT_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

struct _SeafileSearchResultPrivate {
	gint64 _size;
	gint64 _mtime;
	gboolean _is_dir;
};

static gint SeafileSearchResult_private_offset;
static gpointer seafile_search_result_parent_class = NULL;

static void seafile_search_result_finalize (GObject * obj);
static GType seafile_search_result_get_type_once (void);
static void _vala_seafile_search_result_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_seafile_search_result_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);

static inline gpointer
seafile_search_result_get_instance_private (SeafileSearchResult* self)
{
	return G_STRUCT_MEMBER_P (self, SeafileSearchResult_private_offset);
}

SeafileSearchResult*
seafile_search_result_construct (GType object_type)
{
	SeafileSearchResult * self = NULL;
	self = (SeafileSearchResult*) g_object_new (object_type, NULL);
	return self;
}

SeafileSearchResult*
seafile_search_result_new (void)
{
	return seafile_search_result_construct (SEAFILE_TYPE_SEARCH_RESULT);
}

const gchar*
seafile_search_result_get_path (SeafileSearchResult* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_path;
	result = _tmp0_;
	return result;
}

void
seafile_search_result_set_path (SeafileSearchResult* self,
                                const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->_path);
	self->_path = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, seafile_search_result_properties[SEAFILE_SEARCH_RESULT_PATH_PROPERTY]);
}

gint64
seafile_search_result_get_size (SeafileSearchResult* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_size;
	return result;
}

void
seafile_search_result_set_size (SeafileSearchResult* self,
                                gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = seafile_search_result_get_size (self);
	if (old_value != value) {
		self->priv->_size = value;
		g_object_notify_by_pspec ((GObject *) self, seafile_search_result_properties[SEAFILE_SEARCH_RESULT_SIZE_PROPERTY]);
	}
}

gint64
seafile_search_result_get_mtime (SeafileSearchResult* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_mtime;
	return result;
}

void
seafile_search_result_set_mtime (SeafileSearchResult* self,
                                 gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = seafile_search_result_get_mtime (self);
	if (old_value != value) {
		self->priv->_mtime = value;
		g_object_notify_by_pspec ((GObject *) self, seafile_search_result_properties[SEAFILE_SEARCH_RESULT_MTIME_PROPERTY]);
	}
}

gboolean
seafile_search_result_get_is_dir (SeafileSearchResult* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_dir;
	return result;
}

void
seafile_search_result_set_is_dir (SeafileSearchResult* self,
                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = seafile_search_result_get_is_dir (self);
	if (old_value != value) {
		self->priv->_is_dir = value;
		g_object_notify_by_pspec ((GObject *) self, seafile_search_result_properties[SEAFILE_SEARCH_RESULT_IS_DIR_PROPERTY]);
	}
}

static void
seafile_search_result_class_init (SeafileSearchResultClass * klass,
                                  gpointer klass_data)
{
	seafile_search_result_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SeafileSearchResult_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_seafile_search_result_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_seafile_search_result_set_property;
	G_OBJECT_CLASS (klass)->finalize = seafile_search_result_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_SEARCH_RESULT_PATH_PROPERTY, seafile_search_result_properties[SEAFILE_SEARCH_RESULT_PATH_PROPERTY] = g_param_spec_string ("path", "path", "path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_SEARCH_RESULT_SIZE_PROPERTY, seafile_search_result_properties[SEAFILE_SEARCH_RESULT_SIZE_PROPERTY] = g_param_spec_int64 ("size", "size", "size", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_SEARCH_RESULT_MTIME_PROPERTY, seafile_search_result_properties[SEAFILE_SEARCH_RESULT_MTIME_PROPERTY] = g_param_spec_int64 ("mtime", "mtime", "mtime", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_SEARCH_RESULT_IS_DIR_PROPERTY, seafile_search_result_properties[SEAFILE_SEARCH_RESULT_IS_DIR_PROPERTY] = g_param_spec_boolean ("is-dir", "is-dir", "is-dir", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
seafile_search_result_instance_init (SeafileSearchResult * self,
                                     gpointer klass)
{
	self->priv = seafile_search_result_get_instance_private (self);
}

static void
seafile_search_result_finalize (GObject * obj)
{
	SeafileSearchResult * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SEAFILE_TYPE_SEARCH_RESULT, SeafileSearchResult);
	_g_free0 (self->_path);
	G_OBJECT_CLASS (seafile_search_result_parent_class)->finalize (obj);
}

static GType
seafile_search_result_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SeafileSearchResultClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) seafile_search_result_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SeafileSearchResult), 0, (GInstanceInitFunc) seafile_search_result_instance_init, NULL };
	GType seafile_search_result_type_id;
	seafile_search_result_type_id = g_type_register_static (G_TYPE_OBJECT, "SeafileSearchResult", &g_define_type_info, 0);
	SeafileSearchResult_private_offset = g_type_add_instance_private (seafile_search_result_type_id, sizeof (SeafileSearchResultPrivate));
	return seafile_search_result_type_id;
}

GType
seafile_search_result_get_type (void)
{
	static volatile gsize seafile_search_result_type_id__once = 0;
	if (g_once_init_enter (&seafile_search_result_type_id__once)) {
		GType seafile_search_result_type_id;
		seafile_search_result_type_id = seafile_search_result_get_type_once ();
		g_once_init_leave (&seafile_search_result_type_id__once, seafile_search_result_type_id);
	}
	return seafile_search_result_type_id__once;
}

static void
_vala_seafile_search_result_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	SeafileSearchResult * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SEAFILE_TYPE_SEARCH_RESULT, SeafileSearchResult);
	switch (property_id) {
		case SEAFILE_SEARCH_RESULT_PATH_PROPERTY:
		g_value_set_string (value, seafile_search_result_get_path (self));
		break;
		case SEAFILE_SEARCH_RESULT_SIZE_PROPERTY:
		g_value_set_int64 (value, seafile_search_result_get_size (self));
		break;
		case SEAFILE_SEARCH_RESULT_MTIME_PROPERTY:
		g_value_set_int64 (value, seafile_search_result_get_mtime (self));
		break;
		case SEAFILE_SEARCH_RESULT_IS_DIR_PROPERTY:
		g_value_set_boolean (value, seafile_search_result_get_is_dir (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_seafile_search_result_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	SeafileSearchResult * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SEAFILE_TYPE_SEARCH_RESULT, SeafileSearchResult);
	switch (property_id) {
		case SEAFILE_SEARCH_RESULT_PATH_PROPERTY:
		seafile_search_result_set_path (self, g_value_get_string (value));
		break;
		case SEAFILE_SEARCH_RESULT_SIZE_PROPERTY:
		seafile_search_result_set_size (self, g_value_get_int64 (value));
		break;
		case SEAFILE_SEARCH_RESULT_MTIME_PROPERTY:
		seafile_search_result_set_mtime (self, g_value_get_int64 (value));
		break;
		case SEAFILE_SEARCH_RESULT_IS_DIR_PROPERTY:
		seafile_search_result_set_is_dir (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

