Public Member Functions | Private Attributes | List of all members
RefList Class Reference

#include <reflist.h>

Public Member Functions

int addRefItem ()
 
RefItemgetRefItem (int todoItemId)
 
RefItemgetFirstRefItem ()
 
RefItemgetNextRefItem ()
 
QCString listName () const
 
QCString fileName () const
 
QCString pageTitle () const
 
QCString sectionTitle () const
 
 RefList (const char *listName, const char *pageTitle, const char *secTitle)
 
 ~RefList ()
 
void insertIntoList (const char *key, RefItem *item)
 
void generatePage ()
 

Private Attributes

int m_id
 
QCString m_listName
 
QCString m_fileName
 
QCString m_pageTitle
 
QCString m_secTitle
 
SortedRefItemsm_itemList
 
QIntDict< RefItem > * m_dict
 
QIntDictIterator< RefItem > * m_dictIterator
 

Detailed Description

List of cross-referenced items

This class represents a list of items that are put at a certain point in the documentation by some special command and are collected in a list. The items cross-reference the documentation and the list.

Examples are the todo list, the test list and the bug list, introduced by the \todo, \test, and \bug commands respectively.

Definition at line 67 of file reflist.h.

Constructor & Destructor Documentation

RefList::RefList ( const char *  listName,
const char *  pageTitle,
const char *  secTitle 
)

Create a list of items that are cross referenced with documentation blocks

Parameters
listNameString representing the name of the list.
pageTitleString representing the title of the list page.
secTitleString representing the title of the section.

Definition at line 30 of file reflist.cpp.

34 {
35  m_itemList = 0;
36  m_dict = 0;
37  m_dictIterator = 0;
38  m_id = 0;
42  m_secTitle = secTitle;
43 }
QCString m_pageTitle
Definition: reflist.h:90
QCString listName() const
Definition: reflist.cpp:98
const bool FALSE
Definition: qglobal.h:370
QCString pageTitle() const
Definition: reflist.cpp:108
QIntDictIterator< RefItem > * m_dictIterator
Definition: reflist.h:94
QCString m_listName
Definition: reflist.h:88
int m_id
Definition: reflist.h:87
QCString m_fileName
Definition: reflist.h:89
SortedRefItems * m_itemList
Definition: reflist.h:92
QCString convertNameToFile(const char *name, bool allowDots, bool allowUnderscore)
Definition: util.cpp:5354
QCString m_secTitle
Definition: reflist.h:91
const bool TRUE
Definition: qglobal.h:371
QIntDict< RefItem > * m_dict
Definition: reflist.h:93
RefList::~RefList ( )

Destroy the todo list. Currently not called!

Definition at line 46 of file reflist.cpp.

47 {
48  delete m_dictIterator;
49  delete m_dict;
50  delete m_itemList;
51 }
QIntDictIterator< RefItem > * m_dictIterator
Definition: reflist.h:94
SortedRefItems * m_itemList
Definition: reflist.h:92
QIntDict< RefItem > * m_dict
Definition: reflist.h:93

Member Function Documentation

int RefList::addRefItem ( )

Adds a new item to the list.

Returns
A unique id for this item.

Definition at line 56 of file reflist.cpp.

57 {
58  if (m_dict==0)
59  {
60  m_dict = new QIntDict<RefItem>(1009);
63  }
64  RefItem *item = new RefItem;
65  m_id++;
66  m_dict->insert(m_id,item);
67  return m_id;
68 }
QIntDictIterator< RefItem > * m_dictIterator
Definition: reflist.h:94
void insert(long k, const type *d)
Definition: qintdict.h:57
int m_id
Definition: reflist.h:87
void setAutoDelete(bool enable)
Definition: qcollection.h:55
const bool TRUE
Definition: qglobal.h:371
QIntDict< RefItem > * m_dict
Definition: reflist.h:93
QCString RefList::fileName ( ) const

Definition at line 103 of file reflist.cpp.

104 {
105  return m_fileName;
106 }
QCString m_fileName
Definition: reflist.h:89
void RefList::generatePage ( )

Definition at line 140 of file reflist.cpp.

141 {
142  if (m_itemList==0) return;
143  m_itemList->sort();
145  RefItem *item;
146  QCString doc;
147  doc += "<dl class=\"reflist\">";
148  for (it.toFirst();(item=it.current());++it)
149  {
150  doc += " <dt>";
151  doc += "\\anchor ";
152  doc += item->listAnchor;
153  doc += "\n";
154  if (item->scope)
155  {
156  if (item->scope->name() != "<globalScope>")
157  {
158  doc += "\\_setscope ";
159  doc += item->scope->name();
160  doc += " ";
161  }
162  }
163  doc += item->prefix;
164  doc += " \\_internalref ";
165  doc += item->name;
166  doc += " \"";
167  doc += item->title;
168  doc += "\" ";
169  // write declaration in case a function with arguments
170  if (!item->args.isEmpty())
171  {
172  doc += item->args;
173  }
174  doc += "</dt><dd> ";
175  doc += item->text;
177  RefItem *extraItem;
178  for (li.toFirst();(extraItem=li.current());++li)
179  {
180  doc += "<p>" + extraItem->text;
181  }
182  doc += "</dd>";
183  }
184  doc += "</dl>\n";
185  //printf("generatePage('%s')\n",doc.data());
187 }
QCString listAnchor
anchor in the list
Definition: reflist.h:33
QCString prefix
type prefix for the name
Definition: reflist.h:35
QCString title
display name of the entity
Definition: reflist.h:38
QCString m_pageTitle
Definition: reflist.h:90
bool isEmpty() const
Definition: qcstring.h:189
QCString text
text of the item.
Definition: reflist.h:32
Definition: sortdict.h:73
const QCString & name() const
Definition: definition.h:114
QCString m_listName
Definition: reflist.h:88
QCString name
name of the entity containing the reference
Definition: reflist.h:37
static void addRelatedPage(EntryNav *rootNav)
Definition: doxygen.cpp:577
void sort()
Definition: sortdict.h:188
QCString m_fileName
Definition: reflist.h:89
SortedRefItems * m_itemList
Definition: reflist.h:92
QCString doc
Definition * scope
scope to use for references.
Definition: reflist.h:36
QCString args
optional arguments for the entity (if function)
Definition: reflist.h:39
QList< RefItem > extraItems
more items belonging to the same entity
Definition: reflist.h:41
RefItem * RefList::getFirstRefItem ( )

Returns the first item in the dictionary or 0 if non is available. Items are not sorted.

Definition at line 83 of file reflist.cpp.

84 {
85  return m_dictIterator ? m_dictIterator->toFirst() : 0;
86 }
QIntDictIterator< RefItem > * m_dictIterator
Definition: reflist.h:94
type * toFirst()
Definition: qintdict.h:92
RefItem * RefList::getNextRefItem ( )

Returns the next item in the dictionary or 0 if we are at the end of the list. Items are not sorted.

Definition at line 92 of file reflist.cpp.

93 {
94  return m_dictIterator ? m_dictIterator->operator++() : 0;
95 }
QIntDictIterator< RefItem > * m_dictIterator
Definition: reflist.h:94
RefItem * RefList::getRefItem ( int  itemId)

Returns an item given it's id that is obtained with addRefItem()

Parameters
itemIditem's identifier.
Returns
A pointer to the todo item's structure.

Definition at line 74 of file reflist.cpp.

75 {
76  return m_dict ? m_dict->find(itemId) : 0;
77 }
type * find(long k) const
Definition: qintdict.h:63
QIntDict< RefItem > * m_dict
Definition: reflist.h:93
void RefList::insertIntoList ( const char *  key,
RefItem item 
)

Definition at line 118 of file reflist.cpp.

119 {
120  if (m_itemList==0)
121  {
122  m_itemList = new SortedRefItems(1009);
123  }
124  RefItem *ri = m_itemList->find(key);
125  if (ri==0)
126  {
127  m_itemList->append(key,item);
128  }
129  else // item already added to the list (i.e. multiple item for the same
130  // entity)
131  {
132  if (ri!=item)
133  {
134  ri->extraItems.append(item);
135  }
136  }
137 }
void append(const type *d)
Definition: qlist.h:73
void append(const char *key, const T *d)
Definition: sortdict.h:135
def key(type, name=None)
Definition: graph.py:13
SortedRefItems * m_itemList
Definition: reflist.h:92
T * find(const char *key)
Definition: sortdict.h:232
QList< RefItem > extraItems
more items belonging to the same entity
Definition: reflist.h:41
QCString RefList::listName ( ) const

Returns the name of the list as set in the constructor.

Definition at line 98 of file reflist.cpp.

99 {
100  return m_listName;
101 }
QCString m_listName
Definition: reflist.h:88
QCString RefList::pageTitle ( ) const

Definition at line 108 of file reflist.cpp.

109 {
110  return m_pageTitle;
111 }
QCString m_pageTitle
Definition: reflist.h:90
QCString RefList::sectionTitle ( ) const

Definition at line 113 of file reflist.cpp.

114 {
115  return m_secTitle;
116 }
QCString m_secTitle
Definition: reflist.h:91

Member Data Documentation

QIntDict<RefItem>* RefList::m_dict
private

Definition at line 93 of file reflist.h.

QIntDictIterator<RefItem>* RefList::m_dictIterator
private

Definition at line 94 of file reflist.h.

QCString RefList::m_fileName
private

Definition at line 89 of file reflist.h.

int RefList::m_id
private

Definition at line 87 of file reflist.h.

SortedRefItems* RefList::m_itemList
private

Definition at line 92 of file reflist.h.

QCString RefList::m_listName
private

Definition at line 88 of file reflist.h.

QCString RefList::m_pageTitle
private

Definition at line 90 of file reflist.h.

QCString RefList::m_secTitle
private

Definition at line 91 of file reflist.h.


The documentation for this class was generated from the following files: