QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
QgsDataSourceURI Class Reference

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
 QgsDataSourceURI (QString uri)
 constructor which parses input URI
 QgsDataSourceURI (const QByteArray &uri)
 constructor which parses input encoded URI (generic mode)
QString connectionInfo () const
 return connection part of URI
QString uri () const
 return complete uri
QByteArray encodedUri () const
 return complete encoded uri (generic mode)
void setEncodedUri (const QByteArray &uri)
 set complete encoded uri (generic mode)
void setEncodedUri (const QString &uri)
 set complete encoded uri (generic mode)
QString quotedTablename () const
 quoted table name
void setParam (const QString &key, const QString &value)
 Set generic param (generic mode)
void setParam (const QString &key, const QStringList &value)
int removeParam (const QString &key)
 Remove generic param (generic mode)
QString param (const QString &key) const
 Get generic param (generic mode)
QStringList params (const QString &key) const
 Get multiple generic param (generic mode)
bool hasParam (const QString &key) const
 Test if param exists (generic mode)
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.
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)
void setDatabase (const QString &database)
 Set database.
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.
void setUsername (QString username)
 set username
void setPassword (QString password)
 set password
QString username () const
QString schema () const
QString table () const
QString sql () const
QString geometryColumn () const
void setUseEstimatedMetadata (bool theFlag)
 set use Estimated Metadata
bool useEstimatedMetadata () const
void disableSelectAtId (bool theFlag)
bool selectAtIdDisabled () const
void clearSchema ()
void setSql (QString sql)
QString host () const
QString database () const
QString port () const
QString password () const
enum SSLmode sslMode () const
QString service () const
QString keyColumn () const
void setKeyColumn (QString column)
QGis::WkbType wkbType () const
void setWkbType (QGis::WkbType type)
QString srid () const
void setSrid (QString srid)

Static Public Member Functions

static QString removePassword (const QString &aUri)
 Removes password element from uris.

Detailed Description

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)

Member Enumeration Documentation

Enumerator:
SSLprefer 
SSLdisable 
SSLallow 
SSLrequire 

Constructor & Destructor Documentation

QgsDataSourceURI::QgsDataSourceURI ( )

default constructor

QgsDataSourceURI::QgsDataSourceURI ( QString  uri)

constructor which parses input URI

QgsDataSourceURI::QgsDataSourceURI ( const QByteArray &  uri)

constructor which parses input encoded URI (generic mode)

Member Function Documentation

void QgsDataSourceURI::clearSchema ( )
QString QgsDataSourceURI::connectionInfo ( ) const

return connection part of URI

QString QgsDataSourceURI::database ( ) const
void QgsDataSourceURI::disableSelectAtId ( bool  theFlag)
QByteArray QgsDataSourceURI::encodedUri ( ) const

return complete encoded uri (generic mode)

QString QgsDataSourceURI::geometryColumn ( ) const
bool QgsDataSourceURI::hasParam ( const QString &  key) const

Test if param exists (generic mode)

QString QgsDataSourceURI::host ( ) const
QString QgsDataSourceURI::keyColumn ( ) const
QString QgsDataSourceURI::param ( const QString &  key) const

Get generic param (generic mode)

QStringList QgsDataSourceURI::params ( const QString &  key) const

Get multiple generic param (generic mode)

QString QgsDataSourceURI::password ( ) const
QString QgsDataSourceURI::port ( ) const
QString QgsDataSourceURI::quotedTablename ( ) const

quoted table name

int QgsDataSourceURI::removeParam ( const QString &  key)

Remove generic param (generic mode)

QString QgsDataSourceURI::removePassword ( const QString &  aUri)
static

Removes password element from uris.

QString QgsDataSourceURI::schema ( ) const
bool QgsDataSourceURI::selectAtIdDisabled ( ) const
QString QgsDataSourceURI::service ( ) const
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.

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)

void QgsDataSourceURI::setDatabase ( const QString &  database)

Set database.

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.

void QgsDataSourceURI::setEncodedUri ( const QByteArray &  uri)

set complete encoded uri (generic mode)

void QgsDataSourceURI::setEncodedUri ( const QString &  uri)

set complete encoded uri (generic mode)

void QgsDataSourceURI::setKeyColumn ( QString  column)
void QgsDataSourceURI::setParam ( const QString &  key,
const QString &  value 
)

Set generic param (generic mode)

void QgsDataSourceURI::setParam ( const QString &  key,
const QStringList &  value 
)
void QgsDataSourceURI::setPassword ( QString  password)

set password

void QgsDataSourceURI::setSql ( QString  sql)
void QgsDataSourceURI::setSrid ( QString  srid)
void QgsDataSourceURI::setUseEstimatedMetadata ( bool  theFlag)

set use Estimated Metadata

void QgsDataSourceURI::setUsername ( QString  username)

set username

void QgsDataSourceURI::setWkbType ( QGis::WkbType  type)
QString QgsDataSourceURI::sql ( ) const
QString QgsDataSourceURI::srid ( ) const
QgsDataSourceURI::SSLmode QgsDataSourceURI::sslMode ( ) const
QString QgsDataSourceURI::table ( ) const
QString QgsDataSourceURI::uri ( ) const

return complete uri

bool QgsDataSourceURI::useEstimatedMetadata ( ) const
QString QgsDataSourceURI::username ( ) const
QGis::WkbType QgsDataSourceURI::wkbType ( ) const

The documentation for this class was generated from the following files: