KDbDriverManager

Search for usage in LXR

KDbDriverManager Class Reference

#include <KDbDriverManager.h>

Public Member Functions

KDbDriverdriver (const QString &id)
 
QStringList driverIds ()
 
QStringList driverIdsForMimeType (const QString &mimeType)
 
const KDbDriverMetaDatadriverMetaData (const QString &id)
 
bool hasDatabaseServerDrivers ()
 
QString possibleProblemsMessage () const
 
KDbResult result () const
 
KDbResultableresultable () const
 

Detailed Description

A driver manager for finding and loading driver plugins.

Definition at line 37 of file KDbDriverManager.h.

Constructor & Destructor Documentation

◆ KDbDriverManager()

KDbDriverManager::KDbDriverManager ( )

Definition at line 245 of file KDbDriverManager.cpp.

◆ ~KDbDriverManager()

KDbDriverManager::~KDbDriverManager ( )
virtual

Definition at line 249 of file KDbDriverManager.cpp.

Member Function Documentation

◆ driver()

KDbDriver * KDbDriverManager::driver ( const QString & id)

Tries to load db driver with ID id. The lookup is case insensitive.

Returns
driver object or nullptr on error. On error status can be obtained using result(). The driver object is owned by KDb internals and is not deleted after this KDbDriverManager object is deleted.
Note
If more than one driver with the same ID found on the search path, first located driver is selected. All other drivers for this ID are skip with a warning "Driver with ID '...' already found at (path) – skipping another at (path). The warning can be suppressed by setting a KDB_NO_DUPLICATED_DRIVER_WARNINGS environment variable.

Definition at line 278 of file KDbDriverManager.cpp.

◆ driverIds()

QStringList KDbDriverManager::driverIds ( )

returns list of available drivers IDs. That drivers can be loaded by first use of driver() method.

Definition at line 263 of file KDbDriverManager.cpp.

◆ driverIdsForMimeType()

QStringList KDbDriverManager::driverIdsForMimeType ( const QString & mimeType)

Returns list of driver IDs for mimeType MIME type.

IDs of drivers for file-based databases are only returned. Empty list is returned if no driver has been found for the type or if the type is invalid. Driver supports the supplied MIME type if it is specified as supported in the driver's metadata. If a MIME type alias is supplied, proper type for this alias is resolved and driver IDs for that type are returned. Similarly, if proper MIME type is supplied, IDs are returned for drivers that support any alias for this type.

The lookup is case insensitive.

Definition at line 273 of file KDbDriverManager.cpp.

◆ driverMetaData()

const KDbDriverMetaData * KDbDriverManager::driverMetaData ( const QString & id)
Returns
information (metadata) about driver with ID id. The lookup is case insensitive. The metadata object is owned by KDb internals and is not deleted after this KDbDriverManager object is deleted. nullptr is returned if the metadata has not been found. On error status can be obtained using result().
See also
driver(const QString& id) for information about duplicated drivers.

Definition at line 268 of file KDbDriverManager.cpp.

◆ hasDatabaseServerDrivers()

bool KDbDriverManager::hasDatabaseServerDrivers ( )
Returns
true if there is at least one server-based database driver installed.

Definition at line 297 of file KDbDriverManager.cpp.

◆ possibleProblemsMessage()

QString KDbDriverManager::possibleProblemsMessage ( ) const
Returns
HTML-formatted message about possible problems encountered. It can be displayed in a 'details' section of a GUI message if an error encountered. Currently the message contains a list of incompatible db drivers. Can be used in code that finds driver depending on file format.
Todo
make it just QStringList

Definition at line 283 of file KDbDriverManager.cpp.

◆ result()

KDbResult KDbDriverManager::result ( ) const
Returns
result of the recent operation.

Definition at line 253 of file KDbDriverManager.cpp.

◆ resultable()

KDbResultable * KDbDriverManager::resultable ( ) const
Returns
KDbResultable object for the recent operation. It adds serverResultName() in addition to the result().

Definition at line 258 of file KDbDriverManager.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.