kexi

KexiDB::OrderByColumnList Class Reference

#include <queryschema.h>

List of all members.


Detailed Description

KexiDB::OrderByColumnList provides list of sorted columns for a query schema.

Definition at line 158 of file queryschema.h.


Public Member Functions

 OrderByColumnList ()
 ~OrderByColumnList ()
bool appendFields (QuerySchema &querySchema, const QString &field1, bool ascending1=true, const QString &field2=QString::null, bool ascending2=true, const QString &field3=QString::null, bool ascending3=true, const QString &field4=QString::null, bool ascending4=true, const QString &field5=QString::null, bool ascending5=true)
void appendColumn (QueryColumnInfo &columnInfo, bool ascending=true)
void appendField (Field &field, bool ascending=true)
bool appendField (QuerySchema &querySchema, const QString &fieldName, bool ascending=true)
bool appendColumn (QuerySchema &querySchema, bool ascending=true, int pos=-1)
void appendColumn (const OrderByColumn &column)
bool isEmpty () const
uint count () const
void clear ()
const_iterator constBegin () const
const_iterator constEnd () const
QString debugString () const
QString toSQLString (bool includeTableNames=true, Driver *drv=0, int identifierEscaping=Driver::EscapeDriver|Driver::EscapeAsNecessary) const

Constructor & Destructor Documentation

OrderByColumnList::OrderByColumnList (  ) 

Constructs empty list of ordered columns.

Definition at line 448 of file queryschema.cpp.


Member Function Documentation

bool OrderByColumnList::appendFields ( QuerySchema querySchema,
const QString &  field1,
bool  ascending1 = true,
const QString &  field2 = QString::null,
bool  ascending2 = true,
const QString &  field3 = QString::null,
bool  ascending3 = true,
const QString &  field4 = QString::null,
bool  ascending4 = true,
const QString &  field5 = QString::null,
bool  ascending5 = true 
)

Appends multiple fields for sorting. querySchema is used to find appropriate field or alias name.

Returns:
false if there is at least one name for which a field or alias name does not exist (all the newly appended fields are removed in this case)

Definition at line 453 of file queryschema.cpp.

void OrderByColumnList::appendColumn ( QueryColumnInfo columnInfo,
bool  ascending = true 
)

Appends column columnInfo. Ascending sorting is set is ascending is true.

Definition at line 486 of file queryschema.cpp.

void OrderByColumnList::appendField ( Field field,
bool  ascending = true 
)

Appends a field field. Ascending sorting is set is ascending is true. Read documentation of OrderByColumn(const Field& field, bool ascending = true) for more info.

Definition at line 501 of file queryschema.cpp.

bool OrderByColumnList::appendField ( QuerySchema querySchema,
const QString &  fieldName,
bool  ascending = true 
)

Appends field with a name field. Ascending sorting is set is ascending is true.

Returns:
true on successful appending, and false if there is no such field or alias name in the querySchema.

Definition at line 506 of file queryschema.cpp.

bool OrderByColumnList::appendColumn ( QuerySchema querySchema,
bool  ascending = true,
int  pos = -1 
)

Appends a column that is at position pos (counted from 0).

Returns:
true on successful adding and false if there is no such position pos.

Definition at line 491 of file queryschema.cpp.

void OrderByColumnList::appendColumn ( const OrderByColumn column  ) 

Appends column to the list.

Definition at line 524 of file queryschema.cpp.

bool KexiDB::OrderByColumnList::isEmpty (  )  const [inline]

Returns:
true if the list is empty.

Definition at line 199 of file queryschema.h.

uint KexiDB::OrderByColumnList::count (  )  const [inline]

Returns:
number of elements of the list.

Definition at line 202 of file queryschema.h.

void KexiDB::OrderByColumnList::clear (  )  [inline]

Removes all elements from the list.

Definition at line 205 of file queryschema.h.

QString OrderByColumnList::debugString (  )  const

Returns:
string for debugging purposes.

Definition at line 529 of file queryschema.cpp.

QString OrderByColumnList::toSQLString ( bool  includeTableNames = true,
Driver drv = 0,
int  identifierEscaping = Driver::EscapeDriver|Driver::EscapeAsNecessary 
) const

Returns:
a string like "name ASC, 2 DESC" usable for building a SQL statement. If includeTableNames is true (the default) fields are output in a form of "tablename.fieldname". drv and identifierEscaping are used for escaping the table and field identifiers.

Definition at line 542 of file queryschema.cpp.


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