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

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

Initial release

File size: 3.4 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.ZlibCompressor;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.ConverterIF;
26private import gio.ConverterT;
27private import gio.FileInfo;
28private import glib.ConstructionException;
29private import gobject.ObjectG;
30
31
32/**
33 * Zlib decompression
34 */
35public class ZlibCompressor : ObjectG, ConverterIF
36{
37        /** the main Gtk struct */
38        protected GZlibCompressor* gZlibCompressor;
39
40        /** Get the main Gtk struct */
41        public GZlibCompressor* getZlibCompressorStruct()
42        {
43                return gZlibCompressor;
44        }
45
46        /** the main Gtk struct as a void* */
47        protected override void* getStruct()
48        {
49                return cast(void*)gZlibCompressor;
50        }
51
52        protected override void setStruct(GObject* obj)
53        {
54                gZlibCompressor = cast(GZlibCompressor*)obj;
55                super.setStruct(obj);
56        }
57
58        /**
59         * Sets our main struct and passes it to the parent class.
60         */
61        public this (GZlibCompressor* gZlibCompressor, bool ownedRef = false)
62        {
63                this.gZlibCompressor = gZlibCompressor;
64                super(cast(GObject*)gZlibCompressor, ownedRef);
65        }
66
67        // add the Converter capabilities
68        mixin ConverterT!(GZlibCompressor);
69
70
71        /** */
72        public static GType getType()
73        {
74                return g_zlib_compressor_get_type();
75        }
76
77        /**
78         * Creates a new #GZlibCompressor.
79         *
80         * Params:
81         *     format = The format to use for the compressed data
82         *     level = compression level (0-9), -1 for default
83         *
84         * Returns: a new #GZlibCompressor
85         *
86         * Since: 2.24
87         *
88         * Throws: ConstructionException GTK+ fails to create the object.
89         */
90        public this(GZlibCompressorFormat format, int level)
91        {
92                auto p = g_zlib_compressor_new(format, level);
93               
94                if(p is null)
95                {
96                        throw new ConstructionException("null returned by new");
97                }
98               
99                this(cast(GZlibCompressor*) p, true);
100        }
101
102        /**
103         * Returns the #GZlibCompressor:file-info property.
104         *
105         * Returns: a #GFileInfo, or %NULL
106         *
107         * Since: 2.26
108         */
109        public FileInfo getFileInfo()
110        {
111                auto p = g_zlib_compressor_get_file_info(gZlibCompressor);
112               
113                if(p is null)
114                {
115                        return null;
116                }
117               
118                return ObjectG.getDObject!(FileInfo)(cast(GFileInfo*) p);
119        }
120
121        /**
122         * Sets @file_info in @compressor. If non-%NULL, and @compressor's
123         * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
124         * it will be used to set the file name and modification time in
125         * the GZIP header of the compressed data.
126         *
127         * Note: it is an error to call this function while a compression is in
128         * progress; it may only be called immediately after creation of @compressor,
129         * or after resetting it with g_converter_reset().
130         *
131         * Params:
132         *     fileInfo = a #GFileInfo
133         *
134         * Since: 2.26
135         */
136        public void setFileInfo(FileInfo fileInfo)
137        {
138                g_zlib_compressor_set_file_info(gZlibCompressor, (fileInfo is null) ? null : fileInfo.getFileInfoStruct());
139        }
140}
Note: See TracBrowser for help on using the repository browser.