19 #ifndef QGSDATASOURCEURI_H
20 #define QGSDATASOURCEURI_H
39 enum SSLmode { SSLprefer, SSLdisable, SSLallow, SSLrequire };
52 QString connectionInfo()
const;
59 QByteArray encodedUri()
const;
64 void setEncodedUri(
const QByteArray & uri );
68 void setEncodedUri(
const QString & uri );
71 QString quotedTablename()
const;
76 void setParam(
const QString &key,
const QString &value );
77 void setParam(
const QString &key,
const QStringList &value );
82 int removeParam(
const QString &key );
86 QString param(
const QString &key )
const;
90 QStringList params(
const QString &key )
const;
94 bool hasParam(
const QString &key )
const;
98 void setConnection(
const QString& aHost,
100 const QString& aDatabase,
101 const QString& aUsername,
102 const QString& aPassword,
103 SSLmode sslmode = SSLprefer );
107 void setConnection(
const QString& aService,
108 const QString& aDatabase,
109 const QString& aUsername,
110 const QString& aPassword,
111 SSLmode sslmode = SSLprefer );
115 void setDatabase(
const QString &database );
118 void setDataSource(
const QString& aSchema,
119 const QString& aTable,
120 const QString& aGeometryColumn,
121 const QString& aSql = QString(),
122 const QString& aKeyColumn = QString() );
126 void setUsername( QString username );
130 void setPassword( QString password );
133 static QString removePassword(
const QString& aUri );
135 QString username()
const;
136 QString schema()
const;
137 QString table()
const;
139 QString geometryColumn()
const;
143 void setUseEstimatedMetadata(
bool theFlag );
144 bool useEstimatedMetadata()
const;
146 void disableSelectAtId(
bool theFlag );
147 bool selectAtIdDisabled()
const;
150 void setSql( QString sql );
153 QString host()
const;
154 QString database()
const;
155 QString port()
const;
156 QString password()
const;
157 enum SSLmode sslMode()
const;
160 QString service()
const;
163 QString keyColumn()
const;
164 void setKeyColumn( QString column );
171 QString srid()
const;
172 void setSrid( QString srid );
175 void skipBlanks(
const QString &uri,
int &i );
176 QString getValue(
const QString &uri,
int &i );
177 QString escape(
const QString &uri, QChar delim )
const;
217 #endif //QGSDATASOURCEURI_H