|
1 |
| -/** |
2 |
| -\struct QgsDataSourceURI |
3 |
| -\brief Structure for storing the component parts of a PostgreSQL/RDBMS datasource URI. |
4 |
| - |
5 |
| - This structure stores the database connection information, including host, database, |
6 |
| - user name, password, schema, password, and sql where clause |
7 |
| - */ |
8 |
| -class QgsDataSourceURI |
9 |
| -{ |
10 |
| -%TypeHeaderCode |
11 |
| -#include <qgsdatasourceuri.h> |
12 |
| -%End |
13 |
| -
|
14 |
| -public: |
15 |
| - //! \note enumeration added in version 1.1 |
16 |
| - enum SSLmode { SSLprefer, SSLdisable, SSLallow, SSLrequire }; |
17 |
| -
|
18 |
| - //! default constructor |
19 |
| - QgsDataSourceURI(); |
20 |
| - |
21 |
| - //! constructor which parses input URI |
22 |
| - QgsDataSourceURI(QString uri); |
23 |
| - |
24 |
| - //! connection info |
25 |
| - QString connectionInfo() const; |
26 |
| -
|
27 |
| - //! complete uri |
28 |
| - QString uri() const; |
29 |
| -
|
30 |
| - //! quoted table name |
31 |
| - QString quotedTablename() const; |
32 |
| - |
33 |
| - //! Set all connection related members at once |
34 |
| - //! \note This optional sslmode parameter has been added in version 1.1 |
35 |
| - void setConnection(const QString& aHost, |
36 |
| - const QString& aPort, |
37 |
| - const QString& aDatabase, |
38 |
| - const QString& aUsername, |
39 |
| - const QString& aPassword, |
40 |
| - SSLmode sslmode = SSLprefer ); |
41 |
| - |
42 |
| - //! Set all data source related members at once |
43 |
| - void setDataSource(const QString& aSchema, |
44 |
| - const QString& aTable, |
45 |
| - const QString& aGeometryColumn, |
46 |
| - const QString& aSql = QString(), |
47 |
| - const QString& aKeyColumn = QString()); |
48 |
| -
|
49 |
| - /** Removes password from uris |
50 |
| - * @note this method was added in QGIS 1.1 |
51 |
| - */ |
52 |
| - static QString removePassword( const QString& aUri); |
53 |
| - |
54 |
| - QString username() const; |
55 |
| - QString schema() const; |
56 |
| - QString table() const; |
57 |
| - QString sql() const; |
58 |
| - QString geometryColumn() const; |
59 |
| -
|
60 |
| - // added in 1.1 |
61 |
| - QString host() const; |
62 |
| - QString database() const; |
63 |
| - QString password() const; |
64 |
| - QString port() const; |
65 |
| - SSLmode sslMode() const; |
66 |
| -
|
67 |
| - void setSql(QString sql); |
68 |
| -
|
69 |
| - // added in 1.2 |
70 |
| - QString keyColumn() const; |
71 |
| - void setKeyColumn(QString column); |
72 |
| -}; |
| 1 | +/** |
| 2 | +\struct QgsDataSourceURI |
| 3 | +\brief Structure for storing the component parts of a PostgreSQL/RDBMS datasource URI. |
| 4 | + |
| 5 | + This structure stores the database connection information, including host, database, |
| 6 | + user name, password, schema, password, and sql where clause |
| 7 | + */ |
| 8 | +class QgsDataSourceURI |
| 9 | +{ |
| 10 | +%TypeHeaderCode |
| 11 | +#include <qgsdatasourceuri.h> |
| 12 | +%End |
| 13 | + |
| 14 | +public: |
| 15 | + //! \note enumeration added in version 1.1 |
| 16 | + enum SSLmode { SSLprefer, SSLdisable, SSLallow, SSLrequire }; |
| 17 | + |
| 18 | + //! default constructor |
| 19 | + QgsDataSourceURI(); |
| 20 | + |
| 21 | + //! constructor which parses input URI |
| 22 | + QgsDataSourceURI(QString uri); |
| 23 | + |
| 24 | + //! connection info |
| 25 | + QString connectionInfo() const; |
| 26 | + |
| 27 | + //! complete uri |
| 28 | + QString uri() const; |
| 29 | + |
| 30 | + //! quoted table name |
| 31 | + QString quotedTablename() const; |
| 32 | + |
| 33 | + //! Set all connection related members at once |
| 34 | + //! \note This optional sslmode parameter has been added in version 1.1 |
| 35 | + void setConnection(const QString& aHost, |
| 36 | + const QString& aPort, |
| 37 | + const QString& aDatabase, |
| 38 | + const QString& aUsername, |
| 39 | + const QString& aPassword, |
| 40 | + SSLmode sslmode = SSLprefer ); |
| 41 | + |
| 42 | + //! Set all data source related members at once |
| 43 | + void setDataSource(const QString& aSchema, |
| 44 | + const QString& aTable, |
| 45 | + const QString& aGeometryColumn, |
| 46 | + const QString& aSql = QString(), |
| 47 | + const QString& aKeyColumn = QString()); |
| 48 | + |
| 49 | + /** Removes password from uris |
| 50 | + * @note this method was added in QGIS 1.1 |
| 51 | + */ |
| 52 | + static QString removePassword( const QString& aUri); |
| 53 | + |
| 54 | + QString username() const; |
| 55 | + QString schema() const; |
| 56 | + QString table() const; |
| 57 | + QString sql() const; |
| 58 | + QString geometryColumn() const; |
| 59 | + |
| 60 | + // added in 1.1 |
| 61 | + QString host() const; |
| 62 | + QString database() const; |
| 63 | + QString password() const; |
| 64 | + QString port() const; |
| 65 | + SSLmode sslMode() const; |
| 66 | + |
| 67 | + void setSql(QString sql); |
| 68 | + |
| 69 | + // added in 1.2 |
| 70 | + QString keyColumn() const; |
| 71 | + void setKeyColumn(QString column); |
| 72 | +}; |
0 commit comments