QGIS API Documentation
2.14.0-Essen
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
core
qgsdatasourceuri.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsdatasourceuri.h - Structure to contain the component parts
3
of a data source URI
4
-------------------
5
begin : Dec 5, 2004
6
copyright : (C) 2004 by Gary E.Sherman
7
email : sherman at mrcc.com
8
***************************************************************************/
9
10
/***************************************************************************
11
* *
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
16
* *
17
***************************************************************************/
18
19
#ifndef QGSDATASOURCEURI_H
20
#define QGSDATASOURCEURI_H
21
22
#include "
qgis.h
"
23
24
#include <QMap>
25
35
class
CORE_EXPORT
QgsDataSourceURI
36
{
37
public
:
38
enum
SSLmode
{ SSLprefer, SSLdisable, SSLallow, SSLrequire };
39
41
QgsDataSourceURI
();
42
44
QgsDataSourceURI
(
QString
uri );
45
47
QgsDataSourceURI
(
const
QByteArray
& uri );
48
50
QString
connectionInfo(
bool
expandAuthConfig =
true
)
const
;
51
53
QString
uri(
bool
expandAuthConfig =
true
)
const
;
54
56
QByteArray
encodedUri()
const
;
57
59
// \note not available in python bindings
60
void
setEncodedUri(
const
QByteArray
& uri );
61
63
void
setEncodedUri(
const
QString
& uri );
64
66
QString
quotedTablename()
const
;
67
69
// \note if key exists, another is inserted
70
void
setParam(
const
QString
&key,
const
QString
&value );
72
void
setParam(
const
QString
&key,
const
QStringList
&value );
73
75
// \note remove all occurrences of key, returns number of params removed
76
int
removeParam(
const
QString
&key );
77
79
QString
param(
const
QString
&key )
const
;
80
82
QStringList
params(
const
QString
&key )
const
;
83
85
bool
hasParam(
const
QString
&key )
const
;
86
88
void
setConnection(
const
QString
& aHost,
89
const
QString
& aPort,
90
const
QString
& aDatabase,
91
const
QString
& aUsername,
92
const
QString
& aPassword,
93
SSLmode
sslmode = SSLprefer,
94
const
QString
& authConfigId =
QString
() );
95
97
void
setConnection(
const
QString
& aService,
98
const
QString
& aDatabase,
99
const
QString
& aUsername,
100
const
QString
& aPassword,
101
SSLmode
sslmode = SSLprefer,
102
const
QString
& authConfigId =
QString
() );
103
105
void
setDatabase(
const
QString
&database );
106
108
void
setDataSource(
const
QString
& aSchema,
109
const
QString
& aTable,
110
const
QString
& aGeometryColumn,
111
const
QString
& aSql =
QString
(),
112
const
QString
& aKeyColumn =
QString
() );
113
115
void
setAuthConfigId(
const
QString
& authcfg );
116
118
void
setUsername(
const
QString
& username );
119
121
void
setPassword(
const
QString
& password );
122
124
static
QString
removePassword(
const
QString
& aUri );
125
127
QString
authConfigId()
const
;
128
130
QString
username()
const
;
131
133
QString
schema()
const
;
134
136
QString
table()
const
;
137
139
QString
sql()
const
;
140
142
QString
geometryColumn()
const
;
143
145
void
setUseEstimatedMetadata(
bool
theFlag );
146
148
bool
useEstimatedMetadata()
const
;
149
151
void
disableSelectAtId(
bool
theFlag );
153
bool
selectAtIdDisabled()
const
;
154
156
void
clearSchema();
157
159
// @note added in 2.11
160
void
setSchema(
const
QString
& schema );
161
163
void
setSql(
const
QString
& sql );
164
166
QString
host()
const
;
168
QString
database()
const
;
170
QString
port()
const
;
172
QString
password()
const
;
174
enum
SSLmode
sslMode()
const
;
175
177
QString
service()
const
;
178
180
QString
keyColumn()
const
;
182
void
setKeyColumn(
const
QString
& column );
183
186
Q_DECL_DEPRECATED
QGis::WkbType
wkbType()
const
;
187
190
QgsWKBTypes::Type
newWkbType()
const
;
191
193
Q_DECL_DEPRECATED
void
setWkbType(
QGis::WkbType
type );
194
196
void
setWkbType(
QgsWKBTypes::Type
type );
197
199
QString
srid()
const
;
201
void
setSrid(
const
QString
& srid );
202
203
private
:
204
void
skipBlanks(
const
QString
&uri,
int
&i );
205
QString
getValue(
const
QString
&uri,
int
&i );
206
QString
escape(
const
QString
&uri,
QChar
delim )
const
;
207
208
/* data */
209
211
QString
mHost;
213
QString
mPort;
215
QString
mService;
217
QString
mDatabase;
219
QString
mSchema;
221
QString
mTable;
223
QString
mGeometryColumn;
225
QString
mSql;
227
QString
mAuthConfigId;
229
QString
mUsername;
231
QString
mPassword;
233
enum
SSLmode
mSSLmode;
235
QString
mKeyColumn;
237
bool
mUseEstimatedMetadata;
239
bool
mSelectAtIdDisabled;
241
QgsWKBTypes::Type
mWkbType;
243
QString
mSrid;
245
QMap<QString, QString>
mParams;
246
};
247
248
#endif //QGSDATASOURCEURI_H
249
QByteArray
QgsDataSourceURI::SSLmode
SSLmode
Definition:
qgsdatasourceuri.h:38
QChar
QMap< QString, QString >
QGis::WkbType
WkbType
Used for symbology operations.
Definition:
qgis.h:57
QString
QStringList
QgsDataSourceURI
Class for storing the component parts of a PostgreSQL/RDBMS datasource URI.
Definition:
qgsdatasourceuri.h:35
QgsWKBTypes::Type
Type
Definition:
qgswkbtypes.h:40
qgis.h
Generated on Sat Feb 27 2016 18:33:25 for QGIS API Documentation by
1.8.11