#include <stdlib.h>
#include <fstream>
#include "defgen.h"
#include "doxygen.h"
#include "message.h"
#include "config.h"
#include "classlist.h"
#include "util.h"
#include "defargs.h"
#include "outputgen.h"
#include "dot.h"
#include "dotclassgraph.h"
#include "arguments.h"
#include "memberlist.h"
#include "namespacedef.h"
#include "filedef.h"
#include "filename.h"
#include "dir.h"
#include "textstream.h"
浏览源代码.
|
static void | writeDEFString (TextStream &t, const QCString &s) |
|
static void | generateDEFForMember (const MemberDef *md, TextStream &t, const Definition *def, const QCString &prefix) |
|
static void | generateDEFClassSection (const ClassDef *cd, TextStream &t, const MemberList *ml, const QCString &kind) |
|
static void | generateDEFForClass (const ClassDef *cd, TextStream &t) |
|
static void | generateDEFSection (const Definition *d, TextStream &t, const MemberList *ml, const QCString &kind) |
|
static void | generateDEFForNamespace (const NamespaceDef *nd, TextStream &t) |
|
static void | generateDEFForFile (const FileDef *fd, TextStream &t) |
|
void | generateDEF () |
|
◆ DEF_DB
◆ generateDEF()
在文件 defgen.cpp 第 526 行定义.
529 Dir defDir(outputDirectory.
str());
530 if (!defDir.exists() && !defDir.mkdir(outputDirectory.
str()))
532 err(
"Could not create def directory in %s\n",
qPrint(outputDirectory));
536 QCString fileName=outputDirectory+
"/doxygen.def";
537 std::ofstream f(fileName.
str(),std::ostream::out | std::ostream::binary);
540 err(
"Cannot open file %s for writing!\n",
qPrint(fileName));
544 t <<
"AutoGen Definitions dummy;\n";
556 for (
const auto &fd : *fn)
568 t <<
"dummy_value = true;\n";
引用了 Doxygen::classLinkedMap, Config_getString, err(), Dir::exists(), generateDEFForClass(), generateDEFForFile(), generateDEFForNamespace(), Doxygen::inputNameLinkedMap, Dir::mkdir(), Doxygen::namespaceLinkedMap, qPrint(), QCString::size() , 以及 QCString::str().
被这些函数引用 generateOutput().
◆ generateDEFClassSection()
◆ generateDEFForClass()
在文件 defgen.cpp 第 318 行定义.
335 if (cd->
name().
find(
'@')!=-1)
return;
340 t <<
" cp-name = '" << cd->
name() <<
"';\n";
344 t <<
" cp-ref = {\n" <<
" ref-type = base;\n";
346 << bcd.classDef->getOutputFileBase() <<
"';\n";
350 case Public: t <<
"public;\n";
break;
352 case Protected: t <<
"protected;\n";
break;
353 case Private: t <<
"private;\n";
break;
358 case Normal: t <<
"non-virtual;";
break;
359 case Virtual: t <<
"virtual;";
break;
360 case Pure: t <<
"pure-virtual;";
break;
367 t <<
" cp-ref = {\n" <<
" ref-type = derived;\n";
369 << bcd.classDef->getOutputFileBase() <<
"';\n";
373 case Public: t <<
"public;\n";
break;
375 case Protected: t <<
"protected;\n";
break;
376 case Private: t <<
"private;\n";
break;
381 case Normal: t <<
"non-virtual;";
break;
382 case Virtual: t <<
"virtual;";
break;
383 case Pure: t <<
"pure-virtual;";
break;
388 size_t numMembers = 0;
393 numMembers+=ml->size();
426 t <<
" cp-fileline = '" << cd->
getDefLine() <<
"';\n";
427 t <<
" cp-briefdesc = <<_EnD_oF_dEf_TeXt_\n"
430 t <<
" cp-documentation = <<_EnD_oF_dEf_TeXt_\n"
434 if (!inheritanceGraph.isTrivial())
436 t <<
" cp-inheritancegraph = <<_EnD_oF_dEf_TeXt_\n";
437 inheritanceGraph.writeDEF(t);
438 t <<
"\n_EnD_oF_dEf_TeXt_;\n";
441 if (!collaborationGraph.isTrivial())
443 t <<
" cp-collaborationgraph = <<_EnD_oF_dEf_TeXt_\n";
444 collaborationGraph.writeDEF(t);
445 t <<
"\n_EnD_oF_dEf_TeXt_;\n";
引用了 ClassDef::baseClasses(), Definition::briefDescription(), Collaboration, ClassDef::compoundTypeString(), Definition::documentation(), QCString::find(), generateDEFClassSection(), Definition::getDefFileName(), Definition::getDefLine(), ClassDef::getMemberList(), ClassDef::getMemberLists(), ClassDef::getOutputFileBase(), Inheritance, ClassDef::isReference(), DotClassGraph::isTrivial(), MemberListType_dcopMethods, MemberListType_detailedLists, MemberListType_friends, MemberListType_interfaces, MemberListType_priAttribs, MemberListType_priMethods, MemberListType_priSlots, MemberListType_priStaticAttribs, MemberListType_priStaticMethods, MemberListType_priTypes, MemberListType_proAttribs, MemberListType_proMethods, MemberListType_properties, MemberListType_proSlots, MemberListType_proStaticAttribs, MemberListType_proStaticMethods, MemberListType_proTypes, MemberListType_pubAttribs, MemberListType_pubMethods, MemberListType_pubSlots, MemberListType_pubStaticAttribs, MemberListType_pubStaticMethods, MemberListType_pubTypes, MemberListType_related, MemberListType_services, MemberListType_signals, Definition::name(), Normal, Package, Private, Protected, Public, Pure, ClassDef::subClasses(), ClassDef::templateMaster(), Virtual , 以及 DotClassGraph::writeDEF().
被这些函数引用 generateDEF().
◆ generateDEFForFile()
在文件 defgen.cpp 第 494 行定义.
500 t <<
" file-name = ";
514 t <<
" file-first-line = '" << fd->
getDefLine() <<
"';\n";
516 t <<
" file-briefdesc = <<_EnD_oF_dEf_TeXt_\n"
519 t <<
" file-documentation = <<_EnD_oF_dEf_TeXt_\n"
522 t <<
"}; /* file */\n";
引用了 Definition::briefDescription(), Definition::documentation(), generateDEFSection(), Definition::getDefFileName(), Definition::getDefLine(), FileDef::getMemberList(), FileDef::getOutputFileBase(), Definition::isReference(), MemberListType_decDefineMembers, MemberListType_decDictionaryMembers, MemberListType_decEnumMembers, MemberListType_decFuncMembers, MemberListType_decProtoMembers, MemberListType_decSequenceMembers, MemberListType_decTypedefMembers, MemberListType_decVarMembers, FileDef::name() , 以及 writeDEFString().
被这些函数引用 generateDEF().
◆ generateDEFForMember()
在文件 defgen.cpp 第 60 行定义.
86 t <<
" " << prefix <<
"-member = {\n";
88 memPrefix.
append( prefix );
89 memPrefix.
append(
"-mem-" );
113 t << memPrefix <<
"kind = '" << memType <<
"';\n";
114 t << memPrefix <<
"id = '"
118 t << memPrefix <<
"virt = ";
121 case Normal: t <<
"normal;\n";
break;
122 case Virtual: t <<
"virtual;\n";
break;
123 case Pure: t <<
"pure-virtual;\n";
break;
127 t << memPrefix <<
"prot = ";
130 case Public: t <<
"public;\n";
break;
131 case Protected: t <<
"protected;\n";
break;
132 case Private: t <<
"private;\n";
break;
133 case Package: t <<
"package;\n";
break;
141 t << memPrefix <<
"type = <<_EnD_oF_dEf_TeXt_\n" << typeStr <<
"\n"
142 <<
"_EnD_oF_dEf_TeXt_;\n";
145 t << memPrefix <<
"name = '" << md->
name() <<
"';\n";
151 QCString fcnPrefix =
" " + memPrefix +
"param-";
153 auto defIt = defAl.
begin();
157 if (defIt!=defAl.
end())
162 t << memPrefix <<
"param = {\n";
163 if (!a.attrib.isEmpty())
165 t << fcnPrefix <<
"attributes = ";
169 if (!a.type.isEmpty())
171 t << fcnPrefix <<
"type = <<_EnD_oF_dEf_TeXt_\n"
172 << a.type <<
"\n_EnD_oF_dEf_TeXt_;\n";
174 if (!a.name.isEmpty())
176 t << fcnPrefix <<
"declname = ";
182 t << fcnPrefix <<
"defname = ";
186 if (!a.array.isEmpty())
188 t << fcnPrefix <<
"array = ";
192 if (!a.defval.isEmpty())
194 t << fcnPrefix <<
"defval = <<_EnD_oF_dEf_TeXt_\n"
195 << a.defval <<
"\n_EnD_oF_dEf_TeXt_;\n";
197 t <<
" }; /*" << fcnPrefix <<
"-param */\n";
203 QCString defPrefix =
" " + memPrefix +
"def-";
206 t << memPrefix <<
"param = {\n";
207 t << defPrefix <<
"name = '" << a.type <<
"';\n";
208 t <<
" }; /*" << defPrefix <<
"-param */\n";
214 t << memPrefix <<
"initializer = <<_EnD_oF_dEf_TeXt_\n"
222 t << memPrefix <<
"enum = { enum-name = " << emd->name() <<
';';
223 if (!emd->initializer().isEmpty())
225 t <<
" enum-value = ";
233 t << memPrefix <<
"desc-file = '" << md->
getDefFileName() <<
"';\n";
234 t << memPrefix <<
"desc-line = '" << md->
getDefLine() <<
"';\n";
235 t << memPrefix <<
"briefdesc = <<_EnD_oF_dEf_TeXt_\n"
237 t << memPrefix <<
"documentation = <<_EnD_oF_dEf_TeXt_\n"
242 QCString refPrefix =
" " + memPrefix +
"ref-";
244 for (
const auto &rmd : refList)
246 if (rmd->getStartBodyLine()!=-1 && rmd->getBodyDef())
248 t << memPrefix <<
"referenceto = {\n";
249 t << refPrefix <<
"id = '"
250 << rmd->getBodyDef()->getOutputFileBase()
252 << rmd->anchor() <<
"';\n";
254 t << refPrefix <<
"line = '"
255 << rmd->getStartBodyLine() <<
"';\n";
257 QCString scope = rmd->getScopeString();
264 t << refPrefix <<
"name = ";
266 t <<
';' <<
"\n };\n";
270 for (
const auto &rmd : refByList)
272 if (rmd->getStartBodyLine()!=-1 && rmd->getBodyDef())
274 t << memPrefix <<
"referencedby = {\n";
275 t << refPrefix <<
"id = '"
276 << rmd->getBodyDef()->getOutputFileBase()
278 << rmd->anchor() <<
"';\n";
280 t << refPrefix <<
"line = '"
281 << rmd->getStartBodyLine() <<
"';\n";
283 QCString scope = rmd->getScopeString();
290 t << refPrefix <<
"name = ";
292 t <<
';' <<
"\n };\n";
296 t <<
" }; /* " << prefix <<
"-member */\n";
引用了 MemberDef::anchor(), QCString::append(), MemberDef::argsString(), MemberDef::argumentList(), ASSERT, ArgumentList::begin(), MemberDef::briefDescription(), MemberDef::documentation(), ArgumentList::end(), MemberDef::enumFieldList(), FALSE, MemberDef::getClassDef(), Definition::getDefFileName(), Definition::getDefLine(), Definition::getLanguage(), MemberDef::getNamespaceDef(), MemberDef::getOutputFileBase(), Definition::getReferencedByMembers(), Definition::getReferencesMembers(), MemberDef::initializer(), QCString::isEmpty(), MemberDef::memberType(), MemberType_DCOP, MemberType_Define, MemberType_Dictionary, MemberType_Enumeration, MemberType_EnumValue, MemberType_Event, MemberType_Friend, MemberType_Function, MemberType_Interface, MemberType_Property, MemberType_Sequence, MemberType_Service, MemberType_Signal, MemberType_Slot, MemberType_Typedef, MemberType_Variable, Argument::name, Definition::name(), Normal, Package, QCString::prepend(), Private, Protected, MemberDef::protection(), Public, Pure, replaceAnonymousScopes(), stringToArgumentList(), TRUE, MemberDef::typeString(), Virtual, MemberDef::virtualness() , 以及 writeDEFString().
被这些函数引用 generateDEFClassSection() , 以及 generateDEFSection().
◆ generateDEFForNamespace()
在文件 defgen.cpp 第 466 行定义.
469 t <<
" namespace = {\n";
485 t <<
" ns-fileline = '" << nd->
getDefLine() <<
"';\n";
486 t <<
" ns-briefdesc = <<_EnD_oF_dEf_TeXt_\n"
489 t <<
" ns-documentation = <<_EnD_oF_dEf_TeXt_\n"
引用了 Definition::briefDescription(), Definition::documentation(), generateDEFSection(), Definition::getDefFileName(), Definition::getDefLine(), NamespaceDef::getMemberList(), NamespaceDef::getOutputFileBase(), Definition::isReference(), MemberListType_decDefineMembers, MemberListType_decDictionaryMembers, MemberListType_decEnumMembers, MemberListType_decFuncMembers, MemberListType_decProtoMembers, MemberListType_decSequenceMembers, MemberListType_decTypedefMembers, MemberListType_decVarMembers, Definition::name() , 以及 writeDEFString().
被这些函数引用 generateDEF().
◆ generateDEFSection()
◆ writeDEFString()
virtual QCString getOutputFileBase() const =0
QCString replaceAnonymousScopes(const QCString &s, const QCString &replacement)
@ MemberListType_priStaticMethods
@ MemberListType_priStaticAttribs
virtual QCString argsString() const =0
static void writeDEFString(TextStream &t, const QCString &s)
virtual QCString briefDescription(bool abbr=FALSE) const =0
virtual QCString documentation() const =0
@ MemberListType_services
Class representing a directory in the file system
This class represents an function or template argument list.
static void generateDEFForFile(const FileDef *fd, TextStream &t)
virtual QCString compoundTypeString() const =0
Returns the type of compound as a string
virtual int getDefLine() const =0
@ MemberListType_priAttribs
bool isEmpty() const
Returns TRUE iff the string is empty
virtual const MemberLists & getMemberLists() const =0
Returns the list containing the list of members sorted per type
@ MemberListType_pubTypes
virtual const MemberVector & getReferencedByMembers() const =0
@ MemberListType_priSlots
static void generateDEFSection(const Definition *d, TextStream &t, const MemberList *ml, const QCString &kind)
@ MemberListType_dcopMethods
@ MemberListType_decDictionaryMembers
void err(const char *fmt,...)
Text streaming class that buffers data.
static void generateDEFForMember(const MemberDef *md, TextStream &t, const Definition *def, const QCString &prefix)
int find(char c, int index=0, bool cs=TRUE) const
@ MemberListType_proAttribs
@ MemberListType_pubMethods
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
@ MemberListType_interfaces
virtual const ClassDef * templateMaster() const =0
Returns the template master of which this class is an instance.
@ MemberListType_decSequenceMembers
static FileNameLinkedMap * inputNameLinkedMap
virtual QCString anchor() const =0
@ MemberListType_decProtoMembers
@ MemberListType_pubSlots
@ MemberListType_decVarMembers
@ MemberListType_proStaticMethods
virtual QCString name() const =0
virtual Specifier virtualness(int count=0) const =0
virtual const MemberVector & enumFieldList() const =0
virtual const MemberVector & getReferencesMembers() const =0
virtual QCString getOutputFileBase() const =0
Returns the unique base name (without extension) of the class's file on disk
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
virtual MemberList * getMemberList(MemberListType lt) const =0
virtual bool isReference() const =0
virtual QCString name() const =0
This class contains the information about the argument of a function or template
virtual const ClassDef * getClassDef() const =0
static void generateDEFForNamespace(const NamespaceDef *nd, TextStream &t)
virtual MemberList * getMemberList(MemberListType lt) const =0
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
virtual const NamespaceDef * getNamespaceDef() const =0
virtual Protection protection() const =0
static void generateDEFClassSection(const ClassDef *cd, TextStream &t, const MemberList *ml, const QCString &kind)
@ MemberListType_decEnumMembers
@ MemberListType_priTypes
Representation of a class inheritance or dependency graph
@ MemberListType_pubStaticAttribs
virtual const BaseClassList & subClasses() const =0
Returns the list of sub classes that directly derive from this class
@ MemberListType_decDefineMembers
@ MemberListType_proMethods
@ MemberListType_decFuncMembers
@ MemberListType_proTypes
@ MemberListType_proStaticAttribs
@ MemberListType_detailedLists
virtual QCString getOutputFileBase() const =0
QCString & append(char c)
@ MemberListType_priMethods
virtual QCString documentation() const =0
virtual bool isReference() const =0
Returns TRUE if this class is imported via a tag file
@ MemberListType_proSlots
@ MemberListType_decTypedefMembers
const char * qPrint(const char *s)
#define Config_getString(name)
virtual QCString getDefFileName() const =0
virtual const ArgumentList & argumentList() const =0
@ MemberListType_pubAttribs
static NamespaceLinkedMap * namespaceLinkedMap
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
virtual MemberList * getMemberList(MemberListType lt) const =0
Returns the members in the list identified by lt
@ MemberListType_properties
static void generateDEFForClass(const ClassDef *cd, TextStream &t)
static ClassLinkedMap * classLinkedMap
virtual const QCString & initializer() const =0
virtual QCString getOutputFileBase() const =0
virtual QCString typeString() const =0
@ MemberListType_pubStaticMethods
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const QCString &argsString, QCString *extraTypeChars=0)
QCString & prepend(const char *s)
virtual MemberType memberType() const =0
This is an alternative implementation of QCString.