DataSource Class Reference

Configures database settings. More...

#include <datasource.h>

List of all members.


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.

Detailed Description

Configures database settings.

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.


Constructor & Destructor Documentation

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.

Note:
If dbms is an empty string, the default database management system (SQLITE3) will be used.
Parameters:
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.

Parameters:
d DataSource object to copy

Definition at line 57 of file datasource.cpp.

DataSource::~DataSource (  ) 

Destructor for DataSource object.

Definition at line 66 of file datasource.cpp.


Member Function Documentation

void DataSource::setDBMS ( const string  dbms  ) 

Sets database management system.

Note:
If an empty string is provided, the default system (SQLITE3) will be used.
Parameters:
dbms database management system (currently either "SQLITE3", "FREETDS" or "MYSQL"
See also:
getDBMS()

Definition at line 70 of file datasource.cpp.

const string DataSource::getDBMS (  ) 

Gets database management system.

Note:
If it returns an empty string, sqlite3 will be used.
Returns:
Either "", "SQLITE3", "FREETDS" or "MYSQL"
See also:
setDBMS()

Definition at line 74 of file datasource.cpp.

void DataSource::setAddress ( const string  address  ) 

Sets the ip address for the database connection.

Parameters:
address database ip address
See also:
getAddress()

setPort()

getPort()

Definition at line 78 of file datasource.cpp.

const string DataSource::getAddress (  ) 

Gets the ip address for the database connection.

Returns:
ip address of database connection
See also:
setAddress()

setPort()

getPort()

Definition at line 82 of file datasource.cpp.

void DataSource::setPort ( const unsigned int  port  ) 

Sets the port for the database connection.

Parameters:
port database port
See also:
getPort()

setAddress()

getAddress()

Definition at line 86 of file datasource.cpp.

const unsigned int DataSource::getPort (  ) 

Gets the port for the database connection.

Returns:
database connection port
See also:
setPort()

setAddress()

getAddress()

Definition at line 90 of file datasource.cpp.

void DataSource::setDatabaseName ( const string  dbName  ) 

Sets the database name.

Parameters:
dbName database name
See also:
getDatabaseName()

Definition at line 94 of file datasource.cpp.

const string DataSource::getDatabaseName (  ) 

Gets the database name.

Returns:
database name
See also:
setDatabaseName()

Definition at line 98 of file datasource.cpp.

void DataSource::setUser ( const string  user  ) 

Sets the user for database access.

Parameters:
user user for database access
See also:
getUser()

setPassword()

getPassword()

Definition at line 102 of file datasource.cpp.

const string DataSource::getUser (  ) 

Gets the user for database access.

Returns:
user for database access
See also:
setUser()

setPassword()

getPassword()

Definition at line 106 of file datasource.cpp.

void DataSource::setPassword ( const string  password  ) 

Sets the password for database access.

Parameters:
password password for database access
See also:
getPassword()

setUser()

getUser()

Definition at line 110 of file datasource.cpp.

const string DataSource::getPassword (  ) 

Gets the password for database access.

Returns:
password for database access
See also:
setPassword()

setUser()

getUser()

Definition at line 114 of file datasource.cpp.


Member Data Documentation

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]

Defines the database ip address.

Definition at line 58 of file datasource.h.

unsigned int DataSource::port [private]

Defines the database port.

Definition at line 59 of file datasource.h.

string DataSource::dbName [private]

Defines the database name.

Definition at line 60 of file datasource.h.

string DataSource::user [private]

Defines the username to access the database.

Definition at line 61 of file datasource.h.

string DataSource::password [private]

Defines the password to access the database.

Definition at line 62 of file datasource.h.


The documentation for this class was generated from the following files: