source: appstream-generator/build/girepo/glib/DataSet.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 3.5 KB
Line 
1/*
2 * Licensed under the GNU Lesser General Public License Version 3
3 *
4 * This library is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the license, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18// generated automatically - do not change
19
20
21module glib.DataSet;
22
23private import gi.glib;
24public  import gi.glibtypes;
25
26
27/** */
28public struct DataSet
29{
30
31        /**
32         * Destroys the dataset, freeing all memory allocated, and calling any
33         * destroy functions set for data elements.
34         *
35         * Params:
36         *     datasetLocation = the location identifying the dataset.
37         */
38        public static void destroy(void* datasetLocation)
39        {
40                g_dataset_destroy(datasetLocation);
41        }
42
43        /**
44         * Calls the given function for each data element which is associated
45         * with the given location. Note that this function is NOT thread-safe.
46         * So unless @datalist can be protected from any modifications during
47         * invocation of this function, it should not be called.
48         *
49         * Params:
50         *     datasetLocation = the location identifying the dataset.
51         *     func = the function to call for each data element.
52         *     userData = user data to pass to the function.
53         */
54        public static void foreac(void* datasetLocation, GDataForeachFunc func, void* userData)
55        {
56                g_dataset_foreach(datasetLocation, func, userData);
57        }
58
59        /**
60         * Gets the data element corresponding to a #GQuark.
61         *
62         * Params:
63         *     datasetLocation = the location identifying the dataset.
64         *     keyId = the #GQuark id to identify the data element.
65         *
66         * Returns: the data element corresponding to the #GQuark, or %NULL if
67         *     it is not found.
68         */
69        public static void* idGetData(void* datasetLocation, GQuark keyId)
70        {
71                return g_dataset_id_get_data(datasetLocation, keyId);
72        }
73
74        /**
75         * Removes an element, without calling its destroy notification
76         * function.
77         *
78         * Params:
79         *     datasetLocation = the location identifying the dataset.
80         *     keyId = the #GQuark ID identifying the data element.
81         *
82         * Returns: the data previously stored at @key_id, or %NULL if none.
83         */
84        public static void* idRemoveNoNotify(void* datasetLocation, GQuark keyId)
85        {
86                return g_dataset_id_remove_no_notify(datasetLocation, keyId);
87        }
88
89        /**
90         * Sets the data element associated with the given #GQuark id, and also
91         * the function to call when the data element is destroyed. Any
92         * previous data with the same key is removed, and its destroy function
93         * is called.
94         *
95         * Params:
96         *     datasetLocation = the location identifying the dataset.
97         *     keyId = the #GQuark id to identify the data element.
98         *     data = the data element.
99         *     destroyFunc = the function to call when the data element is
100         *         removed. This function will be called with the data
101         *         element and can be used to free any memory allocated
102         *         for it.
103         */
104        public static void idSetDataFull(void* datasetLocation, GQuark keyId, void* data, GDestroyNotify destroyFunc)
105        {
106                g_dataset_id_set_data_full(datasetLocation, keyId, data, destroyFunc);
107        }
108}
Note: See TracBrowser for help on using the repository browser.