1#ifndef __OPENTREP_DBPARAMS_HPP
2#define __OPENTREP_DBPARAMS_HPP
123 if (_dbname.empty() ==
true) {
133 if (_user.empty() ==
true || _passwd.empty() ==
true
134 || _host.empty() ==
true || _port.empty()
135 || _dbname.empty() ==
true) {
145 if (_user.empty() ==
true || _passwd.empty() ==
true
146 || _dbname.empty() ==
true) {
174 std::ostringstream oStr;
175 oStr << _dbname <<
"." << _user <<
"@" << _host <<
":" << _port;
183 std::ostringstream oStr;
184 oStr << _dbname <<
"." << _user <<
"@" << _host <<
":" << _port;
192 std::ostringstream oStr;
193 oStr <<
"db=" << _dbname <<
" user=" << _user <<
" password=" << _passwd
194 <<
" port=" << _port <<
" host=" << _host;
202 std::ostringstream oStr;
203 oStr <<
"dbname=" << _dbname <<
" user=" << _user
204 <<
" password=" << _passwd;
205 if (!_host.empty()) {
206 oStr <<
" host=" << _host;
208 if (!_port.empty()) {
209 oStr <<
" port=" << _port;
218 std::ostringstream oStr;
219 oStr <<
"db=" << _dbname;
230 const std::string& iDBUser,
const std::string& iDBPasswd,
231 const std::string& iDBHost,
const std::string& iDBPort,
232 const std::string& iDBName)
233 : _dbtype (iDBType), _user (iDBUser), _passwd (iDBPasswd),
234 _host (iDBHost), _port (iDBPort), _dbname (iDBName) {
237 : _dbtype (iDBType), _dbname (iDBName) {
std::list< std::string > DBParamsNameList_T
const std::string & getUser() const
const std::string & getPort() const
const std::string & getDBName() const
void setPassword(const std::string &iPasswd)
DBParams(const DBType &iDBType, const std::string &iDBUser, const std::string &iDBPasswd, const std::string &iDBHost, const std::string &iDBPort, const std::string &iDBName)
std::string toShortString() const
void toStream(std::ostream &ioOut) const
void fromStream(std::istream &)
const DBType & getType() const
void setUser(const std::string &iUser)
const std::string & getPassword() const
std::string toString() const
std::string toMySQLConnectionString() const
void setType(const DBType &iType)
void setDBName(const std::string &iDBName)
std::string toPGConnectionString() const
std::string toSQLiteConnectionString() const
void setPort(const std::string &iPort)
DBParams(const DBType &iDBType, const std::string &iDBName)
void setHost(const std::string &iHost)
const std::string & getHost() const
Enumeration of database types.