Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

KDB::DBEngine Class Reference

Entry point for the library. More...

#include <dbengine.h>

Inheritance diagram for KDB::DBEngine:

KDB::Object KDB::QObject List of all members.

Public Methods

virtual ~DBEngine ()
PluginIterator beginPlugins ()
 Returns an iterator that points to the first plugin.

PluginfindPlugin (const QString &name)
 Find a plugin by name. More...

QStringList pluginNames ()
 Returns the names of all detected plugins.

ConnectionopenConnection (const QString &pluginName, const QString &host, int port, const QString &user, const QString &password = QString::null)
 Open a connection to the given host, with the given plugin, username and password. More...

ConnectionopenConnection (const QString &name)
 open a connection by name. More...

virtual ConnectionaddConnection (const QString &pluginName, const QString &host, int port = 0, const QString &user = QString::null, const QString &password = QString::null)
 Creates a connection object, without acually opening it.

void remove (Connection *)
 Removes a connection from the list of connections. More...

ConnectionfindConnection (const QString &plugin, const QString &host, const int port, const QString &user)
 Return a connection to the specified host for the given user. More...

ConnectionfindConnection (const QString &name)
 return a connection with the specified name.

ConnectionIterator beginConnections ()
 Returns an iterator that points to the first Connection object.

void loadConnections (KConfigBase *config = 0L)
 Load all connections saved in the KConfig-object config. More...

void saveConnections (KConfigBase *config = 0L)
 Save all connections to the KConfig-object config. More...

DatabaseopenDatabase (const QString &pluginName, const QString &host, int port, const QString &user, const QString &password, const QString &databaseName)
 Open a database. More...


Static Public Methods

DBEngine* self ()
 creates, if needed, the engine object, and returns it.


Protected Methods

bool loadPlugin (const QString&)
 Loads a plugin by its name if it is not already loaded.


Protected Slots

void slotConnectionClosed (Connection *)
void slotDeleteConnection ()

Detailed Description

Entry point for the library.

This object manages all available plugins, and can create connections to servers or databases.

In more detail:

Author(s):
Alessandro Praduroux <pradu@thekompany.com> , Michael Koch <m_kock@bigfoot.de>
Version:
kdbcore 0.0.2


Constructor & Destructor Documentation

virtual ~DBEngine ( ) [virtual]
 


Member Function Documentation

Connection * addConnection ( const QString & pluginName,
const QString & host,
int port = 0,
const QString & user = QString::null,
const QString & password = QString::null ) [virtual]
 

Creates a connection object, without acually opening it.

ConnectionIterator beginConnections ( )
 

Returns an iterator that points to the first Connection object.

PluginIterator beginPlugins ( )
 

Returns an iterator that points to the first plugin.

Connection * findConnection ( const QString & name )
 

return a connection with the specified name.

Connection * findConnection ( const QString & plugin,
const QString & host,
const int port,
const QString & user )
 

Return a connection to the specified host for the given user.

If the returned value is 0L no connection with the specified arguments is found.

Plugin * findPlugin ( const QString & name )
 

Find a plugin by name.

If no plugin is found, OL is returned.

void loadConnections ( KConfigBase * config = 0L )
 

Load all connections saved in the KConfig-object config.

If config is 0L the connections will be load from the standard file kdbrc.

bool loadPlugin ( const QString & ) [protected]
 

Loads a plugin by its name if it is not already loaded.

Connection * openConnection ( const QString & name )
 

open a connection by name.

If there is no such connection, 0L is returned. This differs from the other openConnection call, that builds one on the fly

Connection * openConnection ( const QString & pluginName,
const QString & host,
int port,
const QString & user,
const QString & password = QString::null )
 

Open a connection to the given host, with the given plugin, username and password.

If the plugin does not exists, OL is returned. This is a convenience function, to avoid passing through a plugin to get a connection

Database * openDatabase ( const QString & pluginName,
const QString & host,
int port,
const QString & user,
const QString & password,
const QString & databaseName )
 

Open a database.

This is a convenience function.

QStringList pluginNames ( )
 

Returns the names of all detected plugins.

void remove ( Connection * )
 

Removes a connection from the list of connections.

This will delete the connection, so make sure to not have dangling reference to the connection.

void saveConnections ( KConfigBase * config = 0L )
 

Save all connections to the KConfig-object config.

If config is 0L the connections will be saved into the standard file kdbrc.

DBEngine * self ( ) [static]
 

creates, if needed, the engine object, and returns it.

void slotConnectionClosed ( Connection * ) [protected, slot]
 

void slotDeleteConnection ( ) [protected, slot]
 


The documentation for this class was generated from the following file:
Generated at Fri Sep 29 16:32:22 2000 for KDB by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000