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.

decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
NamespaceSDict::~NamespaceSDict ( )
inline

Definition at line 177 of file namespacedef.h.

177 {}

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.

183  {
184  return qstricmp(item1->name(),item2->name());
185  }
const QCString & name() const
Definition: definition.h:114
int qstricmp(const char *str1, const char *str2)
Definition: qcstring.cpp:567
bool NamespaceSDict::declVisible ( ) const

Definition at line 925 of file namespacedef.cpp.

926 {
928  NamespaceDef *nd;
929  for (ni.toFirst();(nd=ni.current());++ni)
930  {
931  if (nd->isLinkable())
932  {
933  return TRUE;
934  }
935  }
936  return FALSE;
937 }
const bool FALSE
Definition: qglobal.h:370
Definition: sortdict.h:73
bool isLinkable() const
const bool TRUE
Definition: qglobal.h:371
void NamespaceSDict::writeDeclaration ( OutputList ol,
const char *  title,
bool  isConstantGroup = false,
bool  localName = FALSE 
)

Definition at line 939 of file namespacedef.cpp.

941 {
942 
943 
944  if (count()==0) return; // no namespaces in the list
945 
946  if (Config_getBool("OPTIMIZE_OUTPUT_VHDL")) return;
947 
948 
950  NamespaceDef *nd;
951  bool found=FALSE;
952  for (ni.toFirst();(nd=ni.current()) && !found;++ni)
953  {
954  if (nd->isLinkable())
955  {
956  SrcLangExt lang = nd->getLanguage();
957  if (SrcLangExt_IDL==lang)
958  {
959  if (isConstantGroup == nd->isConstantGroup())
960  {
961  found=TRUE;
962  break;
963  }
964  }
965  else if (!isConstantGroup) // ensure we only get extra section in IDL
966  {
967  if (nd->isConstantGroup())
968  {
969  err("Internal inconsistency: constant group but not IDL?\n");
970  }
971  found=TRUE;
972  break;
973  }
974  }
975  }
976  if (!found) return; // no linkable namespaces in the list
977 
978  // write list of namespaces
979  ol.startMemberHeader("namespaces");
980  //bool javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
981  //bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
982  ol.parseText(title);
983  ol.endMemberHeader();
984  ol.startMemberList();
985  for (ni.toFirst();(nd=ni.current());++ni)
986  {
987  if (nd->isLinkable() && nd->hasDocumentation())
988  {
989  SrcLangExt lang = nd->getLanguage();
990  if (lang==SrcLangExt_IDL && (isConstantGroup != nd->isConstantGroup()))
991  continue; // will be output in another pass, see layout_default.xml
994  QCString ct = nd->compoundTypeString();
995  ol.docify(ct);
996  ol.docify(" ");
997  ol.insertMemberAlign();
998  QCString name;
999  if (localName)
1000  {
1001  name = nd->localName();
1002  }
1003  else
1004  {
1005  name = nd->displayName();
1006  }
1008  ol.endMemberItem();
1009  if (!nd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
1010  {
1012  ol.generateDoc(nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription(),FALSE,FALSE,0,TRUE);
1013  ol.endMemberDescription();
1014  }
1015  ol.endMemberDeclaration(0,0);
1016  }
1017  }
1018  ol.endMemberList();
1019 }
static QCString name
Definition: declinfo.cpp:673
void startMemberItem(const char *anchor, int i1, const char *id=0)
Definition: outputlist.h:218
void endMemberDeclaration(const char *anchor, const char *inheritId)
Definition: outputlist.h:314
void endMemberItem()
Definition: outputlist.h:220
virtual QCString getReference() const
bool isEmpty() const
Definition: qcstring.h:189
QCString displayName(bool=TRUE) const
QCString getOutputFileBase() const
bool generateDoc(const char *fileName, int startLine, Definition *ctx, MemberDef *md, const QCString &docStr, bool indexWords, bool isExample, const char *exampleName=0, bool singleLine=FALSE, bool linkFromIndex=FALSE)
Definition: outputlist.cpp:131
virtual bool hasDocumentation() const
const bool FALSE
Definition: qglobal.h:370
QCString compoundTypeString() const
void startMemberDescription(const char *anchor, const char *inheritId=0)
Definition: outputlist.h:308
int briefLine() const
int count() const
Definition: sortdict.h:284
void startMemberList()
Definition: outputlist.h:206
SrcLangExt
Definition: types.h:41
bool parseText(const QCString &textStr)
Definition: outputlist.cpp:175
void endMemberHeader()
Definition: outputlist.h:196
Definition: sortdict.h:73
void startMemberDeclaration()
Definition: outputlist.h:312
SrcLangExt getLanguage() const
bool isLinkable() const
#define Config_getBool(val)
Definition: config.cpp:664
QCString briefFile() const
void err(const char *fmt,...)
Definition: message.cpp:226
virtual QCString briefDescription(bool abbreviate=FALSE) const
bool isConstantGroup() const
Definition: namespacedef.h:71
QCString localName() const
void endMemberDescription()
Definition: outputlist.h:310
void startMemberHeader(const char *anchor)
Definition: outputlist.h:194
void docify(const char *s)
Definition: outputlist.h:145
void insertMemberAlign(bool templ=FALSE)
Definition: outputlist.h:238
void writeObjectLink(const char *ref, const char *file, const char *anchor, const char *name)
Definition: outputlist.h:149
const bool TRUE
Definition: qglobal.h:371
void endMemberList()
Definition: outputlist.h:208

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