The QSparqlResultRow class encapsulates a row in the results of a query. More...
Public Member Functions |
|
QSparqlResultRow () | |
QSparqlResultRow (const QSparqlResultRow &other) | |
QSparqlResultRow & | operator= (const QSparqlResultRow &other) |
~QSparqlResultRow () | |
bool | operator== (const QSparqlResultRow &other) const |
bool | operator!= (const QSparqlResultRow &other) const |
int | indexOf (const QString &name) const |
QString | variableName (int i) const |
QSparqlBinding | binding (int i) const |
QSparqlBinding | binding (const QString &name) const |
QVariant | value (int i) const |
QVariant | value (const QString &name) const |
void | append (const QSparqlBinding &binding) |
bool | isEmpty () const |
bool | contains (const QString &name) const |
void | clear () |
void | clearValues () |
int | count () const |
The QSparqlResultRow class encapsulates a row in the results of a query.
The QSparqlResultRow class encapsulates the functionality and characteristics of a row of results returned by a QSparqlQuery. A QSparqlResultRow is a set of (name, value) pairs (bindings). QSparqlResultRow supports adding and removing bindings as well as setting and retrieving binding values.
The values of a QSparqlResultRow can be set by name or position with setValue(); if you want to set a binding to null use setValue() with QVariant(). To find the position of a binding by name use indexOf(), and to find the name of a binding at a particular position use bindingName(). Use binding() to retrieve a QSparqlBinding object for a given binding. Use contains() to see if the QSparqlResultRow contains a particular binding name.
A QSparqlResultRow can have bindings added with append() or insert(), replaced with replace(), and removed with remove(). All the bindings can be removed with clear(). The number of bindings is given by count(); all their values can be cleared (to null) using clearValues().
QSparqlResultRow::QSparqlResultRow | ( | ) |
QSparqlResultRow::QSparqlResultRow | ( | const QSparqlResultRow & | other | ) |
Constructs a copy of other.
QSparqlResultRow is implicitly shared. This means you can make copies of a result row in constant time.
QSparqlResultRow::~QSparqlResultRow | ( | ) |
Destroys the object and frees any allocated resources.
void QSparqlResultRow::append | ( | const QSparqlBinding & | binding | ) |
Append a copy of binding binding to the end of the result row.
QSparqlBinding QSparqlResultRow::binding | ( | int | index | ) | const |
Returns the binding at position index. If the position is out of range, an empty binding is returned.
QSparqlBinding QSparqlResultRow::binding | ( | const QString & | name | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns the binding called name.
void QSparqlResultRow::clear | ( | ) |
Removes all the result row's bindings.
void QSparqlResultRow::clearValues | ( | ) |
Clears the value of all bindings in the result row and sets each binding to null.
bool QSparqlResultRow::contains | ( | const QString & | name | ) | const |
Returns true if there is a binding in the result row called name; otherwise returns false.
int QSparqlResultRow::count | ( | ) | const |
Returns the number of bindings in the result row.
int QSparqlResultRow::indexOf | ( | const QString & | name | ) | const |
Returns the position of the binding called name within the result row, or -1 if it cannot be found. Variable names are case-sensitive. If more than one binding matches, the index of the first one is returned.
bool QSparqlResultRow::isEmpty | ( | ) | const |
bool QSparqlResultRow::operator!= | ( | const QSparqlResultRow & | other | ) | const [inline] |
Returns true if this object is not identical to other; otherwise returns false.
QSparqlResultRow & QSparqlResultRow::operator= | ( | const QSparqlResultRow & | other | ) |
Sets the result row equal to other.
QSparqlResultRow is implicitly shared. This means you can make copies of a result row in constant time.
bool QSparqlResultRow::operator== | ( | const QSparqlResultRow & | other | ) | const |
Returns true if this object is identical to other (i.e., has the same bindings in the same order); otherwise returns false.
QVariant QSparqlResultRow::value | ( | int | index | ) | const |
Returns the value at the current row and position index. If the position is out of range, an empty QVariant is returned.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns the value of the binding called name.
Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). Commercial Qt/LGPL 2.1 with Nokia exception/GPL 3.0 |
MeeGo 1.2 Harmattan API
|