1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module glib.Quark;
26 
27 private import glib.Str;
28 private import gtkc.glib;
29 public  import gtkc.glibtypes;
30 
31 
32 public struct Quark
33 {
34 	/**
35 	 */
36 
37 	/**
38 	 * Returns a canonical representation for @string. Interned strings
39 	 * can be compared for equality by comparing the pointers, instead of
40 	 * using strcmp(). g_intern_static_string() does not copy the string,
41 	 * therefore @string must not be freed or modified.
42 	 *
43 	 * Params:
44 	 *     str = a static string
45 	 *
46 	 * Return: a canonical representation for the string
47 	 *
48 	 * Since: 2.10
49 	 */
50 	public static string internStaticString(string str)
51 	{
52 		return Str.toString(g_intern_static_string(Str.toStringz(str)));
53 	}
54 
55 	/**
56 	 * Returns a canonical representation for @string. Interned strings
57 	 * can be compared for equality by comparing the pointers, instead of
58 	 * using strcmp().
59 	 *
60 	 * Params:
61 	 *     str = a string
62 	 *
63 	 * Return: a canonical representation for the string
64 	 *
65 	 * Since: 2.10
66 	 */
67 	public static string internString(string str)
68 	{
69 		return Str.toString(g_intern_string(Str.toStringz(str)));
70 	}
71 
72 	/**
73 	 * Gets the #GQuark identifying the given (static) string. If the
74 	 * string does not currently have an associated #GQuark, a new #GQuark
75 	 * is created, linked to the given string.
76 	 *
77 	 * Note that this function is identical to g_quark_from_string() except
78 	 * that if a new #GQuark is created the string itself is used rather
79 	 * than a copy. This saves memory, but can only be used if the string
80 	 * will continue to exist until the program terminates. It can be used
81 	 * with statically allocated strings in the main program, but not with
82 	 * statically allocated memory in dynamically loaded modules, if you
83 	 * expect to ever unload the module again (e.g. do not use this
84 	 * function in GTK+ theme engines).
85 	 *
86 	 * Params:
87 	 *     str = a string
88 	 *
89 	 * Return: the #GQuark identifying the string, or 0 if @string is %NULL
90 	 */
91 	public static GQuark quarkFromStaticString(string str)
92 	{
93 		return g_quark_from_static_string(Str.toStringz(str));
94 	}
95 
96 	/**
97 	 * Gets the #GQuark identifying the given string. If the string does
98 	 * not currently have an associated #GQuark, a new #GQuark is created,
99 	 * using a copy of the string.
100 	 *
101 	 * Params:
102 	 *     str = a string
103 	 *
104 	 * Return: the #GQuark identifying the string, or 0 if @string is %NULL
105 	 */
106 	public static GQuark quarkFromString(string str)
107 	{
108 		return g_quark_from_string(Str.toStringz(str));
109 	}
110 
111 	/**
112 	 * Gets the string associated with the given #GQuark.
113 	 *
114 	 * Params:
115 	 *     quark = a #GQuark.
116 	 *
117 	 * Return: the string associated with the #GQuark
118 	 */
119 	public static string quarkToString(GQuark quark)
120 	{
121 		return Str.toString(g_quark_to_string(quark));
122 	}
123 
124 	/**
125 	 * Gets the #GQuark associated with the given string, or 0 if string is
126 	 * %NULL or it has no associated #GQuark.
127 	 *
128 	 * If you want the GQuark to be created if it doesn't already exist,
129 	 * use g_quark_from_string() or g_quark_from_static_string().
130 	 *
131 	 * Params:
132 	 *     str = a string
133 	 *
134 	 * Return: the #GQuark associated with the string, or 0 if @string is
135 	 *     %NULL or there is no #GQuark associated with it
136 	 */
137 	public static GQuark quarkTryString(string str)
138 	{
139 		return g_quark_try_string(Str.toStringz(str));
140 	}
141 }