My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | List of all members
NamespaceSDict Class Reference

#include <namespacedef.h>

Inheritance diagram for NamespaceSDict:
SDict< NamespaceDef >

Public Member Functions

 NamespaceSDict (int size=17)
 
 ~NamespaceSDict ()
 
void writeDeclaration (OutputList &ol, const char *title, bool isConstantGroup=false, bool localName=FALSE)
 
bool declVisible () const
 
- Public Member Functions inherited from SDict< NamespaceDef >
 SDict (int size=17, bool caseSensitive=TRUE)
 
virtual ~SDict ()
 
void append (const char *key, const NamespaceDef *d)
 
void prepend (const char *key, const NamespaceDef *d)
 
bool remove (const char *key)
 
NamespaceDeftake (const char *key)
 
void sort ()
 
void inSort (const char *key, const NamespaceDef *d)
 
void insertAt (int i, const char *key, const NamespaceDef *d)
 
void setAutoDelete (bool val)
 
NamespaceDeffind (const char *key)
 
NamespaceDeffind (const QCString &key)
 
NamespaceDeffind (const QString &key)
 
int findAt (const QCString &key)
 
NamespaceDefoperator[] (const char *key) const
 
NamespaceDefat (uint i)
 
void clear ()
 
int count () const
 

Private Member Functions

int compareValues (const NamespaceDef *item1, const NamespaceDef *item2) const
 

Detailed Description

A sorted dictionary of NamespaceDef objects.

Definition at line 173 of file namespacedef.h.

Constructor & Destructor Documentation

NamespaceSDict::NamespaceSDict ( int  size = 17)
inline

Definition at line 176 of file namespacedef.h.

NamespaceSDict::~NamespaceSDict ( )
inline

Definition at line 177 of file namespacedef.h.

{}

Member Function Documentation

int NamespaceSDict::compareValues ( const NamespaceDef item1,
const NamespaceDef item2 
) const
inlineprivatevirtual

Function that is used to compare two items when sorting. Overload this to properly sort items.

See Also
inSort()

Reimplemented from SDict< NamespaceDef >.

Definition at line 182 of file namespacedef.h.

References Definition::name().

{
return qstricmp(item1->name(),item2->name());
}
bool NamespaceSDict::declVisible ( ) const

Definition at line 931 of file namespacedef.cpp.

References NamespaceDef::isLinkable().

Referenced by NamespaceDef::writeSummaryLinks(), GroupDef::writeSummaryLinks(), and FileDef::writeSummaryLinks().

{
for (ni.toFirst();(nd=ni.current());++ni)
{
if (nd->isLinkable())
{
return TRUE;
}
}
return FALSE;
}
void NamespaceSDict::writeDeclaration ( OutputList ol,
const char *  title,
bool  isConstantGroup = false,
bool  localName = FALSE 
)

Definition at line 945 of file namespacedef.cpp.

References Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), NamespaceDef::compoundTypeString(), Config_getBool, SDict< NamespaceDef >::count(), NamespaceDef::displayName(), OutputList::docify(), OutputList::endMemberDeclaration(), OutputList::endMemberDescription(), OutputList::endMemberHeader(), OutputList::endMemberItem(), OutputList::endMemberList(), err(), OutputList::generateDoc(), Definition::getLanguage(), NamespaceDef::getOutputFileBase(), Definition::getReference(), Definition::hasDocumentation(), OutputList::insertMemberAlign(), NamespaceDef::isConstantGroup(), NamespaceDef::isLinkable(), NamespaceDef::localName(), OutputList::parseText(), SrcLangExt_IDL, OutputList::startMemberDeclaration(), OutputList::startMemberDescription(), OutputList::startMemberHeader(), OutputList::startMemberItem(), OutputList::startMemberList(), and OutputList::writeObjectLink().

Referenced by NamespaceDef::writeNamespaceDeclarations(), FileDef::writeNamespaceDeclarations(), and GroupDef::writeNamespaces().

{
if (count()==0) return; // no namespaces in the list
if (Config_getBool(OPTIMIZE_OUTPUT_VHDL)) return;
bool found=FALSE;
for (ni.toFirst();(nd=ni.current()) && !found;++ni)
{
if (nd->isLinkable())
{
SrcLangExt lang = nd->getLanguage();
if (SrcLangExt_IDL==lang)
{
if (isConstantGroup == nd->isConstantGroup())
{
found=TRUE;
break;
}
}
else if (!isConstantGroup) // ensure we only get extra section in IDL
{
if (nd->isConstantGroup())
{
err("Internal inconsistency: constant group but not IDL?\n");
}
found=TRUE;
break;
}
}
}
if (!found) return; // no linkable namespaces in the list
// write list of namespaces
ol.startMemberHeader("namespaces");
//bool javaOpt = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
//bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
ol.parseText(title);
for (ni.toFirst();(nd=ni.current());++ni)
{
if (nd->isLinkable() && nd->hasDocumentation())
{
SrcLangExt lang = nd->getLanguage();
if (lang==SrcLangExt_IDL && (isConstantGroup != nd->isConstantGroup()))
continue; // will be output in another pass, see layout_default.xml
QCString ct = nd->compoundTypeString();
ol.docify(ct);
ol.docify(" ");
QCString name;
if (localName)
{
name = nd->localName();
}
else
{
name = nd->displayName();
}
if (!nd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
{
ol.generateDoc(nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription(),FALSE,FALSE,0,TRUE);
}
}
}
}

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