#include <datasource.h>
Public Member Functions | |
DataSource (const string dbms, const string dbName, const string address="", const unsigned int port=0, const string user="", const string password="") | |
Constructor for DataSource object. | |
DataSource (const DataSource &d) | |
Copy-constructor for DataSource object. | |
~DataSource () | |
Destructor for DataSource object. | |
void | setDBMS (const string dbms) |
Sets database management system. | |
const string | getDBMS () |
Gets database management system. | |
void | setAddress (const string address) |
Sets the ip address for the database connection. | |
const string | getAddress () |
Gets the ip address for the database connection. | |
void | setPort (const unsigned int port) |
Sets the port for the database connection. | |
const unsigned int | getPort () |
Gets the port for the database connection. | |
void | setDatabaseName (const string dbName) |
Sets the database name. | |
const string | getDatabaseName () |
Gets the database name. | |
void | setUser (const string user) |
Sets the user for database access. | |
const string | getUser () |
Gets the user for database access. | |
void | setPassword (const string password) |
Sets the password for database access. | |
const string | getPassword () |
Gets the password for database access. | |
Private Attributes | |
string | dbms |
Defines the database management system to use ("SQLITE3", "FREETDS" or "MYSQL"). | |
string | address |
Defines the database ip address. | |
unsigned int | port |
Defines the database port. | |
string | dbName |
Defines the database name. | |
string | user |
Defines the username to access the database. | |
string | password |
Defines the password to access the database. |
This class defines common settings for databases. Be aware that not all databases need user/password or ip connection settings, so they may be ignored.
Definition at line 54 of file datasource.h.
DataSource::DataSource | ( | const string | dbms, | |
const string | dbName, | |||
const string | address = "" , |
|||
const unsigned int | port = 0 , |
|||
const string | user = "" , |
|||
const string | password = "" | |||
) |
Constructor for DataSource object.
dbms | database management system (currently either "SQLITE3", "FREETDS" or "MYSQL") | |
dbName | database name | |
address | database ip address | |
port | database port | |
user | username to access database | |
password | password to access database |
Definition at line 43 of file datasource.cpp.
DataSource::DataSource | ( | const DataSource & | d | ) |
Copy-constructor for DataSource object.
d | DataSource object to copy |
Definition at line 57 of file datasource.cpp.
DataSource::~DataSource | ( | ) |
void DataSource::setDBMS | ( | const string | dbms | ) |
Sets database management system.
dbms | database management system (currently either "SQLITE3", "FREETDS" or "MYSQL" |
Definition at line 70 of file datasource.cpp.
const string DataSource::getDBMS | ( | ) |
Gets database management system.
Definition at line 74 of file datasource.cpp.
void DataSource::setAddress | ( | const string | address | ) |
Sets the ip address for the database connection.
address | database ip address |
Definition at line 78 of file datasource.cpp.
const string DataSource::getAddress | ( | ) |
Gets the ip address for the database connection.
Definition at line 82 of file datasource.cpp.
void DataSource::setPort | ( | const unsigned int | port | ) |
Sets the port for the database connection.
port | database port |
Definition at line 86 of file datasource.cpp.
const unsigned int DataSource::getPort | ( | ) |
Gets the port for the database connection.
Definition at line 90 of file datasource.cpp.
void DataSource::setDatabaseName | ( | const string | dbName | ) |
Sets the database name.
dbName | database name |
Definition at line 94 of file datasource.cpp.
const string DataSource::getDatabaseName | ( | ) |
Gets the database name.
Definition at line 98 of file datasource.cpp.
void DataSource::setUser | ( | const string | user | ) |
Sets the user for database access.
user | user for database access |
Definition at line 102 of file datasource.cpp.
const string DataSource::getUser | ( | ) |
Gets the user for database access.
Definition at line 106 of file datasource.cpp.
void DataSource::setPassword | ( | const string | password | ) |
Sets the password for database access.
password | password for database access |
Definition at line 110 of file datasource.cpp.
const string DataSource::getPassword | ( | ) |
Gets the password for database access.
Definition at line 114 of file datasource.cpp.
string DataSource::dbms [private] |
Defines the database management system to use ("SQLITE3", "FREETDS" or "MYSQL").
Definition at line 57 of file datasource.h.
string DataSource::address [private] |
unsigned int DataSource::port [private] |
string DataSource::dbName [private] |
string DataSource::user [private] |
string DataSource::password [private] |