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

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

Initial release

File size: 4.8 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.UnixMountPoint;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.Icon;
26private import gio.IconIF;
27private import glib.Str;
28private import gobject.ObjectG;
29
30
31/**
32 * Defines a Unix mount point (e.g. <filename>/dev</filename>).
33 * This corresponds roughly to a fstab entry.
34 */
35public class UnixMountPoint
36{
37        /** the main Gtk struct */
38        protected GUnixMountPoint* gUnixMountPoint;
39        protected bool ownedRef;
40
41        /** Get the main Gtk struct */
42        public GUnixMountPoint* getUnixMountPointStruct()
43        {
44                return gUnixMountPoint;
45        }
46
47        /** the main Gtk struct as a void* */
48        protected void* getStruct()
49        {
50                return cast(void*)gUnixMountPoint;
51        }
52
53        /**
54         * Sets our main struct and passes it to the parent class.
55         */
56        public this (GUnixMountPoint* gUnixMountPoint, bool ownedRef = false)
57        {
58                this.gUnixMountPoint = gUnixMountPoint;
59                this.ownedRef = ownedRef;
60        }
61
62
63        /**
64         * Compares two unix mount points.
65         *
66         * Params:
67         *     mount2 = a #GUnixMount.
68         *
69         * Returns: 1, 0 or -1 if @mount1 is greater than, equal to,
70         *     or less than @mount2, respectively.
71         */
72        public int compare(UnixMountPoint mount2)
73        {
74                return g_unix_mount_point_compare(gUnixMountPoint, (mount2 is null) ? null : mount2.getUnixMountPointStruct());
75        }
76
77        /**
78         * Frees a unix mount point.
79         */
80        public void free()
81        {
82                g_unix_mount_point_free(gUnixMountPoint);
83        }
84
85        /**
86         * Gets the device path for a unix mount point.
87         *
88         * Returns: a string containing the device path.
89         */
90        public string getDevicePath()
91        {
92                return Str.toString(g_unix_mount_point_get_device_path(gUnixMountPoint));
93        }
94
95        /**
96         * Gets the file system type for the mount point.
97         *
98         * Returns: a string containing the file system type.
99         */
100        public string getFsType()
101        {
102                return Str.toString(g_unix_mount_point_get_fs_type(gUnixMountPoint));
103        }
104
105        /**
106         * Gets the mount path for a unix mount point.
107         *
108         * Returns: a string containing the mount path.
109         */
110        public string getMountPath()
111        {
112                return Str.toString(g_unix_mount_point_get_mount_path(gUnixMountPoint));
113        }
114
115        /**
116         * Gets the options for the mount point.
117         *
118         * Returns: a string containing the options.
119         *
120         * Since: 2.32
121         */
122        public string getOptions()
123        {
124                return Str.toString(g_unix_mount_point_get_options(gUnixMountPoint));
125        }
126
127        /**
128         * Guesses whether a Unix mount point can be ejected.
129         *
130         * Returns: %TRUE if @mount_point is deemed to be ejectable.
131         */
132        public bool guessCanEject()
133        {
134                return g_unix_mount_point_guess_can_eject(gUnixMountPoint) != 0;
135        }
136
137        /**
138         * Guesses the icon of a Unix mount point.
139         *
140         * Returns: a #GIcon
141         */
142        public IconIF guessIcon()
143        {
144                auto p = g_unix_mount_point_guess_icon(gUnixMountPoint);
145               
146                if(p is null)
147                {
148                        return null;
149                }
150               
151                return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p, true);
152        }
153
154        /**
155         * Guesses the name of a Unix mount point.
156         * The result is a translated string.
157         *
158         * Returns: A newly allocated string that must
159         *     be freed with g_free()
160         */
161        public string guessName()
162        {
163                auto retStr = g_unix_mount_point_guess_name(gUnixMountPoint);
164               
165                scope(exit) Str.freeString(retStr);
166                return Str.toString(retStr);
167        }
168
169        /**
170         * Guesses the symbolic icon of a Unix mount point.
171         *
172         * Returns: a #GIcon
173         *
174         * Since: 2.34
175         */
176        public IconIF guessSymbolicIcon()
177        {
178                auto p = g_unix_mount_point_guess_symbolic_icon(gUnixMountPoint);
179               
180                if(p is null)
181                {
182                        return null;
183                }
184               
185                return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p, true);
186        }
187
188        /**
189         * Checks if a unix mount point is a loopback device.
190         *
191         * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
192         */
193        public bool isLoopback()
194        {
195                return g_unix_mount_point_is_loopback(gUnixMountPoint) != 0;
196        }
197
198        /**
199         * Checks if a unix mount point is read only.
200         *
201         * Returns: %TRUE if a mount point is read only.
202         */
203        public bool isReadonly()
204        {
205                return g_unix_mount_point_is_readonly(gUnixMountPoint) != 0;
206        }
207
208        /**
209         * Checks if a unix mount point is mountable by the user.
210         *
211         * Returns: %TRUE if the mount point is user mountable.
212         */
213        public bool isUserMountable()
214        {
215                return g_unix_mount_point_is_user_mountable(gUnixMountPoint) != 0;
216        }
217}
Note: See TracBrowser for help on using the repository browser.