1 #ifndef __OPENTREP_DBPARAMS_HPP
2 #define __OPENTREP_DBPARAMS_HPP
108 if (_dbname.empty() ==
true) {
118 if (_user.empty() ==
true || _passwd.empty() ==
true
119 || _host.empty() ==
true || _port.empty()
120 || _dbname.empty() ==
true) {
148 std::ostringstream oStr;
149 oStr << _dbname <<
"." << _user <<
"@" << _host <<
":" << _port;
157 std::ostringstream oStr;
158 oStr << _dbname <<
"." << _user <<
"@" << _host <<
":" << _port;
166 std::ostringstream oStr;
167 oStr <<
"db=" << _dbname <<
" user=" << _user <<
" password=" << _passwd
168 <<
" port=" << _port <<
" host=" << _host;
176 std::ostringstream oStr;
177 oStr <<
"db=" << _dbname;
187 DBParams (
const std::string& iDBUser,
const std::string& iDBPasswd,
188 const std::string& iDBHost,
const std::string& iDBPort,
189 const std::string& iDBName)
190 : _user (iDBUser), _passwd (iDBPasswd), _host (iDBHost), _port (iDBPort),
193 DBParams (
const std::string& iDBName) : _dbname (iDBName) {
236 #endif // __OPENTREP_DBPARAMS_HPP
void setHost(const std::string &iHost)
void setUser(const std::string &iUser)
std::string getPort() const
std::string getDBName() const
std::list< std::string > DBParamsNameList_T
void fromStream(std::istream &)
std::string getUser() const
std::string toShortString() const
std::string toString() const
void setPort(const std::string &iPort)
DBParams(const std::string &iDBUser, const std::string &iDBPasswd, const std::string &iDBHost, const std::string &iDBPort, const std::string &iDBName)
Structure modelling a database parameters.
std::string getHost() const
DBParams(const std::string &iDBName)
std::string toMySQLConnectionString() const
std::string getPassword() const
void setPassword(const std::string &iPasswd)
void toStream(std::ostream &ioOut) const
void setDBName(const std::string &iDBName)
std::string toSQLiteConnectionString() const