#include <connectiondata.h>

Inheritance diagram for KexiDB::ConnectionData:
KexiDB::ConnectionDataBase KexiProjectConnectionData

Public Types

typedef TQPtrList< ConnectionData > List
 
typedef TQPtrListIterator< ConnectionData > ListIterator
 

Public Member Functions

 ConnectionData (const ConnectionData &)
 
ConnectionData & operator= (const ConnectionData &cd)
 
void setFileName (const TQString &fn)
 
TQString fileName () const
 
TQString dbPath () const
 
TQString dbFileName () const
 
TQString serverInfoString (bool addUser=true) const
 

Public Attributes

uint formatVersion
 
- Public Attributes inherited from KexiDB::ConnectionDataBase
TQString caption
 
TQString description
 
int id
 
TQString driverName
 
TQString hostName
 
unsigned short int port
 
bool useLocalSocketFile
 
TQString localSocketFileName
 
TQString password
 
bool savePassword
 
TQString userName
 

Protected Attributes

Private * priv
 
- Protected Attributes inherited from KexiDB::ConnectionDataBase
TQString m_fileName
 
TQString m_dbPath
 
TQString m_dbFileName
 

Friends

class Connection
 

Detailed Description

Database specific connection data, e.g. host, port.

Connection data, once configured, can be later stored for reuse.

Definition at line 162 of file connectiondata.h.

Member Typedef Documentation

◆ List

typedef TQPtrList<ConnectionData> KexiDB::ConnectionData::List

Definition at line 165 of file connectiondata.h.

◆ ListIterator

typedef TQPtrListIterator<ConnectionData> KexiDB::ConnectionData::ListIterator

Definition at line 166 of file connectiondata.h.

Constructor & Destructor Documentation

◆ ConnectionData() [1/2]

ConnectionData::ConnectionData ( )

Definition at line 52 of file connectiondata.cpp.

◆ ConnectionData() [2/2]

ConnectionData::ConnectionData ( const ConnectionData &  cd)

Definition at line 60 of file connectiondata.cpp.

◆ ~ConnectionData()

ConnectionData::~ConnectionData ( )

Definition at line 68 of file connectiondata.cpp.

Member Function Documentation

◆ dbFileName()

TQString KexiDB::ConnectionData::dbFileName ( ) const
inline

The file name (without path) of the database file.

Returns
The file name (for file-based engines) but without a full path

Definition at line 206 of file connectiondata.h.

◆ dbPath()

TQString KexiDB::ConnectionData::dbPath ( ) const
inline

The directory the database file is in.

Returns
file path (for file-based engines) but without a file name

Definition at line 199 of file connectiondata.h.

◆ fileName()

TQString KexiDB::ConnectionData::fileName ( ) const
inline

Get the filename used by the connection.

For file-based database engines like SQLite, fileName is used instead hostName and port.

Returns
An absolute path to the database file being used

Definition at line 192 of file connectiondata.h.

◆ operator=()

ConnectionData & ConnectionData::operator= ( const ConnectionData &  cd)

Definition at line 74 of file connectiondata.cpp.

◆ serverInfoString()

TQString ConnectionData::serverInfoString ( bool  addUser = true) const

A user-friendly string for the server.

Returns
a user-friendly string like:
  • "myhost.org:12345" if a host and port is specified;
  • "localhost:12345" of only port is specified;
  • "user@myhost.org:12345" if also user is specified
  • "<file>" if file-based driver is assigned but no filename is assigned
  • "file: pathto/mydb.kexi" if file-based driver is assigned and filename is assigned

User's name is added if addUser is true (the default).

Definition at line 95 of file connectiondata.cpp.

◆ setFileName()

void ConnectionData::setFileName ( const TQString &  fn)

Set the filename used by the connection.

For file-based database engines, like SQLite, you should use this function to set the file name of the database to use. fn can be either absolute or relative path to the file.

Definition at line 85 of file connectiondata.cpp.

Friends And Related Symbol Documentation

◆ Connection

friend class Connection
friend

Definition at line 234 of file connectiondata.h.

Member Data Documentation

◆ formatVersion

uint KexiDB::ConnectionData::formatVersion

Definition at line 228 of file connectiondata.h.

◆ priv

Private* KexiDB::ConnectionData::priv
protected

Definition at line 232 of file connectiondata.h.


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