MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

QSparqlResultRow Class Reference

The QSparqlResultRow class encapsulates a row in the results of a query. More...

List of all members.

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

Detailed Description

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().

See also:
QSparqlBinding, QSparqlResult

Constructor & Destructor Documentation

QSparqlResultRow::QSparqlResultRow (  ) 

Constructs an empty result row.

See also:
isEmpty(), append(), insert()
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.


Member Function Documentation

void QSparqlResultRow::append ( const QSparqlBinding binding  ) 

Append a copy of binding binding to the end of the result row.

See also:
insert() replace() remove()
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.

See also:
clearValues() isEmpty()
void QSparqlResultRow::clearValues (  ) 

Clears the value of all bindings in the result row and sets each binding to null.

See also:
setValue()
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.

See also:
isEmpty()
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.

See also:
bindingName()
bool QSparqlResultRow::isEmpty (  )  const

Returns true if there are no bindings in the result row; otherwise returns false.

See also:
append() insert() clear()
bool QSparqlResultRow::operator!= ( const QSparqlResultRow other  )  const [inline]

Returns true if this object is not identical to other; otherwise returns false.

See also:
operator==()
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.

See also:
operator!=()
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.

QVariant QSparqlResultRow::value ( 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 value of the binding called name.

QString QSparqlResultRow::variableName ( int  index  )  const

Returns the name of the binding at position index. If the binding does not exist, an empty string is returned.

See also:
indexOf()

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