2009-10-09 Chris Toshok <toshok@ximian.com>
[moon.git] / src / propertypath.h
blob46ddc5091dfd64a10b01d1da81e4de50ecc54e3c
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * propertypath.h:
5 * Contact:
6 * Moonlight List (moonlight-list@lists.ximian.com)
8 * Copyright 2009 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
13 #ifndef __PROPERTY_PATH_H__
14 #define __PROPERTY_PATH_H__
16 #include <glib.h>
17 #include <string.h>
19 /* @IncludeInKinds */
20 struct PropertyPath {
21 public:
22 PropertyPath (DependencyProperty *property)
24 this->path = NULL;
25 this->expanded_path = NULL;
26 this->property = property;
29 PropertyPath (const char *path)
31 this->path = g_strdup (path);
32 this->expanded_path = NULL;
33 this->property = NULL;
36 PropertyPath (const PropertyPath &path)
38 this->path = g_strdup (path.path);
39 this->expanded_path = g_strdup (path.expanded_path);
40 this->property = path.property;
43 ~PropertyPath ()
45 g_free (path);
46 g_free (expanded_path);
49 bool operator== (const PropertyPath &v) const
51 if (path) {
52 return v.path && !strcmp (v.path, path);
54 else {
55 return v.property == property;
59 bool operator!= (const PropertyPath &v) const
61 if (path) {
62 return !v.path || strcmp (v.path, path);
64 else {
65 return v.property != property;
69 char *path;
70 char *expanded_path; // This is a path with namespaces expanded into full assembly names
71 DependencyProperty *property;
74 #endif