Kexi API Documentation (2.0 alpha)

KexiDB::ConnectionData Class Reference

#include <connectiondata.h>

Inheritance diagram for KexiDB::ConnectionData:

KexiDB::ConnectionDataBase KexiProjectConnectionData List of all members.

Detailed Description

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

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

Definition at line 160 of file connectiondata.h.

Public Types

typedef QPtrList< ConnectionDataList
typedef QPtrListIterator<
ConnectionData
ListIterator

Public Member Functions

 ConnectionData ()
 ConnectionData (const ConnectionData &)
 ~ConnectionData ()
ConnectionDataoperator= (const ConnectionData &cd)
void setFileName (const QString &fn)
 Set the filename used by the connection.
QString fileName () const
 Get the filename used by the connection.
QString dbPath () const
 The directory the database file is in.
QString dbFileName () const
 The file name (without path) of the database file.
QString serverInfoString (bool addUser=true) const
 A user-friendly string for the server.

Public Attributes

uint formatVersion

Protected Attributes

Private * priv

Friends

class Connection


Member Typedef Documentation

typedef QPtrList<ConnectionData> KexiDB::ConnectionData::List
 

Definition at line 163 of file connectiondata.h.

typedef QPtrListIterator<ConnectionData> KexiDB::ConnectionData::ListIterator
 

Definition at line 164 of file connectiondata.h.


Constructor & Destructor Documentation

ConnectionData::ConnectionData  ) 
 

Definition at line 52 of file connectiondata.cpp.

ConnectionData::ConnectionData const ConnectionData  ) 
 

Definition at line 60 of file connectiondata.cpp.

ConnectionData::~ConnectionData  ) 
 

Definition at line 68 of file connectiondata.cpp.

References priv.


Member Function Documentation

QString 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 204 of file connectiondata.h.

Referenced by KexiStartupHandler::init(), and KexiMigration::KexiMigrate::isSourceAndDestinationDataSourceTheSame().

QString 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 197 of file connectiondata.h.

Referenced by KexiMigration::KexiMigrate::isSourceAndDestinationDataSourceTheSame(), and SQLiteAdminTools::vacuum().

QString 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 190 of file connectiondata.h.

Referenced by KexiMigration::PqxxMigrate::drv_connect(), KexiStartupHandler::init(), KexiMigration::KexiMigrate::isSourceAndDestinationDataSourceTheSame(), KexiDB::toMap(), and KexiMainWindowImpl::slotToolsCompactDatabase().

ConnectionData & ConnectionData::operator= const ConnectionData cd  ) 
 

Definition at line 74 of file connectiondata.cpp.

References priv.

QString 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.

References KexiDB::DriverManager::driverInfo(), KexiDB::ConnectionDataBase::driverName, KexiDB::Driver::Info::fileBased, KexiDB::ConnectionDataBase::hostName, KexiDB::ConnectionDataBase::m_dbFileName, KexiDB::ConnectionDataBase::m_dbPath, KexiDB::Driver::Info::name, KexiDB::ConnectionDataBase::port, and KexiDB::ConnectionDataBase::userName.

Referenced by KexiMainWindowImpl::createBlankProjectData(), KexiDBPasswordDialog::KexiDBPasswordDialog(), KexiMigration::KexiMigrate::performImport(), KexiStartupHandler::selectProject(), and ConnectionDataLVItem::update().

void ConnectionData::setFileName const QString 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.

References file, KexiDB::ConnectionDataBase::m_dbFileName, KexiDB::ConnectionDataBase::m_dbPath, and KexiDB::ConnectionDataBase::m_fileName.

Referenced by KexiMainWindowImpl::createBlankProjectData(), KexiStartupHandler::init(), KexiDB::fromMap(), KexiProjectConnectionData::KexiProjectConnectionData(), KexiMainWindowImpl::openProject(), and KexiMainWindowImpl::slotToolsCompactDatabase().


Friends And Related Function Documentation

friend class Connection [friend]
 

Definition at line 232 of file connectiondata.h.


Member Data Documentation

uint KexiDB::ConnectionData::formatVersion
 

Definition at line 226 of file connectiondata.h.

Private* KexiDB::ConnectionData::priv [protected]
 

Definition at line 229 of file connectiondata.h.

Referenced by operator=(), and ~ConnectionData().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:50:39 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003