kexidb/utils.h File Reference
#include <qvaluelist.h>
#include <qvariant.h>
#include <kexidb/connection.h>
#include <kexidb/driver.h>
Go to the source code of this file.
Namespaces | |
| namespace | KexiDB |
Typedefs | |
| typedef QValueList< uint > | TypeGroupList |
Enumerations | |
| enum | SplitToTableAndFieldPartsOptions { FailIfNoTableOrFieldName = 0, SetFieldNameIfNoTableName = 1 } |
| Used in splitToTableAndFieldParts(). More... | |
| enum | BLOBEscapingType { BLOBEscapeXHex = 1, BLOBEscape0xHex, BLOBEscapeHex, BLOBEscapeOctal } |
| Escaping types used in escapeBLOB(). More... | |
Functions | |
| bool | deleteRow (Connection &conn, TableSchema *table, const QString &keyname, const QString &keyval) |
| for convenience | |
| bool | deleteRow (Connection &conn, const QString &tableName, const QString &keyname, const QString &keyval) |
| bool | deleteRow (Connection &conn, TableSchema *table, const QString &keyname, int keyval) |
| bool | deleteRow (Connection &conn, const QString &tableName, const QString &keyname, int keyval) |
| bool | deleteRow (Connection &conn, const QString &tableName, const QString &keyname1, Field::Type keytype1, const QVariant &keyval1, const QString &keyname2, Field::Type keytype2, const QVariant &keyval2) |
| bool | replaceRow (Connection &conn, TableSchema *table, const QString &keyname, const QString &keyval, const QString &valname, QVariant val, int ftype) |
| const TypeGroupList | typesForGroup (Field::TypeGroup typeGroup) |
| QStringList | typeNamesForGroup (Field::TypeGroup typeGroup) |
| QStringList | typeStringsForGroup (Field::TypeGroup typeGroup) |
| Field::Type | defaultTypeForGroup (Field::TypeGroup typeGroup) |
| bool | isEmptyValue (Field *f, const QVariant &v) |
| void | getHTMLErrorMesage (Object *obj, QString &msg, QString &details) |
| void | getHTMLErrorMesage (Object *obj, QString &msg) |
| void | getHTMLErrorMesage (Object *obj, ResultInfo *result) |
| QString | sqlWhere (Driver *drv, Field::Type t, const QString fieldName, const QVariant value) |
| int | idForObjectName (Connection &conn, const QString &objName, int objType) |
| int | rowCount (Connection &conn, const QString &sql) |
| int | rowCount (const TableSchema &tableSchema) |
| int | rowCount (QuerySchema &querySchema) |
| int | rowCount (TableOrQuerySchema &tableOrQuery) |
| int | fieldCount (TableOrQuerySchema &tableOrQuery) |
| void | connectionTestDialog (QWidget *parent, const ConnectionData &data, MessageHandler &msgHandler) |
| QMap< QString, QString > | toMap (const ConnectionData &data) |
| void | fromMap (const QMap< QString, QString > &map, ConnectionData &data) |
| bool | splitToTableAndFieldParts (const QString &string, QString &tableName, QString &fieldName, SplitToTableAndFieldPartsOptions option=FailIfNoTableOrFieldName) |
| bool | supportsVisibleDecimalPlacesProperty (Field::Type type) |
| QString | formatNumberForVisibleDecimalPlaces (double value, int decimalPlaces) |
| bool | isBuiltinTableFieldProperty (const QCString &propertyName) |
| bool | isExtendedTableFieldProperty (const QCString &propertyName) |
| Field::Type | intToFieldType (int type) |
| bool | setFieldProperties (Field &field, const QMap< QCString, QVariant > &values) |
| bool | setFieldProperty (Field &field, const QCString &propertyName, const QVariant &value) |
| QVariant | loadPropertyValueFromDom (const QDomNode &node) |
| int | loadIntPropertyValueFromDom (const QDomNode &node, bool *ok) |
| QString | loadStringPropertyValueFromDom (const QDomNode &node, bool *ok) |
| QDomElement | saveNumberElementToDom (QDomDocument &doc, QDomElement &parentEl, const QString &elementName, int value) |
| QDomElement | saveBooleanElementToDom (QDomDocument &doc, QDomElement &parentEl, const QString &elementName, bool value) |
| QVariant | emptyValueForType (Field::Type type) |
| QVariant | notEmptyValueForType (Field::Type type) |
| QString | escapeBLOB (const QByteArray &array, BLOBEscapingType type) |
| QByteArray | pgsqlByteaToByteArray (const char *data, int length) |
| QString | variantToString (const QVariant &v) |
| QVariant | stringToVariant (const QString &s, QVariant::Type type, bool &ok) |
| bool | isDefaultValueAllowed (Field *field) |
| void | getLimitsForType (Field::Type type, int &minValue, int &maxValue) |
| void | debugRowData (const RowData &rowData) |
| Field::Type | maximumForIntegerTypes (Field::Type t1, Field::Type t2) |
| QVariant | cstringToVariant (const char *data, KexiDB::Field *f, int length=-1) |
Typedef Documentation
|
|
Definition at line 86 of file kexidb/utils.h. |
Enumeration Type Documentation
|
|
Escaping types used in escapeBLOB().
Definition at line 379 of file kexidb/utils.h. |
|
|
Used in splitToTableAndFieldParts().
Definition at line 262 of file kexidb/utils.h. |
Function Documentation
|
||||||||||||||||
|
shows connection test dialog with a progress bar indicating connection testing (within a second thread). data is used to perform a (temporary) test connection. msgHandler is used to display errors. On successful connecting, a message is displayed. After testing, temporary connection is closed. Referenced by KexiDBConnectionTabWidget::slotTestConnection(). |
|
||||||||||||||||
|
Definition at line 437 of file kexidb/utils.h. References KexiDB::Field::BigInteger, KexiDB::Field::BLOB, KexiDB::Field::isFPNumericType(), KexiDB::Field::isIntegerType(), KexiDB::Field::isTextType(), KexiDB::Field::type(), and KexiDB::Field::variantType(). Referenced by KexiMigration::PqxxMigrate::drv_copyTable(), KexiMigration::MySQLMigrate::drv_copyTable(), KexiDB::MySqlCursor::storeCurrentRow(), and KexiDB::MySqlCursor::value(). |
|
|
Shows debug information about rowData row data. |
|
|
Referenced by KexiTableDesignerView::slotBeforeCellChanged(), and KexiTableDesignerView::slotRowUpdated(). |
|
||||||||||||||||||||||||||||||||||||
|
Delete row with two generic criterias. Definition at line 66 of file kexidb/utils.h. |
|
||||||||||||||||||||
|
Definition at line 58 of file kexidb/utils.h. References KexiDB::Field::Integer. |
|
||||||||||||||||||||
|
Definition at line 51 of file kexidb/utils.h. References KexiDB::Field::Integer, and KexiDB::SchemaData::name(). |
|
||||||||||||||||||||
|
Definition at line 44 of file kexidb/utils.h. References KexiDB::Field::Text. |
|
||||||||||||||||||||
|
for convenience
Definition at line 37 of file kexidb/utils.h. References KexiDB::Connection::driver(), KexiDB::Connection::executeSQL(), KexiDB::SchemaData::name(), and KexiDB::Field::Text. Referenced by KexiDB::Connection::createTable(), KexiDB::Connection::dropTable(), KexiDB::Connection::removeDataBlock(), KexiDB::Connection::removeObject(), and KexiDB::replaceRow(). |
|
|
Referenced by KexiDB::AlterTableHandler::execute(), and KexiDB::notEmptyValueForType(). |
|
||||||||||||
|
Referenced by KexiDB::SQLiteDriver::escapeBLOB(), KexiDB::pqxxSqlDriver::escapeBLOB(), KexiDB::MySqlDriver::escapeBLOB(), KexiCSVExport::exportData(), and KexiDB::variantToString(). |
|
|
Referenced by KexiDB::PreparedStatement::generateStatementString(), and KexiCSVExportWizard::showPage(). |
|
||||||||||||
|
Referenced by KexiTableEdit::setupContents(), and KexiTextFormatter::valueToText(). |
|
||||||||||||
|
Restores connection data data from map. |
|
||||||||||||
|
This methods works like above, but works on result's members instead. |
|
||||||||||||
|
This methods works like above, but appends both a message and a description to msg. |
|
||||||||||||||||
|
Sets msg to an error message retrieved from object obj, and details to details of this error (server message and result number). Does nothing if obj is null or no error occurred. msg and details strings are not overwritten. If msg is not empty, obj's error message is appended to details. Referenced by KexiTableViewData::deleteRow(), KexiDB::getHTMLErrorMesage(), KexiTableViewData::saveRow(), KexiBrowser::setProject(), and KexiGUIMessageHandler::showErrorMessage(). |
|
||||||||||||||||
|
Gets limits for values of type type. The result is put into minValue and maxValue. Supported types are Byte, ShortInteger, Integer and BigInteger Results for BigInteger or non-integer types are the same as for Integer due to limitation of int type. Signed integers are assumed.
Referenced by KexiQueryParameters::getParameters(). |
|
||||||||||||||||
|
Referenced by KexiDBSubForm::setFormName(), and KexiSubReport::setReportName(). |
|
|
Referenced by KexiTableDesignerView::buildField(), KexiDB::SQLiteConnection::drv_changeFieldProperty(), setIntToFieldType(), KexiTableDesignerView::slotPropertyChanged(), and KexiTableDesignerView::slotRowUpdated(). |
|
|
Referenced by KexiDB::setFieldProperties(). |
|
|
Referenced by KexiDB::RowEditBuffer::at(), and KexiDB::Connection::insertRow(). |
|
||||||||||||
|
Definition at line 105 of file kexidb/utils.h. References KexiDB::Field::hasEmptyProperty(). Referenced by KexiTableViewData::saveRow(). |
|
|
Referenced by KexiDB::setFieldProperties(), and KexiDB::setFieldProperty(). |
|
||||||||||||
|
Convenience version of loadPropertyValueFromDom().
Referenced by KexiDB::Connection::loadExtendedTableSchemaData(). |
|
|
Referenced by KexiDB::Connection::loadExtendedTableSchemaData(), and KexiDB::LookupFieldSchema::loadFromDom(). |
|
||||||||||||
|
Convenience version of loadPropertyValueFromDom().
|
|
||||||||||||
|
Referenced by KexiDB::maximumForIntegerTypes(), and KexiDB::BinaryExpr::type(). |
|
|
Referenced by KexiDB::AlterTableHandler::execute(). |
|
||||||||||||
|
Referenced by KexiMigration::PqxxMigrate::drv_copyTable(), pgsqlByteaToByteArray(), and KexiDB::pgsqlCStrToVariant(). |
|
||||||||||||||||||||||||||||||||
|
Definition at line 75 of file kexidb/utils.h. References KexiDB::deleteRow(), KexiDB::SchemaData::name(), and KexiDB::Field::Text. |
|
|
Like above but operates on a table or query schema variant. |
|
|
Like above but operates on a query schema. |
|
|
|
|
||||||||||||
|
Referenced by KexiCSVExport::exportData(), KexiDB::rowCount(), and KexiCSVExportWizard::showPage(). |
|
||||||||||||||||||||
|
Saves boolean element for value value to doc document within parent element parentEl. Like saveNumberElementToDom() but creates "bool" tags. True/false values will be saved as "true"/"false" strings.
Referenced by KexiDB::LookupFieldSchema::saveToDom(). |
|
||||||||||||||||||||
|
Saves integer element for value value to doc document within parent element parentEl. The value will be enclosed in "number" element and "elementName" element. Example: saveNumberElementToDom(doc, parentEl, "height", 15) will create <height><number>15</number></height>
Referenced by KexiDB::LookupFieldSchema::saveToDom(). |
|
||||||||||||
|
Sets property values for field.
Referenced by KexiTableDesignerView::buildField(), and KexiDB::AlterTableHandler::InsertFieldAction::simplifyActions(). |
|
||||||||||||||||
|
Sets property value for field.
Referenced by KexiDB::AlterTableHandler::ChangeFieldPropertyAction::execute(), and KexiDB::AlterTableHandler::ChangeFieldPropertyAction::updateTableSchema(). |
|
||||||||||||||||||||
|
Splits string like "table.field" into "table" and "field" parts. On success, a table name is passed to tableName and a field name is passed to fieldName. The function fails if either:
If option is SetFieldNameIfNoTableName and string does not contain '.', string is passed to fieldName and tableName is set to QString::null without failure. If function fails, tableName and fieldName remain unchanged.
Referenced by KexiDB::QuerySchema::findTableField(), and KexiQueryDesignerGuiEditor::slotBeforeCellChanged(). |
|
||||||||||||||||||||
|
Function useful for building WHERE parts of sql statements. Constructs an sql string like "fielname = value" for specific drv driver, field type t, fieldName and value. If value is null, "fieldname is NULL" string is returned. Definition at line 130 of file kexidb/utils.h. References KexiDB::Driver::valueToSQL(). Referenced by KexiDB::Connection::loadDataBlock(), and KexiDB::Connection::storeDataBlock(). |
|
||||||||||||||||
|
Referenced by KexiDB::Connection::setupField(). |
|
|
Referenced by KexiDB::setFieldProperties(), KexiDB::setFieldProperty(), KexiDB::Connection::loadExtendedTableSchemaData(), KexiDB::Field::setVisibleDecimalPlaces(), KexiDB::Connection::storeExtendedTableSchemaData(), and KexiTableDesignerViewPrivate::updatePropertiesVisibility(). |
|
|
Saves connection data data into map. Referenced by KexiMainWindowImpl::showProjectMigrationWizard(). |
|
|
Referenced by KexiTableDesignerView::getSubTypeListData(). |
|
|
|
|
|
Referenced by KexiTableDesignerView::getSubTypeListData(). |
|
|
Referenced by buildValuesForKexi__Fields(), and KexiDB::Field::debugString(). |
