reflist.cpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  *
00003  * $Id: reflist.cpp,v 1.2 2001/03/19 19:27:41 root Exp $
00004  *
00005  *
00006  * Copyright (C) 1997-2008 by Dimitri van Heesch.
00007  *
00008  * Permission to use, copy, modify, and distribute this software and its
00009  * documentation under the terms of the GNU General Public License is hereby 
00010  * granted. No representations are made about the suitability of this software 
00011  * for any purpose. It is provided "as is" without express or implied warranty.
00012  * See the GNU General Public License for more details.
00013  *
00014  * Documents produced by Doxygen are derivative works derived from the
00015  * input used in their production; they are not affected by this license.
00016  *
00017  */
00018 
00019 #include "reflist.h"
00020 
00026 RefList::RefList(const char *listName,
00027                  const char *pageTitle,
00028                  const char *secTitle
00029                 )
00030 { 
00031   m_dict = 0;
00032   m_dictIterator = 0;
00033   m_id = 0;
00034   m_listName = listName;
00035   m_pageTitle = pageTitle;
00036   m_secTitle = secTitle;
00037 }
00038 
00040 RefList::~RefList() 
00041 { 
00042   delete m_dictIterator; 
00043   delete m_dict; 
00044 }
00045 
00049 int RefList::addRefItem()
00050 {
00051   if (m_dict==0)
00052   {
00053     m_dict = new QIntDict<RefItem>(1009); 
00054     m_dict->setAutoDelete(TRUE);
00055     m_dictIterator = new QIntDictIterator<RefItem>(*m_dict);
00056   }
00057   RefItem *item = new RefItem;
00058   m_id++;
00059   m_dict->insert(m_id,item);
00060   return m_id;
00061 }
00062 
00067 RefItem *RefList::getRefItem(int itemId)
00068 {
00069   return m_dict ? m_dict->find(itemId) : 0;
00070 }
00071 
00076 RefItem *RefList::getFirstRefItem()
00077 {
00078   return m_dictIterator ? m_dictIterator->toFirst() : 0;
00079 }
00080 
00085 RefItem *RefList::getNextRefItem()
00086 {
00087   return m_dictIterator ? m_dictIterator->operator++() : 0;
00088 }
00089 
00091 QCString RefList::listName() const
00092 {
00093   return m_listName;
00094 }
00095 
00096 QCString RefList::pageTitle() const
00097 {
00098   return m_pageTitle;
00099 }
00100 
00101 QCString RefList::sectionTitle() const
00102 {
00103   return m_secTitle;
00104 }
00105 



Generated on Mon Mar 31 10:58:42 2008 by  doxygen 1.5.1