summaryrefslogtreecommitdiffstats
path: root/src/htmlattrib.h
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2013-12-30 17:55:14 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2013-12-30 17:55:14 (GMT)
commit6e51abf63021dc9fe32c05f003232fe68a08591d (patch)
treee9fe6f526e4a2b22b1a55659331c15750969a019 /src/htmlattrib.h
parent744d1ca52e25dfa9e3d656056d87ed7cb6320585 (diff)
downloadDoxygen-6e51abf63021dc9fe32c05f003232fe68a08591d.zip
Doxygen-6e51abf63021dc9fe32c05f003232fe68a08591d.tar.gz
Doxygen-6e51abf63021dc9fe32c05f003232fe68a08591d.tar.bz2
Reduced and improved functionality of QList
- operations on current index and node (next(), prev(), last(), first()) have been removed. - access to internal nodes has been removed. - old QList has been renamed to QInternalList for use inside qtools only. - added type safe compare, new, and delete operations (compareValues(), newValue(), deleteValue()). - add compareValues also to QDict for consistency. - changed doxygen's implementation to comply with the new QList and QDict interface.
Diffstat (limited to 'src/htmlattrib.h')
-rw-r--r--src/htmlattrib.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/htmlattrib.h b/src/htmlattrib.h
index 203fb48..0b139aa 100644
--- a/src/htmlattrib.h
+++ b/src/htmlattrib.h
@@ -40,33 +40,31 @@ class HtmlAttribList : public QList<HtmlAttrib>
{ clear(); QList<HtmlAttrib>::operator=(l); return *this; }
QCString find(const QCString name) const
{
- HtmlAttribList *that = (HtmlAttribList *)this;
+ QListIterator<HtmlAttrib> it(*this);
QCString result;
- HtmlAttrib *attr=that->first();
- while (attr)
+ HtmlAttrib *attr;
+ for (;(attr=it.current());++it)
{
if (attr->name==name) return attr->value;
- attr=that->next();
}
return result;
}
QCString toString() const
{
- HtmlAttribList *that = (HtmlAttribList *)this;
+ QListIterator<HtmlAttrib> it(*this);
QCString result;
- HtmlAttrib *attr=that->first();
- while (attr)
+ HtmlAttrib *attr;
+ for (;(attr=it.current());++it)
{
result+=" "+attr->name+"=\""+attr->value+"\"";
- attr=that->next();
}
return result;
}
private:
- QCollection::Item newItem( QCollection::Item d )
- { return (QCollection::Item)new HtmlAttrib(*(HtmlAttrib *)d); }
- void deleteItem(QCollection::Item d)
- { delete (HtmlAttrib *)d; }
+ HtmlAttrib *newValue( HtmlAttrib *v ) const
+ { return new HtmlAttrib(*v); }
+ void deleteValue(HtmlAttrib *v) const
+ { delete v; }
};
/*! @brief Html attribute list iterator */