Search for usage in LXR

#include <KDbResult.shared.h>

Public Member Functions

 KDbResult (const QString &message)
 KDbResult (int code, const QString &message)
void clearSql ()
bool isError () const
void prependMessage (const QString &message)
void prependMessage (int code, const QString &message)
virtual KDbEscapedString recentSqlString () const
void setServerErrorCode (int errorCode)

Public Attributes

int code
KDbEscapedString errorSql
QString message
QString messageTitle
int serverErrorCode
bool serverErrorCodeSet
QString serverMessage
KDbEscapedString sql

Protected Member Functions

void init (int code, const QString &message)

Detailed Description

Stores detailed information about result of recent operation.

Definition at line 34 of file KDbResult.shared.h.

Constructor & Destructor Documentation

◆ KDbResult() [1/2]

KDbResult::KDbResult ( int code,
const QString & message )

Definition at line 35 of file KDbResult.cpp.

◆ KDbResult() [2/2]

KDbResult::KDbResult ( const QString & message)

Definition at line 41 of file KDbResult.cpp.

Member Function Documentation

◆ clearSql()

void KDbResult::clearSql ( )

Efficient clearing of the sql attribute, equivalent of setSql(QString()).

Definition at line 110 of file KDbResult.shared.h.

◆ init()

void KDbResult::init ( int code,
const QString & message )

Definition at line 51 of file KDbResult.cpp.

◆ isError()

bool KDbResult::isError ( ) const
true if there is an error i.e. a nonempty message, error code other than ERR_NONE or server result has been set.

Definition at line 64 of file KDbResult.cpp.

◆ prependMessage() [1/2]

void KDbResult::prependMessage ( const QString & message)

Prepends message to an existing message.

Definition at line 98 of file KDbResult.cpp.

◆ prependMessage() [2/2]

void KDbResult::prependMessage ( int code,
const QString & message )

Sets result code and prepends message to an existing message.


Definition at line 80 of file KDbResult.cpp.

◆ recentSqlString()

virtual KDbEscapedString KDbResult::recentSqlString ( ) const
sql string of actually executed SQL statement, usually using drv_executeSql(). If there was error during executing SQL statement, before, that string is returned instead.

Definition at line 117 of file KDbResult.shared.h.

◆ setServerErrorCode()

void KDbResult::setServerErrorCode ( int errorCode)

Sets an implementation-specific error code of server-side operation.

Use this to give users more precise information. Implies isError() == true. The only way to clear already set server result code is to create a new KDbResult object.

Definition at line 74 of file KDbResult.cpp.

Member Data Documentation

◆ code

int KDbResult::code


result code, default is ERR_NONE (0). @setter Sets the result code if there was error.

Definition at line 44 of file KDbResult.shared.h.

◆ errorSql

KDbEscapedString KDbResult::errorSql

Definition at line 72 of file KDbResult.shared.h.

◆ message

QString KDbResult::message


(localized) message if there was error. @setter Sets (localized) message to message.

Definition at line 63 of file KDbResult.shared.h.

◆ messageTitle

QString KDbResult::messageTitle


message title that sometimes is provided and prepended to the main warning/error message. Used by KDbMessageHandler.

Definition at line 70 of file KDbResult.shared.h.

◆ serverErrorCode

int KDbResult::serverErrorCode


an implementation-specific last server-side operation result number. Use this to give users more precise information about the result.

For example, use this for your driver - default implementation just returns 0. Note that this value is not the same as the one returned by code().

See also

Definition at line 55 of file KDbResult.shared.h.

◆ serverErrorCodeSet

bool KDbResult::serverErrorCodeSet

Definition at line 88 of file KDbResult.shared.h.

◆ serverMessage

QString KDbResult::serverMessage


message from server. KDb framework offers detailed result numbers using resultCode() and detailed result i18n-ed messages using message(). These both are (almost) not engine-dependent. Use setServerMessage() to users more information on the result of operation that is non-i18n-ed and engine-specific, usually coming from the server server side. @setter Sets message from the server.

Definition at line 86 of file KDbResult.shared.h.

◆ sql

KDbEscapedString KDbResult::sql

Definition at line 74 of file KDbResult.shared.h.

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 Fri Jul 19 2024 12:00:08 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.