19 #ifndef QGSDATASOURCEURI_H
20 #define QGSDATASOURCEURI_H
38 enum SSLmode { SSLprefer, SSLdisable, SSLallow, SSLrequire };
50 QString connectionInfo()
const;
56 QByteArray encodedUri()
const;
60 void setEncodedUri(
const QByteArray & uri );
63 void setEncodedUri(
const QString & uri );
66 QString quotedTablename()
const;
70 void setParam(
const QString &key,
const QString &value );
71 void setParam(
const QString &key,
const QStringList &value );
75 int removeParam(
const QString &key );
78 QString param(
const QString &key )
const;
81 QStringList params(
const QString &key )
const;
84 bool hasParam(
const QString &key )
const;
87 void setConnection(
const QString& aHost,
89 const QString& aDatabase,
90 const QString& aUsername,
91 const QString& aPassword,
92 SSLmode sslmode = SSLprefer );
95 void setConnection(
const QString& aService,
96 const QString& aDatabase,
97 const QString& aUsername,
98 const QString& aPassword,
99 SSLmode sslmode = SSLprefer );
102 void setDatabase(
const QString &database );
105 void setDataSource(
const QString& aSchema,
106 const QString& aTable,
107 const QString& aGeometryColumn,
108 const QString& aSql = QString(),
109 const QString& aKeyColumn = QString() );
112 void setUsername( QString username );
115 void setPassword( QString password );
118 static QString removePassword(
const QString& aUri );
120 QString username()
const;
121 QString schema()
const;
122 QString table()
const;
124 QString geometryColumn()
const;
127 void setUseEstimatedMetadata(
bool theFlag );
128 bool useEstimatedMetadata()
const;
130 void disableSelectAtId(
bool theFlag );
131 bool selectAtIdDisabled()
const;
134 void setSql( QString sql );
136 QString host()
const;
137 QString database()
const;
138 QString port()
const;
139 QString password()
const;
140 enum SSLmode sslMode()
const;
142 QString service()
const;
144 QString keyColumn()
const;
145 void setKeyColumn( QString column );
150 QString srid()
const;
151 void setSrid( QString srid );
154 void skipBlanks(
const QString &uri,
int &i );
155 QString getValue(
const QString &uri,
int &i );
156 QString escape(
const QString &uri, QChar delim )
const;
173 QString mGeometryColumn;
181 enum SSLmode mSSLmode;
185 bool mUseEstimatedMetadata;
187 bool mSelectAtIdDisabled;
193 QMap<QString, QString> mParams;
196 #endif //QGSDATASOURCEURI_H