source: appstream-generator/build/girepo/gio/UnixMountEntry.d @ 4841

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

Initial release

File size: 7.7 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 gio.UnixMountEntry;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.Icon;
26private import gio.IconIF;
27private import glib.ListG;
28private import glib.Str;
29private import gobject.ObjectG;
30
31
32/**
33 * Defines a Unix mount entry (e.g. <filename>/media/cdrom</filename>).
34 * This corresponds roughly to a mtab entry.
35 */
36public struct UnixMountEntry
37{
38
39        /**
40         * Determines if @mount_path is considered an implementation of the
41         * OS. This is primarily used for hiding mountable and mounted volumes
42         * that only are used in the OS and has little to no relevance to the
43         * casual user.
44         *
45         * Params:
46         *     mountPath = a mount path, e.g. `/media/disk` or `/usr`
47         *
48         * Returns: %TRUE if @mount_path is considered an implementation detail
49         *     of the OS.
50         */
51        public static bool isMountPathSystemInternal(string mountPath)
52        {
53                return g_unix_is_mount_path_system_internal(Str.toStringz(mountPath)) != 0;
54        }
55
56        /**
57         * Gets a #GUnixMountEntry for a given mount path. If @time_read
58         * is set, it will be filled with a unix timestamp for checking
59         * if the mounts have changed since with g_unix_mounts_changed_since().
60         *
61         * Params:
62         *     mountPath = path for a possible unix mount.
63         *     timeRead = guint64 to contain a timestamp.
64         *
65         * Returns: a #GUnixMountEntry.
66         */
67        public static GUnixMountEntry* at(string mountPath, out ulong timeRead)
68        {
69                return g_unix_mount_at(Str.toStringz(mountPath), &timeRead);
70        }
71
72        /**
73         * Compares two unix mounts.
74         *
75         * Params:
76         *     mount1 = first #GUnixMountEntry to compare.
77         *     mount2 = second #GUnixMountEntry to compare.
78         *
79         * Returns: 1, 0 or -1 if @mount1 is greater than, equal to,
80         *     or less than @mount2, respectively.
81         */
82        public static int compare(GUnixMountEntry* mount1, GUnixMountEntry* mount2)
83        {
84                return g_unix_mount_compare(mount1, mount2);
85        }
86
87        /**
88         * Frees a unix mount.
89         *
90         * Params:
91         *     mountEntry = a #GUnixMountEntry.
92         */
93        public static void free(GUnixMountEntry* mountEntry)
94        {
95                g_unix_mount_free(mountEntry);
96        }
97
98        /**
99         * Gets the device path for a unix mount.
100         *
101         * Params:
102         *     mountEntry = a #GUnixMount.
103         *
104         * Returns: a string containing the device path.
105         */
106        public static string getDevicePath(GUnixMountEntry* mountEntry)
107        {
108                return Str.toString(g_unix_mount_get_device_path(mountEntry));
109        }
110
111        /**
112         * Gets the filesystem type for the unix mount.
113         *
114         * Params:
115         *     mountEntry = a #GUnixMount.
116         *
117         * Returns: a string containing the file system type.
118         */
119        public static string getFsType(GUnixMountEntry* mountEntry)
120        {
121                return Str.toString(g_unix_mount_get_fs_type(mountEntry));
122        }
123
124        /**
125         * Gets the mount path for a unix mount.
126         *
127         * Params:
128         *     mountEntry = input #GUnixMountEntry to get the mount path for.
129         *
130         * Returns: the mount path for @mount_entry.
131         */
132        public static string getMountPath(GUnixMountEntry* mountEntry)
133        {
134                return Str.toString(g_unix_mount_get_mount_path(mountEntry));
135        }
136
137        /**
138         * Guesses whether a Unix mount can be ejected.
139         *
140         * Params:
141         *     mountEntry = a #GUnixMountEntry
142         *
143         * Returns: %TRUE if @mount_entry is deemed to be ejectable.
144         */
145        public static bool guessCanEject(GUnixMountEntry* mountEntry)
146        {
147                return g_unix_mount_guess_can_eject(mountEntry) != 0;
148        }
149
150        /**
151         * Guesses the icon of a Unix mount.
152         *
153         * Params:
154         *     mountEntry = a #GUnixMountEntry
155         *
156         * Returns: a #GIcon
157         */
158        public static IconIF guessIcon(GUnixMountEntry* mountEntry)
159        {
160                auto p = g_unix_mount_guess_icon(mountEntry);
161               
162                if(p is null)
163                {
164                        return null;
165                }
166               
167                return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p, true);
168        }
169
170        /**
171         * Guesses the name of a Unix mount.
172         * The result is a translated string.
173         *
174         * Params:
175         *     mountEntry = a #GUnixMountEntry
176         *
177         * Returns: A newly allocated string that must
178         *     be freed with g_free()
179         */
180        public static string guessName(GUnixMountEntry* mountEntry)
181        {
182                auto retStr = g_unix_mount_guess_name(mountEntry);
183               
184                scope(exit) Str.freeString(retStr);
185                return Str.toString(retStr);
186        }
187
188        /**
189         * Guesses whether a Unix mount should be displayed in the UI.
190         *
191         * Params:
192         *     mountEntry = a #GUnixMountEntry
193         *
194         * Returns: %TRUE if @mount_entry is deemed to be displayable.
195         */
196        public static bool guessShouldDisplay(GUnixMountEntry* mountEntry)
197        {
198                return g_unix_mount_guess_should_display(mountEntry) != 0;
199        }
200
201        /**
202         * Guesses the symbolic icon of a Unix mount.
203         *
204         * Params:
205         *     mountEntry = a #GUnixMountEntry
206         *
207         * Returns: a #GIcon
208         *
209         * Since: 2.34
210         */
211        public static IconIF guessSymbolicIcon(GUnixMountEntry* mountEntry)
212        {
213                auto p = g_unix_mount_guess_symbolic_icon(mountEntry);
214               
215                if(p is null)
216                {
217                        return null;
218                }
219               
220                return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p, true);
221        }
222
223        /**
224         * Checks if a unix mount is mounted read only.
225         *
226         * Params:
227         *     mountEntry = a #GUnixMount.
228         *
229         * Returns: %TRUE if @mount_entry is read only.
230         */
231        public static bool isReadonly(GUnixMountEntry* mountEntry)
232        {
233                return g_unix_mount_is_readonly(mountEntry) != 0;
234        }
235
236        /**
237         * Checks if a unix mount is a system path.
238         *
239         * Params:
240         *     mountEntry = a #GUnixMount.
241         *
242         * Returns: %TRUE if the unix mount is for a system path.
243         */
244        public static bool isSystemInternal(GUnixMountEntry* mountEntry)
245        {
246                return g_unix_mount_is_system_internal(mountEntry) != 0;
247        }
248
249        /**
250         * Checks if the unix mount points have changed since a given unix time.
251         *
252         * Params:
253         *     time = guint64 to contain a timestamp.
254         *
255         * Returns: %TRUE if the mount points have changed since @time.
256         */
257        public static bool pointsChangedSince(ulong time)
258        {
259                return g_unix_mount_points_changed_since(time) != 0;
260        }
261
262        /**
263         * Gets a #GList of #GUnixMountPoint containing the unix mount points.
264         * If @time_read is set, it will be filled with the mount timestamp,
265         * allowing for checking if the mounts have changed with
266         * g_unix_mount_points_changed_since().
267         *
268         * Params:
269         *     timeRead = guint64 to contain a timestamp.
270         *
271         * Returns: a #GList of the UNIX mountpoints.
272         */
273        public static ListG mountPointsGet(out ulong timeRead)
274        {
275                auto p = g_unix_mount_points_get(&timeRead);
276               
277                if(p is null)
278                {
279                        return null;
280                }
281               
282                return new ListG(cast(GList*) p, true);
283        }
284
285        /**
286         * Checks if the unix mounts have changed since a given unix time.
287         *
288         * Params:
289         *     time = guint64 to contain a timestamp.
290         *
291         * Returns: %TRUE if the mounts have changed since @time.
292         */
293        public static bool mountsChangedSince(ulong time)
294        {
295                return g_unix_mounts_changed_since(time) != 0;
296        }
297
298        /**
299         * Gets a #GList of #GUnixMountEntry containing the unix mounts.
300         * If @time_read is set, it will be filled with the mount
301         * timestamp, allowing for checking if the mounts have changed
302         * with g_unix_mounts_changed_since().
303         *
304         * Params:
305         *     timeRead = guint64 to contain a timestamp, or %NULL
306         *
307         * Returns: a #GList of the UNIX mounts.
308         */
309        public static ListG mountsGet(out ulong timeRead)
310        {
311                auto p = g_unix_mounts_get(&timeRead);
312               
313                if(p is null)
314                {
315                        return null;
316                }
317               
318                return new ListG(cast(GList*) p, true);
319        }
320}
Note: See TracBrowser for help on using the repository browser.