Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/src/classlist.cpp

Source at commit 1322 created 12 years 8 months ago.
By meklort, Add doxygen to utils folder
1/******************************************************************************
2 *
3 * $Id: classlist.cpp,v 1.14 2001/03/19 19:27:39 root Exp $
4 *
5 * Copyright (C) 1997-2011 by Dimitri van Heesch.
6 *
7 * Permission to use, copy, modify, and distribute this software and its
8 * documentation under the terms of the GNU General Public License is hereby
9 * granted. No representations are made about the suitability of this software
10 * for any purpose. It is provided "as is" without express or implied warranty.
11 * See the GNU General Public License for more details.
12 *
13 * Documents produced by Doxygen are derivative works derived from the
14 * input used in their production; they are not affected by this license.
15 *
16 */
17
18#include "classlist.h"
19#include "config.h"
20#include "util.h"
21#include "outputlist.h"
22#include "language.h"
23#include "doxygen.h"
24#include "vhdldocgen.h"
25
26ClassList::ClassList() : QList<ClassDef>()
27{
28}
29
30ClassList::~ClassList()
31{
32}
33
34static int compItems(void *item1,void *item2)
35{
36 ClassDef *c1=(ClassDef *)item1;
37 ClassDef *c2=(ClassDef *)item2;
38 static bool b = Config_getBool("SORT_BY_SCOPE_NAME");
39 //printf("compItems: %d %s<->%s\n",b,c1->qualifiedName().data(),c2->qualifiedName().data());
40 if (b)
41 {
42 return stricmp(c1->name(),
43 c2->name());
44 }
45 else
46 {
47 return stricmp(c1->className(),
48 c2->className());
49 }
50}
51
52int ClassList::compareItems(GCI item1, GCI item2)
53{
54 return compItems(item1,item2);
55}
56
57int ClassSDict::compareItems(GCI item1, GCI item2)
58{
59 return compItems(item1,item2);
60}
61
62ClassListIterator::ClassListIterator(const ClassList &cllist) :
63 QListIterator<ClassDef>(cllist)
64{
65}
66
67bool ClassSDict::declVisible(const ClassDef::CompoundType *filter) const
68{
69 static bool hideUndocClasses = Config_getBool("HIDE_UNDOC_CLASSES");
70 static bool extractLocalClasses = Config_getBool("EXTRACT_LOCAL_CLASSES");
71 if (count()>0)
72 {
73 ClassSDict::Iterator sdi(*this);
74 ClassDef *cd=0;
75 for (sdi.toFirst();(cd=sdi.current());++sdi)
76 {
77 if (cd->name().find('@')==-1 &&
78 (filter==0 || *filter==cd->compoundType())
79 )
80 {
81 bool isLink = cd->isLinkable();
82 if (isLink ||
83 (!hideUndocClasses &&
84 (!cd->isLocal() || extractLocalClasses)
85 )
86 )
87 {
88 return TRUE;
89 }
90 }
91 }
92 }
93 return FALSE;
94}
95
96void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter,
97 const char *header,bool localNames)
98{
99// static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES");
100// bool first=TRUE;
101 if (count()>0)
102 {
103 ClassSDict::Iterator sdi(*this);
104 ClassDef *cd=0;
105 bool found=FALSE;
106 for (sdi.toFirst();(cd=sdi.current());++sdi)
107 {
108 //printf(" ClassSDict::writeDeclaration for %s\n",cd->name().data());
109 if (cd->name().find('@')==-1 &&
110 (filter==0 || *filter==cd->compoundType())
111 )
112 {
113// //bool isLink = cd->isLinkable();
114// if (inlineGroupedClasses && cd->partOfGroups()->count()>0)
115// {
116// cd->writeInlineDeclaration(ol,first);
117// first=FALSE;
118// }
119// else // show link's only
120// {
121 cd->writeDeclarationLink(ol,found,header,localNames);
122// }
123 }
124 }
125 if (found) ol.endMemberList();
126 }
127}
128
129void ClassSDict::writeDocumentation(OutputList &ol)
130{
131 static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
132
133 static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES");
134 if (!inlineGroupedClasses) return;
135
136 if (count()>0)
137 {
138 ol.writeRuler();
139 ol.startGroupHeader();
140 ol.parseText(fortranOpt?theTranslator->trTypeDocumentation():
141 theTranslator->trClassDocumentation());
142 ol.endGroupHeader();
143
144 ClassSDict::Iterator sdi(*this);
145 ClassDef *cd=0;
146 for (sdi.toFirst();(cd=sdi.current());++sdi)
147 {
148 if (cd->name().find('@')==-1 &&
149 cd->partOfGroups()->count()==1
150 )
151 {
152 cd->writeInlineDocumentation(ol);
153 }
154 }
155 }
156}
157
158

Archive Download this file

Revision: 1322