QGIS API Documentation
2.10.1-Pisa
|
Class for storing the component parts of a PostgreSQL/RDBMS datasource URI. More...
#include <qgsdatasourceuri.h>
Public Types | |
enum | SSLmode { SSLprefer, SSLdisable, SSLallow, SSLrequire } |
Public Member Functions | |
QgsDataSourceURI () | |
default constructor More... | |
QgsDataSourceURI (QString uri) | |
constructor which parses input URI More... | |
QgsDataSourceURI (const QByteArray &uri) | |
constructor which parses input encoded URI (generic mode) More... | |
void | clearSchema () |
QString | connectionInfo () const |
return connection part of URI More... | |
QString | database () const |
void | disableSelectAtId (bool theFlag) |
QByteArray | encodedUri () const |
return complete encoded uri (generic mode) More... | |
QString | geometryColumn () const |
bool | hasParam (const QString &key) const |
Test if param exists (generic mode) More... | |
QString | host () const |
QString | keyColumn () const |
QString | param (const QString &key) const |
Get generic param (generic mode) More... | |
QStringList | params (const QString &key) const |
Get multiple generic param (generic mode) More... | |
QString | password () const |
QString | port () const |
QString | quotedTablename () const |
quoted table name More... | |
int | removeParam (const QString &key) |
Remove generic param (generic mode) More... | |
QString | schema () const |
bool | selectAtIdDisabled () const |
QString | service () const |
void | setConnection (const QString &aHost, const QString &aPort, const QString &aDatabase, const QString &aUsername, const QString &aPassword, SSLmode sslmode=SSLprefer) |
Set all connection related members at once. More... | |
void | setConnection (const QString &aService, const QString &aDatabase, const QString &aUsername, const QString &aPassword, SSLmode sslmode=SSLprefer) |
Set all connection related members at once (for the service case) More... | |
void | setDatabase (const QString &database) |
Set database. More... | |
void | setDataSource (const QString &aSchema, const QString &aTable, const QString &aGeometryColumn, const QString &aSql=QString(), const QString &aKeyColumn=QString()) |
Set all data source related members at once. More... | |
void | setEncodedUri (const QByteArray &uri) |
set complete encoded uri (generic mode) More... | |
void | setEncodedUri (const QString &uri) |
set complete encoded uri (generic mode) More... | |
void | setKeyColumn (QString column) |
void | setParam (const QString &key, const QString &value) |
Set generic param (generic mode) More... | |
void | setParam (const QString &key, const QStringList &value) |
void | setPassword (QString password) |
set password More... | |
void | setSql (QString sql) |
void | setSrid (QString srid) |
void | setUseEstimatedMetadata (bool theFlag) |
set use Estimated Metadata More... | |
void | setUsername (QString username) |
set username More... | |
void | setWkbType (QGis::WkbType type) |
QString | sql () const |
QString | srid () const |
enum SSLmode | sslMode () const |
QString | table () const |
QString | uri () const |
return complete uri More... | |
bool | useEstimatedMetadata () const |
QString | username () const |
QGis::WkbType | wkbType () const |
Static Public Member Functions | |
static QString | removePassword (const QString &aUri) |
Removes password element from uris. More... | |
Class for storing the component parts of a PostgreSQL/RDBMS datasource URI.
This structure stores the database connection information, including host, database, user name, password, schema, password, and sql where clause
Extended to support generic params so that it may be used by any provider. The 2 modes (the old - RDMS specific and the new generic) may not yet be mixed. (Radim Blazek 4/2012)
Definition at line 35 of file qgsdatasourceuri.h.
Enumerator | |
---|---|
SSLprefer | |
SSLdisable | |
SSLallow | |
SSLrequire |
Definition at line 38 of file qgsdatasourceuri.h.
QgsDataSourceURI::QgsDataSourceURI | ( | ) |
default constructor
Definition at line 27 of file qgsdatasourceuri.cpp.
QgsDataSourceURI::QgsDataSourceURI | ( | QString | uri | ) |
constructor which parses input URI
Definition at line 37 of file qgsdatasourceuri.cpp.
QgsDataSourceURI::QgsDataSourceURI | ( | const QByteArray & | uri | ) |
constructor which parses input encoded URI (generic mode)
void QgsDataSourceURI::clearSchema | ( | ) |
Definition at line 358 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::connectionInfo | ( | ) | const |
return connection part of URI
Definition at line 447 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::database | ( | ) | const |
Definition at line 277 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::disableSelectAtId | ( | bool | theFlag | ) |
Definition at line 343 of file qgsdatasourceuri.cpp.
QByteArray QgsDataSourceURI::encodedUri | ( | ) | const |
return complete encoded uri (generic mode)
Definition at line 548 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::geometryColumn | ( | ) | const |
Definition at line 317 of file qgsdatasourceuri.cpp.
bool QgsDataSourceURI::hasParam | ( | const QString & | key | ) | const |
Test if param exists (generic mode)
Definition at line 684 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::host | ( | ) | const |
Definition at line 272 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::keyColumn | ( | ) | const |
Definition at line 322 of file qgsdatasourceuri.cpp.
Get generic param (generic mode)
Definition at line 674 of file qgsdatasourceuri.cpp.
QStringList QgsDataSourceURI::params | ( | const QString & | key | ) | const |
Get multiple generic param (generic mode)
Definition at line 679 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::password | ( | ) | const |
Definition at line 282 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::port | ( | ) | const |
Definition at line 292 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::quotedTablename | ( | ) | const |
quoted table name
Definition at line 578 of file qgsdatasourceuri.cpp.
int QgsDataSourceURI::removeParam | ( | const QString & | key | ) |
Remove generic param (generic mode)
Definition at line 669 of file qgsdatasourceuri.cpp.
Removes password element from uris.
Definition at line 223 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::schema | ( | ) | const |
Definition at line 302 of file qgsdatasourceuri.cpp.
bool QgsDataSourceURI::selectAtIdDisabled | ( | ) | const |
Definition at line 348 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::service | ( | ) | const |
Definition at line 267 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setConnection | ( | const QString & | aHost, |
const QString & | aPort, | ||
const QString & | aDatabase, | ||
const QString & | aUsername, | ||
const QString & | aPassword, | ||
SSLmode | sslmode = SSLprefer |
||
) |
Set all connection related members at once.
Definition at line 589 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setConnection | ( | const QString & | aService, |
const QString & | aDatabase, | ||
const QString & | aUsername, | ||
const QString & | aPassword, | ||
SSLmode | sslmode = SSLprefer |
||
) |
Set all connection related members at once (for the service case)
Definition at line 604 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setDatabase | ( | const QString & | database | ) |
Set database.
Definition at line 630 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setDataSource | ( | const QString & | aSchema, |
const QString & | aTable, | ||
const QString & | aGeometryColumn, | ||
const QString & | aSql = QString() , |
||
const QString & | aKeyColumn = QString() |
||
) |
Set all data source related members at once.
Definition at line 617 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setEncodedUri | ( | const QByteArray & | uri | ) |
set complete encoded uri (generic mode)
Definition at line 561 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setEncodedUri | ( | const QString & | uri | ) |
set complete encoded uri (generic mode)
Definition at line 573 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setKeyColumn | ( | QString | column | ) |
Definition at line 327 of file qgsdatasourceuri.cpp.
Set generic param (generic mode)
Definition at line 655 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setParam | ( | const QString & | key, |
const QStringList & | value | ||
) |
Definition at line 661 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setPassword | ( | QString | password | ) |
set password
Definition at line 287 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setSql | ( | QString | sql | ) |
Definition at line 353 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setSrid | ( | QString | srid | ) |
Definition at line 650 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setUseEstimatedMetadata | ( | bool | theFlag | ) |
set use Estimated Metadata
Definition at line 333 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setUsername | ( | QString | username | ) |
set username
Definition at line 262 of file qgsdatasourceuri.cpp.
void QgsDataSourceURI::setWkbType | ( | QGis::WkbType | type | ) |
Definition at line 640 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::sql | ( | ) | const |
Definition at line 312 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::srid | ( | ) | const |
Definition at line 645 of file qgsdatasourceuri.cpp.
QgsDataSourceURI::SSLmode QgsDataSourceURI::sslMode | ( | ) | const |
Definition at line 297 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::table | ( | ) | const |
Definition at line 307 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::uri | ( | ) | const |
return complete uri
Definition at line 495 of file qgsdatasourceuri.cpp.
bool QgsDataSourceURI::useEstimatedMetadata | ( | ) | const |
Definition at line 338 of file qgsdatasourceuri.cpp.
QString QgsDataSourceURI::username | ( | ) | const |
Definition at line 257 of file qgsdatasourceuri.cpp.
QGis::WkbType QgsDataSourceURI::wkbType | ( | ) | const |
Definition at line 635 of file qgsdatasourceuri.cpp.