diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2000-07-30 13:58:29 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2000-07-30 13:58:29 (GMT) |
commit | 3876f92c80e9cc62af30916f0ccdeb83cdc2ff05 (patch) | |
tree | 2d71d4688e381dc8e0c968d120b25fdd0763c27e /src/reflist.cpp | |
parent | 7295388a3c6b3a12a77dc7a56862333c97e4ccb6 (diff) | |
download | Doxygen-3876f92c80e9cc62af30916f0ccdeb83cdc2ff05.zip Doxygen-3876f92c80e9cc62af30916f0ccdeb83cdc2ff05.tar.gz Doxygen-3876f92c80e9cc62af30916f0ccdeb83cdc2ff05.tar.bz2 |
Release-1.2.0-20000730
Diffstat (limited to 'src/reflist.cpp')
-rw-r--r-- | src/reflist.cpp | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/reflist.cpp b/src/reflist.cpp new file mode 100644 index 0000000..8bef347 --- /dev/null +++ b/src/reflist.cpp @@ -0,0 +1,86 @@ +/****************************************************************************** + * + * + * + * + * Copyright (C) 1997-2000 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ + +#include "reflist.h" + +/*! The one and only todo list */ +RefList todoList; +/*! The test criteria list */ +RefList testList; + + +/*! Create a todo list */ +RefList::RefList() +{ + m_dict = 0; + m_dictIterator = 0; + m_id = 0; +} + +/*! Destroy the todo list. Currently not called! */ +RefList::~RefList() +{ + delete m_dictIterator; + delete m_dict; +} + +/*! Adds a new item to the list. + * \param text The item text. + * \returns A unique id for this item. + */ +int RefList::addRefItem() +{ + if (m_dict==0) + { + m_dict = new QIntDict<RefItem>(1009); + m_dict->setAutoDelete(TRUE); + m_dictIterator = new QIntDictIterator<RefItem>(*m_dict); + } + RefItem *item = new RefItem; + m_id++; + m_dict->insert(m_id,item); + return m_id; +} + +/*! Returns an item given it's id that is obtained with addRefItem() + * \param itemId item's identifier. + * \returns A pointer to the todo item's structure. + */ +RefItem *RefList::getRefItem(int itemId) +{ + return m_dict->find(itemId); +} + +/*! Returns the first item in the dictionary or 0 if + * non is available. + * Items are not sorted. + */ +RefItem *RefList::getFirstRefItem() +{ + return m_dictIterator->toFirst(); +} + +/*! Returns the next item in the dictionary or 0 if + * we are at the end of the list. + * Items are not sorted. + */ +RefItem *RefList::getNextRefItem() +{ + return m_dictIterator->operator++(); +} + |