/* vbfstringliteral.c generated by valac 0.12.1.1-323029-dirty, the Vala compiler
 * generated from vbfstringliteral.vala, do not modify */

/*
 *  vbfstringliteral.vala - Vala Build Framework library
 *  
 *  Copyright (C) 2008 - Andrea Del Signore <sejerpz@tin.it>
 *  
 *  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
 */

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


#define VBF_TYPE_CONFIG_NODE (vbf_config_node_get_type ())
#define VBF_CONFIG_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VBF_TYPE_CONFIG_NODE, VbfConfigNode))
#define VBF_CONFIG_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VBF_TYPE_CONFIG_NODE, VbfConfigNodeClass))
#define VBF_IS_CONFIG_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VBF_TYPE_CONFIG_NODE))
#define VBF_IS_CONFIG_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VBF_TYPE_CONFIG_NODE))
#define VBF_CONFIG_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VBF_TYPE_CONFIG_NODE, VbfConfigNodeClass))

typedef struct _VbfConfigNode VbfConfigNode;
typedef struct _VbfConfigNodeClass VbfConfigNodeClass;
typedef struct _VbfConfigNodePrivate VbfConfigNodePrivate;

#define VBF_TYPE_STRING_LITERAL (vbf_string_literal_get_type ())
#define VBF_STRING_LITERAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VBF_TYPE_STRING_LITERAL, VbfStringLiteral))
#define VBF_STRING_LITERAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VBF_TYPE_STRING_LITERAL, VbfStringLiteralClass))
#define VBF_IS_STRING_LITERAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VBF_TYPE_STRING_LITERAL))
#define VBF_IS_STRING_LITERAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VBF_TYPE_STRING_LITERAL))
#define VBF_STRING_LITERAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VBF_TYPE_STRING_LITERAL, VbfStringLiteralClass))

typedef struct _VbfStringLiteral VbfStringLiteral;
typedef struct _VbfStringLiteralClass VbfStringLiteralClass;
typedef struct _VbfStringLiteralPrivate VbfStringLiteralPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _VbfConfigNode {
	GObject parent_instance;
	VbfConfigNodePrivate * priv;
	VbfConfigNode* parent;
};

struct _VbfConfigNodeClass {
	GObjectClass parent_class;
	gchar* (*to_string) (VbfConfigNode* self);
};

struct _VbfStringLiteral {
	VbfConfigNode parent_instance;
	VbfStringLiteralPrivate * priv;
	gchar* data;
};

struct _VbfStringLiteralClass {
	VbfConfigNodeClass parent_class;
};


static gpointer vbf_string_literal_parent_class = NULL;

GType vbf_config_node_get_type (void) G_GNUC_CONST;
GType vbf_string_literal_get_type (void) G_GNUC_CONST;
enum  {
	VBF_STRING_LITERAL_DUMMY_PROPERTY
};
VbfStringLiteral* vbf_string_literal_new (const gchar* data);
VbfStringLiteral* vbf_string_literal_construct (GType object_type, const gchar* data);
VbfConfigNode* vbf_config_node_construct (GType object_type);
static gchar* vbf_string_literal_real_to_string (VbfConfigNode* base);
static void vbf_string_literal_finalize (GObject* obj);


VbfStringLiteral* vbf_string_literal_construct (GType object_type, const gchar* data) {
	VbfStringLiteral * self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (data != NULL, NULL);
	self = (VbfStringLiteral*) vbf_config_node_construct (object_type);
	_tmp0_ = g_strdup (data);
	_g_free0 (self->data);
	self->data = _tmp0_;
	return self;
}


VbfStringLiteral* vbf_string_literal_new (const gchar* data) {
	return vbf_string_literal_construct (VBF_TYPE_STRING_LITERAL, data);
}


static gchar* vbf_string_literal_real_to_string (VbfConfigNode* base) {
	VbfStringLiteral * self;
	gchar* result = NULL;
	self = (VbfStringLiteral*) base;
	if (self->data == NULL) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("(null)");
		result = _tmp0_;
		return result;
	} else {
		if (g_strcmp0 (self->data, "") == 0) {
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("(empty)");
			result = _tmp1_;
			return result;
		} else {
			gchar* _tmp2_;
			_tmp2_ = g_strdup (self->data);
			result = _tmp2_;
			return result;
		}
	}
}


static void vbf_string_literal_class_init (VbfStringLiteralClass * klass) {
	vbf_string_literal_parent_class = g_type_class_peek_parent (klass);
	VBF_CONFIG_NODE_CLASS (klass)->to_string = vbf_string_literal_real_to_string;
	G_OBJECT_CLASS (klass)->finalize = vbf_string_literal_finalize;
}


static void vbf_string_literal_instance_init (VbfStringLiteral * self) {
}


static void vbf_string_literal_finalize (GObject* obj) {
	VbfStringLiteral * self;
	self = VBF_STRING_LITERAL (obj);
	_g_free0 (self->data);
	G_OBJECT_CLASS (vbf_string_literal_parent_class)->finalize (obj);
}


GType vbf_string_literal_get_type (void) {
	static volatile gsize vbf_string_literal_type_id__volatile = 0;
	if (g_once_init_enter (&vbf_string_literal_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (VbfStringLiteralClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vbf_string_literal_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (VbfStringLiteral), 0, (GInstanceInitFunc) vbf_string_literal_instance_init, NULL };
		GType vbf_string_literal_type_id;
		vbf_string_literal_type_id = g_type_register_static (VBF_TYPE_CONFIG_NODE, "VbfStringLiteral", &g_define_type_info, 0);
		g_once_init_leave (&vbf_string_literal_type_id__volatile, vbf_string_literal_type_id);
	}
	return vbf_string_literal_type_id__volatile;
}



