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

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

Initial release

File size: 3.9 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.FileAttributeInfoList;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import glib.ConstructionException;
26private import glib.Str;
27private import gobject.ObjectG;
28
29
30/**
31 * Acts as a lightweight registry for possible valid file attributes.
32 * The registry stores Key-Value pair formats as #GFileAttributeInfos.
33 */
34public class FileAttributeInfoList
35{
36        /** the main Gtk struct */
37        protected GFileAttributeInfoList* gFileAttributeInfoList;
38        protected bool ownedRef;
39
40        /** Get the main Gtk struct */
41        public GFileAttributeInfoList* getFileAttributeInfoListStruct()
42        {
43                return gFileAttributeInfoList;
44        }
45
46        /** the main Gtk struct as a void* */
47        protected void* getStruct()
48        {
49                return cast(void*)gFileAttributeInfoList;
50        }
51
52        /**
53         * Sets our main struct and passes it to the parent class.
54         */
55        public this (GFileAttributeInfoList* gFileAttributeInfoList, bool ownedRef = false)
56        {
57                this.gFileAttributeInfoList = gFileAttributeInfoList;
58                this.ownedRef = ownedRef;
59        }
60
61
62        /** */
63        public static GType getType()
64        {
65                return g_file_attribute_info_list_get_type();
66        }
67
68        /**
69         * Creates a new file attribute info list.
70         *
71         * Returns: a #GFileAttributeInfoList.
72         *
73         * Throws: ConstructionException GTK+ fails to create the object.
74         */
75        public this()
76        {
77                auto p = g_file_attribute_info_list_new();
78               
79                if(p is null)
80                {
81                        throw new ConstructionException("null returned by new");
82                }
83               
84                this(cast(GFileAttributeInfoList*) p);
85        }
86
87        /**
88         * Adds a new attribute with @name to the @list, setting
89         * its @type and @flags.
90         *
91         * Params:
92         *     name = the name of the attribute to add.
93         *     type = the #GFileAttributeType for the attribute.
94         *     flags = #GFileAttributeInfoFlags for the attribute.
95         */
96        public void add(string name, GFileAttributeType type, GFileAttributeInfoFlags flags)
97        {
98                g_file_attribute_info_list_add(gFileAttributeInfoList, Str.toStringz(name), type, flags);
99        }
100
101        /**
102         * Makes a duplicate of a file attribute info list.
103         *
104         * Returns: a copy of the given @list.
105         */
106        public FileAttributeInfoList dup()
107        {
108                auto p = g_file_attribute_info_list_dup(gFileAttributeInfoList);
109               
110                if(p is null)
111                {
112                        return null;
113                }
114               
115                return ObjectG.getDObject!(FileAttributeInfoList)(cast(GFileAttributeInfoList*) p, true);
116        }
117
118        /**
119         * Gets the file attribute with the name @name from @list.
120         *
121         * Params:
122         *     name = the name of the attribute to lookup.
123         *
124         * Returns: a #GFileAttributeInfo for the @name, or %NULL if an
125         *     attribute isn't found.
126         */
127        public GFileAttributeInfo* lookup(string name)
128        {
129                return g_file_attribute_info_list_lookup(gFileAttributeInfoList, Str.toStringz(name));
130        }
131
132        /**
133         * References a file attribute info list.
134         *
135         * Returns: #GFileAttributeInfoList or %NULL on error.
136         */
137        public FileAttributeInfoList doref()
138        {
139                auto p = g_file_attribute_info_list_ref(gFileAttributeInfoList);
140               
141                if(p is null)
142                {
143                        return null;
144                }
145               
146                return ObjectG.getDObject!(FileAttributeInfoList)(cast(GFileAttributeInfoList*) p, true);
147        }
148
149        /**
150         * Removes a reference from the given @list. If the reference count
151         * falls to zero, the @list is deleted.
152         */
153        public void unref()
154        {
155                g_file_attribute_info_list_unref(gFileAttributeInfoList);
156        }
157}
Note: See TracBrowser for help on using the repository browser.