2009-12-01 Jeffrey Stedfast <fejj@novell.com>
[moon.git] / src / managedtypeinfo.cpp
blob95ec33e4403f07cc9ebb6f47b77f15a40e8bebb6
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * managedtypeinfo.cpp
5 * Copyright 2009 Novell, Inc. (http://www.novell.com)
7 * See the LICENSE file included with the distribution for details.
8 *
9 */
11 #include <config.h>
12 #include <glib.h>
13 #include <string.h>
15 #include "managedtypeinfo.h"
17 ManagedTypeInfo::ManagedTypeInfo (const ManagedTypeInfo& v)
19 Initialize (v.assembly_name, v.full_name);
22 ManagedTypeInfo::~ManagedTypeInfo ()
24 g_free (assembly_name);
25 g_free (full_name);
28 void
29 ManagedTypeInfo::Initialize (const char *assembly_name, const char *full_name)
31 this->assembly_name = g_strdup (assembly_name);
32 this->full_name = g_strdup (full_name);
35 bool
36 ManagedTypeInfo::operator == (const ManagedTypeInfo &v)
38 return strcmp (assembly_name, v.assembly_name) == 0 && strcmp (full_name, v.full_name) == 0;
41 bool
42 ManagedTypeInfo::operator != (const ManagedTypeInfo &v)
44 return !(*this == v);
47 ManagedTypeInfo&
48 ManagedTypeInfo::operator = (const ManagedTypeInfo &v)
50 if (this != &v) {
51 g_free (this->assembly_name);
52 g_free (this->full_name);
53 this->assembly_name = g_strdup (v.assembly_name);
54 this->full_name = g_strdup (v.full_name);
56 return *this;
59 void
60 ManagedTypeInfo::Free (ManagedTypeInfo *mti)
62 if (mti == NULL)
63 return;
65 g_free (mti->assembly_name);
66 g_free (mti->full_name);
67 g_free (mti);