Skip to content

Commit 6ae0631

Browse files
committed
issue #10997 How to tell Doxygen to process an #include within a class definition
1 parent dbf7d31 commit 6ae0631

File tree

4 files changed

+72
-1
lines changed

4 files changed

+72
-1
lines changed

src/pre.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3570,7 +3570,7 @@ static void readIncludeFile(yyscan_t yyscanner,const QCString &inc)
35703570
fs->lineNr = oldLineNr;
35713571
fs->fileName = oldFileName;
35723572
fs->curlyCount = state->curlyCount;
3573-
state->curlyCount = 0;
3573+
//state->curlyCount = 0; // don't reset counter, see issue #10997
35743574
fs->lexRulesPart = state->lexRulesPart;
35753575
state->lexRulesPart = false;
35763576
// push the state on the stack

testing/103/class_test.xml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="" xml:lang="en-US">
3+
<compounddef id="class_test" kind="class" language="C++" prot="public">
4+
<compoundname>Test</compoundname>
5+
<sectiondef kind="public-func">
6+
<memberdef kind="function" id="class_test_1a03179ef9ecc0c0bccb7cf38441b2f73d" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
7+
<type>void</type>
8+
<definition>void Test::pubMember</definition>
9+
<argsstring>()</argsstring>
10+
<name>pubMember</name>
11+
<qualifiedname>Test::pubMember</qualifiedname>
12+
<briefdescription>
13+
</briefdescription>
14+
<detaileddescription>
15+
<para>an included public member </para>
16+
</detaileddescription>
17+
<inbodydescription>
18+
</inbodydescription>
19+
<location file="members.ci" line="4" column="8"/>
20+
</memberdef>
21+
</sectiondef>
22+
<sectiondef kind="protected-func">
23+
<memberdef kind="function" id="class_test_1a6c15350627eb93f7dd1a71e9e2ac8a03" prot="protected" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
24+
<type>void</type>
25+
<definition>void Test::proMember</definition>
26+
<argsstring>()</argsstring>
27+
<name>proMember</name>
28+
<qualifiedname>Test::proMember</qualifiedname>
29+
<briefdescription>
30+
</briefdescription>
31+
<detaileddescription>
32+
<para>an included protected member </para>
33+
</detaileddescription>
34+
<inbodydescription>
35+
</inbodydescription>
36+
<location file="members.ci" line="7" column="8"/>
37+
</memberdef>
38+
</sectiondef>
39+
<briefdescription>
40+
<para><ref refid="class_test" kindref="compound">Test</ref> clasx. </para>
41+
</briefdescription>
42+
<detaileddescription>
43+
</detaileddescription>
44+
<location file="103_include.cpp" line="5" column="1" bodyfile="103_include.cpp" bodystart="6" bodyend="8"/>
45+
<listofallmembers>
46+
<member refid="class_test_1a6c15350627eb93f7dd1a71e9e2ac8a03" prot="protected" virt="non-virtual">
47+
<scope>Test</scope>
48+
<name>proMember</name>
49+
</member>
50+
<member refid="class_test_1a03179ef9ecc0c0bccb7cf38441b2f73d" prot="public" virt="non-virtual">
51+
<scope>Test</scope>
52+
<name>pubMember</name>
53+
</member>
54+
</listofallmembers>
55+
</compounddef>
56+
</doxygen>

testing/103_include.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// objective: test if #include inside a class body will include the results as-is
2+
// check: class_test.xml
3+
4+
/// Test clasx
5+
class Test
6+
{
7+
#include "members.ci"
8+
};

testing/members.ci

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
public:
2+
/** an included public member */
3+
void pubMember();
4+
protected:
5+
/** an included protected member */
6+
void proMember();
7+

0 commit comments

Comments
 (0)