#include <queryschema.h>

Public Types

typedef TQValueListConstIterator< OrderByColumn > ListConstIterator
 

Public Member Functions

 OrderByColumn (QueryColumnInfo &column, bool ascending=true, int pos=-1)
 
 OrderByColumn (Field &field, bool ascending=true)
 
QueryColumnInfo * column () const
 
int position () const
 
Field * field () const
 
bool ascending () const
 
bool operator== (const OrderByColumn &col) const
 
TQString debugString () const
 
TQString toSQLString (bool includeTableName=true, Driver *drv=0, int identifierEscaping=Driver::EscapeDriver|Driver::EscapeAsNecessary) const
 

Protected Attributes

QueryColumnInfo * m_column
 
int m_pos
 
Field * m_field
 
bool m_ascending: 1
 

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 100 of file queryschema.h.

Member Typedef Documentation

◆ ListConstIterator

typedef TQValueListConstIterator<OrderByColumn> KexiDB::OrderByColumn::ListConstIterator

Definition at line 103 of file queryschema.h.

Constructor & Destructor Documentation

◆ OrderByColumn() [1/3]

OrderByColumn::OrderByColumn ( )

Definition at line 371 of file queryschema.cpp.

◆ OrderByColumn() [2/3]

OrderByColumn::OrderByColumn ( QueryColumnInfo &  column,
bool  ascending = true,
int  pos = -1 
)

Definition at line 379 of file queryschema.cpp.

◆ OrderByColumn() [3/3]

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 387 of file queryschema.cpp.

◆ ~OrderByColumn()

OrderByColumn::~OrderByColumn ( )

Definition at line 395 of file queryschema.cpp.

Member Function Documentation

◆ ascending()

bool KexiDB::OrderByColumn::ascending ( ) const
inline
Returns
true if ascending sorting should be performed (the default).

Definition at line 125 of file queryschema.h.

◆ column()

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

A column to sort.

Definition at line 114 of file queryschema.h.

◆ debugString()

TQString OrderByColumn::debugString ( ) const
Returns
string for debugging purposes.

Definition at line 399 of file queryschema.cpp.

◆ field()

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

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

Definition at line 122 of file queryschema.h.

◆ operator==()

bool KexiDB::OrderByColumn::operator== ( const OrderByColumn &  col) const
inline
Returns
true if this column is thesame as col

Definition at line 128 of file queryschema.h.

◆ position()

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 119 of file queryschema.h.

◆ toSQLString()

TQString OrderByColumn::toSQLString ( bool  includeTableName = true,
Driver *  drv = 0,
int  identifierEscaping = Driver::EscapeDriver|Driver::EscapeAsNecessary 
) 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" (but only if fieldname is not a name of alias). drv and identifierEscaping are used for escaping the table and field identifiers.

Definition at line 413 of file queryschema.cpp.

Member Data Documentation

◆ m_ascending

bool KexiDB::OrderByColumn::m_ascending
protected

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

Definition at line 151 of file queryschema.h.

◆ m_column

QueryColumnInfo* KexiDB::OrderByColumn::m_column
protected

Column to sort.

0 if m_field is non-0.

Definition at line 144 of file queryschema.h.

◆ m_field

Field* KexiDB::OrderByColumn::m_field
protected

Used only in case when the second contructor is used.

Definition at line 148 of file queryschema.h.

◆ m_pos

int KexiDB::OrderByColumn::m_pos
protected

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 145 of file queryschema.h.


The documentation for this class was generated from the following files: