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.Uuid;
26 
27 private import glib.Str;
28 private import gtkc.glib;
29 public  import gtkc.glibtypes;
30 
31 
32 /** */
33 public struct Uuid
34 {
35 
36 	/**
37 	 * Parses the string @str and verify if it is a UUID.
38 	 *
39 	 * The function accepts the following syntax:
40 	 *
41 	 * - simple forms (e.g. `f81d4fae-7dec-11d0-a765-00a0c91e6bf6`)
42 	 *
43 	 * Note that hyphens are required within the UUID string itself,
44 	 * as per the aforementioned RFC.
45 	 *
46 	 * Params:
47 	 *     str = a string representing a UUID
48 	 *
49 	 * Returns: %TRUE if @str is a valid UUID, %FALSE otherwise.
50 	 *
51 	 * Since: 2.52
52 	 */
53 	public static bool stringIsValid(string str)
54 	{
55 		return g_uuid_string_is_valid(Str.toStringz(str)) != 0;
56 	}
57 
58 	/**
59 	 * Generates a random UUID (RFC 4122 version 4) as a string.
60 	 *
61 	 * Returns: A string that should be freed with g_free().
62 	 *
63 	 * Since: 2.52
64 	 */
65 	public static string stringRandom()
66 	{
67 		auto retStr = g_uuid_string_random();
68 		
69 		scope(exit) Str.freeString(retStr);
70 		return Str.toString(retStr);
71 	}
72 }