Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
31198c21
Commit
31198c21
authored
Oct 27, 2013
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More template and context updates
parent
7cda115a
Changes
14
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
3353 additions
and
1417 deletions
+3353
-1417
classdef.cpp
src/classdef.cpp
+470
-455
classdef.h
src/classdef.h
+8
-4
classlist.cpp
src/classlist.cpp
+12
-12
context.cpp
src/context.cpp
+1679
-224
context.h
src/context.h
+183
-0
definition.cpp
src/definition.cpp
+6
-0
definition.h
src/definition.h
+3
-0
doxygen.cpp
src/doxygen.cpp
+12
-14
memberdef.cpp
src/memberdef.cpp
+566
-539
memberdef.h
src/memberdef.h
+1
-0
namespacedef.cpp
src/namespacedef.cpp
+5
-4
namespacedef.h
src/namespacedef.h
+3
-2
template.cpp
src/template.cpp
+376
-158
template.h
src/template.h
+29
-5
No files found.
src/classdef.cpp
View file @
31198c21
...
@@ -94,7 +94,7 @@ class ClassDefImpl
...
@@ -94,7 +94,7 @@ class ClassDefImpl
ArgumentList
*
typeConstraints
;
ArgumentList
*
typeConstraints
;
/*! Files that were used for generating the class documentation. */
/*! Files that were used for generating the class documentation. */
QStr
List
files
;
File
List
files
;
/*! Examples that use this class */
/*! Examples that use this class */
ExampleSDict
*
exampleSDict
;
ExampleSDict
*
exampleSDict
;
...
@@ -764,16 +764,17 @@ void ClassDef::findSectionsInDocumentation()
...
@@ -764,16 +764,17 @@ void ClassDef::findSectionsInDocumentation()
// add a file name to the used files set
// add a file name to the used files set
void
ClassDef
::
insertUsedFile
(
const
char
*
f
)
void
ClassDef
::
insertUsedFile
(
FileDef
*
fd
)
{
{
if
(
m_impl
->
files
.
find
(
f
)
==-
1
)
m_impl
->
files
.
append
(
f
);
if
(
fd
==
0
)
return
;
if
(
m_impl
->
files
.
find
(
fd
)
==-
1
)
m_impl
->
files
.
append
(
fd
);
if
(
m_impl
->
templateInstances
)
if
(
m_impl
->
templateInstances
)
{
{
QDictIterator
<
ClassDef
>
qdi
(
*
m_impl
->
templateInstances
);
QDictIterator
<
ClassDef
>
qdi
(
*
m_impl
->
templateInstances
);
ClassDef
*
cd
;
ClassDef
*
cd
;
for
(
qdi
.
toFirst
();(
cd
=
qdi
.
current
());
++
qdi
)
for
(
qdi
.
toFirst
();(
cd
=
qdi
.
current
());
++
qdi
)
{
{
cd
->
insertUsedFile
(
f
);
cd
->
insertUsedFile
(
f
d
);
}
}
}
}
}
}
...
@@ -916,12 +917,6 @@ static void writeTemplateSpec(OutputList &ol,Definition *d,
...
@@ -916,12 +917,6 @@ static void writeTemplateSpec(OutputList &ol,Definition *d,
}
}
}
}
bool
ClassDef
::
hasBriefDescription
()
const
{
static
bool
briefMemberDesc
=
Config_getBool
(
"BRIEF_MEMBER_DESC"
);
return
!
briefDescription
().
isEmpty
()
&&
briefMemberDesc
;
}
void
ClassDef
::
writeBriefDescription
(
OutputList
&
ol
,
bool
exampleFlag
)
void
ClassDef
::
writeBriefDescription
(
OutputList
&
ol
,
bool
exampleFlag
)
{
{
if
(
hasBriefDescription
())
if
(
hasBriefDescription
())
...
@@ -1039,45 +1034,49 @@ void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &/*pageTy
...
@@ -1039,45 +1034,49 @@ void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &/*pageTy
}
}
}
}
void
ClassDef
::
showUsedFiles
(
OutputList
&
ol
)
QCString
ClassDef
::
generatedFromFiles
()
const
{
{
ol
.
pushGeneratorState
();
QCString
result
;
ol
.
disable
(
OutputGenerator
::
Man
);
SrcLangExt
lang
=
getLanguage
();
SrcLangExt
lang
=
getLanguage
();
ol
.
writeRuler
();
if
(
lang
==
SrcLangExt_Fortran
)
if
(
lang
==
SrcLangExt_Fortran
)
{
{
ol
.
parseText
(
theTranslator
->
trGeneratedFromFilesFortran
(
result
=
theTranslator
->
trGeneratedFromFilesFortran
(
getLanguage
()
==
SrcLangExt_ObjC
&&
m_impl
->
compType
==
Interface
?
Class
:
m_impl
->
compType
,
getLanguage
()
==
SrcLangExt_ObjC
&&
m_impl
->
compType
==
Interface
?
Class
:
m_impl
->
compType
,
m_impl
->
files
.
count
()
==
1
)
)
;
m_impl
->
files
.
count
()
==
1
);
}
}
else
if
(
isJavaEnum
())
else
if
(
isJavaEnum
())
{
{
ol
.
parseText
(
theTranslator
->
trEnumGeneratedFromFiles
(
m_impl
->
files
.
count
()
==
1
)
);
result
=
theTranslator
->
trEnumGeneratedFromFiles
(
m_impl
->
files
.
count
()
==
1
);
}
}
else
if
(
m_impl
->
compType
==
Service
)
else
if
(
m_impl
->
compType
==
Service
)
{
{
ol
.
parseText
(
theTranslator
->
trServiceGeneratedFromFiles
(
m_impl
->
files
.
count
()
==
1
)
);
result
=
theTranslator
->
trServiceGeneratedFromFiles
(
m_impl
->
files
.
count
()
==
1
);
}
}
else
if
(
m_impl
->
compType
==
Singleton
)
else
if
(
m_impl
->
compType
==
Singleton
)
{
{
ol
.
parseText
(
theTranslator
->
trSingletonGeneratedFromFiles
(
m_impl
->
files
.
count
()
==
1
)
);
result
=
theTranslator
->
trSingletonGeneratedFromFiles
(
m_impl
->
files
.
count
()
==
1
);
}
}
else
else
{
{
ol
.
parseText
(
theTranslator
->
trGeneratedFromFiles
(
result
=
theTranslator
->
trGeneratedFromFiles
(
getLanguage
()
==
SrcLangExt_ObjC
&&
m_impl
->
compType
==
Interface
?
Class
:
m_impl
->
compType
,
getLanguage
()
==
SrcLangExt_ObjC
&&
m_impl
->
compType
==
Interface
?
Class
:
m_impl
->
compType
,
m_impl
->
files
.
count
()
==
1
)
);
m_impl
->
files
.
count
()
==
1
)
;
}
}
return
result
;
}
void
ClassDef
::
showUsedFiles
(
OutputList
&
ol
)
{
ol
.
pushGeneratorState
();
ol
.
disable
(
OutputGenerator
::
Man
);
ol
.
writeRuler
();
ol
.
parseText
(
generatedFromFiles
());
bool
first
=
TRUE
;
bool
first
=
TRUE
;
const
char
*
file
=
m_impl
->
files
.
first
();
FileDef
*
fd
=
m_impl
->
files
.
first
();
while
(
file
)
while
(
fd
)
{
bool
ambig
;
FileDef
*
fd
=
findFileDef
(
Doxygen
::
inputNameDict
,
file
,
ambig
);
if
(
fd
)
{
{
if
(
first
)
if
(
first
)
{
{
...
@@ -1131,18 +1130,16 @@ void ClassDef::showUsedFiles(OutputList &ol)
...
@@ -1131,18 +1130,16 @@ void ClassDef::showUsedFiles(OutputList &ol)
ol
.
popGeneratorState
();
ol
.
popGeneratorState
();
ol
.
endItemListItem
();
ol
.
endItemListItem
();
}
f
ile
=
m_impl
->
files
.
next
();
f
d
=
m_impl
->
files
.
next
();
}
}
if
(
!
first
)
ol
.
endItemList
();
if
(
!
first
)
ol
.
endItemList
();
ol
.
popGeneratorState
();
ol
.
popGeneratorState
();
}
}
int
ClassDef
::
countInheritanceNodes
()
void
ClassDef
::
writeInheritanceGraph
(
OutputList
&
ol
)
{
{
// count direct inheritance relations
int
count
=
0
;
int
count
=
0
;
BaseClassDef
*
ibcd
;
BaseClassDef
*
ibcd
;
if
(
m_impl
->
inheritedBy
)
if
(
m_impl
->
inheritedBy
)
...
@@ -1165,7 +1162,13 @@ void ClassDef::writeInheritanceGraph(OutputList &ol)
...
@@ -1165,7 +1162,13 @@ void ClassDef::writeInheritanceGraph(OutputList &ol)
ibcd
=
m_impl
->
inherits
->
next
();
ibcd
=
m_impl
->
inherits
->
next
();
}
}
}
}
return
count
;
}
void
ClassDef
::
writeInheritanceGraph
(
OutputList
&
ol
)
{
// count direct inheritance relations
int
count
=
countInheritanceNodes
();
bool
renderDiagram
=
FALSE
;
bool
renderDiagram
=
FALSE
;
if
(
Config_getBool
(
"HAVE_DOT"
)
&&
if
(
Config_getBool
(
"HAVE_DOT"
)
&&
...
@@ -1322,6 +1325,24 @@ void ClassDef::writeCollaborationGraph(OutputList &ol)
...
@@ -1322,6 +1325,24 @@ void ClassDef::writeCollaborationGraph(OutputList &ol)
}
}
}
}
QCString
ClassDef
::
includeStatement
()
const
{
SrcLangExt
lang
=
getLanguage
();
bool
isIDLorJava
=
lang
==
SrcLangExt_IDL
||
lang
==
SrcLangExt_Java
;
if
(
isIDLorJava
)
{
return
"import"
;
}
else
if
(
isObjectiveC
())
{
return
"#import "
;
}
else
{
return
"#include "
;
}
}
void
ClassDef
::
writeIncludeFiles
(
OutputList
&
ol
)
void
ClassDef
::
writeIncludeFiles
(
OutputList
&
ol
)
{
{
if
(
m_impl
->
incInfo
/*&& Config_getBool("SHOW_INCLUDE_FILES")*/
)
if
(
m_impl
->
incInfo
/*&& Config_getBool("SHOW_INCLUDE_FILES")*/
)
...
@@ -1335,20 +1356,9 @@ void ClassDef::writeIncludeFiles(OutputList &ol)
...
@@ -1335,20 +1356,9 @@ void ClassDef::writeIncludeFiles(OutputList &ol)
{
{
ol
.
startParagraph
();
ol
.
startParagraph
();
ol
.
startTypewriter
();
ol
.
startTypewriter
();
ol
.
docify
(
includeStatement
());
SrcLangExt
lang
=
getLanguage
();
SrcLangExt
lang
=
getLanguage
();
bool
isIDLorJava
=
lang
==
SrcLangExt_IDL
||
lang
==
SrcLangExt_Java
;
bool
isIDLorJava
=
lang
==
SrcLangExt_IDL
||
lang
==
SrcLangExt_Java
;
if
(
isIDLorJava
)
{
ol
.
docify
(
"import "
);
}
else
if
(
isObjectiveC
())
{
ol
.
docify
(
"#import "
);
}
else
{
ol
.
docify
(
"#include "
);
}
if
(
m_impl
->
incInfo
->
local
||
isIDLorJava
)
if
(
m_impl
->
incInfo
->
local
||
isIDLorJava
)
ol
.
docify
(
"
\"
"
);
ol
.
docify
(
"
\"
"
);
else
else
...
@@ -4743,3 +4753,8 @@ const ClassSDict *ClassDef::innerClasses() const
...
@@ -4743,3 +4753,8 @@ const ClassSDict *ClassDef::innerClasses() const
return
m_impl
->
innerClasses
;
return
m_impl
->
innerClasses
;
}
}
const
FileList
&
ClassDef
::
usedFiles
()
const
{
return
m_impl
->
files
;
}
src/classdef.h
View file @
31198c21
...
@@ -31,6 +31,7 @@ class ClassList;
...
@@ -31,6 +31,7 @@ class ClassList;
class
ClassSDict
;
class
ClassSDict
;
class
OutputList
;
class
OutputList
;
class
FileDef
;
class
FileDef
;
class
FileList
;
class
BaseClassList
;
class
BaseClassList
;
class
NamespaceDef
;
class
NamespaceDef
;
class
MemberDef
;
class
MemberDef
;
...
@@ -125,9 +126,6 @@ class ClassDef : public Definition
...
@@ -125,9 +126,6 @@ class ClassDef : public Definition
/** returns TRUE if this class has documentation */
/** returns TRUE if this class has documentation */
bool
hasDocumentation
()
const
;
bool
hasDocumentation
()
const
;
/** returns TRUE if this class has a brief description */
bool
hasBriefDescription
()
const
;
/** returns TRUE if this class has a non-empty detailed description */
/** returns TRUE if this class has a non-empty detailed description */
bool
hasDetailedDescription
()
const
;
bool
hasDetailedDescription
()
const
;
...
@@ -310,6 +308,11 @@ class ClassDef : public Definition
...
@@ -310,6 +308,11 @@ class ClassDef : public Definition
const
ClassSDict
*
innerClasses
()
const
;
const
ClassSDict
*
innerClasses
()
const
;
QCString
title
()
const
;
QCString
title
()
const
;
QCString
generatedFromFiles
()
const
;
const
FileList
&
usedFiles
()
const
;
QCString
includeStatement
()
const
;
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
// --- setters ----
// --- setters ----
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
...
@@ -318,7 +321,7 @@ class ClassDef : public Definition
...
@@ -318,7 +321,7 @@ class ClassDef : public Definition
void
insertSubClass
(
ClassDef
*
,
Protection
p
,
Specifier
s
,
const
char
*
t
=
0
);
void
insertSubClass
(
ClassDef
*
,
Protection
p
,
Specifier
s
,
const
char
*
t
=
0
);
void
setIncludeFile
(
FileDef
*
fd
,
const
char
*
incName
,
bool
local
,
bool
force
);
void
setIncludeFile
(
FileDef
*
fd
,
const
char
*
incName
,
bool
local
,
bool
force
);
void
insertMember
(
MemberDef
*
);
void
insertMember
(
MemberDef
*
);
void
insertUsedFile
(
const
char
*
);
void
insertUsedFile
(
FileDef
*
);
bool
addExample
(
const
char
*
anchor
,
const
char
*
name
,
const
char
*
file
);
bool
addExample
(
const
char
*
anchor
,
const
char
*
name
,
const
char
*
file
);
void
mergeCategory
(
ClassDef
*
category
);
void
mergeCategory
(
ClassDef
*
category
);
void
setNamespace
(
NamespaceDef
*
nd
);
void
setNamespace
(
NamespaceDef
*
nd
);
...
@@ -375,6 +378,7 @@ class ClassDef : public Definition
...
@@ -375,6 +378,7 @@ class ClassDef : public Definition
void
addGroupedInheritedMembers
(
OutputList
&
ol
,
MemberListType
lt
,
void
addGroupedInheritedMembers
(
OutputList
&
ol
,
MemberListType
lt
,
ClassDef
*
inheritedFrom
,
const
QCString
&
inheritId
);
ClassDef
*
inheritedFrom
,
const
QCString
&
inheritId
);
int
countMembersIncludingGrouped
(
MemberListType
lt
,
ClassDef
*
inheritedFrom
,
bool
additional
);
int
countMembersIncludingGrouped
(
MemberListType
lt
,
ClassDef
*
inheritedFrom
,
bool
additional
);
int
countInheritanceNodes
();
bool
visited
;
bool
visited
;
...
...
src/classlist.cpp
View file @
31198c21
src/context.cpp
View file @
31198c21
This diff is collapsed.
Click to expand it.
src/context.h
View file @
31198c21
#ifndef CONTEXT_H
#ifndef CONTEXT_H
#define CONTEXT_H
#define CONTEXT_H
#include "types.h"
#include "template.h"
#include "template.h"
class
Definition
;
class
Definition
;
class
ClassDef
;
class
ClassDef
;
class
ClassSDict
;
class
ClassSDict
;
class
BaseClassList
;
class
PageDef
;
class
PageDef
;
class
GroupDef
;
class
GroupDef
;
class
NamespaceDef
;
class
NamespaceDef
;
...
@@ -21,6 +23,11 @@ class PageSDict;
...
@@ -21,6 +23,11 @@ class PageSDict;
class
GroupSDict
;
class
GroupSDict
;
class
GroupDef
;
class
GroupDef
;
class
GroupList
;
class
GroupList
;
struct
IncludeInfo
;
class
MemberList
;
class
MemberDef
;
struct
Argument
;
class
ArgumentList
;
//----------------------------------------------------
//----------------------------------------------------
...
@@ -72,6 +79,42 @@ class TranslateContext : public TemplateStructIntf
...
@@ -72,6 +79,42 @@ class TranslateContext : public TemplateStructIntf
//----------------------------------------------------
//----------------------------------------------------
class
UsedFilesContext
:
public
TemplateListIntf
{
public
:
UsedFilesContext
(
ClassDef
*
cd
);
~
UsedFilesContext
();
// TemplateListIntf
virtual
int
count
()
const
;
virtual
TemplateVariant
at
(
int
index
)
const
;
virtual
TemplateListIntf
::
ConstIterator
*
createIterator
()
const
;
void
addFile
(
FileDef
*
fd
);
private
:
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
class
IncludeInfoContext
:
public
TemplateStructIntf
{
public
:
IncludeInfoContext
(
IncludeInfo
*
,
SrcLangExt
lang
);
~
IncludeInfoContext
();
// TemplateStructIntf methods
virtual
TemplateVariant
get
(
const
char
*
name
)
const
;
private
:
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
class
ClassContext
:
public
TemplateStructIntf
class
ClassContext
:
public
TemplateStructIntf
{
{
public
:
public
:
...
@@ -150,6 +193,23 @@ class PageContext : public TemplateStructIntf
...
@@ -150,6 +193,23 @@ class PageContext : public TemplateStructIntf
Private
*
p
;
Private
*
p
;
};
};
//----------------------------------------------------
class
MemberContext
:
public
TemplateStructIntf
{
public
:
MemberContext
(
MemberDef
*
);
~
MemberContext
();
// TemplateStructIntf methods
virtual
TemplateVariant
get
(
const
char
*
name
)
const
;
private
:
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
//----------------------------------------------------
class
ModuleContext
:
public
TemplateStructIntf
class
ModuleContext
:
public
TemplateStructIntf
...
@@ -168,6 +228,26 @@ class ModuleContext : public TemplateStructIntf
...
@@ -168,6 +228,26 @@ class ModuleContext : public TemplateStructIntf
//----------------------------------------------------
//----------------------------------------------------
class
NestedClassListContext
:
public
TemplateListIntf
{
public
:
NestedClassListContext
();
~
NestedClassListContext
();
// TemplateListIntf
virtual
int
count
()
const
;
virtual
TemplateVariant
at
(
int
index
)
const
;
virtual
TemplateListIntf
::
ConstIterator
*
createIterator
()
const
;
void
append
(
ClassDef
*
cd
);
private
:
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
class
ClassListContext
:
public
TemplateListIntf
class
ClassListContext
:
public
TemplateListIntf
{
{
public
:
public
:
...
@@ -530,6 +610,109 @@ class ExampleListContext : public TemplateStructIntf
...
@@ -530,6 +610,109 @@ class ExampleListContext : public TemplateStructIntf
//----------------------------------------------------
//----------------------------------------------------
class
InheritanceNodeContext
:
public
TemplateStructIntf
{
public
:
InheritanceNodeContext
(
ClassDef
*
cd
,
const
QCString
&
name
);
~
InheritanceNodeContext
();
// TemplateStructIntf methods
virtual
TemplateVariant
get
(
const
char
*
name
)
const
;
private
:
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
class
InheritanceListContext
:
public
TemplateListIntf
{
public
:
InheritanceListContext
(
const
BaseClassList
*
list
,
bool
baseClasses
);
~
InheritanceListContext
();
// TemplateListIntf
virtual
int
count
()
const
;
virtual
TemplateVariant
at
(
int
index
)
const
;
virtual
TemplateListIntf
::
ConstIterator
*
createIterator
()
const
;
private
:
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
class
MemberListContext
:
public
TemplateListIntf
{
public
:
MemberListContext
(
const
MemberList
*
ml
);
~
MemberListContext
();
// TemplateListIntf
virtual
int
count
()
const
;
virtual
TemplateVariant
at
(
int
index
)
const
;
virtual
TemplateListIntf
::
ConstIterator
*
createIterator
()
const
;
private
:
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
class
MemberListInfoContext
:
public
TemplateStructIntf
{
public
:
MemberListInfoContext
(
const
MemberList
*
ml
,
const
QCString
&
title
,
const
QCString
&
subtitle
=
QCString
());
~
MemberListInfoContext
();
// TemplateStructIntf methods
virtual
TemplateVariant
get
(
const
char
*
name
)
const
;
private
:
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
class
ArgumentContext
:
public
TemplateStructIntf
{
public
:
ArgumentContext
(
const
Argument
*
arg
);
~
ArgumentContext
();
// TemplateStructIntf methods
virtual
TemplateVariant
get
(
const
char
*
name
)
const
;
private
:
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
class
ArgumentListContext
:
public
TemplateListIntf
{
public
:
ArgumentListContext
(
const
ArgumentList
*
al
);
~
ArgumentListContext
();
// TemplateListIntf
virtual
int
count
()
const
;
virtual
TemplateVariant
at
(
int
index
)
const
;
virtual
TemplateListIntf
::
ConstIterator
*
createIterator
()
const
;
private
:
class
Private
;
Private
*
p
;
};
//----------------------------------------------------
void
generateOutputViaTemplate
();
void
generateOutputViaTemplate
();
#endif
#endif
src/definition.cpp
View file @
31198c21
...
@@ -1876,4 +1876,10 @@ void Definition::_setSymbolName(const QCString &name)
...
@@ -1876,4 +1876,10 @@ void Definition::_setSymbolName(const QCString &name)
m_symbolName
=
name
;
m_symbolName
=
name
;
}
}
bool
Definition
::
hasBriefDescription
()
const
{
static
bool
briefMemberDesc
=
Config_getBool
(
"BRIEF_MEMBER_DESC"
);
return
!
briefDescription
().
isEmpty
()
&&
briefMemberDesc
;
}
src/definition.h
View file @
31198c21
...
@@ -260,6 +260,9 @@ class Definition : public DefinitionIntf
...
@@ -260,6 +260,9 @@ class Definition : public DefinitionIntf
bool
hasSections
()
const
;
bool
hasSections
()
const
;
/** returns TRUE if this class has a brief description */
bool
hasBriefDescription
()
const
;
QCString
id
()
const
;
QCString
id
()
const
;
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
...
...
src/doxygen.cpp
View file @
31198c21
...
@@ -1336,8 +1336,7 @@ static void addClassToContext(EntryNav *rootNav)
...
@@ -1336,8 +1336,7 @@ static void addClassToContext(EntryNav *rootNav)
// see if the class is found inside a namespace
// see if the class is found inside a namespace
//bool found=addNamespace(root,cd);
//bool found=addNamespace(root,cd);
// the empty string test is needed for extract all case
cd
->
insertUsedFile
(
fd
);
cd
->
insertUsedFile
(
root
->
fileName
);
// add class to the list
// add class to the list
//printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data());
//printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data());
...
@@ -1537,7 +1536,6 @@ static ClassDef *createTagLessInstance(ClassDef *rootCd,ClassDef *templ,const QC
...
@@ -1537,7 +1536,6 @@ static ClassDef *createTagLessInstance(ClassDef *rootCd,ClassDef *templ,const QC
gd
->
addClass
(
cd
);
gd
->
addClass
(
cd
);
}
}
}
}
//cd->insertUsedFile(root->fileName);
//printf("** adding class %s based on %s\n",fullName.data(),templ->name().data());
//printf("** adding class %s based on %s\n",fullName.data(),templ->name().data());
Doxygen
::
classSDict
->
append
(
fullName
,
cd
);
Doxygen
::
classSDict
->
append
(
fullName
,
cd
);
...
@@ -1776,7 +1774,7 @@ static void buildNamespaceList(EntryNav *rootNav)
...
@@ -1776,7 +1774,7 @@ static void buildNamespaceList(EntryNav *rootNav)
// the empty string test is needed for extract all case
// the empty string test is needed for extract all case
nd
->
setBriefDescription
(
root
->
brief
,
root
->
briefFile
,
root
->
briefLine
);
nd
->
setBriefDescription
(
root
->
brief
,
root
->
briefFile
,
root
->
briefLine
);
nd
->
insertUsedFile
(
root
->
fileName
);
nd
->
insertUsedFile
(
fd
);
nd
->
setBodySegment
(
root
->
bodyLine
,
root
->
endBodyLine
);
nd
->
setBodySegment
(
root
->
bodyLine
,
root
->
endBodyLine
);
nd
->
setBodyDef
(
fd
);
nd
->
setBodyDef
(
fd
);
// add class to the list
// add class to the list
...
@@ -1954,7 +1952,7 @@ static void findUsingDirectives(EntryNav *rootNav)
...
@@ -1954,7 +1952,7 @@ static void findUsingDirectives(EntryNav *rootNav)
// the empty string test is needed for extract all case
// the empty string test is needed for extract all case
nd
->
setBriefDescription
(
root
->
brief
,
root
->
briefFile
,
root
->
briefLine
);
nd
->
setBriefDescription
(
root
->
brief
,
root
->
briefFile
,
root
->
briefLine
);
nd
->
insertUsedFile
(
root
->
fileName
);
nd
->
insertUsedFile
(
fd
);
// add class to the list
// add class to the list
Doxygen
::
namespaceSDict
->
inSort
(
name
,
nd
);
Doxygen
::
namespaceSDict
->
inSort
(
name
,
nd
);
nd
->
setRefItems
(
root
->
sli
);
nd
->
setRefItems
(
root
->
sli
);
...
@@ -2373,7 +2371,7 @@ static MemberDef *addVariableToClass(
...
@@ -2373,7 +2371,7 @@ static MemberDef *addVariableToClass(
md
->
setRefItems
(
root
->
sli
);
md
->
setRefItems
(
root
->
sli
);
//TODO: insert FileDef instead of filename strings.
//TODO: insert FileDef instead of filename strings.
cd
->
insertUsedFile
(
root
->
fileName
);
cd
->
insertUsedFile
(
root
Nav
->
fileDef
()
);
rootNav
->
changeSection
(
Entry
::
EMPTY_SEC
);
rootNav
->
changeSection
(
Entry
::
EMPTY_SEC
);
return
md
;
return
md
;
}
}
...
@@ -3114,7 +3112,7 @@ static void addInterfaceOrServiceToServiceOrSingleton(
...
@@ -3114,7 +3112,7 @@ static void addInterfaceOrServiceToServiceOrSingleton(
findClassRelation
(
rootNav
,
cd
,
cd
,
&
base
,
0
,
DocumentedOnly
,
true
)
findClassRelation
(
rootNav
,
cd
,
cd
,
&
base
,
0
,
DocumentedOnly
,
true
)
||
findClassRelation
(
rootNav
,
cd
,
cd
,
&
base
,
0
,
Undocumented
,
true
);
||
findClassRelation
(
rootNav
,
cd
,
cd
,
&
base
,
0
,
Undocumented
,
true
);
// add file to list of used files
// add file to list of used files
cd
->
insertUsedFile
(
root
->
fileName
);
cd
->
insertUsedFile
(
fd
);
addMemberToGroups
(
root
,
md
);
addMemberToGroups
(
root
,
md
);
rootNav
->
changeSection
(
Entry
::
EMPTY_SEC
);
rootNav
->
changeSection
(
Entry
::
EMPTY_SEC
);
...
@@ -3357,7 +3355,7 @@ static void addMethodToClass(EntryNav *rootNav,ClassDef *cd,
...
@@ -3357,7 +3355,7 @@ static void addMethodToClass(EntryNav *rootNav,ClassDef *cd,
// add member to the class cd
// add member to the class cd
cd
->
insertMember
(
md
);
cd
->
insertMember
(
md
);
// add file to list of used files
// add file to list of used files
cd
->
insertUsedFile
(
root
->
fileName
);
cd
->
insertUsedFile
(
fd
);
addMemberToGroups
(
root
,
md
);
addMemberToGroups
(
root
,
md
);
rootNav
->
changeSection
(
Entry
::
EMPTY_SEC
);
rootNav
->
changeSection
(
Entry
::
EMPTY_SEC
);
...
@@ -4831,7 +4829,7 @@ static bool findClassRelation(
...
@@ -4831,7 +4829,7 @@ static bool findClassRelation(
// add this class as super class to the base class
// add this class as super class to the base class
baseClass
->
insertSubClass
(
cd
,
bi
->
prot
,
bi
->
virt
,
templSpec
);
baseClass
->
insertSubClass
(
cd
,
bi
->
prot
,
bi
->
virt
,
templSpec
);
// the undocumented base was found in this file
// the undocumented base was found in this file
baseClass
->
insertUsedFile
(
root
->
fileName
);
baseClass
->
insertUsedFile
(
root
Nav
->
fileDef
()
);
baseClass
->
setOuterScope
(
Doxygen
::
globalScope
);
baseClass
->
setOuterScope
(
Doxygen
::
globalScope
);
if
(
baseClassName
.
right
(
2
)
==
"-p"
)
if
(
baseClassName
.
right
(
2
)
==
"-p"
)
{
{
...
@@ -5344,7 +5342,7 @@ static void addMemberDocs(EntryNav *rootNav,
...
@@ -5344,7 +5342,7 @@ static void addMemberDocs(EntryNav *rootNav,
md
->
mergeMemberSpecifiers
(
root
->
spec
);
md
->
mergeMemberSpecifiers
(
root
->
spec
);
md
->
addSectionsToDefinition
(
root
->
anchors
);
md
->
addSectionsToDefinition
(
root
->
anchors
);
addMemberToGroups
(
root
,
md
);
addMemberToGroups
(
root
,
md
);
if
(
cd
)
cd
->
insertUsedFile
(
r
oot
->
fileName
);
if
(
cd
)
cd
->
insertUsedFile
(
r
fd
);
//printf("root->mGrpId=%d\n",root->mGrpId);
//printf("root->mGrpId=%d\n",root->mGrpId);
if
(
root
->
mGrpId
!=-
1
)
if
(
root
->
mGrpId
!=-
1
)
{
{
...
@@ -6424,7 +6422,7 @@ static void findMember(EntryNav *rootNav,
...
@@ -6424,7 +6422,7 @@ static void findMember(EntryNav *rootNav,
md
->
setMemberGroupId
(
root
->
mGrpId
);
md
->
setMemberGroupId
(
root
->
mGrpId
);
mn
->
append
(
md
);
mn
->
append
(
md
);
cd
->
insertMember
(
md
);
cd
->
insertMember
(
md
);
cd
->
insertUsedFile
(
root
->
fileName
);
cd
->
insertUsedFile
(
fd
);
md
->
setRefItems
(
root
->
sli
);
md
->
setRefItems
(
root
->
sli
);
}
}
}
}
...
@@ -6621,7 +6619,7 @@ static void findMember(EntryNav *rootNav,
...
@@ -6621,7 +6619,7 @@ static void findMember(EntryNav *rootNav,
//md->setMemberDefTemplateArguments(root->mtArgList);
//md->setMemberDefTemplateArguments(root->mtArgList);
mn
->
append
(
md
);
mn
->
append
(
md
);
cd
->
insertMember
(
md
);
cd
->
insertMember
(
md
);
cd
->
insertUsedFile
(
root
->
fileName
);
cd
->
insertUsedFile
(
fd
);
md
->
setRefItems
(
root
->
sli
);
md
->
setRefItems
(
root
->
sli
);
if
(
root
->
relatesType
==
Duplicate
)
md
->
setRelatedAlso
(
cd
);
if
(
root
->
relatesType
==
Duplicate
)
md
->
setRelatedAlso
(
cd
);
if
(
!
isDefine
)
if
(
!
isDefine
)
...
@@ -6693,7 +6691,7 @@ localObjCMethod:
...
@@ -6693,7 +6691,7 @@ localObjCMethod:
md
->
setMemberSpecifiers
(
root
->
spec
);
md
->
setMemberSpecifiers
(
root
->
spec
);
md
->
setMemberGroupId
(
root
->
mGrpId
);
md
->
setMemberGroupId
(
root
->
mGrpId
);
cd
->
insertMember
(
md
);
cd
->
insertMember
(
md
);
cd
->
insertUsedFile
(
root
->
fileName
);
cd
->
insertUsedFile
(
fd
);
md
->
setRefItems
(
root
->
sli
);
md
->
setRefItems
(
root
->
sli
);
if
((
mn
=
Doxygen
::
memberNameSDict
->
find
(
root
->
name
)))
if
((
mn
=
Doxygen
::
memberNameSDict
->
find
(
root
->
name
)))
{
{
...
@@ -7077,7 +7075,7 @@ static void findEnums(EntryNav *rootNav)
...
@@ -7077,7 +7075,7 @@ static void findEnums(EntryNav *rootNav)
md
->
setDefinition
(
cd
->
name
()
+
"::"
+
name
+
baseType
);
md
->
setDefinition
(
cd
->
name
()
+
"::"
+
name
+
baseType
);
}
}
cd
->
insertMember
(
md
);
cd
->
insertMember
(
md
);
cd
->
insertUsedFile
(
root
->
fileName
);
cd
->
insertUsedFile
(
fd
);
}
}
md
->
setDocumentation
(
root
->
doc
,
root
->
docFile
,
root
->
docLine
);
md
->
setDocumentation
(
root
->
doc
,
root
->
docFile
,
root
->
docLine
);
md
->
setDocsForDefinition
(
!
root
->
proto
);
md
->
setDocsForDefinition
(
!
root
->
proto
);
...
...
src/memberdef.cpp
View file @
31198c21
...
@@ -1390,6 +1390,33 @@ bool MemberDef::isBriefSectionVisible() const
...
@@ -1390,6 +1390,33 @@ bool MemberDef::isBriefSectionVisible() const
return
visible
;
return
visible
;
}
}
QCString
MemberDef
::
getDeclType
()
const
{
QCString
ltype
(
m_impl
->
type
);
if
(
m_impl
->
mtype
==
MemberType_Typedef
)
{
ltype
.
prepend
(
"typedef "
);
}
if
(
isAlias
())
{
ltype
=
"using"
;
}
// strip `friend' keyword from ltype
ltype
.
stripPrefix
(
"friend "
);
if
(
ltype
==
"@"
)
// rename type from enum values
{
ltype
=
""
;
}
else
{
if
(
isObjCMethod
())
{
ltype
.
prepend
(
"("
);
ltype
.
append
(
")"
);
}
}
return
ltype
;
}
void
MemberDef
::
writeDeclaration
(
OutputList
&
ol
,
void
MemberDef
::
writeDeclaration
(
OutputList
&
ol
,
ClassDef
*
cd
,
NamespaceDef
*
nd
,
FileDef
*
fd
,
GroupDef
*
gd
,
ClassDef
*
cd
,
NamespaceDef
*
nd
,
FileDef
*
fd
,
GroupDef
*
gd
,
...
@@ -1678,7 +1705,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
...
@@ -1678,7 +1705,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
// *** write bitfields
// *** write bitfields
if
(
!
m_impl
->
bitfields
.
isEmpty
())
// add bitfields
if
(
!
m_impl
->
bitfields
.
isEmpty
())
// add bitfields
{
{
linkifyText
(
TextGeneratorOLImpl
(
ol
),
d
,
getBodyDef
(),
this
,
m_impl
->
bitfields
.
simplifyWhiteSpace
()
);
linkifyText
(
TextGeneratorOLImpl
(
ol
),
d
,
getBodyDef
(),
this
,
m_impl
->
bitfields
);
}
}
else
if
(
hasOneLineInitializer
()
else
if
(
hasOneLineInitializer
()
//!init.isEmpty() && initLines==0 && // one line initializer
//!init.isEmpty() && initLines==0 && // one line initializer
...
@@ -2978,7 +3005,7 @@ void MemberDef::writeMemberDocSimple(OutputList &ol, Definition *container)
...
@@ -2978,7 +3005,7 @@ void MemberDef::writeMemberDocSimple(OutputList &ol, Definition *container)
}
}
if
(
!
m_impl
->
bitfields
.
isEmpty
())
// add bitfields
if
(
!
m_impl
->
bitfields
.
isEmpty
())
// add bitfields
{
{
linkifyText
(
TextGeneratorOLImpl
(
ol
),
getOuterScope
(),
getBodyDef
(),
this
,
m_impl
->
bitfields
.
simplifyWhiteSpace
()
);
linkifyText
(
TextGeneratorOLImpl
(
ol
),
getOuterScope
(),
getBodyDef
(),
this
,
m_impl
->
bitfields
);
}
}
ol
.
endInlineMemberName
();
ol
.
endInlineMemberName
();
...
@@ -4433,7 +4460,7 @@ void MemberDef::mergeMemberSpecifiers(uint64 s)
...
@@ -4433,7 +4460,7 @@ void MemberDef::mergeMemberSpecifiers(uint64 s)
void
MemberDef
::
setBitfields
(
const
char
*
s
)
void
MemberDef
::
setBitfields
(
const
char
*
s
)
{
{
m_impl
->
bitfields
=
s
;
m_impl
->
bitfields
=
QCString
(
s
).
simplifyWhiteSpace
();
}
}
void
MemberDef
::
setMaxInitLines
(
int
lines
)
void
MemberDef
::
setMaxInitLines
(
int
lines
)
...
...
src/memberdef.h
View file @
31198c21
...
@@ -241,6 +241,7 @@ class MemberDef : public Definition
...
@@ -241,6 +241,7 @@ class MemberDef : public Definition
MemberDef
*
categoryRelation
()
const
;
MemberDef
*
categoryRelation
()
const
;
QCString
displayName
(
bool
=
TRUE
)
const
;
QCString
displayName
(
bool
=
TRUE
)
const
;
QCString
getDeclType
()
const
;
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
// ---- setters -----
// ---- setters -----
...
...
src/namespacedef.cpp
View file @
31198c21
...
@@ -115,14 +115,15 @@ void NamespaceDef::findSectionsInDocumentation()
...
@@ -115,14 +115,15 @@ void NamespaceDef::findSectionsInDocumentation()
}
}
}
}
void
NamespaceDef
::
insertUsedFile
(
const
char
*
f
)
void
NamespaceDef
::
insertUsedFile
(
FileDef
*
fd
)
{
{
if
(
files
.
find
(
f
)
==-
1
)
if
(
fd
==
0
)
return
;
if
(
files
.
find
(
fd
)
==-
1
)
{
{
if
(
Config_getBool
(
"SORT_MEMBER_DOCS"
))
if
(
Config_getBool
(
"SORT_MEMBER_DOCS"
))
files
.
inSort
(
f
);
files
.
inSort
(
f
d
);
else
else
files
.
append
(
f
);
files
.
append
(
f
d
);
}
}
}
}
...
...
src/namespacedef.h
View file @
31198c21
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include <qdict.h>
#include <qdict.h>
#include "sortdict.h"
#include "sortdict.h"
#include "definition.h"
#include "definition.h"
#include "filedef.h"
class
MemberList
;
class
MemberList
;
class
ClassDef
;
class
ClassDef
;
...
@@ -45,7 +46,7 @@ class NamespaceDef : public Definition
...
@@ -45,7 +46,7 @@ class NamespaceDef : public Definition
DefType
definitionType
()
const
{
return
TypeNamespace
;
}
DefType
definitionType
()
const
{
return
TypeNamespace
;
}
QCString
getOutputFileBase
()
const
;
QCString
getOutputFileBase
()
const
;
QCString
anchor
()
const
{
return
QCString
();
}
QCString
anchor
()
const
{
return
QCString
();
}
void
insertUsedFile
(
const
char
*
fname
);
void
insertUsedFile
(
FileDef
*
fd
);
void
writeDocumentation
(
OutputList
&
ol
);
void
writeDocumentation
(
OutputList
&
ol
);
void
writeMemberPages
(
OutputList
&
ol
);
void
writeMemberPages
(
OutputList
&
ol
);
...
@@ -117,7 +118,7 @@ class NamespaceDef : public Definition
...
@@ -117,7 +118,7 @@ class NamespaceDef : public Definition
void
addNamespaceAttributes
(
OutputList
&
ol
);
void
addNamespaceAttributes
(
OutputList
&
ol
);
QCString
fileName
;
QCString
fileName
;
QStr
List
files
;
File
List
files
;
NamespaceSDict
*
usingDirList
;
NamespaceSDict
*
usingDirList
;
SDict
<
Definition
>
*
usingDeclList
;
SDict
<
Definition
>
*
usingDeclList
;
...
...
src/template.cpp
View file @
31198c21
This diff is collapsed.
Click to expand it.
src/template.h
View file @
31198c21
...
@@ -42,8 +42,10 @@ class TemplateEngine;
...
@@ -42,8 +42,10 @@ class TemplateEngine;
* - `for ... empty ... endfor`
* - `for ... empty ... endfor`
* - `if ... else ... endif`
* - `if ... else ... endif`
* - `block ... endblock`
* - `block ... endblock`
* - `extend
s
`
* - `extend`
* - `include`
* - `include`
* - `with ... endwith`
* - `spaceless ... endspaceless`
*
*
* Supported Django filters:
* Supported Django filters:
* - `default`
* - `default`
...
@@ -53,6 +55,13 @@ class TemplateEngine;
...
@@ -53,6 +55,13 @@ class TemplateEngine;
* Extension tags:
* Extension tags:
* - `create` which instantiates a template and writes the result to a file.
* - `create` which instantiates a template and writes the result to a file.
* The syntax is `{% create 'filename' from 'template' %}`.
* The syntax is `{% create 'filename' from 'template' %}`.
* - `recursetree`
* - `markers`
*
* Extension filters:
* - `stripPath`
* - `nowrap`
* - `prepend`
*
*
* @{
* @{
*/
*/
...
@@ -62,7 +71,7 @@ class TemplateVariant
...
@@ -62,7 +71,7 @@ class TemplateVariant
{
{
public
:
public
:
/** Signature of the callback function, used for function type variants */
/** Signature of the callback function, used for function type variants */
typedef
QCString
(
*
FuncType
)(
const
void
*
obj
,
const
QValueList
<
TemplateVariant
>
&
args
);
typedef
TemplateVariant
(
*
FuncType
)(
const
void
*
obj
,
const
QValueList
<
TemplateVariant
>
&
args
);
/** Types of data that can be stored in a TemplateVariant */
/** Types of data that can be stored in a TemplateVariant */
enum
Type
{
None
,
Bool
,
Integer
,
String
,
Struct
,
List
,
Function
};
enum
Type
{
None
,
Bool
,
Integer
,
String
,
Struct
,
List
,
Function
};
...
@@ -83,10 +92,10 @@ class TemplateVariant
...
@@ -83,10 +92,10 @@ class TemplateVariant
TemplateVariant
(
int
v
);
TemplateVariant
(
int
v
);
/** Constructs a new variant with a string value \a s. */
/** Constructs a new variant with a string value \a s. */
TemplateVariant
(
const
char
*
s
);
TemplateVariant
(
const
char
*
s
,
bool
raw
=
FALSE
);
/** Constructs a new variant with a string value \a s. */
/** Constructs a new variant with a string value \a s. */
TemplateVariant
(
const
QCString
&
s
);
TemplateVariant
(
const
QCString
&
s
,
bool
raw
=
FALSE
);
/** Constructs a new variant with a struct value \a s.
/** Constructs a new variant with a struct value \a s.
* @note. Only a pointer to the struct is stored. The caller
* @note. Only a pointer to the struct is stored. The caller
...
@@ -146,7 +155,7 @@ class TemplateVariant
...
@@ -146,7 +155,7 @@ class TemplateVariant
/** Return the result of apply this function with \a args.
/** Return the result of apply this function with \a args.
* Returns an empty string if the variant type is not a function.
* Returns an empty string if the variant type is not a function.
*/
*/
QCString
call
(
const
QValueList
<
TemplateVariant
>
&
args
);
TemplateVariant
call
(
const
QValueList
<
TemplateVariant
>
&
args
);
/** Sets whether or not the value of the Variant should be
/** Sets whether or not the value of the Variant should be
* escaped or written as-is (raw).
* escaped or written as-is (raw).
...
@@ -283,6 +292,16 @@ class TemplateEscapeIntf
...
@@ -283,6 +292,16 @@ class TemplateEscapeIntf
//------------------------------------------------------------------------
//------------------------------------------------------------------------
/** @brief Interface used to remove redundant spaces inside a spaceless block */
class
TemplateSpacelessIntf
{
public
:
/** Returns the \a input after removing redundant whitespace */
virtual
QCString
remove
(
const
QCString
&
input
)
=
0
;
};
//------------------------------------------------------------------------
/** @brief Abstract interface for a template context.
/** @brief Abstract interface for a template context.
*
*
* A Context consists of a stack of dictionaries.
* A Context consists of a stack of dictionaries.
...
@@ -333,6 +352,11 @@ class TemplateContext
...
@@ -333,6 +352,11 @@ class TemplateContext
* of variable expansion before writing it to the output.
* of variable expansion before writing it to the output.
*/
*/
virtual
void
setEscapeIntf
(
TemplateEscapeIntf
*
intf
)
=
0
;
virtual
void
setEscapeIntf
(
TemplateEscapeIntf
*
intf
)
=
0
;
/** Sets the interface that will be used inside a spaceless block
* to remove any redundant whitespace.
*/
virtual
void
setSpacelessIntf
(
TemplateSpacelessIntf
*
intf
)
=
0
;
};
};
//------------------------------------------------------------------------
//------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment