My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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.

References convertNameToFile(), listName(), m_dict, m_dictIterator, m_fileName, m_id, m_itemList, m_listName, m_pageTitle, m_secTitle, and pageTitle().

RefList::~RefList ( )

Destroy the todo list. Currently not called!

Definition at line 46 of file reflist.cpp.

References m_dict, m_dictIterator, and m_itemList.

{
delete m_dict;
delete m_itemList;
}

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.

References m_dict, m_dictIterator, and m_id.

{
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;
}
QCString RefList::fileName ( ) const

Definition at line 103 of file reflist.cpp.

References m_fileName.

Referenced by DocXRefItem::parse().

{
return m_fileName;
}
void RefList::generatePage ( )

Definition at line 140 of file reflist.cpp.

References addRelatedPage(), RefItem::args, doc, RefItem::extraItems, RefItem::listAnchor, m_fileName, m_itemList, m_listName, m_pageTitle, RefItem::name, Definition::name(), RefItem::prefix, RefItem::scope, SDict< T >::sort(), RefItem::text, and RefItem::title.

Referenced by generateXRefPages().

{
if (m_itemList==0) return;
RefItem *item;
QCString doc;
doc += "<dl class=\"reflist\">";
for (it.toFirst();(item=it.current());++it)
{
doc += " <dt>";
doc += "\\anchor ";
doc += item->listAnchor;
doc += "\n";
if (item->scope)
{
if (item->scope->name() != "<globalScope>")
{
doc += "\\_setscope ";
doc += item->scope->name();
doc += " ";
}
}
doc += item->prefix;
doc += " \\_internalref ";
doc += item->name;
doc += " \"";
doc += item->title;
doc += "\" ";
// write declaration in case a function with arguments
if (!item->args.isEmpty())
{
doc += item->args;
}
doc += "</dt><dd> ";
doc += item->text;
QListIterator<RefItem> li(item->extraItems);
RefItem *extraItem;
for (li.toFirst();(extraItem=li.current());++li)
{
doc += "<p>" + extraItem->text;
}
doc += "</dd>";
}
doc += "</dl>\n";
//printf("generatePage('%s')\n",doc.data());
}
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.

References m_dictIterator.

{
return m_dictIterator ? m_dictIterator->toFirst() : 0;
}
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.

References m_dictIterator.

{
return m_dictIterator ? m_dictIterator->operator++() : 0;
}
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.

References m_dict.

Referenced by addRefItem(), and DocXRefItem::parse().

{
return m_dict ? m_dict->find(itemId) : 0;
}
void RefList::insertIntoList ( const char *  key,
RefItem item 
)

Definition at line 118 of file reflist.cpp.

References SDict< T >::append(), RefItem::extraItems, SDict< T >::find(), and m_itemList.

Referenced by addRefItem().

{
if (m_itemList==0)
{
}
RefItem *ri = m_itemList->find(key);
if (ri==0)
{
m_itemList->append(key,item);
}
else // item already added to the list (i.e. multiple item for the same
// entity)
{
if (ri!=item)
{
ri->extraItems.append(item);
}
}
}
QCString RefList::listName ( ) const

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

Definition at line 98 of file reflist.cpp.

References m_listName.

Referenced by RefList(), resolveUserReferences(), and PageDef::writeTagFile().

{
return m_listName;
}
QCString RefList::pageTitle ( ) const

Definition at line 108 of file reflist.cpp.

References m_pageTitle.

Referenced by RefList().

{
return m_pageTitle;
}
QCString RefList::sectionTitle ( ) const

Definition at line 113 of file reflist.cpp.

References m_secTitle.

Referenced by DocXRefItem::parse().

{
return m_secTitle;
}

Member Data Documentation

QIntDict<RefItem>* RefList::m_dict
private

Definition at line 93 of file reflist.h.

Referenced by addRefItem(), getRefItem(), RefList(), and ~RefList().

QIntDictIterator<RefItem>* RefList::m_dictIterator
private

Definition at line 94 of file reflist.h.

Referenced by addRefItem(), getFirstRefItem(), getNextRefItem(), RefList(), and ~RefList().

QCString RefList::m_fileName
private

Definition at line 89 of file reflist.h.

Referenced by fileName(), generatePage(), and RefList().

int RefList::m_id
private

Definition at line 87 of file reflist.h.

Referenced by addRefItem(), and RefList().

SortedRefItems* RefList::m_itemList
private

Definition at line 92 of file reflist.h.

Referenced by generatePage(), insertIntoList(), RefList(), and ~RefList().

QCString RefList::m_listName
private

Definition at line 88 of file reflist.h.

Referenced by generatePage(), listName(), and RefList().

QCString RefList::m_pageTitle
private

Definition at line 90 of file reflist.h.

Referenced by generatePage(), pageTitle(), and RefList().

QCString RefList::m_secTitle
private

Definition at line 91 of file reflist.h.

Referenced by RefList(), and sectionTitle().


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