kexi

KexiDB::OrderByColumn Class Reference

#include <queryschema.h>

List of all members.


Detailed Description

KexiDB::OrderByColumn provides information about a single query column used for sorting.

The column can be expression or table field.

Definition at line 94 of file queryschema.h.


Public Types

typedef QValueListConstIterator<
OrderByColumn
ListConstIterator

Public Member Functions

 OrderByColumn ()
 OrderByColumn (QueryColumnInfo &column, bool ascending=true, int pos=-1)
 OrderByColumn (Field &field, bool ascending=true)
 ~OrderByColumn ()
QueryColumnInfocolumn () const
int position () const
Fieldfield () const
bool ascending () const
bool operator== (const OrderByColumn &col) const
QString debugString () const
QString toSQLString (bool includeTableName=true) const

Protected Attributes

QueryColumnInfom_column
int m_pos
Fieldm_field
bool m_ascending: 1

Constructor & Destructor Documentation

OrderByColumn::OrderByColumn ( Field field,
bool  ascending = true 
)

Like above but used when the field field is not present on the list of columns.

(e.g. SELECT a FROM t ORDER BY b; where T is a table with fields (a,b)).

Definition at line 345 of file queryschema.cpp.


Member Function Documentation

QueryColumnInfo* KexiDB::OrderByColumn::column (  )  const [inline]

A column to sort.

Definition at line 108 of file queryschema.h.

int KexiDB::OrderByColumn::position (  )  const [inline]

A helper for column() that allows you to know that sorting column was defined by providing its position. -1 by default. Example query: SELECT a, b FROM T ORDER BY 2

Definition at line 113 of file queryschema.h.

Field* KexiDB::OrderByColumn::field (  )  const [inline]

A field to sort, used only in case when the second constructor was used.

Definition at line 116 of file queryschema.h.

bool KexiDB::OrderByColumn::ascending (  )  const [inline]

Returns:
true if ascending sorting should be performed (the default).

Definition at line 119 of file queryschema.h.

bool KexiDB::OrderByColumn::operator== ( const OrderByColumn col  )  const [inline]

Returns:
true if this column is thesame as col

Definition at line 122 of file queryschema.h.

QString OrderByColumn::debugString (  )  const

Returns:
string for debugging purposes.

Definition at line 357 of file queryschema.cpp.

QString OrderByColumn::toSQLString ( bool  includeTableName = true  )  const

Returns:
a string like "name ASC" usable for building a SQL statement. If includeTableNames is true (the default) field is output in a form of "tablename.fieldname".

Definition at line 371 of file queryschema.cpp.


Member Data Documentation

Column to sort 0 if m_field is non-0.

Definition at line 136 of file queryschema.h.

A helper for m_column that allows to know that sorting column was defined by providing its position.

-1 by default. e.g. SELECT a, b FROM T ORDER BY 2

Definition at line 137 of file queryschema.h.

Used only in case when the second contructor is used.

Definition at line 140 of file queryschema.h.

true if ascending sorting should be performed (the default).

Definition at line 143 of file queryschema.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys