1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = GTlsFileDatabase.html
27  * outPack = gio
28  * outFile = TlsFileDatabase
29  * strct   = GTlsFileDatabase
30  * realStrct=
31  * ctorStrct=GTlsDatabase
32  * clss    = TlsFileDatabase
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = GTlsDatabase
38  * implements:
39  * prefixes:
40  * 	- g_tls_file_database_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- glib.ErrorG
48  * 	- glib.GException
49  * structWrap:
50  * module aliases:
51  * local aliases:
52  * overrides:
53  */
54 
55 module gio.TlsFileDatabase;
56 
57 public  import gtkc.giotypes;
58 
59 private import gtkc.gio;
60 private import glib.ConstructionException;
61 private import gobject.ObjectG;
62 
63 
64 private import glib.Str;
65 private import glib.ErrorG;
66 private import glib.GException;
67 
68 
69 
70 private import gio.TlsDatabase;
71 
72 /**
73  * GTlsFileDatabase is implemented by GTlsDatabase objects which load
74  * their certificate information from a file. It is an interface which
75  * TLS library specific subtypes implement.
76  */
77 public class TlsFileDatabase : TlsDatabase
78 {
79 	
80 	/** the main Gtk struct */
81 	protected GTlsFileDatabase* gTlsFileDatabase;
82 	
83 	
84 	public GTlsFileDatabase* getTlsFileDatabaseStruct()
85 	{
86 		return gTlsFileDatabase;
87 	}
88 	
89 	
90 	/** the main Gtk struct as a void* */
91 	protected override void* getStruct()
92 	{
93 		return cast(void*)gTlsFileDatabase;
94 	}
95 	
96 	/**
97 	 * Sets our main struct and passes it to the parent class
98 	 */
99 	public this (GTlsFileDatabase* gTlsFileDatabase)
100 	{
101 		super(cast(GTlsDatabase*)gTlsFileDatabase);
102 		this.gTlsFileDatabase = gTlsFileDatabase;
103 	}
104 	
105 	protected override void setStruct(GObject* obj)
106 	{
107 		super.setStruct(obj);
108 		gTlsFileDatabase = cast(GTlsFileDatabase*)obj;
109 	}
110 	
111 	/**
112 	 */
113 	
114 	/**
115 	 * Creates a new GTlsFileDatabase which uses anchor certificate authorities
116 	 * in anchors to verify certificate chains.
117 	 * The certificates in anchors must be PEM encoded.
118 	 * Since 2.30
119 	 * Params:
120 	 * anchors = filename of anchor certificate authorities.
121 	 * Throws: GException on failure.
122 	 * Throws: ConstructionException GTK+ fails to create the object.
123 	 */
124 	public this (string anchors)
125 	{
126 		// GTlsDatabase * g_tls_file_database_new (const gchar *anchors,  GError **error);
127 		GError* err = null;
128 		
129 		auto p = g_tls_file_database_new(Str.toStringz(anchors), &err);
130 		
131 		if (err !is null)
132 		{
133 			throw new GException( new ErrorG(err) );
134 		}
135 		
136 		if(p is null)
137 		{
138 			throw new ConstructionException("null returned by g_tls_file_database_new(Str.toStringz(anchors), &err)");
139 		}
140 		this(cast(GTlsFileDatabase*) p);
141 	}
142 }