summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml27
-rw-r--r--doc/autolink.doc2
-rw-r--r--doc/changelog.doc2
-rw-r--r--doc/commands.doc111
-rw-r--r--doc/custcmd.doc2
-rw-r--r--doc/customize.doc9
-rw-r--r--doc/docblocks.doc2
-rw-r--r--doc/doxygen.14
-rw-r--r--doc/doxygen_manual.tex7
-rw-r--r--doc/doxyindexer.12
-rw-r--r--doc/doxysearch.14
-rw-r--r--doc/faq.doc2
-rw-r--r--doc/install.doc2
-rw-r--r--doc/starting.doc2
-rw-r--r--doc/xmlcmds.doc3
-rw-r--r--qtools/CMakeLists.txt1
-rw-r--r--qtools/qcstringlist.cpp192
-rw-r--r--qtools/qcstringlist.h47
-rw-r--r--qtools/qglist.cpp2
-rw-r--r--qtools/qlist.doc2
-rw-r--r--src/clangparser.cpp26
-rw-r--r--src/classdef.cpp15
-rw-r--r--src/classdef.h3
-rw-r--r--src/code.l13
-rw-r--r--src/commentcnv.l20
-rw-r--r--src/commentscan.l459
-rw-r--r--src/condparser.cpp7
-rw-r--r--src/config.xml26
-rwxr-xr-xsrc/configgen.py4
-rw-r--r--src/definition.cpp117
-rw-r--r--src/definition.h5
-rw-r--r--src/docparser.cpp37
-rw-r--r--src/doctokenizer.h1
-rw-r--r--src/doctokenizer.l17
-rw-r--r--src/dot.cpp21
-rw-r--r--src/dot.h5
-rw-r--r--src/doxygen.cpp67
-rw-r--r--src/entry.cpp1
-rw-r--r--src/entry.h16
-rw-r--r--src/formula.cpp2
-rw-r--r--src/fortrancode.l21
-rw-r--r--src/fortranscanner.l8
-rw-r--r--src/ftvhelp.cpp2
-rw-r--r--src/htmlgen.cpp31
-rw-r--r--src/htmlgen.h7
-rw-r--r--src/index.cpp13
-rw-r--r--src/latexdocvisitor.cpp8
-rw-r--r--src/latexgen.cpp88
-rw-r--r--src/latexgen.h4
-rw-r--r--src/mangen.cpp25
-rw-r--r--src/mangen.h9
-rw-r--r--src/markdown.cpp8
-rw-r--r--src/marshal.cpp32
-rw-r--r--src/memberdef.cpp21
-rw-r--r--src/outputgen.h8
-rw-r--r--src/outputlist.h9
-rw-r--r--src/pagedef.cpp19
-rw-r--r--src/pagedef.h9
-rw-r--r--src/perlmodgen.cpp2
-rw-r--r--src/plantuml.cpp6
-rw-r--r--src/portable.cpp24
-rw-r--r--src/pre.l34
-rw-r--r--src/qhp.cpp12
-rw-r--r--src/reflist.cpp6
-rw-r--r--src/rtfgen.cpp17
-rw-r--r--src/rtfgen.h4
-rw-r--r--src/scanner.l60
-rw-r--r--src/tagreader.cpp58
-rw-r--r--src/tclscanner.l119
-rw-r--r--src/types.h45
-rw-r--r--src/util.cpp66
-rw-r--r--src/util.h2
-rw-r--r--src/vhdlcode.l31
-rw-r--r--src/vhdldocgen.cpp68
-rw-r--r--src/vhdljjparser.cpp14
-rw-r--r--src/vhdljjparser.h3
-rw-r--r--src/xmlgen.cpp59
-rw-r--r--templates/html/doxygen.css46
-rw-r--r--templates/html/menu.js2
-rw-r--r--templates/html/navtree.css2
-rw-r--r--templates/latex/doxygen.sty15
-rw-r--r--templates/xml/compound.xsd16
-rw-r--r--testing/043/mypage.xml29
-rw-r--r--testing/043_page.dox2
-rw-r--r--vhdlparser/VhdlParser.cc6
-rw-r--r--vhdlparser/vhdlparser.jj6
86 files changed, 1601 insertions, 762 deletions
diff --git a/.travis.yml b/.travis.yml
index acc325a..28b8401 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,18 +1,25 @@
language: cpp
+os:
+ - linux-ppc64le
+ - linux
+dist: xenial
compiler:
- gcc
- clang
+sudo: required
-before_install:
- - sudo apt-add-repository ppa:smspillaz/cmake-2.8.12 -y
- - sudo apt-get update -qq
-
-install:
- - sudo apt-get install -qq texlive
- - sudo apt-get install -qq texlive-extra-utils
- - sudo apt-get install -q -y texlive-latex-extra
- - sudo apt-get install -qq libxml2-utils
- - sudo apt-get install -qq cmake cmake-data
+addons:
+ apt:
+ update: true
+ packages:
+ - texlive
+ - texlive-extra-utils
+ - texlive-latex-extra
+ - texlive-font-utils
+ - ghostscript
+ - libxml2-utils
+ - cmake
+ - cmake-data
script:
- mkdir build
diff --git a/doc/autolink.doc b/doc/autolink.doc
index 98556c5..ff468e4 100644
--- a/doc/autolink.doc
+++ b/doc/autolink.doc
@@ -16,7 +16,7 @@
*/
/*! \page autolink Automatic link generation
- \tableofcontents
+ \tableofcontents{html,latex}
Most documentation systems have special `see also' sections where links
to other pieces of documentation can be inserted.
diff --git a/doc/changelog.doc b/doc/changelog.doc
index 1d4eeba..0b245b6 100644
--- a/doc/changelog.doc
+++ b/doc/changelog.doc
@@ -1,5 +1,5 @@
/** \page changelog Changelog
-\tableofcontents
+\tableofcontents{html,latex}
\section log_1_8 1.8 Series
\subsection log_1_8_14 Release 1.8.14
diff --git a/doc/commands.doc b/doc/commands.doc
index 1c7e7cf..a630aac 100644
--- a/doc/commands.doc
+++ b/doc/commands.doc
@@ -442,14 +442,15 @@ Structural indicators
\endlatexonly
</p><hr>
-\section cmdexample \\example <file-name>
+\section cmdexample \\example[{lineno}] <file-name>
\addindex \\example
Indicates that a comment block contains documentation for a source code
- example. The name of the source file is \<file-name\>. The text of
- this file will be included in the documentation, just after the
- documentation contained in the comment block. All examples are placed
- in a list. The source code is scanned for documented members and classes.
+ example. The name of the source file is \<file-name\>.
+ The contents of this file will be included in the documentation, just after the
+ documentation contained in the comment block.
+ You can add option `{lineno}` to enable line numbers for the example if desired.
+ All examples are placed in a list. The source code is scanned for documented members and classes.
If any are found, the names are cross-referenced with the documentation.
Source files or directories can be specified using the
\ref cfg_example_path "EXAMPLE_PATH"
@@ -1108,6 +1109,14 @@ Structural indicators
This command is equivalent to \ref cmdfn "\\fn",
\ref cmdproperty "\\property", and \ref cmdtypedef "\\typedef".
+ Note that for PHP one can also specify the type of the variable.
+ The syntax is similar as for the `phpDocumentor` but the description has to start
+ at the next line, i.e.
+\verbatim
+@var datatype $varname
+Description
+\endverbatim
+
\sa section \ref cmdfn "\\fn", \ref cmdproperty "\\property", and \ref cmdtypedef "\\typedef".
<hr>
@@ -1281,6 +1290,8 @@ The output will be different depending on whether or not \ref cfg_enabled_sectio
contains \c TEST, or \c DEV
\sa sections \ref cmdendcond "\\endcond" and \ref cfg_enabled_sections "ENABLED_SECTIONS".
+ \note Due to the moment of parsing the \c \\cond and \ref cmdendcond "\\endcond" commands cannot
+ be used in \ref cfg_aliases "ALIASES".
<hr>
\section cmdcopyright \\copyright { copyright description }
@@ -1357,6 +1368,8 @@ contains \c TEST, or \c DEV
Ends a conditional section that was started by \ref cmdcond "\\cond".
\sa section \ref cmdcond "\\cond".
+ \note Due to the moment of parsing the \c \\endcond and \ref cmdcond "\\cond" commands cannot
+ be used in \ref cfg_aliases "ALIASES".
<hr>
\section cmdendif \\endif
@@ -1571,7 +1584,7 @@ void setPosition(double x,double y,double z,double t)
Note that for PHP one can also specify the type (or types if you
separate them with a pipe symbol) which are allowed for a parameter
(as this is not part of the definition).
- The syntax is the same as for phpDocumentor, i.e.
+ The syntax is the same as for the `phpDocumentor`, i.e.
\verbatim
@param datatype1|datatype2 $paramname description
\endverbatim
@@ -2016,15 +2029,23 @@ Make sure you have first read \ref intro "the introduction".
\endverbatim
<hr>
-\section cmdtableofcontents \\tableofcontents
+\section cmdtableofcontents \\tableofcontents['{'[option[:level]][,option[:level]]*'}']
\addindex \\tableofcontents
Creates a table of contents at the top of a page, listing all
- sections and subsections in the page.
+ sections and subsections in the page. The `option` can be `HTML` or `LaTeX`
+ or `XML`. When a `level` is specified this means the maximum nesting level
+ that is shown. The value of `level` should be in the range 1..5, values outside
+ this range are considered to be 5. In case no `level` is specified `level` is
+ set to 5 (show all)
+ In case no `option`. is specified \c \\tableofcontents acts as if just the
+ `option` `HTML` was specified. In case of multiple \c \\tableofcontents
+ commands in a page the `option`(s) will be used additional to the already
+ specified `option`(s), but only the last `level` of an `option` is valid.
\warning This command only works inside related page documentation and
\e not in other documentation blocks and only has effect in the
- HTML output!
+ the specified output!
<hr>
\section cmdsection \\section <section-name> (section title)
@@ -2131,16 +2152,12 @@ Commands for displaying examples
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly
- Alternatively, the \ref cmdsnippet "\\snippet" command can be used to
- include only a fragment of a source file. For this to work the
- fragment has to be marked.
-
\sa sections \ref cmdline "\\line", \ref cmdskip "\\skip",
\ref cmdskipline "\\skipline", \ref cmduntil "\\until", and
\ref cmdinclude "\\include".
</p><hr>
-\section cmdinclude \\include <file-name>
+\section cmdinclude \\include[{lineno|doc}] <file-name>
\addindex \\include
This command can be used to include a source file as a block of code.
@@ -2174,33 +2191,38 @@ Commands for displaying examples
\note Doxygen's special commands do not work inside blocks of code.
It is allowed to nest C-style comments inside a code block though.
+ You can add option `{lineno}` to enable line numbers for the included code if desired.
+
+ You can add option `{doc}` to treat the file as documentation rather than code.
+
+ \note Some that when using the `{doc}` option,
+ commands like \ref cmdcond "\\cond" and \ref cmdif "\\if" don't work with
+ this command due to the moment of parsing.
+
+ \note The included documentation should not have comment signs in it as they will appear
+ in the documentation as well.
+
\sa sections \ref cmdexample "\\example", \ref cmddontinclude "\\dontinclude",
- \ref cmdverbatim "\\verbatim" and \ref cmdincludedoc "\\includedoc".
+ \ref cmdverbatim "\\verbatim", \ref cmdincludedoc "\\includedoc", and
+ \ref cmdsnippet "\\snippet".
<hr>
\section cmdincludelineno \\includelineno <file-name>
\addindex \\includelineno
- This command works the same way as \ref cmdinclude "\\include", but will add line
- numbers to the included file.
+ This command is obsolete and is still supported for backward compatibility reasons,
+ it works the same way as \ref cmdinclude "\\include{lineno}"
- \sa sections \ref cmdinclude "\\include" and \ref cmdsnippetlineno "\\snippetlineno".
+ \sa sections \ref cmdinclude "\\include{lineno}".
<hr>
\section cmdincludedoc \\includedoc <file-name>
\addindex \\includedoc
- This command works the same way as \ref cmdinclude "\\include", but it will include
- the content of the file as if it were at the place where this command is called.
- The result is that the content is parsed by doxygen and placed in the documentation.
+ This command is obsolete and is still supported for backward compatibility reasons,
+ it works the same way as \ref cmdinclude "\\include{doc}"
- \note Some commands like \ref cmdcond "\\cond" and \ref cmdif "\\if" don't work with
- this command due to the moment of parsing.
-
- \note The included documentation should not have comment signs in it as they will appear
- in the documentation as well.
-
- \sa section \ref cmdinclude "\\include".
+ \sa section \ref cmdinclude "\\include{doc}".
<hr>
\section cmdline \\line ( pattern )
@@ -2258,7 +2280,7 @@ Commands for displaying examples
See section \ref cmddontinclude "\\dontinclude" for an example.
<hr>
-\section cmdsnippet \\snippet <file-name> ( block_id )
+\section cmdsnippet \\snippet[{lineno|doc}] <file-name> ( block_id )
\addindex \\snippet
Where the \ref cmdinclude "\\include" command can be used to include
@@ -2301,34 +2323,37 @@ Commands for displaying examples
Note also that the [block_id] markers should appear exactly twice in the
source file.
+ You can add option `{lineno}` to enable line numbers for the snippet if desired.
+
+ You can add option `{doc}` to treat the file as documentation rather than code.
+
+ \note Some that when using the `{doc}` option,
+ commands like \ref cmdcond "\\cond" and \ref cmdif "\\if" don't work with
+ this command due to the moment of parsing.
+
+ \note The included documentation should not have comment signs in it as they will appear
+ in the documentation as well.
+
see section \ref cmddontinclude "\\dontinclude" for an alternative way
to include fragments of a source file that does not require markers.
- \sa section \ref cmdsnippetdoc "\\snippetdoc" and \ref cmdsnippetlineno "\\snippetlineno".
<hr>
\section cmdsnippetlineno \\snippetlineno <file-name> ( block_id )
\addindex \\snippetlineno
- This command works the same way as \ref cmdsnippet "\\snippet", but will add line
- numbers to the included snippet.
+ This command is obsolete and is still supported for backward compatibility reasons,
+ it works the same way as \ref cmdsnippet "\\snippet{lineno}"
- \sa sections \ref cmdsnippet "\\snippet" and \ref cmdincludelineno "\\includelineno".
+ \sa sections \ref cmdsnippet "\\snippet{lineno}"
<hr>
\section cmdsnippetdoc \\snippetdoc <file-name> ( block_id )
\addindex \\snippetdoc
- This command works the same way as \ref cmdsnippet "\\snippet", but it will include
- the content of the file between the `block-id`s as if it were at the place where this command is called.
- The result is that the content is parsed by doxygen and placed in the documentation.
-
- \note Some commands like \ref cmdcond "\\cond" and \ref cmdif "\\if" don't work with
- this command due to the moment of parsing.
-
- \note The included documentation should not have comment signs in it as they will appear
- in the documentation as well.
+ This command is obsolete and is still supported for backward compatibility reasons,
+ it works the same way as \ref cmdsnippet "\\snippet{doc}"
- \sa section \ref cmdsnippet "\\snippet" and \ref cmdincludedoc "\\includedoc".
+ \sa section \ref cmdsnippet "\\snippet{doc}" and \ref cmdinclude "\\include{doc}".
<hr>
\section cmduntil \\until ( pattern )
diff --git a/doc/custcmd.doc b/doc/custcmd.doc
index de9a30d..acc0224 100644
--- a/doc/custcmd.doc
+++ b/doc/custcmd.doc
@@ -16,7 +16,7 @@
*/
/*! \page custcmd Custom Commands
-\tableofcontents
+\tableofcontents{html,latex}
Doxygen provides a large number of \ref commands "special commands",
\ref xmlcmds "XML commands", and \ref htmlcmds "HTML commands".
diff --git a/doc/customize.doc b/doc/customize.doc
index e2d53db..7b2729d 100644
--- a/doc/customize.doc
+++ b/doc/customize.doc
@@ -16,7 +16,7 @@
*/
/*! \page customize Customizing the output
-\tableofcontents
+\tableofcontents{html,latex}
Doxygen provides various levels of customization.
The section \ref minor_tweaks "Minor Tweaks" discusses what to
@@ -289,7 +289,12 @@ The following generic elements are possible for each page:
<dt>\c detaileddescription
<dd>Represents the detailed description on a page.
<dt>\c authorsection
- <dd>Represents the author section of a page (only used for man pages).
+ <dd>Represents the author section of a page (only used for man pages). This is
+ a separate section for man pages with a text like:
+ `Generated automatically by Doxygen for My Project from the source code.`
+ This should not be misinterpreted with the doxygen commands \ref cmdauthor
+ "\\author" or \ref cmdauthors "\\authors" that generate an author paragraph
+ inside a detailed description.
<dt>\c memberdecl
<dd>Represents the quick overview of members on a page (member declarations).
This elements has child elements per type of member list.
diff --git a/doc/docblocks.doc b/doc/docblocks.doc
index e72ce95..f02e55b 100644
--- a/doc/docblocks.doc
+++ b/doc/docblocks.doc
@@ -15,7 +15,7 @@
*
*/
/*! \page docblocks Documenting the code
-\tableofcontents
+\tableofcontents{html,latex}
This chapter covers two topics:
1. How to put comments in your code such that doxygen incorporates them in
diff --git a/doc/doxygen.1 b/doc/doxygen.1
index 1deb7b6..5ac287e 100644
--- a/doc/doxygen.1
+++ b/doc/doxygen.1
@@ -3,7 +3,7 @@
doxygen \- documentation system for various programming languages
.SH DESCRIPTION
Doxygen is a documentation system for C++, C, Java, Objective-C, IDL
-(Corba and Microsoft flavors) and to some extent PHP, C#, and D.
+(Corba and Microsoft flavors), Fortran, Python, VHDL and to some extent PHP, C#, and D.
.PP
You can use doxygen in a number of ways:
.TP
@@ -25,7 +25,7 @@ If - is used for configName doxygen will read from standard input.
.TP
4) Use doxygen to generate a template file controlling the layout of the generated documentation:
.IP
-doxygen -l layoutFileName.xml
+doxygen -l [layoutFileName.xml]
.TP
5) Use doxygen to generate a template style sheet file for RTF, HTML or Latex.
.TP
diff --git a/doc/doxygen_manual.tex b/doc/doxygen_manual.tex
index 3e4cd49..95e1ed6 100644
--- a/doc/doxygen_manual.tex
+++ b/doc/doxygen_manual.tex
@@ -70,9 +70,13 @@
\hfuzz=15pt
\setlength{\emergencystretch}{15pt}
\setlength{\parindent}{0pt}
-\setlength{\parskip}{0.2cm}
+\newcommand{\doxynormalparskip}{\setlength{\parskip}{0.2cm}}
+\newcommand{\doxytocparskip}{\setlength{\parskip}{0.2cm}}
+\doxynormalparskip
\hbadness=750
\tolerance=750
+\usepackage{etoc}
+\etocsettocstyle{\doxytocparskip}{\doxynormalparskip}
\begin{document}
\pagenumbering{alph}
\begin{titlepage}
@@ -85,6 +89,7 @@ Written by Dimitri van Heesch\\[2ex]
\end{titlepage}
\clearemptydoublepage
\pagenumbering{Roman}
+\chapter*{Contents}
\tableofcontents
\clearemptydoublepage
\pagenumbering{arabic}
diff --git a/doc/doxyindexer.1 b/doc/doxyindexer.1
index ae4b282..b0d46d0 100644
--- a/doc/doxyindexer.1
+++ b/doc/doxyindexer.1
@@ -3,7 +3,7 @@
doxyindexer \- creates a search index from raw search data
.SH SYNOPSIS
.B doxyindexer
-[\fI-o output_dir\fR] \fIsearchdata.xml \fR[\fIsearchdata2.xml\fR...] ]
+[\fI-o output_dir\fR] \fIsearchdata.xml \fR[\fIsearchdata2.xml\fR...]
.SH DESCRIPTION
Generates a search index called \fBdoxysearch.db\fR from one or more
search data files produced by doxygen. Use
diff --git a/doc/doxysearch.1 b/doc/doxysearch.1
index a00124f..a26107b 100644
--- a/doc/doxysearch.1
+++ b/doc/doxysearch.1
@@ -2,10 +2,10 @@
.SH NAME
doxysearch.cgi \- search engine used for searching in doxygen documentation.
.SH SYNOPSIS
-.B doxyindexer.cgi
+.B doxysearch.cgi
.SH DESCRIPTION
CGI binary that is used by doxygen generated HTML output to search for words.
The tool uses the search index called \fBdoxysearch.db\fR produced by
doxyindexer.
.SH SEE ALSO
-doxygen(1), doxysearch(1), doxywizard(1).
+doxygen(1), doxyindexer(1), doxywizard(1).
diff --git a/doc/faq.doc b/doc/faq.doc
index a91a2f5..e9c93d8 100644
--- a/doc/faq.doc
+++ b/doc/faq.doc
@@ -16,7 +16,7 @@
*/
/*! \page faq Frequently Asked Questions
-\tableofcontents
+\tableofcontents{html,latex}
\section faq_index How to get information on the index page in HTML?
diff --git a/doc/install.doc b/doc/install.doc
index f981431..497a0c0 100644
--- a/doc/install.doc
+++ b/doc/install.doc
@@ -17,7 +17,7 @@
/*! \page install Installation
\addindex installation
-\tableofcontents
+\tableofcontents{html,latex}
First go to the
<a href="http://www.doxygen.org/download.html">download</a> page
diff --git a/doc/starting.doc b/doc/starting.doc
index e39aa25..0765a3b 100644
--- a/doc/starting.doc
+++ b/doc/starting.doc
@@ -15,7 +15,7 @@
*
*/
/*! \page starting Getting started
-\tableofcontents
+\tableofcontents{html,latex}
The executable \c doxygen is the main program that parses the sources and
generates the documentation. See section \ref doxygen_usage for more
diff --git a/doc/xmlcmds.doc b/doc/xmlcmds.doc
index 501bf91..848858d 100644
--- a/doc/xmlcmds.doc
+++ b/doc/xmlcmds.doc
@@ -70,6 +70,9 @@ Here is the list of tags supported by doxygen:
<li><tt>\<typeparamref name="paramName"\></tt> Refers to a parameter with name
"paramName". Similar to using \ref cmda "\\a".
<li><tt>\<value\></tt> Identifies a property. Ignored by doxygen.
+<li><tt>\<![CDATA[...]]\></tt> The text inside this tag (on the ...) is handled as normal
+ doxygen comment except for the XML special characters `<`, `>` and
+ `&` that are used as if they were escaped.
</ul>
Here is an example of a typical piece of code using some of the above commands:
diff --git a/qtools/CMakeLists.txt b/qtools/CMakeLists.txt
index 17f8eb4..cc64de1 100644
--- a/qtools/CMakeLists.txt
+++ b/qtools/CMakeLists.txt
@@ -22,6 +22,7 @@ qstring.cpp
qtextstream.cpp
qtextcodec.cpp
qstringlist.cpp
+qcstringlist.cpp
qxml.cpp
qmap.cpp
qthread.cpp
diff --git a/qtools/qcstringlist.cpp b/qtools/qcstringlist.cpp
new file mode 100644
index 0000000..5725971
--- /dev/null
+++ b/qtools/qcstringlist.cpp
@@ -0,0 +1,192 @@
+/****************************************************************************
+**
+** Copyright (C) 1997-2018 by Dimitri van Heesch.
+**
+** Permission to use, copy, modify, and distribute this software and its
+** documentation under the terms of the GNU General Public License is hereby
+** granted. No representations are made about the suitability of this software
+** for any purpose. It is provided "as is" without express or implied warranty.
+** See the GNU General Public License for more details.
+**
+** Implementation of QCStringList
+**
+**********************************************************************/
+
+#include "qcstringlist.h"
+
+#include "qstrlist.h"
+#include "qdatastream.h"
+#include "qtl.h"
+
+/*!
+ Splits the string \a str using \a sep as separator. Returns the
+ list of strings. If \a allowEmptyEntries is TRUE, also empty
+ entries are inserted into the list, else not. So if you have
+ a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e'
+ would be returned if \a allowEmptyEntries is FALSE, but
+ a list containing 'abc', '', 'd', 'e' and '' would be returned if
+ \a allowEmptyEntries is TRUE.
+ If \a str doesn't contain \a sep, a stringlist
+ with one item, which is the same as \a str, is returned.
+
+ \sa join()
+*/
+
+QCStringList QCStringList::split( char sep, const QCString &str, bool allowEmptyEntries )
+{
+ char cs[2] = { sep, '\0' };
+ return split( cs, str, allowEmptyEntries );
+}
+
+/*!
+ Splits the string \a str using \a sep as separator. Returns the
+ list of strings. If \a allowEmptyEntries is TRUE, also empty
+ entries are inserted into the list, else not. So if you have
+ a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e'
+ would be returned if \a allowEmptyEntries is FALSE, but
+ a list containing 'abc', '', 'd', 'e' and '' would be returned if
+ \a allowEmptyEntries is TRUE.
+ If \a str doesn't contain \a sep, a stringlist
+ with one item, which is the same as \a str, is returned.
+
+ \sa join()
+*/
+
+QCStringList QCStringList::split( const QCString &sep, const QCString &str, bool allowEmptyEntries )
+{
+ QCStringList lst;
+
+ int j = 0;
+ int i = str.find( sep, j );
+
+ while ( i != -1 ) {
+ if ( str.mid( j, i - j ).length() > 0 )
+ lst << str.mid( j, i - j );
+ else if ( allowEmptyEntries )
+ lst << QCString();
+ j = i + sep.length();
+ i = str.find( sep, j );
+ }
+
+ int l = str.length() - 1;
+ if ( str.mid( j, l - j + 1 ).length() > 0 )
+ lst << str.mid( j, l - j + 1 );
+ else if ( allowEmptyEntries )
+ lst << QCString();
+
+ return lst;
+}
+
+/*!
+ Splits the string \a str using the regular expression \a sep as separator. Returns the
+ list of strings. If \a allowEmptyEntries is TRUE, also empty
+ entries are inserted into the list, else not. So if you have
+ a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e'
+ would be returned if \a allowEmptyEntries is FALSE, but
+ a list containing 'abc', '', 'd', 'e' and '' would be returned if
+ \a allowEmptyEntries is TRUE.
+ If \a str doesn't contain \a sep, a stringlist
+ with one item, which is the same as \a str, is returned.
+
+ \sa join()
+*/
+
+QCStringList QCStringList::split( const QRegExp &sep, const QCString &str, bool allowEmptyEntries )
+{
+ QCStringList lst;
+
+ int j = 0;
+ int len = 0;
+ int i = sep.match( str.data(), j, &len );
+
+ while ( i != -1 ) {
+ if ( str.mid( j, i - j ).length() > 0 )
+ lst << str.mid( j, i - j );
+ else if ( allowEmptyEntries )
+ lst << QCString();
+ j = i + len;
+ i = sep.match( str.data(), j, &len );
+ }
+
+ int l = str.length() - 1;
+ if ( str.mid( j, l - j + 1 ).length() > 0 )
+ lst << str.mid( j, l - j + 1 );
+ else if ( allowEmptyEntries )
+ lst << QCString();
+
+ return lst;
+}
+
+/*!
+ Returns a list of all strings containing the substring \a str.
+
+ If \a cs is TRUE, the grep is done case sensitively, else not.
+*/
+
+QCStringList QCStringList::grep( const QCString &str, bool cs ) const
+{
+ QCStringList res;
+ for ( QCStringList::ConstIterator it = begin(); it != end(); ++it )
+ if ( (*it).contains( str, cs ) )
+ res << *it;
+
+ return res;
+}
+
+/*!
+ Returns a list of all strings containing a substring that matches
+ the regular expression \a expr.
+*/
+
+QCStringList QCStringList::grep( const QRegExp &expr ) const
+{
+ QCStringList res;
+ for ( QCStringList::ConstIterator it = begin(); it != end(); ++it )
+ if ( (*it).contains( expr ) )
+ res << *it;
+
+ return res;
+}
+
+/*!
+ Joins the stringlist into a single string with each element
+ separated by \a sep.
+
+ \sa split()
+*/
+QCString QCStringList::join( const QCString &sep ) const
+{
+ QCString res;
+ bool alredy = FALSE;
+ for ( QCStringList::ConstIterator it = begin(); it != end(); ++it ) {
+ if ( alredy )
+ res += sep;
+ alredy = TRUE;
+ res += *it;
+ }
+
+ return res;
+}
+
+Q_EXPORT QDataStream &operator>>( QDataStream & s, QCStringList& l )
+{
+ return s >> (QValueList<QCString>&)l;
+}
+
+Q_EXPORT QDataStream &operator<<( QDataStream & s, const QCStringList& l )
+{
+ return s << (const QValueList<QCString>&)l;
+}
+
+/*!
+ Converts from a QStrList (ASCII) to a QCStringList (Unicode).
+*/
+QCStringList QCStringList::fromStrList(const QStrList& ascii)
+{
+ QCStringList res;
+ const char * s;
+ for ( QStrListIterator it(ascii); (s=it.current()); ++it )
+ res << s;
+ return res;
+}
+
diff --git a/qtools/qcstringlist.h b/qtools/qcstringlist.h
new file mode 100644
index 0000000..604a196
--- /dev/null
+++ b/qtools/qcstringlist.h
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 1997-2018 by Dimitri van Heesch.
+**
+** Permission to use, copy, modify, and distribute this software and its
+** documentation under the terms of the GNU General Public License is hereby
+** granted. No representations are made about the suitability of this software
+** for any purpose. It is provided "as is" without express or implied warranty.
+** See the GNU General Public License for more details.
+**
+** Note: this is a variant of the qstringlist.h but for QCString's
+**
+**********************************************************************/
+#ifndef QCSTRINGLIST_H
+#define QCSTRINGLIST_H
+
+#include "qvaluelist.h"
+#include "qcstring.h"
+#include "qregexp.h"
+
+class QStrList;
+class QDataStream;
+
+class QCStringList : public QValueList<QCString>
+{
+public:
+ QCStringList() { }
+ QCStringList( const QCStringList& l ) : QValueList<QCString>(l) { }
+ QCStringList( const QValueList<QCString>& l ) : QValueList<QCString>(l) { }
+ QCStringList( const QCString& i ) { append(i); }
+ QCStringList( const char* i ) { append(i); }
+
+ static QCStringList fromStrList(const QStrList&);
+
+ static QCStringList split( const QCString &sep, const QCString &str, bool allowEmptyEntries = FALSE );
+ static QCStringList split( char sep, const QCString &str, bool allowEmptyEntries = FALSE );
+ static QCStringList split( const QRegExp &sep, const QCString &str, bool allowEmptyEntries = FALSE );
+ QCString join( const QCString &sep ) const;
+
+ QCStringList grep( const QCString &str, bool cs = TRUE ) const;
+ QCStringList grep( const QRegExp &expr ) const;
+};
+
+extern Q_EXPORT QDataStream &operator>>( QDataStream &, QCStringList& );
+extern Q_EXPORT QDataStream &operator<<( QDataStream &, const QCStringList& );
+
+#endif // QCSTRINGLIST_H
diff --git a/qtools/qglist.cpp b/qtools/qglist.cpp
index f464a73..731d9fd 100644
--- a/qtools/qglist.cpp
+++ b/qtools/qglist.cpp
@@ -235,7 +235,7 @@ QGList& QGList::operator=( const QGList &list )
}
/*!
- Compares this list with \a list. Retruns TRUE if the lists
+ Compares this list with \a list. Returns TRUE if the lists
contain the same data, else FALSE.
*/
diff --git a/qtools/qlist.doc b/qtools/qlist.doc
index 6b4278c..59cc971 100644
--- a/qtools/qlist.doc
+++ b/qtools/qlist.doc
@@ -168,7 +168,7 @@
/*!
\fn bool QList::operator==(const QList<type> &list ) const
- Compares this list with \a list. Retruns TRUE if the lists
+ Compares this list with \a list. Returns TRUE if the lists
contain the same data, else FALSE.
*/
diff --git a/src/clangparser.cpp b/src/clangparser.cpp
index 2ea15ee..78b8faa 100644
--- a/src/clangparser.cpp
+++ b/src/clangparser.cpp
@@ -197,32 +197,32 @@ void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit)
std::vector<std::string> options = command[command.size()-1].CommandLine;
// copy each compiler option used from the database. Skip the first which is compiler exe.
for (auto option = options.begin()+1; option != options.end(); option++) {
- argv[argc++] = strdup(option->c_str());
+ argv[argc++] = qstrdup(option->c_str());
}
// this extra addition to argv is accounted for as we are skipping the first entry in
- argv[argc++]=strdup("-w"); // finally, turn off warnings.
+ argv[argc++]=qstrdup("-w"); // finally, turn off warnings.
} else {
// add include paths for input files
for (di.toFirst();di.current();++di,++argc)
{
QCString inc = QCString("-I")+di.currentKey();
- argv[argc]=strdup(inc.data());
+ argv[argc]=qstrdup(inc.data());
//printf("argv[%d]=%s\n",argc,argv[argc]);
}
// add external include paths
for (uint i=0;i<includePath.count();i++)
{
QCString inc = QCString("-I")+includePath.at(i);
- argv[argc++]=strdup(inc.data());
+ argv[argc++]=qstrdup(inc.data());
}
// user specified options
for (uint i=0;i<clangOptions.count();i++)
{
- argv[argc++]=strdup(clangOptions.at(i));
+ argv[argc++]=qstrdup(clangOptions.at(i));
}
// extra options
- argv[argc++]=strdup("-ferror-limit=0");
- argv[argc++]=strdup("-x");
+ argv[argc++]=qstrdup("-ferror-limit=0");
+ argv[argc++]=qstrdup("-x");
// Since we can be presented with a .h file that can contain C/C++ or
// Objective C code and we need to configure the parser before knowing this,
@@ -250,19 +250,19 @@ void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit)
switch(p->detectedLang)
{
case ClangParser::Private::Detected_Cpp:
- argv[argc++]=strdup("c++");
+ argv[argc++]=qstrdup("c++");
break;
case ClangParser::Private::Detected_ObjC:
- argv[argc++]=strdup("objective-c");
+ argv[argc++]=qstrdup("objective-c");
break;
case ClangParser::Private::Detected_ObjCpp:
- argv[argc++]=strdup("objective-c++");
+ argv[argc++]=qstrdup("objective-c++");
break;
}
// provide the input and and its dependencies as unsaved files so we can
// pass the filtered versions
- argv[argc++]=strdup(fileName);
+ argv[argc++]=qstrdup(fileName);
}
static bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES);
//printf("source %s ----------\n%s\n-------------\n\n",
@@ -272,7 +272,7 @@ void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit)
p->sources = new QCString[numUnsavedFiles];
p->ufs = new CXUnsavedFile[numUnsavedFiles];
p->sources[0] = detab(fileToString(fileName,filterSourceFiles,TRUE));
- p->ufs[0].Filename = strdup(fileName);
+ p->ufs[0].Filename = qstrdup(fileName);
p->ufs[0].Contents = p->sources[0].data();
p->ufs[0].Length = p->sources[0].length();
QStrListIterator it(filesInTranslationUnit);
@@ -281,7 +281,7 @@ void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit)
{
p->fileMapping.insert(it.current(),new uint(i));
p->sources[i] = detab(fileToString(it.current(),filterSourceFiles,TRUE));
- p->ufs[i].Filename = strdup(it.current());
+ p->ufs[i].Filename = qstrdup(it.current());
p->ufs[i].Contents = p->sources[i].data();
p->ufs[i].Length = p->sources[i].length();
}
diff --git a/src/classdef.cpp b/src/classdef.cpp
index 4977760..1d72073 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -1013,13 +1013,13 @@ void ClassDef::writeDetailedDocumentationBody(OutputList &ol)
// write examples
if (hasExamples() && m_impl->exampleSDict)
{
- ol.startSimpleSect(BaseOutputDocInterface::Examples,0,0,theTranslator->trExamples()+": ");
+ ol.startExamples();
ol.startDescForItem();
//ol.startParagraph();
writeExample(ol,m_impl->exampleSDict);
//ol.endParagraph();
ol.endDescForItem();
- ol.endSimpleSect();
+ ol.endExamples();
}
//ol.newParagraph();
writeSourceDef(ol,name());
@@ -1582,7 +1582,11 @@ void ClassDef::writeSummaryLinks(OutputList &ol)
void ClassDef::writeTagFile(FTextStream &tagFile)
{
if (!isLinkableInProject()) return;
- tagFile << " <compound kind=\"" << compoundTypeString();
+ tagFile << " <compound kind=\"";
+ if (isFortran() && (compoundTypeString() == "type"))
+ tagFile << "struct";
+ else
+ tagFile << compoundTypeString();
tagFile << "\"";
if (isObjectiveC()) { tagFile << " objc=\"yes\""; }
tagFile << ">" << endl;
@@ -4500,6 +4504,11 @@ bool ClassDef::isObjectiveC() const
return getLanguage()==SrcLangExt_ObjC;
}
+bool ClassDef::isFortran() const
+{
+ return getLanguage()==SrcLangExt_Fortran;
+}
+
bool ClassDef::isCSharp() const
{
return getLanguage()==SrcLangExt_CSharp;
diff --git a/src/classdef.h b/src/classdef.h
index b169221..12fcd93 100644
--- a/src/classdef.h
+++ b/src/classdef.h
@@ -266,6 +266,9 @@ class ClassDef : public Definition
/** Returns TRUE if this class is implemented in Objective-C */
bool isObjectiveC() const;
+ /** Returns TRUE if this class is implemented in Fortran */
+ bool isFortran() const;
+
/** Returns TRUE if this class is implemented in C# */
bool isCSharp() const;
diff --git a/src/code.l b/src/code.l
index 5c9e289..2c9b0ae 100644
--- a/src/code.l
+++ b/src/code.l
@@ -1797,6 +1797,11 @@ static QCString escapeComment(const char *s)
return result;
}
+static bool skipLanguageSpecificKeyword(const QCString &kw)
+{
+ return g_insideCpp && (kw == "remove" || kw == "set" || kw == "get");
+}
+
/* -----------------------------------------------------------------
*/
#undef YY_INPUT
@@ -2417,7 +2422,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
}
<Body>{KEYWORD}/([^a-z_A-Z0-9]) {
if (g_insideJava && qstrcmp("internal",yytext) ==0) REJECT;
- if (g_insideCpp && (QCString(yytext) =="set" ||QCString(yytext) =="get")) REJECT;
+ if (skipLanguageSpecificKeyword(yytext)) REJECT;
startFontClass("keyword");
codifyLines(yytext);
if (QCString(yytext)=="typedef")
@@ -2428,13 +2433,13 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
endFontClass();
}
<Body>{KEYWORD}/{B}* {
- if (g_insideCpp && (QCString(yytext) =="set" ||QCString(yytext) =="get")) REJECT;
+ if (skipLanguageSpecificKeyword(yytext)) REJECT;
startFontClass("keyword");
codifyLines(yytext);
endFontClass();
}
<Body>{KEYWORD}/{BN}*"(" {
- if (g_insideCpp && (QCString(yytext) =="set" ||QCString(yytext) =="get")) REJECT;
+ if (skipLanguageSpecificKeyword(yytext)) REJECT;
startFontClass("keyword");
codifyLines(yytext);
endFontClass();
@@ -2989,7 +2994,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
<MemberCall2,FuncCall>{KEYWORD}/([^a-z_A-Z0-9]) {
//addParmType();
//g_parmName=yytext;
- if (g_insideCpp && (QCString(yytext) =="set" ||QCString(yytext) =="get")) REJECT;
+ if (skipLanguageSpecificKeyword(yytext)) REJECT;
startFontClass("keyword");
g_code->codify(yytext);
endFontClass();
diff --git a/src/commentcnv.l b/src/commentcnv.l
index 10dab28..88236ed 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -591,7 +591,15 @@ void replaceComment(int offset);
copyToOutput(yytext,(int)yyleng);
}
<SkipString>\\. { /* escaped character in string */
- copyToOutput(yytext,(int)yyleng);
+ if (g_lang==SrcLangExt_Fortran)
+ {
+ unput(yytext[1]);
+ copyToOutput(yytext,1);
+ }
+ else
+ {
+ copyToOutput(yytext,(int)yyleng);
+ }
}
<SkipString>"\"" { /* end of string */
copyToOutput(yytext,(int)yyleng);
@@ -604,7 +612,15 @@ void replaceComment(int offset);
copyToOutput(yytext,(int)yyleng);
}
<SkipChar>\\. { /* escaped character */
- copyToOutput(yytext,(int)yyleng);
+ if (g_lang==SrcLangExt_Fortran)
+ {
+ unput(yytext[1]);
+ copyToOutput(yytext,1);
+ }
+ else
+ {
+ copyToOutput(yytext,(int)yyleng);
+ }
}
<SkipChar>' { /* end of character literal */
copyToOutput(yytext,(int)yyleng);
diff --git a/src/commentscan.l b/src/commentscan.l
index 55c55a7..39b0edc 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -30,7 +30,7 @@
#include <qstack.h>
#include <qregexp.h>
#include <qfile.h>
-
+#include <qcstringlist.h>
#include "scanner.h"
#include "entry.h"
#include "doxygen.h"
@@ -54,81 +54,81 @@
#define YY_NO_UNISTD_H 1
// forward declarations
-static bool handleBrief(const QCString &);
-static bool handleFn(const QCString &);
-static bool handleDef(const QCString &);
-static bool handleOverload(const QCString &);
-static bool handleEnum(const QCString &);
-static bool handleDefGroup(const QCString &);
-static bool handleAddToGroup(const QCString &);
-static bool handleWeakGroup(const QCString &);
-static bool handleNamespace(const QCString &);
-static bool handlePackage(const QCString &);
-static bool handleClass(const QCString &);
-static bool handleHeaderFile(const QCString &);
-static bool handleProtocol(const QCString &);
-static bool handleCategory(const QCString &);
-static bool handleUnion(const QCString &);
-static bool handleStruct(const QCString &);
-static bool handleInterface(const QCString &);
-static bool handleIdlException(const QCString &);
-static bool handlePage(const QCString &);
-static bool handleMainpage(const QCString &);
-static bool handleFile(const QCString &);
-static bool handleDir(const QCString &);
-static bool handleExample(const QCString &);
-static bool handleDetails(const QCString &);
-static bool handleName(const QCString &);
-static bool handleTodo(const QCString &);
-static bool handleTest(const QCString &);
-static bool handleBug(const QCString &);
-static bool handleSubpage(const QCString &s);
-static bool handleDeprecated(const QCString &);
-static bool handleXRefItem(const QCString &);
-static bool handleRelated(const QCString &);
-static bool handleRelatedAlso(const QCString &);
-static bool handleMemberOf(const QCString &);
-static bool handleRefItem(const QCString &);
-static bool handleSection(const QCString &);
-static bool handleAnchor(const QCString &);
-static bool handleCite(const QCString &);
-static bool handleFormatBlock(const QCString &);
-static bool handleAddIndex(const QCString &);
-static bool handleIf(const QCString &);
-static bool handleIfNot(const QCString &);
-static bool handleElseIf(const QCString &);
-static bool handleElse(const QCString &);
-static bool handleEndIf(const QCString &);
-static bool handleIngroup(const QCString &);
-static bool handleNoSubGrouping(const QCString &);
-static bool handleShowInitializer(const QCString &);
-static bool handleHideInitializer(const QCString &);
-static bool handleCallgraph(const QCString &);
-static bool handleHideCallgraph(const QCString &);
-static bool handleCallergraph(const QCString &);
-static bool handleHideCallergraph(const QCString &);
-static bool handleInternal(const QCString &);
-static bool handleLineBr(const QCString &);
-static bool handleStatic(const QCString &);
-static bool handlePure(const QCString &);
-static bool handlePrivate(const QCString &);
-static bool handlePrivateSection(const QCString &);
-static bool handleProtected(const QCString &);
-static bool handleProtectedSection(const QCString &);
-static bool handlePublic(const QCString &s);
-static bool handlePublicSection(const QCString &s);
-static bool handleToc(const QCString &s);
-static bool handleInherit(const QCString &);
-static bool handleExtends(const QCString &);
-static bool handleCopyDoc(const QCString &);
-static bool handleCopyBrief(const QCString &);
-static bool handleCopyDetails(const QCString &);
-static bool handleParBlock(const QCString &);
-static bool handleEndParBlock(const QCString &);
-static bool handleParam(const QCString &);
-static bool handleRetval(const QCString &);
-
-typedef bool (*DocCmdFunc)(const QCString &name);
+static bool handleBrief(const QCString &, const QCStringList &);
+static bool handleFn(const QCString &, const QCStringList &);
+static bool handleDef(const QCString &, const QCStringList &);
+static bool handleOverload(const QCString &, const QCStringList &);
+static bool handleEnum(const QCString &, const QCStringList &);
+static bool handleDefGroup(const QCString &, const QCStringList &);
+static bool handleAddToGroup(const QCString &, const QCStringList &);
+static bool handleWeakGroup(const QCString &, const QCStringList &);
+static bool handleNamespace(const QCString &, const QCStringList &);
+static bool handlePackage(const QCString &, const QCStringList &);
+static bool handleClass(const QCString &, const QCStringList &);
+static bool handleHeaderFile(const QCString &, const QCStringList &);
+static bool handleProtocol(const QCString &, const QCStringList &);
+static bool handleCategory(const QCString &, const QCStringList &);
+static bool handleUnion(const QCString &, const QCStringList &);
+static bool handleStruct(const QCString &, const QCStringList &);
+static bool handleInterface(const QCString &, const QCStringList &);
+static bool handleIdlException(const QCString &, const QCStringList &);
+static bool handlePage(const QCString &, const QCStringList &);
+static bool handleMainpage(const QCString &, const QCStringList &);
+static bool handleFile(const QCString &, const QCStringList &);
+static bool handleDir(const QCString &, const QCStringList &);
+static bool handleExample(const QCString &, const QCStringList &);
+static bool handleDetails(const QCString &, const QCStringList &);
+static bool handleName(const QCString &, const QCStringList &);
+static bool handleTodo(const QCString &, const QCStringList &);
+static bool handleTest(const QCString &, const QCStringList &);
+static bool handleBug(const QCString &, const QCStringList &);
+static bool handleSubpage(const QCString &s, const QCStringList &);
+static bool handleDeprecated(const QCString &, const QCStringList &);
+static bool handleXRefItem(const QCString &, const QCStringList &);
+static bool handleRelated(const QCString &, const QCStringList &);
+static bool handleRelatedAlso(const QCString &, const QCStringList &);
+static bool handleMemberOf(const QCString &, const QCStringList &);
+static bool handleRefItem(const QCString &, const QCStringList &);
+static bool handleSection(const QCString &, const QCStringList &);
+static bool handleAnchor(const QCString &, const QCStringList &);
+static bool handleCite(const QCString &, const QCStringList &);
+static bool handleFormatBlock(const QCString &, const QCStringList &);
+static bool handleAddIndex(const QCString &, const QCStringList &);
+static bool handleIf(const QCString &, const QCStringList &);
+static bool handleIfNot(const QCString &, const QCStringList &);
+static bool handleElseIf(const QCString &, const QCStringList &);
+static bool handleElse(const QCString &, const QCStringList &);
+static bool handleEndIf(const QCString &, const QCStringList &);
+static bool handleIngroup(const QCString &, const QCStringList &);
+static bool handleNoSubGrouping(const QCString &, const QCStringList &);
+static bool handleShowInitializer(const QCString &, const QCStringList &);
+static bool handleHideInitializer(const QCString &, const QCStringList &);
+static bool handleCallgraph(const QCString &, const QCStringList &);
+static bool handleHideCallgraph(const QCString &, const QCStringList &);
+static bool handleCallergraph(const QCString &, const QCStringList &);
+static bool handleHideCallergraph(const QCString &, const QCStringList &);
+static bool handleInternal(const QCString &, const QCStringList &);
+static bool handleLineBr(const QCString &, const QCStringList &);
+static bool handleStatic(const QCString &, const QCStringList &);
+static bool handlePure(const QCString &, const QCStringList &);
+static bool handlePrivate(const QCString &, const QCStringList &);
+static bool handlePrivateSection(const QCString &, const QCStringList &);
+static bool handleProtected(const QCString &, const QCStringList &);
+static bool handleProtectedSection(const QCString &, const QCStringList &);
+static bool handlePublic(const QCString &s, const QCStringList &);
+static bool handlePublicSection(const QCString &s, const QCStringList &);
+static bool handleToc(const QCString &s, const QCStringList &);
+static bool handleInherit(const QCString &, const QCStringList &);
+static bool handleExtends(const QCString &, const QCStringList &);
+static bool handleCopyDoc(const QCString &, const QCStringList &);
+static bool handleCopyBrief(const QCString &, const QCStringList &);
+static bool handleCopyDetails(const QCString &, const QCStringList &);
+static bool handleParBlock(const QCString &, const QCStringList &);
+static bool handleEndParBlock(const QCString &, const QCStringList &);
+static bool handleParam(const QCString &, const QCStringList &);
+static bool handleRetval(const QCString &, const QCStringList &);
+
+typedef bool (*DocCmdFunc)(const QCString &name, const QCStringList &optList);
struct DocCmdMap
{
@@ -582,7 +582,7 @@ static void addXRefItem(const char *listName,const char *itemTitle,
item->listAnchor = anchorLabel;
docEntry->addSpecialListItem(listName,itemId);
QCString cmdString;
- cmdString.sprintf("\\xrefitem %s %d.",listName,itemId);
+ cmdString.sprintf(" \\xrefitem %s %d.",listName,itemId);
if (inBody)
{
docEntry->inbodyDocs += cmdString;
@@ -989,6 +989,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
%x CiteLabel
%x CopyDoc
%x GuardExpr
+%x CdataSection
%%
@@ -1046,10 +1047,13 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
addOutput(yytext);
}
<Comment>"</summary>" { // start of a .NET XML style detailed description
+ setOutput(OutputBrief);
addOutput(yytext);
setOutput(OutputDoc);
}
<Comment>"</remarks>" { // end of a brief or detailed description
+
+ setOutput(OutputDoc);
addOutput(yytext);
}
<Comment>"<"{CAPTION}{ATTR}">" {
@@ -1078,24 +1082,42 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
insidePre=FALSE;
addOutput(yytext);
}
-<Comment>{RCSTAG} { // RCS tag which end a brief description
- setOutput(OutputDoc);
- REJECT;
- }
-<Comment>"<!--" {
- BEGIN(HtmlComment);
- }
+<Comment>{RCSTAG} { // RCS tag which end a brief description
+ setOutput(OutputDoc);
+ REJECT;
+ }
+<Comment>"<!--" {
+ BEGIN(HtmlComment);
+ }
+<Comment>"<!\[CDATA\[" {
+ BEGIN(CdataSection);
+ }
<Comment>{B}*{CMD}"endinternal"{B}* {
- addOutput("\\endinternal ");
+ addOutput(" \\endinternal ");
if (!inInternalDocs)
warn(yyFileName,yyLineNr,
"found \\endinternal without matching \\internal"
);
inInternalDocs = FALSE;
}
+<Comment>{B}*{CMD}[a-z_A-Z]+"{"[a-zA-Z_,:0-9\. ]*"}"{B}* |
<Comment>{B}*{CMD}[a-z_A-Z]+{B}* { // potentially interesting command
// the {B}* in the front was added for bug620924
- QCString cmdName = QCString(yytext).stripWhiteSpace().data()+1;
+ QCString fullMatch = QCString(yytext);
+ int idx = fullMatch.find('{');
+ int idxEnd = fullMatch.find("}",idx+1);
+ QCString cmdName;
+ QCStringList optList;
+ if (idx == -1) // no options
+ {
+ cmdName = QCString(yytext).stripWhiteSpace().data()+1; // to remove {CMD}
+ }
+ else // options present
+ {
+ cmdName = fullMatch.left(idx).stripWhiteSpace().data()+1; // to remove {CMD}
+ QCString optStr = fullMatch.mid(idx+1,idxEnd-idx-1).stripWhiteSpace();
+ optList = QCStringList::split(',',optStr);
+ }
DocCmdMapper::Cmd *cmdPtr = DocCmdMapper::map(cmdName);
if (cmdPtr) // special action is required
{
@@ -1109,7 +1131,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
setOutput(OutputDoc);
}
//if (i>0) addOutput(QCString(yytext).left(i)); // removed for bug 689341
- if (cmdPtr->func && cmdPtr->func(cmdName))
+ if (cmdPtr->func && cmdPtr->func(cmdName, optList))
{
// implicit split of the comment block into two
// entries. Restart the next block at the start
@@ -1315,6 +1337,24 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
<HtmlComment>. { // ignore every else
}
+<CdataSection>"\]\]>" {
+ BEGIN( Comment );
+ }
+<CdataSection>{DOCNL} {
+ addOutput('\n');
+ if (*yytext=='\n') yyLineNr++;
+ }
+<CdataSection>[<>&] { // the special XML characters for iwhich the CDATA section is especially used
+ addOutput('\\');
+ addOutput(*yytext);
+ }
+<CdataSection>[^\\\n\]<>&]+ {
+ addOutput(yytext);
+ }
+<CdataSection>. {
+ addOutput(*yytext);
+ }
+
/* -------------- Rules for handling formulas ---------------- */
<ReadFormulaShort>{CMD}"f$" { // end of inline formula
@@ -1341,7 +1381,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
formulaText+=*yytext;
yyLineNr++;
}
-<ReadFormulaLong,ReadFormulaShort>. { // any othe character
+<ReadFormulaLong,ReadFormulaShort>. { // any other character
formulaText+=*yytext;
}
@@ -1704,7 +1744,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
/* ----- handle arguments of the section/subsection/.. commands ------- */
-<SectionLabel>{LABELID} { // first argyment
+<SectionLabel>{LABELID} { // first argument
g_sectionLabel=yytext;
addOutput(yytext);
g_sectionTitle.resize(0);
@@ -2038,7 +2078,6 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
}
}
<SkipInternal>[@\\]"endinternal"[ \t]* {
- addOutput("\\endinternal ");
BEGIN(Comment);
}
<SkipInternal>[^ \\@\n]+ { // skip non-special characters
@@ -2209,7 +2248,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
/* ----- handle arguments of the cite command ------- */
-<CiteLabel>{CITEID} { // found argyment
+<CiteLabel>{CITEID} { // found argument
addCite();
addOutput(yytext);
BEGIN(Comment);
@@ -2255,14 +2294,14 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
//----------------------------------------------------------------------------
-static bool handleBrief(const QCString &)
+static bool handleBrief(const QCString &, const QCStringList &)
{
//printf("handleBrief\n");
setOutput(OutputBrief);
return FALSE;
}
-static bool handleFn(const QCString &)
+static bool handleFn(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::MEMBERDOC_SEC);
functionProto.resize(0);
@@ -2271,7 +2310,7 @@ static bool handleFn(const QCString &)
return stop;
}
-static bool handleDef(const QCString &)
+static bool handleDef(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::DEFINEDOC_SEC);
functionProto.resize(0);
@@ -2279,21 +2318,21 @@ static bool handleDef(const QCString &)
return stop;
}
-static bool handleOverload(const QCString &)
+static bool handleOverload(const QCString &, const QCStringList &)
{
functionProto.resize(0);
BEGIN(OverloadParam);
return FALSE;
}
-static bool handleEnum(const QCString &)
+static bool handleEnum(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::ENUMDOC_SEC);
BEGIN(EnumDocArg1);
return stop;
}
-static bool handleDefGroup(const QCString &)
+static bool handleDefGroup(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::GROUPDOC_SEC);
current->groupDocType = Entry::GROUPDOC_NORMAL;
@@ -2301,7 +2340,7 @@ static bool handleDefGroup(const QCString &)
return stop;
}
-static bool handleAddToGroup(const QCString &)
+static bool handleAddToGroup(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::GROUPDOC_SEC);
current->groupDocType = Entry::GROUPDOC_ADD;
@@ -2309,7 +2348,7 @@ static bool handleAddToGroup(const QCString &)
return stop;
}
-static bool handleWeakGroup(const QCString &)
+static bool handleWeakGroup(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::GROUPDOC_SEC);
current->groupDocType = Entry::GROUPDOC_WEAK;
@@ -2317,83 +2356,83 @@ static bool handleWeakGroup(const QCString &)
return stop;
}
-static bool handleNamespace(const QCString &)
+static bool handleNamespace(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::NAMESPACEDOC_SEC);
BEGIN( NameSpaceDocArg1 );
return stop;
}
-static bool handlePackage(const QCString &)
+static bool handlePackage(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::PACKAGEDOC_SEC);
BEGIN( PackageDocArg1 );
return stop;
}
-static bool handleClass(const QCString &)
+static bool handleClass(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::CLASSDOC_SEC);
BEGIN( ClassDocArg1 );
return stop;
}
-static bool handleHeaderFile(const QCString &)
+static bool handleHeaderFile(const QCString &, const QCStringList &)
{
BEGIN( ClassDocArg2 );
return FALSE;
}
-static bool handleProtocol(const QCString &)
+static bool handleProtocol(const QCString &, const QCStringList &)
{ // Obj-C protocol
bool stop=makeStructuralIndicator(Entry::PROTOCOLDOC_SEC);
BEGIN( ClassDocArg1 );
return stop;
}
-static bool handleCategory(const QCString &)
+static bool handleCategory(const QCString &, const QCStringList &)
{ // Obj-C category
bool stop=makeStructuralIndicator(Entry::CATEGORYDOC_SEC);
BEGIN( CategoryDocArg1 );
return stop;
}
-static bool handleUnion(const QCString &)
+static bool handleUnion(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::UNIONDOC_SEC);
BEGIN( ClassDocArg1 );
return stop;
}
-static bool handleStruct(const QCString &)
+static bool handleStruct(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::STRUCTDOC_SEC);
BEGIN( ClassDocArg1 );
return stop;
}
-static bool handleInterface(const QCString &)
+static bool handleInterface(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::INTERFACEDOC_SEC);
BEGIN( ClassDocArg1 );
return stop;
}
-static bool handleIdlException(const QCString &)
+static bool handleIdlException(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::EXCEPTIONDOC_SEC);
BEGIN( ClassDocArg1 );
return stop;
}
-static bool handlePage(const QCString &)
+static bool handlePage(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::PAGEDOC_SEC);
BEGIN( PageDocArg1 );
return stop;
}
-static bool handleMainpage(const QCString &)
+static bool handleMainpage(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::MAINPAGEDOC_SEC);
if (!stop)
@@ -2404,7 +2443,7 @@ static bool handleMainpage(const QCString &)
return stop;
}
-static bool handleFile(const QCString &)
+static bool handleFile(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::FILEDOC_SEC);
if (!stop)
@@ -2415,7 +2454,7 @@ static bool handleFile(const QCString &)
return stop;
}
-static bool handleParam(const QCString &)
+static bool handleParam(const QCString &, const QCStringList &)
{
// we need process param and retval arguments to escape leading underscores in case of
// markdown processing, see bug775493
@@ -2424,14 +2463,14 @@ static bool handleParam(const QCString &)
return FALSE;
}
-static bool handleRetval(const QCString &)
+static bool handleRetval(const QCString &, const QCStringList &)
{
addOutput("@retval ");
BEGIN( ParamArg1 );
return FALSE;
}
-static bool handleDir(const QCString &)
+static bool handleDir(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::DIRDOC_SEC);
if (!stop) current->name = yyFileName;
@@ -2439,15 +2478,30 @@ static bool handleDir(const QCString &)
return stop;
}
-static bool handleExample(const QCString &)
+static bool handleExample(const QCString &cmd, const QCStringList &optList)
{
- bool stop=makeStructuralIndicator(Entry::EXAMPLE_SEC);
+ Entry::Sections section=Entry::EXAMPLE_SEC;
+ QCStringList::ConstIterator it;
+ for ( it = optList.begin(); it != optList.end(); ++it )
+ {
+ QCString opt = (*it).stripWhiteSpace().lower();
+ if (opt=="lineno")
+ {
+ section=Entry::EXAMPLE_LINENO_SEC;
+ }
+ else
+ {
+ warn(yyFileName,yyLineNr,
+ "unsupported option '%s' for command '\\%s'",qPrint(opt),qPrint(cmd));
+ }
+ }
+ bool stop=makeStructuralIndicator(section);
if (!stop) current->name = yyFileName;
BEGIN( FileDocArg1 );
return stop;
}
-static bool handleDetails(const QCString &)
+static bool handleDetails(const QCString &, const QCStringList &)
{
if (inContext!=OutputBrief)
{
@@ -2458,7 +2512,7 @@ static bool handleDetails(const QCString &)
return FALSE;
}
-static bool handleName(const QCString &)
+static bool handleName(const QCString &, const QCStringList &)
{
bool stop=makeStructuralIndicator(Entry::MEMBERGRP_SEC);
if (!stop)
@@ -2473,7 +2527,7 @@ static bool handleName(const QCString &)
return stop;
}
-static bool handleTodo(const QCString &)
+static bool handleTodo(const QCString &, const QCStringList &)
{
newXRefKind = XRef_Todo;
setOutput(OutputXRef);
@@ -2481,7 +2535,7 @@ static bool handleTodo(const QCString &)
return FALSE;
}
-static bool handleTest(const QCString &)
+static bool handleTest(const QCString &, const QCStringList &)
{
newXRefKind = XRef_Test;
setOutput(OutputXRef);
@@ -2489,7 +2543,7 @@ static bool handleTest(const QCString &)
return FALSE;
}
-static bool handleBug(const QCString &)
+static bool handleBug(const QCString &, const QCStringList &)
{
newXRefKind = XRef_Bug;
setOutput(OutputXRef);
@@ -2497,7 +2551,7 @@ static bool handleBug(const QCString &)
return FALSE;
}
-static bool handleDeprecated(const QCString &)
+static bool handleDeprecated(const QCString &, const QCStringList &)
{
newXRefKind = XRef_Deprecated;
setOutput(OutputXRef);
@@ -2505,14 +2559,14 @@ static bool handleDeprecated(const QCString &)
return FALSE;
}
-static bool handleXRefItem(const QCString &)
+static bool handleXRefItem(const QCString &, const QCStringList &)
{
newXRefKind = XRef_Item;
BEGIN(XRefItemParam1);
return FALSE;
}
-static bool handleParBlock(const QCString &)
+static bool handleParBlock(const QCString &, const QCStringList &)
{
if (g_insideParBlock)
{
@@ -2529,7 +2583,7 @@ static bool handleParBlock(const QCString &)
return FALSE;
}
-static bool handleEndParBlock(const QCString &)
+static bool handleEndParBlock(const QCString &, const QCStringList &)
{
if (!g_insideParBlock)
{
@@ -2542,34 +2596,50 @@ static bool handleEndParBlock(const QCString &)
return FALSE;
}
-static bool handleRelated(const QCString &)
+static bool handleRelated(const QCString &, const QCStringList &)
{
+ if (!current->relates.isEmpty())
+ {
+ warn(yyFileName,yyLineNr,
+ "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
+ }
+ current->relatesType = Simple;
BEGIN(RelatesParam1);
return FALSE;
}
-static bool handleRelatedAlso(const QCString &)
+static bool handleRelatedAlso(const QCString &, const QCStringList &)
{
+ if (!current->relates.isEmpty())
+ {
+ warn(yyFileName,yyLineNr,
+ "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
+ }
current->relatesType = Duplicate;
BEGIN(RelatesParam1);
return FALSE;
}
-static bool handleMemberOf(const QCString &)
+static bool handleMemberOf(const QCString &, const QCStringList &)
{
+ if (!current->relates.isEmpty())
+ {
+ warn(yyFileName,yyLineNr,
+ "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
+ }
current->relatesType = MemberOf;
BEGIN(RelatesParam1);
return FALSE;
}
-static bool handleRefItem(const QCString &)
+static bool handleRefItem(const QCString &, const QCStringList &)
{
addOutput("@refitem ");
BEGIN(LineParam);
return FALSE;
}
-static bool handleSection(const QCString &s)
+static bool handleSection(const QCString &s, const QCStringList &)
{
setOutput(OutputDoc);
addOutput("@"+s+" ");
@@ -2581,7 +2651,7 @@ static bool handleSection(const QCString &s)
return FALSE;
}
-static bool handleSubpage(const QCString &s)
+static bool handleSubpage(const QCString &s, const QCStringList &)
{
if (current->section!=Entry::EMPTY_SEC &&
current->section!=Entry::PAGEDOC_SEC &&
@@ -2601,14 +2671,14 @@ static bool handleSubpage(const QCString &s)
return FALSE;
}
-static bool handleAnchor(const QCString &s)
+static bool handleAnchor(const QCString &s, const QCStringList &)
{
addOutput("@"+s+" ");
BEGIN(AnchorLabel);
return FALSE;
}
-static bool handleCite(const QCString &s)
+static bool handleCite(const QCString &s, const QCStringList &)
{
if (!g_spaceBeforeCmd.isEmpty())
{
@@ -2620,24 +2690,31 @@ static bool handleCite(const QCString &s)
return FALSE;
}
-static bool handleFormatBlock(const QCString &s)
+static bool handleFormatBlock(const QCString &s, const QCStringList &optList)
{
- addOutput("@"+s+" ");
- //printf("handleFormatBlock(%s)\n",s.data());
+ if (optList.isEmpty())
+ {
+ addOutput("@"+s+" ");
+ }
+ else
+ {
+ addOutput("@"+s+"{"+optList.join(",")+"} ");
+ }
+ //printf("handleFormatBlock(%s) with option(%s)\n",s.data(),opt.data());
blockName=s;
g_commentCount=0;
BEGIN(FormatBlock);
return FALSE;
}
-static bool handleAddIndex(const QCString &)
+static bool handleAddIndex(const QCString &, const QCStringList &)
{
addOutput("@addindex ");
BEGIN(LineParam);
return FALSE;
}
-static bool handleIf(const QCString &)
+static bool handleIf(const QCString &, const QCStringList &)
{
enabledSectionFound=FALSE;
guardType = Guard_If;
@@ -2646,7 +2723,7 @@ static bool handleIf(const QCString &)
return FALSE;
}
-static bool handleIfNot(const QCString &)
+static bool handleIfNot(const QCString &, const QCStringList &)
{
enabledSectionFound=FALSE;
guardType = Guard_IfNot;
@@ -2655,7 +2732,7 @@ static bool handleIfNot(const QCString &)
return FALSE;
}
-static bool handleElseIf(const QCString &)
+static bool handleElseIf(const QCString &, const QCStringList &)
{
if (guards.isEmpty())
{
@@ -2670,7 +2747,7 @@ static bool handleElseIf(const QCString &)
return FALSE;
}
-static bool handleElse(const QCString &)
+static bool handleElse(const QCString &, const QCStringList &)
{
if (guards.isEmpty())
{
@@ -2684,7 +2761,7 @@ static bool handleElse(const QCString &)
return FALSE;
}
-static bool handleEndIf(const QCString &)
+static bool handleEndIf(const QCString &, const QCStringList &)
{
if (guards.isEmpty())
{
@@ -2705,56 +2782,56 @@ static bool handleEndIf(const QCString &)
return FALSE;
}
-static bool handleIngroup(const QCString &)
+static bool handleIngroup(const QCString &, const QCStringList &)
{
inGroupParamFound=FALSE;
BEGIN( InGroupParam );
return FALSE;
}
-static bool handleNoSubGrouping(const QCString &)
+static bool handleNoSubGrouping(const QCString &, const QCStringList &)
{
current->subGrouping = FALSE;
return FALSE;
}
-static bool handleShowInitializer(const QCString &)
+static bool handleShowInitializer(const QCString &, const QCStringList &)
{
current->initLines = 100000; // ON
return FALSE;
}
-static bool handleHideInitializer(const QCString &)
+static bool handleHideInitializer(const QCString &, const QCStringList &)
{
current->initLines = 0; // OFF
return FALSE;
}
-static bool handleCallgraph(const QCString &)
+static bool handleCallgraph(const QCString &, const QCStringList &)
{
current->callGraph = TRUE; // ON
return FALSE;
}
-static bool handleHideCallgraph(const QCString &)
+static bool handleHideCallgraph(const QCString &, const QCStringList &)
{
current->callGraph = FALSE; // OFF
return FALSE;
}
-static bool handleCallergraph(const QCString &)
+static bool handleCallergraph(const QCString &, const QCStringList &)
{
current->callerGraph = TRUE; // ON
return FALSE;
}
-static bool handleHideCallergraph(const QCString &)
+static bool handleHideCallergraph(const QCString &, const QCStringList &)
{
current->callerGraph = FALSE; // OFF
return FALSE;
}
-static bool handleInternal(const QCString &)
+static bool handleInternal(const QCString &, const QCStringList &)
{
if (!Config_getBool(INTERNAL_DOCS))
{
@@ -2770,91 +2847,135 @@ static bool handleInternal(const QCString &)
else
{
// re-enabled for bug640828
- addOutput("\\internal ");
+ addOutput(" \\internal ");
inInternalDocs = TRUE;
}
return FALSE;
}
-static bool handleLineBr(const QCString &)
+static bool handleLineBr(const QCString &, const QCStringList &)
{
addOutput('\n');
return FALSE;
}
-static bool handleStatic(const QCString &)
+static bool handleStatic(const QCString &, const QCStringList &)
{
endBrief();
current->stat = TRUE;
return FALSE;
}
-static bool handlePure(const QCString &)
+static bool handlePure(const QCString &, const QCStringList &)
{
endBrief();
current->virt = Pure;
return FALSE;
}
-static bool handlePrivate(const QCString &)
+static bool handlePrivate(const QCString &, const QCStringList &)
{
current->protection = Private;
return FALSE;
}
-static bool handlePrivateSection(const QCString &)
+static bool handlePrivateSection(const QCString &, const QCStringList &)
{
current->protection = protection = Private;
return FALSE;
}
-static bool handleProtected(const QCString &)
+static bool handleProtected(const QCString &, const QCStringList &)
{
current->protection = Protected;
return FALSE;
}
-static bool handleProtectedSection(const QCString &)
+static bool handleProtectedSection(const QCString &, const QCStringList &)
{
current->protection = protection = Protected ;
return FALSE;
}
-static bool handlePublic(const QCString &)
+static bool handlePublic(const QCString &, const QCStringList &)
{
current->protection = Public;
return FALSE;
}
-static bool handlePublicSection(const QCString &)
+static bool handlePublicSection(const QCString &, const QCStringList &)
{
current->protection = protection = Public;
return FALSE;
}
-static bool handleToc(const QCString &)
+static bool handleToc(const QCString &, const QCStringList &optList)
{
if (current->section==Entry::PAGEDOC_SEC ||
current->section==Entry::MAINPAGEDOC_SEC)
{
- current->stat=TRUE; // we 'abuse' stat to pass whether or the TOC is enabled
+ QCStringList::ConstIterator it;
+ for ( it = optList.begin(); it != optList.end(); ++it )
+ {
+ QCString opt = (*it).stripWhiteSpace().lower();
+ char dum;
+ int level = 5;
+ int i = opt.find(':');
+ if (i>0) // found ':' but not on position 0 what would mean just a level
+ {
+ if (sscanf(opt.right(opt.length() - i - 1).data(),"%d%c",&level,&dum) != 1)
+ {
+ warn(yyFileName,yyLineNr,"Unknown option:level specified with \\tableofcontents: `%s'", (*it).stripWhiteSpace().data());
+ opt = "";
+ }
+ else
+ {
+ level = (level > 5 ? 5 : level);
+ level = (level <= 0 ? 5 : level);
+ opt = opt.left(i).stripWhiteSpace();
+ }
+ }
+ if (!opt.isEmpty())
+ {
+ if (opt == "html")
+ {
+ current->localToc.enableHtml(level);
+ }
+ else if (opt == "latex")
+ {
+ current->localToc.enableLatex(level);
+ }
+ else if (opt == "xml")
+ {
+ current->localToc.enableXml(level);
+ }
+ else
+ {
+ warn(yyFileName,yyLineNr,"Unknown option specified with \\tableofcontents: `%s'", (*it).stripWhiteSpace().data());
+ }
+ }
+ }
+ if (current->localToc.nothingEnabled())
+ {
+ current->localToc.enableHtml(5); // for backward compatibility
+ }
}
return FALSE;
}
-static bool handleInherit(const QCString &)
+static bool handleInherit(const QCString &, const QCStringList &)
{
BEGIN(InheritParam);
return FALSE;
}
-static bool handleExtends(const QCString &)
+static bool handleExtends(const QCString &, const QCStringList &)
{
BEGIN(ExtendsParam);
return FALSE;
}
-static bool handleCopyBrief(const QCString &)
+static bool handleCopyBrief(const QCString &, const QCStringList &)
{
if (current->brief.isEmpty() && current->doc.isEmpty())
{ // if we don't have a brief or detailed description yet,
@@ -2871,7 +2992,7 @@ static bool handleCopyBrief(const QCString &)
return FALSE;
}
-static bool handleCopyDetails(const QCString &)
+static bool handleCopyDetails(const QCString &, const QCStringList &)
{
setOutput(OutputDoc);
if (!g_spaceBeforeCmd.isEmpty())
@@ -2883,7 +3004,7 @@ static bool handleCopyDetails(const QCString &)
return FALSE;
}
-static bool handleCopyDoc(const QCString &)
+static bool handleCopyDoc(const QCString &, const QCStringList &)
{
setOutput(OutputBrief);
if (!g_spaceBeforeCmd.isEmpty())
diff --git a/src/condparser.cpp b/src/condparser.cpp
index ab33ae3..74e26bc 100644
--- a/src/condparser.cpp
+++ b/src/condparser.cpp
@@ -100,9 +100,10 @@ static bool isAlpha(const char c)
return (c>='A' && c<='Z') || (c>='a' && c<='z') || c=='_';
}
-static bool isAlphaNum(const char c)
+static bool isAlphaNumSpec(const char c)
{
- return isAlpha(c) || (c>='0' && c<='9');
+ return isAlpha(c) || (c>='0' && c<='9') || c=='-' || c=='.' ||
+ (((unsigned char)c)>=0x80 && ((unsigned char)c)<=0xFF);
}
/**
@@ -170,7 +171,7 @@ void CondParser::getToken()
if (isAlpha(*m_e))
{
m_tokenType = VARIABLE;
- while (isAlphaNum(*m_e))
+ while (isAlphaNumSpec(*m_e))
{
m_token += *m_e++;
}
diff --git a/src/config.xml b/src/config.xml
index 7896078..2e0f430 100644
--- a/src/config.xml
+++ b/src/config.xml
@@ -605,11 +605,11 @@ Go to the <a href="commands.html">next</a> section or return to the
With this tag you can assign which parser to use for a given extension.
Doxygen has a built-in mapping, but you can override or extend it using this tag.
The format is <code>ext=language</code>, where \c ext is a file extension, and language is one of
- the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
- Objective-C, Python, Fortran (fixed format Fortran: FortranFixed,
+ the parsers supported by doxygen: IDL, Java, Javascript, Csharp (C#), C, C++, D, PHP,
+ md (Markdown), Objective-C, Python, Fortran (fixed format Fortran: FortranFixed,
free formatted Fortran: FortranFree, unknown formatted Fortran: Fortran. In
the later case the parser tries to guess whether the code is fixed or free
- formatted code, this is the default for Fortran type files), VHDL.
+ formatted code, this is the default for Fortran type files), VHDL, tcl.
For instance to make doxygen treat
<code>.inc</code> files as Fortran files (default is PHP), and <code>.f</code> files as C (default is Fortran),
@@ -1138,6 +1138,8 @@ Go to the <a href="commands.html">next</a> section or return to the
</docs>
<docs doxywizard='0' doxyfile='0'>
<![CDATA[
+<br>
+<br>
Example of using a shell script as a filter for Unix:
\verbatim
FILE_VERSION_FILTER = "/bin/sh versionfilter.sh"
@@ -1157,7 +1159,7 @@ svn stat -v $1 | sed -n 's/^[ A-Z?\*|!]\{1,15\}/r/;s/ \{1,15\}/\/r/;s/ .*//p'
<br>
Example filter for ClearCase:
\verbatim
-FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
+FILE_VERSION_FILTER = "cleartool desc -fmt \%Vn"
\endverbatim
]]>
</docs>
@@ -1244,6 +1246,8 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
or return value. If set to \c NO, doxygen will only warn about
wrong or incomplete parameter documentation, but not about the absence of
documentation.
+ If \ref cfg_extract_all "EXTRACT_ALL" is set to \c YES then this flag will
+ automatically be disabled.
]]>
</docs>
</option>
@@ -2549,6 +2553,20 @@ EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
<![CDATA[
The \c MAKEINDEX_CMD_NAME tag can be used to specify the command name to
generate index for \f$\mbox{\LaTeX}\f$.
+
+ @note This tag is used in the `Makefile` / `make.bat`.
+ \sa \ref cfg_latex_makeindex_cmd "LATEX_MAKEINDEX_CMD" for the part in the generated output file (`.tex`).
+]]>
+ </docs>
+ </option>
+ <option type='string' id='LATEX_MAKEINDEX_CMD' defval='\makeindex' depends='GENERATE_LATEX'>
+ <docs>
+<![CDATA[
+ The \c LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
+ generate index for \f$\mbox{\LaTeX}\f$.
+
+ @note This tag is used in the generated output file (`.tex`).
+ \sa \ref cfg_makeindex_cmd_name "MAKEINDEX_CMD_NAME" for the part in the `Makefile` / `make.bat`.
]]>
</docs>
</option>
diff --git a/src/configgen.py b/src/configgen.py
index 33857b7..ca2a5d1 100755
--- a/src/configgen.py
+++ b/src/configgen.py
@@ -272,7 +272,7 @@ def parseOption(node):
print(" \"%s\"" % (line))
print(" );")
if defval != '':
- print(" cs->setDefaultValue(\"%s\");" % (defval))
+ print(" cs->setDefaultValue(\"%s\");" % (defval.replace('\\','\\\\')))
if format == 'file':
print(" cs->setWidgetType(ConfigString::File);")
elif format == 'image':
@@ -529,7 +529,7 @@ def parseOptionDoc(node, first):
if defval != '':
print("")
print("The default value is: <code>%s</code>." % (
- defval))
+ defval.replace('\\','\\\\')))
print("")
# depends handling
if (node.hasAttribute('depends')):
diff --git a/src/definition.cpp b/src/definition.cpp
index 92baf0c..cbfad94 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -41,6 +41,7 @@
#include "namespacedef.h"
#include "filedef.h"
#include "dirdef.h"
+#include "pagedef.h"
#define START_MARKER 0x4445465B // DEF[
#define END_MARKER 0x4445465D // DEF]
@@ -1613,72 +1614,92 @@ void Definition::writeNavigationPath(OutputList &ol) const
}
// TODO: move to htmlgen
-void Definition::writeToc(OutputList &ol)
+void Definition::writeToc(OutputList &ol, const LocalToc &localToc)
{
SectionDict *sectionDict = m_impl->sectionDict;
if (sectionDict==0) return;
- ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
- ol.writeString("<div class=\"toc\">");
- ol.writeString("<h3>");
- ol.writeString(theTranslator->trRTFTableOfContents());
- ol.writeString("</h3>\n");
- ol.writeString("<ul>");
- SDict<SectionInfo>::Iterator li(*sectionDict);
- SectionInfo *si;
- int level=1,l;
- char cs[2];
- cs[1]='\0';
- bool inLi[5]={ FALSE, FALSE, FALSE, FALSE };
- for (li.toFirst();(si=li.current());++li)
- {
- if (si->type==SectionInfo::Section ||
- si->type==SectionInfo::Subsection ||
- si->type==SectionInfo::Subsubsection ||
- si->type==SectionInfo::Paragraph)
+ if (localToc.isHtmlEnabled())
+ {
+ int maxLevel = localToc.htmlLevel();
+ ol.pushGeneratorState();
+ ol.disableAllBut(OutputGenerator::Html);
+ ol.writeString("<div class=\"toc\">");
+ ol.writeString("<h3>");
+ ol.writeString(theTranslator->trRTFTableOfContents());
+ ol.writeString("</h3>\n");
+ ol.writeString("<ul>");
+ SDict<SectionInfo>::Iterator li(*sectionDict);
+ SectionInfo *si;
+ int level=1,l;
+ char cs[2];
+ cs[1]='\0';
+ bool inLi[5]={ FALSE, FALSE, FALSE, FALSE };
+ for (li.toFirst();(si=li.current());++li)
{
- //printf(" level=%d title=%s\n",level,si->title.data());
- int nextLevel = (int)si->type;
- if (nextLevel>level)
+ if (si->type==SectionInfo::Section ||
+ si->type==SectionInfo::Subsection ||
+ si->type==SectionInfo::Subsubsection ||
+ si->type==SectionInfo::Paragraph)
{
- for (l=level;l<nextLevel;l++)
+ //printf(" level=%d title=%s\n",level,si->title.data());
+ int nextLevel = (int)si->type;
+ if (nextLevel>level)
{
- ol.writeString("<ul>");
+ for (l=level;l<nextLevel;l++)
+ {
+ if (l < maxLevel) ol.writeString("<ul>");
+ }
}
- }
- else if (nextLevel<level)
- {
- for (l=level;l>nextLevel;l--)
+ else if (nextLevel<level)
{
- if (inLi[l]) ol.writeString("</li>\n");
- inLi[l]=FALSE;
- ol.writeString("</ul>\n");
+ for (l=level;l>nextLevel;l--)
+ {
+ if (l <= maxLevel && inLi[l]) ol.writeString("</li>\n");
+ inLi[l]=FALSE;
+ if (l <= maxLevel) ol.writeString("</ul>\n");
+ }
}
+ cs[0]='0'+nextLevel;
+ if (nextLevel <= maxLevel && inLi[nextLevel]) ol.writeString("</li>\n");
+ QCString titleDoc = convertToHtml(si->title);
+ if (nextLevel <= maxLevel) ol.writeString("<li class=\"level"+QCString(cs)+"\"><a href=\"#"+si->label+"\">"+(si->title.isEmpty()?si->label:titleDoc)+"</a>");
+ inLi[nextLevel]=TRUE;
+ level = nextLevel;
}
- cs[0]='0'+nextLevel;
- if (inLi[nextLevel]) ol.writeString("</li>\n");
- QCString titleDoc = convertToHtml(si->title);
- ol.writeString("<li class=\"level"+QCString(cs)+"\"><a href=\"#"+si->label+"\">"+(si->title.isEmpty()?si->label:titleDoc)+"</a>");
- inLi[nextLevel]=TRUE;
- level = nextLevel;
}
- }
- while (level>1)
- {
- if (inLi[level]) ol.writeString("</li>\n");
+ while (level>1 && level <= maxLevel)
+ {
+ if (inLi[level]) ol.writeString("</li>\n");
+ inLi[level]=FALSE;
+ ol.writeString("</ul>\n");
+ level--;
+ }
+ if (level <= maxLevel && inLi[level]) ol.writeString("</li>\n");
inLi[level]=FALSE;
ol.writeString("</ul>\n");
- level--;
+ ol.writeString("</div>\n");
+ ol.popGeneratorState();
+ }
+
+ if (localToc.isLatexEnabled())
+ {
+ ol.pushGeneratorState();
+ ol.disableAllBut(OutputGenerator::Latex);
+ int maxLevel = localToc.latexLevel();
+
+ ol.writeString("\\etocsetnexttocdepth{"+QCString().setNum(maxLevel)+"}\n");
+
+ ol.writeString("\\localtableofcontents\n");
+ ol.popGeneratorState();
}
- if (inLi[level]) ol.writeString("</li>\n");
- inLi[level]=FALSE;
- ol.writeString("</ul>\n");
- ol.writeString("</div>\n");
- ol.popGeneratorState();
}
//----------------------------------------------------------------------------------------
+SectionDict * Definition::getSectionDict(void)
+{
+ return m_impl->sectionDict;
+}
QCString Definition::symbolName() const
{
diff --git a/src/definition.h b/src/definition.h
index d16c6b9..c0428a0 100644
--- a/src/definition.h
+++ b/src/definition.h
@@ -275,6 +275,9 @@ class Definition : public DefinitionIntf
QCString id() const;
+ /** returns the section dictionary, only of importance for pagedef */
+ SectionDict * getSectionDict(void);
+
//-----------------------------------------------------------------------------------
// ---- setters -----
//-----------------------------------------------------------------------------------
@@ -346,7 +349,7 @@ class Definition : public DefinitionIntf
void setLocalName(const QCString name);
void addSectionsToIndex();
- void writeToc(OutputList &ol);
+ void writeToc(OutputList &ol, const LocalToc &lt);
void setCookie(Cookie *cookie) { delete m_cookie; m_cookie = cookie; }
Cookie *cookie() const { return m_cookie; }
diff --git a/src/docparser.cpp b/src/docparser.cpp
index fba02f4..088c0f2 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -26,6 +26,7 @@
#include <qdict.h>
#include <qregexp.h>
#include <ctype.h>
+#include <qcstringlist.h>
#include "doxygen.h"
#include "debug.h"
@@ -146,6 +147,9 @@ struct DocParserContext
static QStack<DocParserContext> g_parserStack;
//---------------------------------------------------------------------------
+static void handleImg(DocNode *parent,QList<DocNode> &children,const HtmlAttribList &tagHtmlAttribs);
+
+//---------------------------------------------------------------------------
static void docParserPushContext(bool saveParamInfo=TRUE)
{
//QCString indent;
@@ -1664,6 +1668,10 @@ reparsetoken:
handleStyleLeave(parent,children,DocStyleChange::Small,tokenName);
}
break;
+ case HTML_IMG:
+ if (!g_token->endTag)
+ handleImg(parent,children,g_token->attribs);
+ break;
default:
return FALSE;
break;
@@ -5218,7 +5226,31 @@ void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t)
{
DBG(("handleInclude(%s)\n",qPrint(cmdName)));
int tok=doctokenizerYYlex();
- if (tok!=TK_WHITESPACE)
+ if (tok==TK_WORD && g_token->name=="{")
+ {
+ doctokenizerYYsetStateOptions();
+ tok=doctokenizerYYlex();
+ doctokenizerYYsetStatePara();
+ QCStringList optList=QCStringList::split(",",g_token->name);
+ if (t==DocInclude::Include && optList.contains("lineno"))
+ {
+ t = DocInclude::IncWithLines;
+ }
+ else if (t==DocInclude::Snippet && optList.contains("lineno"))
+ {
+ t = DocInclude::SnipWithLines;
+ }
+ else if (t==DocInclude::Include && optList.contains("doc"))
+ {
+ t = DocInclude::IncludeDoc;
+ }
+ else if (t==DocInclude::Snippet && optList.contains("doc"))
+ {
+ t = DocInclude::SnippetDoc;
+ }
+ tok=doctokenizerYYlex();
+ }
+ else if (tok!=TK_WHITESPACE)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command",
qPrint(cmdName));
@@ -5656,7 +5688,8 @@ int DocPara::handleCommand(const QCString &cmdName)
defaultHandleTitleAndSize(CMD_STARTUML,dv,dv->children(),width,height);
doctokenizerYYsetStatePlantUML();
retval = doctokenizerYYlex();
- dv->setText(g_token->verb);
+ int line=0;
+ dv->setText(stripLeadingAndTrailingEmptyLines(g_token->verb,line));
dv->setWidth(width);
dv->setHeight(height);
if (jarPath.isEmpty())
diff --git a/src/doctokenizer.h b/src/doctokenizer.h
index eb39906..b3b9fa5 100644
--- a/src/doctokenizer.h
+++ b/src/doctokenizer.h
@@ -163,5 +163,6 @@ void doctokenizerYYendAutoList();
void doctokenizerYYsetStatePlantUML();
void doctokenizerYYsetStateSetScope();
void doctokenizerYYsetStatePlantUMLOpt();
+void doctokenizerYYsetStateOptions();
#endif
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index 64e8d78..f5e074c 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -447,6 +447,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
%x St_Snippet
%x St_SetScope
%x St_SetScopeEnd
+%x St_Options
%x St_Sections
%s St_SecLabel1
@@ -1147,6 +1148,16 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
g_token->chars=yytext;
return TK_WHITESPACE;
}
+<St_Options>{ID} {
+ g_token->name+=yytext;
+ }
+<St_Options>{WS}*","{WS}*
+<St_Options>{WS} { /* option separator */
+ g_token->name+=",";
+ }
+<St_Options>"}" {
+ return TK_WORD;
+ }
<St_File>{FILEMASK} {
g_token->name = yytext;
return TK_WORD;
@@ -1509,6 +1520,12 @@ void doctokenizerYYsetStateSetScope()
BEGIN(St_SetScope);
}
+void doctokenizerYYsetStateOptions()
+{
+ g_token->name="";
+ BEGIN(St_Options);
+}
+
void doctokenizerYYcleanup()
{
yy_delete_buffer( YY_CURRENT_BUFFER );
diff --git a/src/dot.cpp b/src/dot.cpp
index 5adc2ab..7b29569 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -1883,6 +1883,10 @@ void DotNode::writeBox(FTextStream &t,
{
t << ",tooltip=\"" << escapeTooltip(m_tooltip) << "\"";
}
+ else
+ {
+ t << ",tooltip=\" \""; // space in tooltip is required otherwise still something like 'Node0' is used
+ }
t << "];" << endl;
}
@@ -3067,7 +3071,7 @@ DotClassGraph::~DotClassGraph()
QCString computeMd5Signature(DotNode *root,
DotNode::GraphType gt,
GraphOutputFormat format,
- bool lrRank,
+ const QCString &rank, // either "LR", "RL", or ""
bool renderParents,
bool backArrows,
const QCString &title,
@@ -3078,9 +3082,9 @@ QCString computeMd5Signature(DotNode *root,
QGString buf;
FTextStream md5stream(&buf);
writeGraphHeader(md5stream,title);
- if (lrRank)
+ if (!rank.isEmpty())
{
- md5stream << " rankdir=\"LR\";" << endl;
+ md5stream << " rankdir=\"" << rank << "\";" << endl;
}
root->clearWriteFlag();
root->write(md5stream,
@@ -3129,7 +3133,7 @@ static bool updateDotGraph(DotNode *root,
DotNode::GraphType gt,
const QCString &baseName,
GraphOutputFormat format,
- bool lrRank,
+ const QCString &rank,
bool renderParents,
bool backArrows,
const QCString &title=QCString()
@@ -3138,7 +3142,7 @@ static bool updateDotGraph(DotNode *root,
QCString theGraph;
// TODO: write graph to theGraph, then compute md5 checksum
QCString md5 = computeMd5Signature(
- root,gt,format,lrRank,renderParents,
+ root,gt,format,rank,renderParents,
backArrows,title,theGraph);
QFile f(baseName+".dot");
if (f.open(IO_WriteOnly))
@@ -3199,7 +3203,7 @@ QCString DotClassGraph::writeGraph(FTextStream &out,
m_graphType,
absBaseName,
graphFormat,
- m_lrRank,
+ m_lrRank ? "LR" : "",
m_graphType==DotNode::Inheritance,
TRUE,
m_startNode->label()
@@ -3559,7 +3563,7 @@ QCString DotInclDepGraph::writeGraph(FTextStream &out,
DotNode::Dependency,
absBaseName,
graphFormat,
- FALSE, // lrRank
+ "", // lrRank
FALSE, // renderParents
m_inverse, // backArrows
m_startNode->label()
@@ -3872,11 +3876,12 @@ QCString DotCallGraph::writeGraph(FTextStream &out, GraphOutputFormat graphForma
QCString absImgName = absBaseName+"."+imgExt;
bool regenerate = FALSE;
+
if (updateDotGraph(m_startNode,
DotNode::CallGraph,
absBaseName,
graphFormat,
- TRUE, // lrRank
+ m_inverse ? "RL" : "LR", // lrRank
FALSE, // renderParents
m_inverse, // backArrows
m_startNode->label()
diff --git a/src/dot.h b/src/dot.h
index ab6a316..3a70d8b 100644
--- a/src/dot.h
+++ b/src/dot.h
@@ -133,8 +133,9 @@ class DotNode
friend QCString computeMd5Signature(
DotNode *root, GraphType gt,
- GraphOutputFormat f,
- bool lrRank, bool renderParents,
+ GraphOutputFormat f,
+ const QCString &rank,
+ bool renderParents,
bool backArrows,
const QCString &title,
QCString &graphStr
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 7ad8c52..bf93a9b 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -13,6 +13,10 @@
*
*/
+#if !defined(_WIN32) || defined(__CYGWIN__)
+#define _DEFAULT_SOURCE 1
+#endif
+
#include <locale.h>
#include <qfileinfo.h>
@@ -605,7 +609,7 @@ static void addRelatedPage(EntryNav *rootNav)
{
pd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
pd->addSectionsToDefinition(root->anchors);
- pd->setShowToc(root->stat);
+ pd->setLocalToc(root->localToc);
addPageToContext(pd,rootNav);
}
}
@@ -8712,7 +8716,7 @@ static void findMainPage(EntryNav *rootNav)
//setFileNameForSections(root->anchors,"index",Doxygen::mainPage);
Doxygen::mainPage->setBriefDescription(root->brief,root->briefFile,root->briefLine);
Doxygen::mainPage->setFileName(indexName);
- Doxygen::mainPage->setShowToc(root->stat);
+ Doxygen::mainPage->setLocalToc(root->localToc);
addPageToContext(Doxygen::mainPage,rootNav);
SectionInfo *si = Doxygen::sectionDict->find(Doxygen::mainPage->name());
@@ -8922,7 +8926,7 @@ static void generatePageDocs()
static void buildExampleList(EntryNav *rootNav)
{
- if (rootNav->section()==Entry::EXAMPLE_SEC && !rootNav->name().isEmpty())
+ if ((rootNav->section()==Entry::EXAMPLE_SEC || rootNav->section()==Entry::EXAMPLE_LINENO_SEC) && !rootNav->name().isEmpty())
{
rootNav->loadEntry(g_storage);
Entry *root = rootNav->entry();
@@ -8943,7 +8947,7 @@ static void buildExampleList(EntryNav *rootNav)
pd->setFileName(convertNameToFile(pd->name()+"-example",FALSE,TRUE));
pd->addSectionsToDefinition(root->anchors);
pd->setLanguage(root->lang);
- //pi->addSections(root->anchors);
+ pd->setShowLineNo(rootNav->section()==Entry::EXAMPLE_LINENO_SEC);
Doxygen::exampleSDict->inSort(root->name,pd);
//we don't add example to groups
@@ -8992,11 +8996,16 @@ static void generateExampleDocs()
g_outputList->docify(pd->name());
endTitle(*g_outputList,n,0);
g_outputList->startContents();
+ QCString lineNoOptStr;
+ if (pd->showLineNo())
+ {
+ lineNoOptStr="{lineno}";
+ }
g_outputList->generateDoc(pd->docFile(), // file
pd->docLine(), // startLine
pd, // context
0, // memberDef
- pd->documentation()+"\n\n\\include "+pd->name(), // docs
+ pd->documentation()+"\n\n\\include"+lineNoOptStr+" "+pd->name(), // docs
TRUE, // index words
TRUE, // is example
pd->name()
@@ -10203,7 +10212,6 @@ void readConfiguration(int argc, char **argv)
bool genConfig=FALSE;
bool shortList=FALSE;
bool updateConfig=FALSE;
- bool genLayout=FALSE;
int retVal;
while (optind<argc && argv[optind][0]=='-' &&
(isalpha(argv[optind][1]) || argv[optind][1]=='?' ||
@@ -10214,17 +10222,14 @@ void readConfiguration(int argc, char **argv)
{
case 'g':
genConfig=TRUE;
- configName=getArg(argc,argv,optind);
- if (optind+1<argc && qstrcmp(argv[optind+1],"-")==0)
- { configName="-"; optind++; }
- if (!configName)
- { configName="Doxyfile"; }
break;
case 'l':
- genLayout=TRUE;
layoutName=getArg(argc,argv,optind);
if (!layoutName)
{ layoutName="DoxygenLayout.xml"; }
+ writeDefaultLayoutFile(layoutName);
+ cleanUpDoxygen();
+ exit(0);
break;
case 'd':
debugLabel=getArg(argc,argv,optind);
@@ -10457,26 +10462,6 @@ void readConfiguration(int argc, char **argv)
Config::init();
- if (genConfig && g_useOutputTemplate)
- {
- generateTemplateFiles("templates");
- cleanUpDoxygen();
- exit(0);
- }
-
- if (genConfig)
- {
- generateConfigFile(configName,shortList);
- cleanUpDoxygen();
- exit(0);
- }
- if (genLayout)
- {
- writeDefaultLayoutFile(layoutName);
- cleanUpDoxygen();
- exit(0);
- }
-
QFileInfo configFileInfo1("Doxyfile"),configFileInfo2("doxyfile");
if (optind>=argc)
{
@@ -10488,6 +10473,10 @@ void readConfiguration(int argc, char **argv)
{
configName="doxyfile";
}
+ else if (genConfig)
+ {
+ configName="Doxyfile";
+ }
else
{
err("Doxyfile not found and no input file specified!\n");
@@ -10498,7 +10487,7 @@ void readConfiguration(int argc, char **argv)
else
{
QFileInfo fi(argv[optind]);
- if (fi.exists() || qstrcmp(argv[optind],"-")==0)
+ if (fi.exists() || qstrcmp(argv[optind],"-")==0 || genConfig)
{
configName=argv[optind];
}
@@ -10509,7 +10498,19 @@ void readConfiguration(int argc, char **argv)
exit(1);
}
}
+ if (genConfig && g_useOutputTemplate)
+ {
+ generateTemplateFiles("templates");
+ cleanUpDoxygen();
+ exit(0);
+ }
+ if (genConfig)
+ {
+ generateConfigFile(configName,shortList);
+ cleanUpDoxygen();
+ exit(0);
+ }
if (!Config::parse(configName,updateConfig))
{
diff --git a/src/entry.cpp b/src/entry.cpp
index 9d15ec8..a0460da 100644
--- a/src/entry.cpp
+++ b/src/entry.cpp
@@ -73,6 +73,7 @@ Entry::Entry(const Entry &e)
spec = e.spec;
initLines = e.initLines;
stat = e.stat;
+ localToc = e.localToc;
explicitExternal = e.explicitExternal;
proto = e.proto;
subGrouping = e.subGrouping;
diff --git a/src/entry.h b/src/entry.h
index f1b81ef..739b128 100644
--- a/src/entry.h
+++ b/src/entry.h
@@ -91,14 +91,14 @@ class Entry
ENUMDOC_SEC = 0x01000000,
ENUM_SEC = 0x02000000,
- EMPTY_SEC = 0x03000000,
- PAGEDOC_SEC = 0x04000000,
+ EMPTY_SEC = 0x03000000,
+ PAGEDOC_SEC = 0x04000000,
VARIABLE_SEC = 0x05000000,
FUNCTION_SEC = 0x06000000,
TYPEDEF_SEC = 0x07000000,
- MEMBERDOC_SEC = 0x08000000,
+ MEMBERDOC_SEC = 0x08000000,
OVERLOADDOC_SEC = 0x09000000,
- EXAMPLE_SEC = 0x0a000000,
+ EXAMPLE_SEC = 0x0a000000,
VARIABLEDOC_SEC = 0x0b000000,
FILEDOC_SEC = 0x0c000000,
DEFINEDOC_SEC = 0x0d000000,
@@ -112,9 +112,10 @@ class Entry
PACKAGE_SEC = 0x15000000,
PACKAGEDOC_SEC = 0x16000000,
OBJCIMPL_SEC = 0x17000000,
- DIRDOC_SEC = 0x18000000
- ,EXPORTED_INTERFACE_SEC = 0x19000000
- ,INCLUDED_SERVICE_SEC = 0x1A000000
+ DIRDOC_SEC = 0x18000000,
+ EXPORTED_INTERFACE_SEC = 0x19000000,
+ INCLUDED_SERVICE_SEC = 0x1A000000,
+ EXAMPLE_LINENO_SEC = 0x1B000000,
};
// class specifiers (add new items to the end)
@@ -288,6 +289,7 @@ class Entry
bool artificial; //!< Artificially introduced item
GroupDocType groupDocType;
QCString id; //!< libclang id
+ LocalToc localToc;
static int num; //!< counts the total number of entries
diff --git a/src/formula.cpp b/src/formula.cpp
index 46e2075..c252e07 100644
--- a/src/formula.cpp
+++ b/src/formula.cpp
@@ -69,8 +69,10 @@ void FormulaList::generateBitmaps(const char *path)
FTextStream t(&f);
if (Config_getBool(LATEX_BATCHMODE)) t << "\\batchmode" << endl;
t << "\\documentclass{article}" << endl;
+ t << "\\usepackage{ifthen}" << endl;
t << "\\usepackage{epsfig}" << endl; // for those who want to include images
writeExtraLatexPackages(t);
+ writeLatexSpecialFormulaChars(t);
t << "\\pagestyle{empty}" << endl;
t << "\\begin{document}" << endl;
int page=0;
diff --git a/src/fortrancode.l b/src/fortrancode.l
index e64c38e..3014dc3 100644
--- a/src/fortrancode.l
+++ b/src/fortrancode.l
@@ -37,7 +37,7 @@
#include <ctype.h>
#include <qregexp.h>
#include <qdir.h>
-#include <qstringlist.h>
+#include <qcstringlist.h>
#include "entry.h"
#include "doxygen.h"
#include "message.h"
@@ -86,7 +86,7 @@ class UseEntry
{
public:
QCString module; // just for debug
- QStringList onlyNames; /* entries of the ONLY-part */
+ QCStringList onlyNames; /* entries of the ONLY-part */
};
/**
@@ -105,7 +105,7 @@ class UseSDict : public SDict<UseEntry>
class Scope
{
public:
- QStringList useNames; //!< contains names of used modules
+ QCStringList useNames; //!< contains names of used modules
QDict<void> localVars; //!< contains names of local variables
Scope() : localVars(7, FALSE /*caseSensitive*/) {}
@@ -122,7 +122,7 @@ static QCString currentClass=0; //!< name of the current enclosing
static UseSDict *useMembers= new UseSDict; //!< info about used modules
static UseEntry *useEntry = 0; //!< current use statement info
static QList<Scope> scopeStack;
-// static QStringList *currentUseNames= new QStringList; //! contains names of used modules of current program unit
+// static QCStringList *currentUseNames= new QCStringList; //! contains names of used modules of current program unit
static QCString str=""; //!> contents of fortran string
static CodeOutputInterface * g_code;
@@ -478,7 +478,7 @@ static bool getFortranDefs(const QCString &memberName, const QCString &moduleNam
if (ue)
{
// check if only-list exists and if current entry exists is this list
- QStringList &only= ue->onlyNames;
+ QCStringList &only= ue->onlyNames;
if (only.isEmpty())
{
//cout << " found in module " << moduleName << " entry " << memberName << endl;
@@ -486,10 +486,10 @@ static bool getFortranDefs(const QCString &memberName, const QCString &moduleNam
}
else
{
- for ( QStringList::Iterator it = only.begin(); it != only.end(); ++it)
+ for ( QCStringList::Iterator it = only.begin(); it != only.end(); ++it)
{
//cout << " search in only: " << moduleName << ":: " << memberName << "==" << (*it)<< endl;
- if (memberName == (*it).utf8())
+ if (memberName == *it)
{
return TRUE; // found in ONLY-part of use list
}
@@ -632,9 +632,9 @@ static void endScope()
Scope *scope = scopeStack.getLast();
scopeStack.removeLast();
- for ( QStringList::Iterator it = scope->useNames.begin(); it != scope->useNames.end(); ++it)
+ for ( QCStringList::Iterator it = scope->useNames.begin(); it != scope->useNames.end(); ++it)
{
- useMembers->remove((*it).utf8());
+ useMembers->remove(*it);
}
delete scope;
}
@@ -1194,9 +1194,6 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
g_insideBody=FALSE;
}
/*------ strings --------------------------------------------------*/
-<*>"\\\\" { str+=yytext; /* ignore \\ */}
-<*>"\\\""|\\\' { str+=yytext; /* ignore \" */}
-
<String>\n { // string with \n inside
g_contLineNr++;
str+=yytext;
diff --git a/src/fortranscanner.l b/src/fortranscanner.l
index d0503c2..884c86e 100644
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -383,14 +383,6 @@ SCOPENAME ({ID}{BS}"::"{BS})*
/*------ ignore strings that are not initialization strings */
-<*>"\\\\" { if (yy_top_state() == Initialization
- || yy_top_state() == ArrayInitializer)
- initializer+=yytext;
- }
-<*>"\\\""|\\\' { if (yy_top_state() == Initialization
- || yy_top_state() == ArrayInitializer)
- initializer+=yytext;
- }
<String>\"|\' { // string ends with next quote without previous backspace
if (yytext[0]!=stringStartSymbol) { yyColNr -= (int)yyleng; REJECT; } // single vs double quote
if (yy_top_state() == Initialization
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index d71c48f..cee39f2 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -304,7 +304,7 @@ void FTVHelp::generateLink(FTextStream &t,FTVNode *n)
}
else
{
- t << ">";
+ t << "\">";
}
t << convertToHtml(n->name);
t << "</a>";
diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp
index 32eaff6..ee23fb8 100644
--- a/src/htmlgen.cpp
+++ b/src/htmlgen.cpp
@@ -1117,7 +1117,8 @@ void HtmlGenerator::startIndexItem(const char *ref,const char *f)
}
t << "href=\"";
t << externalRef(relPath,ref,TRUE);
- if (f) t << f << Doxygen::htmlFileExtension << "\">";
+ if (f) t << f << Doxygen::htmlFileExtension;
+ t << "\">";
}
else
{
@@ -1942,25 +1943,16 @@ void HtmlGenerator::endDescTableData()
t << "</td>";
}
-void HtmlGenerator::startSimpleSect(SectionTypes,
- const char *filename,const char *anchor,
- const char *title)
+void HtmlGenerator::startExamples()
{
- t << "<dl><dt><b>";
- if (filename)
- {
- writeObjectLink(0,filename,anchor,title);
- }
- else
- {
- docify(title);
- }
- t << "</b></dt>";
+ t << "<dl class=\"section examples\"><dt>";
+ docify(theTranslator->trExamples());
+ t << "</dt>";
}
-void HtmlGenerator::endSimpleSect()
+void HtmlGenerator::endExamples()
{
- t << "</dl>";
+ t << "</dl>" << endl;
}
void HtmlGenerator::startParamList(ParamListTypes,
@@ -2717,13 +2709,16 @@ void HtmlGenerator::writeInheritedSectionTitle(
DBG_HTML(t << "<!-- writeInheritedSectionTitle -->" << endl;)
QCString a = anchor;
if (!a.isEmpty()) a.prepend("#");
- QCString classLink = QCString("<a class=\"el\" href=\"");
+ QCString classLink = QCString("<a class=\"el\" ");
if (ref)
{
- classLink+= externalLinkTarget() + externalRef(relPath,ref,TRUE);
+ classLink+= externalLinkTarget();
+ classLink += " href=\"";
+ classLink+= externalRef(relPath,ref,TRUE);
}
else
{
+ classLink += "href=\"";
classLink+=relPath;
}
classLink+=file+Doxygen::htmlFileExtension+a;
diff --git a/src/htmlgen.h b/src/htmlgen.h
index 2d8d6e0..221269f 100644
--- a/src/htmlgen.h
+++ b/src/htmlgen.h
@@ -246,13 +246,10 @@ class HtmlGenerator : public OutputGenerator
void endCenter() { t << "</center>" << endl; }
void startSmall() { t << "<small>" << endl; }
void endSmall() { t << "</small>" << endl; }
- //void startDescList(SectionTypes) { t << "<dl compact><dt><b>" << endl; }
- //void endDescList() { t << "</dl>"; }
- void startSimpleSect(SectionTypes,const char *,const char *,const char *);
- void endSimpleSect();
+ void startExamples();
+ void endExamples();
void startParamList(ParamListTypes,const char *);
void endParamList();
- //void writeDescItem() { t << "<dd>" << endl; }
void startSection(const char *,const char *,SectionInfo::SectionType);
void endSection(const char *,SectionInfo::SectionType);
void addIndexItem(const char *,const char *);
diff --git a/src/index.cpp b/src/index.cpp
index 3706bbf..8e5f266 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -1579,8 +1579,8 @@ static void writeAnnotatedClassList(OutputList &ol)
{
//LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassList);
//bool addToIndex = lne==0 || lne->visible();
+ bool first=TRUE;
- ol.startIndexList();
ClassSDict::Iterator cli(*Doxygen::classSDict);
ClassDef *cd;
@@ -1593,6 +1593,11 @@ static void writeAnnotatedClassList(OutputList &ol)
{
continue;
}
+ if (first)
+ {
+ ol.startIndexList();
+ first=FALSE;
+ }
ol.pushGeneratorState();
if (cd->isEmbeddedInOuterScope())
@@ -1635,7 +1640,7 @@ static void writeAnnotatedClassList(OutputList &ol)
}
ol.popGeneratorState();
}
- ol.endIndexList();
+ if (!first) ol.endIndexList();
}
inline bool isId1(int c)
@@ -3883,9 +3888,9 @@ static void writeIndex(OutputList &ol)
if (Doxygen::mainPage)
{
Doxygen::insideMainPage=TRUE;
- if (Doxygen::mainPage->showToc() && Doxygen::mainPage->hasSections())
+ if (Doxygen::mainPage->localToc().isHtmlEnabled() && Doxygen::mainPage->hasSections())
{
- Doxygen::mainPage->writeToc(ol);
+ Doxygen::mainPage->writeToc(ol,Doxygen::mainPage->localToc());
}
ol.startTextBlock();
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 58c5d52..c35ef11 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -219,7 +219,7 @@ void LatexDocVisitor::visit(DocURL *u)
if (u->isEmail()) m_t << "mailto:";
m_t << u->url() << "}";
}
- m_t << "{\\tt ";
+ m_t << "\\texttt{ ";
filter(u->url());
m_t << "}";
}
@@ -1255,7 +1255,7 @@ void LatexDocVisitor::visitPre(DocHRef *href)
m_t << href->url();
m_t << "}";
}
- m_t << "{\\tt ";
+ m_t << "\\texttt{ ";
}
void LatexDocVisitor::visitPost(DocHRef *)
@@ -1502,7 +1502,7 @@ void LatexDocVisitor::visitPre(DocParamList *pl)
{
if (pl->direction()!=DocParamSect::Unspecified)
{
- m_t << "\\mbox{\\tt ";
+ m_t << "\\mbox{\\texttt{ ";
if (pl->direction()==DocParamSect::In)
{
m_t << "in";
@@ -1515,7 +1515,7 @@ void LatexDocVisitor::visitPre(DocParamList *pl)
{
m_t << "in,out";
}
- m_t << "} ";
+ m_t << "}} ";
}
if (useTable) m_t << " & ";
}
diff --git a/src/latexgen.cpp b/src/latexgen.cpp
index 076b354..204683e 100644
--- a/src/latexgen.cpp
+++ b/src/latexgen.cpp
@@ -182,7 +182,7 @@ void LatexCodeGenerator::writeCodeLink(const char *ref,const char *f,
}
else
{
- m_t << name;
+ codify(name);
}
m_col+=l;
}
@@ -583,7 +583,9 @@ static void writeDefaultHeaderPart1(FTextStream &t)
"\\hbadness=750\n"
"\\setlength{\\emergencystretch}{15pt}\n"
"\\setlength{\\parindent}{0cm}\n"
- "\\setlength{\\parskip}{3ex plus 2ex minus 2ex}\n";
+ "\\newcommand{\\doxynormalparskip}{\\setlength{\\parskip}{3ex plus 2ex minus 2ex}}\n"
+ "\\newcommand{\\doxytocparskip}{\\setlength{\\parskip}{1ex plus 0ex minus 0ex}}\n"
+ "\\doxynormalparskip\n";
// Redefine paragraph/subparagraph environments, using sectsty fonts
t << "\\makeatletter\n"
"\\renewcommand{\\paragraph}{%\n"
@@ -645,33 +647,29 @@ static void writeDefaultHeaderPart1(FTextStream &t)
"\\usepackage{natbib}\n"
"\\usepackage[titles]{tocloft}\n"
"\\setcounter{tocdepth}{3}\n"
- "\\setcounter{secnumdepth}{5}\n"
- "\\makeindex\n"
- "\n";
+ "\\setcounter{secnumdepth}{5}\n";
+
+ QCString latex_mkidx_command = Config_getString(LATEX_MAKEINDEX_CMD);
+ if (!latex_mkidx_command.isEmpty())
+ {
+ if (latex_mkidx_command[0] == '\\')
+ t << latex_mkidx_command << "\n";
+ else
+ t << '\\' << latex_mkidx_command << "\n";
+ }
+ else
+ {
+ t << "\\makeindex\n";
+ }
+ t << "\n";
writeExtraLatexPackages(t);
+ writeLatexSpecialFormulaChars(t);
// Hyperlinks
bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
if (pdfHyperlinks)
{
- unsigned char minus[4]; // Superscript minus
- char *pminus = (char *)minus;
- unsigned char sup2[3]; // Superscript two
- char *psup2 = (char *)sup2;
- unsigned char sup3[3];
- char *psup3 = (char *)sup3; // Superscript three
- minus[0]= 0xE2;
- minus[1]= 0x81;
- minus[2]= 0xBB;
- minus[3]= 0;
- sup2[0]= 0xC2;
- sup2[1]= 0xB2;
- sup2[2]= 0;
- sup3[0]= 0xC2;
- sup3[1]= 0xB3;
- sup3[2]= 0;
-
t << "% Hyperlinks (required, but should be loaded last)\n"
"\\ifpdf\n"
" \\usepackage[pdftex,pagebackref=true]{hyperref}\n"
@@ -682,18 +680,6 @@ static void writeDefaultHeaderPart1(FTextStream &t)
" \\usepackage[ps2pdf,pagebackref=true]{hyperref}\n"
" \\fi\n"
"\\fi\n"
- "\\ifpdf\n"
- " \\DeclareUnicodeCharacter{207B}{${}^{-}$}% Superscript minus\n"
- " \\DeclareUnicodeCharacter{C2B2}{${}^{2}$}% Superscript two\n"
- " \\DeclareUnicodeCharacter{C2B3}{${}^{3}$}% Superscript three\n"
- "\\else\n"
- " \\catcode`\\" << pminus << "=13% Superscript minus\n"
- " \\def" << pminus << "{${}^{-}$}\n"
- " \\catcode`\\" << psup2 << "=13% Superscript two\n"
- " \\def" << psup2 << "{${}^{2}$}\n"
- " \\catcode`\\"<<psup3<<"=13% Superscript three\n"
- " \\def"<<psup3<<"{${}^{3}$}\n"
- "\\fi\n"
"\n"
"\\hypersetup{%\n"
" colorlinks=true,%\n"
@@ -715,6 +701,11 @@ static void writeDefaultHeaderPart1(FTextStream &t)
t << "\\usepackage{caption}\n"
<< "\\captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top}\n\n";
+
+ // in page table of contents
+ t << "\\usepackage{etoc}\n"
+ "\\etocsettocstyle{\\doxytocparskip}{\\doxynormalparskip}\n";
+
// prevent numbers overlap the titles in toc
t << "\\renewcommand{\\numberline}[1]{#1~}\n";
@@ -1378,7 +1369,7 @@ void LatexGenerator::startHtmlLink(const char *url)
t << url;
t << "}";
}
- t << "{\\tt ";
+ t << "\\texttt{ ";
}
void LatexGenerator::endHtmlLink()
@@ -1394,7 +1385,7 @@ void LatexGenerator::endHtmlLink()
// t << url;
// t << "}";
// }
-// t << "{\\tt ";
+// t << "\\texttt{ ";
// docify(url);
// t << "}";
//}
@@ -1402,7 +1393,7 @@ void LatexGenerator::endHtmlLink()
void LatexGenerator::writeStartAnnoItem(const char *,const char *,
const char *path,const char *name)
{
- t << "\\item\\contentsline{section}{\\bf ";
+ t << "\\item\\contentsline{section}\\textbf{ ";
if (path) docify(path);
docify(name);
t << "} ";
@@ -1437,7 +1428,7 @@ void LatexGenerator::endIndexValue(const char *name,bool /*hasBrief*/)
//void LatexGenerator::writeClassLink(const char *,const char *,
// const char *,const char *name)
//{
-// t << "{\\bf ";
+// t << "\\textbf{ ";
// docify(name);
// t << "}";
//}
@@ -2104,22 +2095,14 @@ void LatexGenerator::endDescItem()
}
}
-void LatexGenerator::startSimpleSect(SectionTypes,const char *file,
- const char *anchor,const char *title)
+void LatexGenerator::startExamples()
{
t << "\\begin{Desc}\n\\item[";
- if (file)
- {
- writeObjectLink(0,file,anchor,title);
- }
- else
- {
- docify(title);
- }
+ docify(theTranslator->trExamples());
t << "]";
}
-void LatexGenerator::endSimpleSect()
+void LatexGenerator::endExamples()
{
t << "\\end{Desc}" << endl;
}
@@ -2150,7 +2133,7 @@ void LatexGenerator::endParameterList()
void LatexGenerator::startParameterType(bool first,const char *key)
{
t << "\\item[{";
- if (!first && key) t << key;
+ if (!first && key) docify(key);
}
void LatexGenerator::endParameterType()
@@ -2239,6 +2222,11 @@ void LatexGenerator::startCodeFragment()
void LatexGenerator::endCodeFragment()
{
+ //if (DoxyCodeOpen)
+ //{
+ // t << "}\n";
+ // DoxyCodeOpen = FALSE;
+ //}
t << "\\end{DoxyCode}\n";
DoxyCodeOpen = FALSE;
}
diff --git a/src/latexgen.h b/src/latexgen.h
index 07c4080..1460000 100644
--- a/src/latexgen.h
+++ b/src/latexgen.h
@@ -235,8 +235,8 @@ class LatexGenerator : public OutputGenerator
const char *,const char *,const char *) {}
void startDescList(SectionTypes) { t << "\\begin{Desc}\n\\item["; }
void endDescList() { t << "\\end{Desc}" << endl; }
- void startSimpleSect(SectionTypes,const char *,const char *,const char *);
- void endSimpleSect();
+ void startExamples();
+ void endExamples();
void startParamList(ParamListTypes,const char *title);
void endParamList();
void startDescForItem() { t << "\\par" << endl; }
diff --git a/src/mangen.cpp b/src/mangen.cpp
index d23b2fe..2a10db6 100644
--- a/src/mangen.cpp
+++ b/src/mangen.cpp
@@ -650,8 +650,25 @@ void ManGenerator::endSection(const char *,SectionInfo::SectionType type)
}
}
-void ManGenerator::startSimpleSect(SectionTypes,const char *,
- const char *,const char *title)
+void ManGenerator::startExamples()
+{
+ if (!firstCol)
+ { t << endl << ".PP" << endl;
+ firstCol=TRUE; paragraph=TRUE;
+ col=0;
+ }
+ paragraph=FALSE;
+ startBold();
+ docify(theTranslator->trExamples());
+ endBold();
+ paragraph=TRUE;
+}
+
+void ManGenerator::endExamples()
+{
+}
+
+void ManGenerator::startDescTable(const char *title)
{
if (!firstCol)
{ t << endl << ".PP" << endl;
@@ -663,10 +680,12 @@ void ManGenerator::startSimpleSect(SectionTypes,const char *,
docify(title);
endBold();
paragraph=TRUE;
+ startDescForItem();
}
-void ManGenerator::endSimpleSect()
+void ManGenerator::endDescTable()
{
+ endDescForItem();
}
void ManGenerator::startParamList(ParamListTypes,const char *title)
diff --git a/src/mangen.h b/src/mangen.h
index 0413ffd..e109355 100644
--- a/src/mangen.h
+++ b/src/mangen.h
@@ -169,8 +169,8 @@ class ManGenerator : public OutputGenerator
const char *,const char *,const char *) {}
void startDescList(SectionTypes);
void endDescList() {}
- void startSimpleSect(SectionTypes,const char *,const char *,const char *);
- void endSimpleSect();
+ void startExamples();
+ void endExamples();
void startParamList(ParamListTypes,const char *title);
void endParamList();
//void writeDescItem();
@@ -197,9 +197,8 @@ class ManGenerator : public OutputGenerator
void endContents() {}
void writeNonBreakableSpace(int n) { int i; for (i=0;i<n;i++) t << " "; }
- void startDescTable(const char *t)
- { startSimpleSect(EnumValues,0,0,t); startDescForItem(); }
- void endDescTable() { endDescForItem(); endSimpleSect(); }
+ void startDescTable(const char *t);
+ void endDescTable();
void startDescTableRow() {}
void endDescTableRow() {}
void startDescTableTitle() { startItemListItem(); startBold(); startEmphasis(); endItemListItem(); }
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 0ca95a4..dff64ff 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -1780,22 +1780,20 @@ static int writeTableBlock(GrowBuf &out,const char *data,int size)
QCString cellTag("th"), cellClass("class=\"markdownTableHead");
for (unsigned row = 0; row < tableContents.size(); row++)
{
- out.addStr(" <tr class=\"markdownTable");
if (row)
{
- out.addStr("Body\"");
if (row % 2)
{
- out.addStr(" class=\"markdownTableRowOdd\">\n");
+ out.addStr("<tr class=\"markdownTableRowOdd\">\n");
}
else
{
- out.addStr(" class=\"markdownTableRowEven\">\n");
+ out.addStr("<tr class=\"markdownTableRowEven\">\n");
}
}
else
{
- out.addStr("Head\">\n");
+ out.addStr(" <tr class=\"markdownTableHead\">\n");
}
for (int c = 0; c < columns; c++)
{
diff --git a/src/marshal.cpp b/src/marshal.cpp
index af14978..fa29aed 100644
--- a/src/marshal.cpp
+++ b/src/marshal.cpp
@@ -344,6 +344,14 @@ void marshalMemberLists(StorageIntf *s,SDict<MemberList> *mls)
}
}
+void marshalLocalToc(StorageIntf *s,const LocalToc &lt)
+{
+ marshalInt(s,lt.mask());
+ marshalInt(s,lt.htmlLevel());
+ marshalInt(s,lt.latexLevel());
+ marshalInt(s,lt.xmlLevel());
+}
+
void marshalEntry(StorageIntf *s,Entry *e)
{
marshalUInt(s,HEADER);
@@ -355,6 +363,7 @@ void marshalEntry(StorageIntf *s,Entry *e)
marshalUInt64(s,e->spec);
marshalInt(s,e->initLines);
marshalBool(s,e->stat);
+ marshalLocalToc(s,e->localToc);
marshalBool(s,e->explicitExternal);
marshalBool(s,e->proto);
marshalBool(s,e->subGrouping);
@@ -724,6 +733,28 @@ SDict<MemberList> *unmarshalMemberLists(StorageIntf *s)
return result;
}
+LocalToc unmarshalLocalToc(StorageIntf *s)
+{
+ LocalToc result;
+ int mask = unmarshalInt(s);
+ int htmlLevel = unmarshalInt(s);
+ int latexLevel = unmarshalInt(s);
+ int xmlLevel = unmarshalInt(s);
+ if ((mask & (1<<LocalToc::Html))!=0)
+ {
+ result.enableHtml(htmlLevel);
+ }
+ if ((mask & (1<<LocalToc::Latex))!=0)
+ {
+ result.enableLatex(latexLevel);
+ }
+ if ((mask & (1<<LocalToc::Xml))!=0)
+ {
+ result.enableXml(xmlLevel);
+ }
+ return result;
+}
+
Entry * unmarshalEntry(StorageIntf *s)
{
Entry *e = new Entry;
@@ -737,6 +768,7 @@ Entry * unmarshalEntry(StorageIntf *s)
e->spec = unmarshalUInt64(s);
e->initLines = unmarshalInt(s);
e->stat = unmarshalBool(s);
+ e->localToc = unmarshalLocalToc(s);
e->explicitExternal = unmarshalBool(s);
e->proto = unmarshalBool(s);
e->subGrouping = unmarshalBool(s);
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index 819904f..c9745ac 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -2309,11 +2309,11 @@ void MemberDef::_writeExamples(OutputList &ol)
// write the list of examples that use this member
if (hasExamples())
{
- ol.startSimpleSect(BaseOutputDocInterface::Examples,0,0,theTranslator->trExamples()+": ");
+ ol.startExamples();
ol.startDescForItem();
writeExample(ol,m_impl->exampleSDict);
ol.endDescForItem();
- ol.endSimpleSect();
+ ol.endExamples();
}
}
@@ -2346,8 +2346,6 @@ void MemberDef::_writeEnumValues(OutputList &ol,Definition *container,
{
if (first)
{
- //ol.startSimpleSect(BaseOutputDocInterface::EnumValues,0,0,theTranslator->trEnumerationValues()+": ");
- //ol.startDescForItem();
ol.startDescTable(theTranslator->trEnumerationValues());
}
@@ -2355,28 +2353,17 @@ void MemberDef::_writeEnumValues(OutputList &ol,Definition *container,
ol.addIndexItem(fmd->name(),ciname);
ol.addIndexItem(ciname,fmd->name());
- //Doxygen::indexList->addIndexItem(
- // ciname, // level1
- // fmd->name(), // level2
- // separateMemPages ? cfname : cfiname, // contRef
- // cfname, // memRef
- // fmd->anchor(), // anchor
- // fmd); // memberdef
Doxygen::indexList->addIndexItem(container,fmd);
- //ol.writeListItem();
ol.startDescTableTitle();
ol.startDoxyAnchor(cfname,cname,fmd->anchor(),fmd->name(),fmd->argsString());
first=FALSE;
- //ol.startEmphasis();
ol.docify(fmd->name());
- //ol.endEmphasis();
ol.disableAllBut(OutputGenerator::Man);
ol.writeString(" ");
ol.enableAll();
ol.endDoxyAnchor(cfname,fmd->anchor());
ol.endDescTableTitle();
- //ol.newParagraph();
ol.startDescTableData();
bool hasBrief = !fmd->briefDescription().isEmpty();
@@ -2407,11 +2394,7 @@ void MemberDef::_writeEnumValues(OutputList &ol,Definition *container,
}
if (!first)
{
- //ol.endItemList();
ol.endDescTable();
- //ol.endDescForItem();
- //ol.endSimpleSect();
- //ol.writeChar('\n');
}
}
}
diff --git a/src/outputgen.h b/src/outputgen.h
index 44d34b8..9935bd9 100644
--- a/src/outputgen.h
+++ b/src/outputgen.h
@@ -145,7 +145,8 @@ class BaseOutputDocInterface : public CodeOutputInterface
Since, Date, Bug, Note,
Warning, Par, Deprecated, Pre,
Post, Invar, Remark, Attention,
- Todo, Test, RCS, */ EnumValues,
+ Todo, Test, RCS, */
+ EnumValues,
Examples
};
@@ -279,9 +280,8 @@ class BaseOutputDocInterface : public CodeOutputInterface
virtual void startSmall() = 0;
virtual void endSmall() = 0;
- virtual void startSimpleSect(SectionTypes t,const char *file,
- const char *anchor,const char *title) = 0;
- virtual void endSimpleSect() = 0;
+ virtual void startExamples() = 0;
+ virtual void endExamples() = 0;
virtual void startParamList(ParamListTypes t,const char *title) = 0;
virtual void endParamList() = 0;
diff --git a/src/outputlist.h b/src/outputlist.h
index 2e89101..5fd8017 100644
--- a/src/outputlist.h
+++ b/src/outputlist.h
@@ -321,11 +321,10 @@ class OutputList : public OutputDocInterface
const char *title,const char *name)
{ forall(&OutputGenerator::writeInheritedSectionTitle,id,ref,
file,anchor,title,name); }
- void startSimpleSect(SectionTypes t,const char *file,const char *anchor,
- const char *title)
- { forall(&OutputGenerator::startSimpleSect,t,file,anchor,title); }
- void endSimpleSect()
- { forall(&OutputGenerator::endSimpleSect); }
+ void startExamples()
+ { forall(&OutputGenerator::startExamples); }
+ void endExamples()
+ { forall(&OutputGenerator::endExamples); }
void startParamList(ParamListTypes t,const char *title)
{ forall(&OutputGenerator::startParamList,t,title); }
void endParamList()
diff --git a/src/pagedef.cpp b/src/pagedef.cpp
index b2b7dc8..d2c3f68 100644
--- a/src/pagedef.cpp
+++ b/src/pagedef.cpp
@@ -35,7 +35,7 @@ PageDef::PageDef(const char *f,int l,const char *n,
m_pageScope = 0;
m_nestingLevel = 0;
m_fileName = ::convertNameToFile(n,FALSE,TRUE);
- m_showToc = FALSE;
+ m_showLineNo = FALSE;
}
PageDef::~PageDef()
@@ -207,9 +207,9 @@ void PageDef::writeDocumentation(OutputList &ol)
ol.popGeneratorState();
//2.}
- if (m_showToc && hasSections())
+ if ((m_localToc.isHtmlEnabled() || m_localToc.isLatexEnabled()) && hasSections())
{
- writeToc(ol);
+ writeToc(ol, m_localToc);
}
writePageDocumentation(ol);
@@ -326,8 +326,17 @@ void PageDef::setNestingLevel(int l)
m_nestingLevel = l;
}
-void PageDef::setShowToc(bool b)
+void PageDef::setLocalToc(const LocalToc &lt)
{
- m_showToc |= b;
+ m_localToc = lt;
}
+void PageDef::setShowLineNo(bool b)
+{
+ m_showLineNo = b;
+}
+
+bool PageDef::showLineNo() const
+{
+ return m_showLineNo;
+}
diff --git a/src/pagedef.h b/src/pagedef.h
index 41b84cb..a0c3acb 100644
--- a/src/pagedef.h
+++ b/src/pagedef.h
@@ -34,7 +34,8 @@ class PageDef : public Definition
// setters
void setFileName(const char *name);
- void setShowToc(bool b);
+ void setLocalToc(const LocalToc &tl);
+ void setShowLineNo(bool);
// getters
DefType definitionType() const { return TypePage; }
@@ -59,10 +60,11 @@ class PageDef : public Definition
bool documentedPage() const;
bool hasSubPages() const;
bool hasParentPage() const;
- bool showToc() const { return m_showToc; }
+ LocalToc localToc() const { return m_localToc; }
void setPageScope(Definition *d){ m_pageScope = d; }
Definition *getPageScope() const { return m_pageScope; }
QCString displayName(bool=TRUE) const { return !m_title.isEmpty() ? m_title : Definition::name(); }
+ bool showLineNo() const;
void writeDocumentation(OutputList &ol);
void writeTagFile(FTextStream &);
@@ -75,7 +77,8 @@ class PageDef : public Definition
PageSDict *m_subPageDict; // list of pages in the group
Definition *m_pageScope;
int m_nestingLevel;
- bool m_showToc;
+ LocalToc m_localToc;
+ bool m_showLineNo;
};
class PageSDict : public SDict<PageDef>
diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp
index 2bf03d1..f805383 100644
--- a/src/perlmodgen.cpp
+++ b/src/perlmodgen.cpp
@@ -1256,6 +1256,7 @@ void PerlModDocVisitor::visitPre(DocParamSect *s)
err("unknown parameter section found\n");
break;
}
+ m_output.openHash();
openOther();
openSubBlock(type);
}
@@ -1264,6 +1265,7 @@ void PerlModDocVisitor::visitPost(DocParamSect *)
{
closeSubBlock();
closeOther();
+ m_output.closeHash();
}
void PerlModDocVisitor::visitPre(DocParamList *pl)
diff --git a/src/plantuml.cpp b/src/plantuml.cpp
index 609d5fd..ada035b 100644
--- a/src/plantuml.cpp
+++ b/src/plantuml.cpp
@@ -47,7 +47,7 @@ QCString writePlantUMLSource(const QCString &outDir,const QCString &fileName,con
}
QCString text = "@startuml\n";
text+=content;
- text+="@enduml\n";
+ text+="\n@enduml\n";
file.writeBlock( text, text.length() );
file.close();
return baseName;
@@ -88,7 +88,9 @@ void generatePlantUMLOutput(const char *baseName,const char *outDir,PlantUMLOutp
{
pumlArgs += "-graphvizdot \"";
pumlArgs += dotPath;
- pumlArgs += "dot\" ";
+ pumlArgs += "dot";
+ pumlArgs += portable_commandExtension();
+ pumlArgs += "\" ";
}
pumlArgs+="-o \"";
pumlArgs+=outDir;
diff --git a/src/portable.cpp b/src/portable.cpp
index 4ad88a4..08691b2 100644
--- a/src/portable.cpp
+++ b/src/portable.cpp
@@ -22,10 +22,10 @@ extern char **environ;
#endif
#include "portable.h"
+#include "util.h"
#ifndef NODEBUG
#include "debug.h"
#endif
-//#include "doxygen.h"
static double g_sysElapsedTime;
static QTime g_time;
@@ -35,7 +35,12 @@ int portable_system(const char *command,const char *args,bool commandHasConsole)
if (command==0) return 1;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ QCString commandCorrectedPath = substitute(command,'/','\\');
+ QCString fullCmd=commandCorrectedPath;
+#else
QCString fullCmd=command;
+#endif
fullCmd=fullCmd.stripWhiteSpace();
if (fullCmd.at(0)!='"' && fullCmd.find(' ')!=-1)
{
@@ -134,7 +139,7 @@ int portable_system(const char *command,const char *args,bool commandHasConsole)
// For that case COM is initialized as follows
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
- QString commandw = QString::fromUtf8( command );
+ QString commandw = QString::fromUtf8( commandCorrectedPath );
QString argsw = QString::fromUtf8( args );
// gswin32 is a GUI api which will pop up a window and run
@@ -458,18 +463,7 @@ void portable_correct_path(void)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
const char *p = portable_getenv("PATH");
- char *q = (char *)malloc(strlen(p) + 1);
- strcpy(q, p);
- bool found = false;
- for (int i = 0 ; i < strlen(q); i++)
- {
- if (q[i] == '/')
- {
- q[i] = '\\';
- found = true;
- }
- }
- if (found) portable_setenv("PATH",q);
- free(q);
+ QCString result = substitute(p,'/','\\');
+ if (result!=p) portable_setenv("PATH",result.data());
#endif
}
diff --git a/src/pre.l b/src/pre.l
index 37f7115..b6ebbf8 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -1739,7 +1739,9 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
%x SkipString
%x CopyLine
%x CopyString
+%x CopyStringCs
%x CopyStringFtn
+%x CopyStringFtnDouble
%x Include
%x IncludeID
%x EndImport
@@ -1849,9 +1851,21 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<CopyLine>"'"."'" {
outputArray(yytext,(int)yyleng);
}
+<CopyLine>@\" {
+ if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_CSharp) REJECT;
+ outputArray(yytext,(int)yyleng);
+ BEGIN( CopyStringCs );
+ }
<CopyLine>\" {
outputChar(*yytext);
- BEGIN( CopyString );
+ if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran)
+ {
+ BEGIN( CopyString );
+ }
+ else
+ {
+ BEGIN( CopyStringFtnDouble );
+ }
}
<CopyLine>\' {
if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran) REJECT;
@@ -1859,17 +1873,30 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN( CopyStringFtn );
}
<CopyString>[^\"\\\r\n]+ {
+ outputArray(yytext,(int)yyleng);
+ }
+<CopyStringCs>[^\"\r\n]+ {
outputArray(yytext,(int)yyleng);
}
<CopyString>\\. {
outputArray(yytext,(int)yyleng);
}
-<CopyString>\" {
+<CopyString,CopyStringCs>\" {
+ outputChar(*yytext);
+ BEGIN( CopyLine );
+ }
+<CopyStringFtnDouble>[^\"\\\r\n]+ {
+ outputArray(yytext,(int)yyleng);
+ }
+<CopyStringFtnDouble>\\. {
+ outputArray(yytext,(int)yyleng);
+ }
+<CopyStringFtnDouble>\" {
outputChar(*yytext);
BEGIN( CopyLine );
}
<CopyStringFtn>[^\'\\\r\n]+ {
- outputArray(yytext,(int)yyleng);
+ outputArray(yytext,(int)yyleng);
}
<CopyStringFtn>\\. {
outputArray(yytext,(int)yyleng);
@@ -1934,6 +1961,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
}
<CopyLine>"\\"\r?/\n { // strip line continuation characters
+ if (getLanguageFromFileName(g_yyFileName)==SrcLangExt_Fortran) outputChar(*yytext);
}
<CopyLine>. {
outputChar(*yytext);
diff --git a/src/qhp.cpp b/src/qhp.cpp
index e7c8d10..6ce6b06 100644
--- a/src/qhp.cpp
+++ b/src/qhp.cpp
@@ -23,7 +23,7 @@
#include "doxygen.h"
#include "filedef.h"
-#include <qstringlist.h>
+#include <qcstringlist.h>
#include <string.h>
#include <qfile.h>
@@ -101,10 +101,10 @@ void Qhp::initialize()
{ "name", filterName, 0 };
m_doc.open("customFilter", tagAttributes);
- QStringList customFilterAttributes = QStringList::split(QChar(' '), Config_getString(QHP_CUST_FILTER_ATTRS));
+ QCStringList customFilterAttributes = QCStringList::split(' ', Config_getString(QHP_CUST_FILTER_ATTRS));
for (int i = 0; i < (int)customFilterAttributes.count(); i++)
{
- m_doc.openCloseContent("filterAttribute", customFilterAttributes[i].utf8());
+ m_doc.openCloseContent("filterAttribute", customFilterAttributes[i]);
}
m_doc.close("customFilter");
}
@@ -112,15 +112,15 @@ void Qhp::initialize()
m_doc.open("filterSection");
// Add section attributes
- QStringList sectionFilterAttributes = QStringList::split(QChar(' '),
+ QCStringList sectionFilterAttributes = QCStringList::split(' ',
Config_getString(QHP_SECT_FILTER_ATTRS));
- if (!sectionFilterAttributes.contains(QString("doxygen")))
+ if (!sectionFilterAttributes.contains("doxygen"))
{
sectionFilterAttributes << "doxygen";
}
for (int i = 0; i < (int)sectionFilterAttributes.count(); i++)
{
- m_doc.openCloseContent("filterAttribute", sectionFilterAttributes[i].utf8());
+ m_doc.openCloseContent("filterAttribute", sectionFilterAttributes[i]);
}
m_toc.open("toc");
diff --git a/src/reflist.cpp b/src/reflist.cpp
index 5a80b19..1da603e 100644
--- a/src/reflist.cpp
+++ b/src/reflist.cpp
@@ -164,12 +164,14 @@ void RefList::generatePage()
doc += " \\_internalref ";
doc += item->name;
doc += " \"";
- doc += item->title;
+ // escape \'s in title, see issue #5901
+ doc += substitute(item->title,"\\","\\\\");
doc += "\" ";
// write declaration in case a function with arguments
if (!item->args.isEmpty())
{
- doc += item->args;
+ // escape @'s in argument list, needed for Java annotations (see issue #6208)
+ doc += substitute(item->args,"@","@@");
}
doc += "</dt><dd> ";
doc += item->text;
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp
index 64da929..e2de5ab 100644
--- a/src/rtfgen.cpp
+++ b/src/rtfgen.cpp
@@ -2727,21 +2727,14 @@ void RTFGenerator::endMemberGroup(bool hasHeader)
t << "}";
}
-void RTFGenerator::startSimpleSect(SectionTypes,const char *file,const char *anchor,const char *title)
+void RTFGenerator::startExamples()
{
- DBG_RTF(t << "{\\comment (startSimpleSect)}" << endl)
+ DBG_RTF(t << "{\\comment (startExamples)}" << endl)
t << "{"; // ends at endDescList
t << "{"; // ends at endDescTitle
startBold();
newParagraph();
- if (file)
- {
- writeObjectLink(0,file,anchor,title);
- }
- else
- {
- docify(title);
- }
+ docify(theTranslator->trExamples());
endBold();
t << "}";
newParagraph();
@@ -2749,9 +2742,9 @@ void RTFGenerator::startSimpleSect(SectionTypes,const char *file,const char *anc
t << rtf_Style_Reset << rtf_DList_DepthStyle();
}
-void RTFGenerator::endSimpleSect()
+void RTFGenerator::endExamples()
{
- DBG_RTF(t << "{\\comment (endSimpleSect)}" << endl)
+ DBG_RTF(t << "{\\comment (endExamples)}" << endl)
m_omitParagraph = FALSE;
newParagraph();
decrementIndentLevel();
diff --git a/src/rtfgen.h b/src/rtfgen.h
index bb3146a..b6b32c7 100644
--- a/src/rtfgen.h
+++ b/src/rtfgen.h
@@ -164,8 +164,8 @@ class RTFGenerator : public OutputGenerator
void writeInheritedSectionTitle(const char *,const char *,const char *,
const char *,const char *,const char *) {}
void startDescList(SectionTypes);
- void startSimpleSect(SectionTypes,const char *,const char *,const char *);
- void endSimpleSect();
+ void startExamples();
+ void endExamples();
void startParamList(ParamListTypes,const char *);
void endParamList();
//void writeDescItem();
diff --git a/src/scanner.l b/src/scanner.l
index 21b845f..4846132 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -149,6 +149,7 @@ static QCString *pCopyRawString;
static QGString *pCopyCurlyGString;
static QGString *pCopyRoundGString;
+static QGString *pCopySquareGString;
static QGString *pCopyQuotedGString;
static QGString *pCopyHereDocGString;
static QGString *pCopyRawGString;
@@ -734,6 +735,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
%x CopyRound
%x CopyCurly
%x GCopyRound
+%x GCopySquare
%x GCopyCurly
%x SkipUnionSwitch
%x Specialization
@@ -2838,6 +2840,14 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
current->initializer+=*yytext;
BEGIN(GCopyRound);
}
+<ReadInitializer>"[" {
+ if (!insidePHP) REJECT;
+ lastSquareContext=YY_START;
+ pCopySquareGString=&current->initializer;
+ squareCount=0;
+ current->initializer+=*yytext;
+ BEGIN(GCopySquare);
+ }
<ReadInitializer>"{" {
lastCurlyContext=YY_START;
pCopyCurlyGString=&current->initializer;
@@ -3180,6 +3190,56 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
*pCopyRoundGString+=*yytext;
}
+ /* generic square bracket list copy rules for growable strings, we should only enter here in case of php, left the test part as in GCopyRound to keep it compatible with te round bracket version */
+<GCopySquare>\" {
+ *pCopySquareGString+=*yytext;
+ pCopyQuotedGString=pCopySquareGString;
+ lastStringContext=YY_START;
+ BEGIN(CopyGString);
+ }
+<GCopySquare>"[" {
+ *pCopySquareGString+=*yytext;
+ squareCount++;
+ }
+<GCopySquare>"]" {
+ *pCopySquareGString+=*yytext;
+ if (--squareCount<0)
+ BEGIN(lastSquareContext);
+ }
+<GCopySquare>\n {
+ lineCount();
+ *pCopySquareGString+=*yytext;
+ }
+<GCopySquare>\' {
+ if (insidePHP)
+ {
+ current->initializer+=yytext;
+ pCopyQuotedGString = pCopySquareGString;
+ lastStringContext=YY_START;
+ BEGIN(CopyPHPGString);
+ }
+ else
+ {
+ *pCopySquareGString+=yytext;
+ }
+ }
+<GCopySquare>{CHARLIT} {
+ if (insidePHP)
+ {
+ REJECT;
+ }
+ else
+ {
+ *pCopySquareGString+=yytext;
+ }
+ }
+<GCopySquare>[^"\[\]\n/]+ {
+ *pCopySquareGString+=yytext;
+ }
+<GCopySquare>. {
+ *pCopySquareGString+=*yytext;
+ }
+
/* generic curly bracket list copy rules */
<CopyCurly>\" {
*pCopyCurlyString+=*yytext;
diff --git a/src/tagreader.cpp b/src/tagreader.cpp
index dfa8511..cf64a35 100644
--- a/src/tagreader.cpp
+++ b/src/tagreader.cpp
@@ -27,7 +27,7 @@
#include <qfileinfo.h>
#include <qlist.h>
#include <qstring.h>
-#include <qstringlist.h>
+#include <qcstringlist.h>
#include "entry.h"
#include "classdef.h"
@@ -105,7 +105,7 @@ class TagClassInfo
QList<BaseInfo> *bases;
QList<TagMemberInfo> members;
QList<QCString> *templateArguments;
- QStringList classList;
+ QCStringList classList;
Kind kind;
bool isObjC;
};
@@ -118,8 +118,8 @@ class TagNamespaceInfo
QCString name;
QCString filename;
QCString clangId;
- QStringList classList;
- QStringList namespaceList;
+ QCStringList classList;
+ QCStringList namespaceList;
TagAnchorInfoList docAnchors;
QList<TagMemberInfo> members;
};
@@ -133,7 +133,7 @@ class TagPackageInfo
QCString filename;
TagAnchorInfoList docAnchors;
QList<TagMemberInfo> members;
- QStringList classList;
+ QCStringList classList;
};
/** Container for include info that can be read from a tagfile */
@@ -157,8 +157,8 @@ class TagFileInfo
QCString filename;
TagAnchorInfoList docAnchors;
QList<TagMemberInfo> members;
- QStringList classList;
- QStringList namespaceList;
+ QCStringList classList;
+ QCStringList namespaceList;
QList<TagIncludeInfo> includes;
};
@@ -172,12 +172,12 @@ class TagGroupInfo
QCString filename;
TagAnchorInfoList docAnchors;
QList<TagMemberInfo> members;
- QStringList subgroupList;
- QStringList classList;
- QStringList namespaceList;
- QStringList fileList;
- QStringList pageList;
- QStringList dirList;
+ QCStringList subgroupList;
+ QCStringList classList;
+ QCStringList namespaceList;
+ QCStringList fileList;
+ QCStringList pageList;
+ QCStringList dirList;
};
/** Container for page specific info that can be read from a tagfile */
@@ -197,8 +197,8 @@ class TagDirInfo
QCString name;
QCString filename;
QCString path;
- QStringList subdirList;
- QStringList fileList;
+ QCStringList subdirList;
+ QCStringList fileList;
TagAnchorInfoList docAnchors;
};
@@ -1009,11 +1009,11 @@ void TagFileParser::dump()
{
msg("namespace `%s'\n",nd->name.data());
msg(" filename `%s'\n",nd->filename.data());
- QStringList::Iterator it;
+ QCStringList::Iterator it;
for ( it = nd->classList.begin();
it != nd->classList.end(); ++it )
{
- msg( " class: %s \n", (*it).latin1() );
+ msg( " class: %s \n", (*it).data() );
}
QListIterator<TagMemberInfo> mci(nd->members);
@@ -1034,16 +1034,16 @@ void TagFileParser::dump()
{
msg("file `%s'\n",fd->name.data());
msg(" filename `%s'\n",fd->filename.data());
- QStringList::Iterator it;
+ QCStringList::Iterator it;
for ( it = fd->namespaceList.begin();
it != fd->namespaceList.end(); ++it )
{
- msg( " namespace: %s \n", (*it).latin1() );
+ msg( " namespace: %s \n", (*it).data() );
}
for ( it = fd->classList.begin();
it != fd->classList.end(); ++it )
{
- msg( " class: %s \n", (*it).latin1() );
+ msg( " class: %s \n", (*it).data() );
}
QListIterator<TagMemberInfo> mci(fd->members);
@@ -1072,31 +1072,31 @@ void TagFileParser::dump()
{
msg("group `%s'\n",gd->name.data());
msg(" filename `%s'\n",gd->filename.data());
- QStringList::Iterator it;
+ QCStringList::Iterator it;
for ( it = gd->namespaceList.begin();
it != gd->namespaceList.end(); ++it )
{
- msg( " namespace: %s \n", (*it).latin1() );
+ msg( " namespace: %s \n", (*it).data() );
}
for ( it = gd->classList.begin();
it != gd->classList.end(); ++it )
{
- msg( " class: %s \n", (*it).latin1() );
+ msg( " class: %s \n", (*it).data() );
}
for ( it = gd->fileList.begin();
it != gd->fileList.end(); ++it )
{
- msg( " file: %s \n", (*it).latin1() );
+ msg( " file: %s \n", (*it).data() );
}
for ( it = gd->subgroupList.begin();
it != gd->subgroupList.end(); ++it )
{
- msg( " subgroup: %s \n", (*it).latin1() );
+ msg( " subgroup: %s \n", (*it).data() );
}
for ( it = gd->pageList.begin();
it != gd->pageList.end(); ++it )
{
- msg( " page: %s \n", (*it).latin1() );
+ msg( " page: %s \n", (*it).data() );
}
QListIterator<TagMemberInfo> mci(gd->members);
@@ -1126,16 +1126,16 @@ void TagFileParser::dump()
{
msg("dir `%s'\n",dd->name.data());
msg(" path `%s'\n",dd->path.data());
- QStringList::Iterator it;
+ QCStringList::Iterator it;
for ( it = dd->fileList.begin();
it != dd->fileList.end(); ++it )
{
- msg( " file: %s \n", (*it).latin1() );
+ msg( " file: %s \n", (*it).data() );
}
for ( it = dd->subdirList.begin();
it != dd->subdirList.end(); ++it )
{
- msg( " subdir: %s \n", (*it).latin1() );
+ msg( " subdir: %s \n", (*it).data() );
}
}
}
diff --git a/src/tclscanner.l b/src/tclscanner.l
index 56d2e3d..7ca5ade 100644
--- a/src/tclscanner.l
+++ b/src/tclscanner.l
@@ -25,7 +25,7 @@
#include <ctype.h>
#include <qstring.h>
-#include <qstringlist.h>
+#include <qcstringlist.h>
#include <qlist.h>
#include <qmap.h>
#include <qarray.h>
@@ -369,7 +369,7 @@ int Tcl_SplitList(
}
// END of tclUtil.c
-void tcl_split_list(QString &str, QStringList &list)
+void tcl_split_list(QCString &str, QCStringList &list)
{
int argc;
const char **argv;
@@ -383,17 +383,20 @@ void tcl_split_list(QString &str, QStringList &list)
{
str=str.mid(1,str.length()-2);
}
- if (Tcl_SplitList(str.ascii(),&argc,&argv) != TCL_OK)
+ if (!str.isEmpty())
{
- list.append(str);
- }
- else
- {
- for (int i = 0; i < argc; i++)
+ if (Tcl_SplitList(str,&argc,&argv) != TCL_OK)
{
- list.append(argv[i]);
+ list.append(str);
+ }
+ else
+ {
+ for (int i = 0; i < argc; i++)
+ {
+ list.append(argv[i]);
+ }
+ ckfree((char *) argv);
}
- ckfree((char *) argv);
}
}
@@ -409,7 +412,7 @@ typedef struct
Entry *entry_cl; // if set contain the current class
Entry *entry_scan; // current scan entry
Protection protection; // current protections state
- QStringList after; // option/value list (options: NULL comment keyword script)
+ QCStringList after; // option/value list (options: NULL comment keyword script)
} tcl_scan;
//* Structure containing all internal global variables.
@@ -446,7 +449,7 @@ static struct
Entry* entry_file; // entry of current file
Entry* entry_current; // currently used entry
Entry* entry_inside; // contain entry of current scan context
- QStringList list_commandwords; // list of command words
+ QCStringList list_commandwords; // list of command words
QList<tcl_scan> scan; // stack of scan contexts
QAsciiDict<Entry> ns; // all read namespace entries
QAsciiDict<Entry> cl; // all read class entries
@@ -602,7 +605,7 @@ Entry* tcl_entry_class(const QCString cl)
// @return 1 if keyword and 0 otherwise
static int tcl_keyword(QCString str)
{
- static QStringList myList;
+ static QCStringList myList;
static int myInit=1;
if (myInit)
{
@@ -639,7 +642,7 @@ static int tcl_keyword(QCString str)
myList <<"tkerror"<<"tkwait"<<"tk_bisque"<<"tk_focusNext"<<"tk_focusPrev"<<"tk_focusFollowsMouse"<<"tk_popup"<<"tk_setPalette"<<"tk_textCut"<<"tk_TextCopy"<<"tk_textPaste"<<"chooseColor"<<"tk_chooseColor"<<"tk_chooseDirectory"<<"tk_dialog"<<"tk_getOpenFile"<<"tkDialog"<<"tk_getSaveFile"<<"tk_messageBox";
myList <<"winfo"<<"wm";
myList <<"button"<<"canvas"<<"checkbutton"<<"entry"<<"frame"<<"image"<<"label"<<"labelframe"<<"listbox"<<"menu"<<"menubutton"<<"message"<<"panedwindow"<<"radiobutton"<<"scale"<<"scrollbar"<<"spinbox"<<"toplevel";
- myList.sort();
+ //myList.sort();
myInit=0;
}
str=str.stripWhiteSpace();
@@ -727,7 +730,7 @@ static void tcl_codify(const char *s,const char *str)
static void tcl_codify(const char *s,const QString &str)
{
if (tcl.code==NULL) return;
- tcl_codify(s,str.utf8());
+ tcl_codify(s,str);
}
//! Codify 'str' with special font class 's'.
@@ -740,7 +743,7 @@ static void tcl_codify(const char *s,const QCString &str)
static void tcl_codify_cmd(const char *s,int i)
{
- tcl_codify(s,(*tcl.list_commandwords.at(i)).utf8());
+ tcl_codify(s,(*tcl.list_commandwords.at(i)));
}
//! codify a string token
//
@@ -1193,7 +1196,7 @@ tcl_inf("line=%d\n",myScan->line1);
myStart=i;
break;
}
- tcl_codify(myScan->after[i].utf8(),myScan->after[i+1].utf8());
+ tcl_codify(myScan->after[i],myScan->after[i+1]);
}
yy_delete_buffer(myScan->buffer_state);
yy_pop_state();
@@ -1608,12 +1611,12 @@ tcl_inf("-> %s\n",(const char *)tcl.string_comment);
}
//! Parse given \c arglist .
-static void tcl_command_ARGLIST(QString &arglist)
+static void tcl_command_ARGLIST(QCString &arglist)
{
D
Argument *myArg;
- QStringList myArgs;
- QString myArglist="";
+ QCStringList myArgs;
+ QCString myArglist="";
if (!tcl.entry_current->argList)
{
@@ -1622,14 +1625,14 @@ D
tcl_split_list(arglist,myArgs);
for (uint i=0;i<myArgs.count();i++)
{
- QStringList myArgs1;
+ QCStringList myArgs1;
myArg=new Argument;
tcl_split_list(*myArgs.at(i),myArgs1);
if (myArgs1.count()==2)
{
- myArg->name= (*myArgs1.at(0)).utf8();
- myArg->defval= (*myArgs1.at(1)).utf8();
+ myArg->name= (*myArgs1.at(0));
+ myArg->defval= (*myArgs1.at(1));
if (myArg->defval.isEmpty())
{
myArg->defval = " ";
@@ -1638,13 +1641,13 @@ D
}
else
{
- myArg->name= (*myArgs.at(i)).utf8();
- myArglist += QString(myArg->name) + " ";
+ myArg->name= (*myArgs.at(i));
+ myArglist += myArg->name + " ";
}
tcl.entry_current->argList->append(myArg);
}
arglist = myArglist;
- tcl.entry_current->args = arglist.utf8();
+ tcl.entry_current->args = arglist;
}
//! Create link.
@@ -1763,7 +1766,7 @@ static void tcl_codify_link(QCString name)
//! scan general argument for brackets
//
-// parses (*tcl.list_commandwords.at(i)).utf8() and checks for brackets.
+// parses (*tcl.list_commandwords.at(i)) and checks for brackets.
// Starts a new scan context if needed (*myScan==0 and brackets found).
// Returns NULL or the created scan context.
//
@@ -1773,7 +1776,7 @@ static tcl_scan *tcl_command_ARG(tcl_scan *myScan, unsigned int i, bool ignoreOu
bool insideQuotes=false;
unsigned int insideBrackets=0;
unsigned int insideBraces=0;
- myName = (*tcl.list_commandwords.at(i)).utf8();
+ myName = (*tcl.list_commandwords.at(i));
if (i%2 != 0)
{
// handle white space
@@ -1861,7 +1864,7 @@ D
// Example: eval [list set] [list NotInvoked] [Invoked NotInvoked]
for (unsigned int i = 1; i < tcl.list_commandwords.count(); i++)
{
- myString += (*tcl.list_commandwords.at(i)).utf8();
+ myString += (*tcl.list_commandwords.at(i));
}
myScan = tcl_scan_start('?', myString,
myScan->ns, myScan->entry_cl, myScan->entry_fn);
@@ -1882,7 +1885,7 @@ D
unsigned int lastOptionIndex = 0;
for (i = 2; i<tcl.list_commandwords.count(); i += 2)
{
- token = (*tcl.list_commandwords.at(i)).utf8();
+ token = (*tcl.list_commandwords.at(i));
if (token == "--")
{
lastOptionIndex = i;
@@ -1913,7 +1916,7 @@ D
int size;
const char *elem;
const char *next;
- token = (*tcl.list_commandwords.at(lastOptionIndex + 4)).utf8();
+ token = (*tcl.list_commandwords.at(lastOptionIndex + 4));
if (token[0] == '{')
{
inBraces = true;
@@ -1966,15 +1969,15 @@ D
//printf("detected: switch ?options? string pattern body ?pattern body ...?\n");
myScan = tcl_command_ARG(myScan, lastOptionIndex + 1, false);
myScan = tcl_command_ARG(myScan, lastOptionIndex + 2, false);
- //printf("value=%s\n",(const char*) (*tcl.list_commandwords.at(lastOptionIndex + 2)).utf8());
+ //printf("value=%s\n",(const char*) (*tcl.list_commandwords.at(lastOptionIndex + 2)));
for (i = lastOptionIndex + 3; i < tcl.list_commandwords.count(); i += 4)
{
myScan = tcl_command_ARG(myScan, i + 0, false); // whitespace
myScan = tcl_command_ARG(myScan, i + 1, false); // pattern
myScan = tcl_command_ARG(myScan, i + 2, false); // whitespace
- myScan = tcl_codify_token(myScan, "script", (*tcl.list_commandwords.at(i+3)).utf8()); // script
- //printf("pattern=%s\n",(const char*) (*tcl.list_commandwords.at(i+1)).utf8());
- //printf("script=%s\n",(const char*) (*tcl.list_commandwords.at(i+3)).utf8());
+ myScan = tcl_codify_token(myScan, "script", (*tcl.list_commandwords.at(i+3))); // script
+ //printf("pattern=%s\n",(const char*) (*tcl.list_commandwords.at(i+1))));
+ //printf("script=%s\n",(const char*) (*tcl.list_commandwords.at(i+3)));
}
}
else
@@ -2007,7 +2010,7 @@ D
//! Handle internal tcl commands.
// "if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN?"
-static void tcl_command_IF(QStringList type)
+static void tcl_command_IF(QCStringList type)
{
D
tcl_codify_cmd("keyword",0);
@@ -2126,7 +2129,7 @@ D
tcl_codify_cmd(NULL,3);
tcl_codify_cmd(NULL,4);
tcl_codify_cmd(NULL,5);
- tcl_name_SnippetAware(myScan->ns,(*tcl.list_commandwords.at(2)).utf8(),myNs,myName);
+ tcl_name_SnippetAware(myScan->ns,(*tcl.list_commandwords.at(2)),myNs,myName);
if (myNs.length())
{
myEntryNs = tcl_entry_namespace(myNs);
@@ -2165,7 +2168,7 @@ D
tcl_codify_cmd(NULL,3);
tcl_codify_cmd(NULL,4);
tcl_codify_cmd(NULL,5);
- tcl_name(myScan->ns,(*tcl.list_commandwords.at(2)).utf8(),myNs,myName);
+ tcl_name(myScan->ns,(*tcl.list_commandwords.at(2)),myNs,myName);
if (myNs.length())
{
myEntryCl = tcl_entry_class(myNs);
@@ -2205,7 +2208,7 @@ D
tcl_codify_cmd(NULL,1);
tcl_codify_cmd(NULL,2);
tcl_codify_cmd(NULL,3);
- tcl_name(myScan->ns,(*tcl.list_commandwords.at(0)).utf8(),myNs,myName);
+ tcl_name(myScan->ns,(*tcl.list_commandwords.at(0)),myNs,myName);
if (myNs.length())
{
myEntryCl = tcl_entry_class(myNs);
@@ -2240,7 +2243,7 @@ D
tcl_codify_cmd("keyword",0);
tcl_codify_cmd(NULL,1);
- tcl_name(myScan->ns,(*tcl.list_commandwords.at(0)).utf8(),myNs,myName);
+ tcl_name(myScan->ns,(*tcl.list_commandwords.at(0)),myNs,myName);
if (myNs.length())
{
myEntryCl = tcl_entry_class(myNs);
@@ -2278,7 +2281,7 @@ D
tcl_codify_cmd(NULL,3);
tcl_codify_cmd(NULL,4);
tcl_codify_cmd(NULL,5);
- tcl_name(myScan->ns,(*tcl.list_commandwords.at(4)).utf8(),myNs,myName);
+ tcl_name(myScan->ns,(*tcl.list_commandwords.at(4)),myNs,myName);
if (myNs.length())
{
myName = myNs+"::"+myName;
@@ -2291,12 +2294,12 @@ D
tcl.entry_main->addSubEntry(tcl.entry_current);
tcl.ns.insert(myName,tcl.entry_current);
//myEntryNs = tcl.entry_current;
- myStr = (*tcl.list_commandwords.at(6)).utf8();
+ myStr = (*tcl.list_commandwords.at(6));
if (tcl.list_commandwords.count() > 7)
{
for (uint i=7;i<tcl.list_commandwords.count();i++)
{
- myStr.append((*tcl.list_commandwords.at(i)).utf8());
+ myStr.append((*tcl.list_commandwords.at(i)));
}
tcl.word_is=' ';
}
@@ -2315,7 +2318,7 @@ D
tcl_codify_cmd(NULL,1);
tcl_codify_cmd("NULL",2);
tcl_codify_cmd("NULL",3);
- tcl_name(myScan->ns,(*tcl.list_commandwords.at(2)).utf8(),myNs,myName);
+ tcl_name(myScan->ns,(*tcl.list_commandwords.at(2)),myNs,myName);
if (myNs.length())
{
myName = myNs+"::"+myName;
@@ -2347,7 +2350,7 @@ D
tcl_codify_cmd("NULL",3);
tcl_codify_cmd("NULL",4);
tcl_codify_cmd("NULL",5);
- tcl_name(myScan->ns,(*tcl.list_commandwords.at(4)).utf8(),myNs,myName);
+ tcl_name(myScan->ns,(*tcl.list_commandwords.at(4)),myNs,myName);
if (myNs.length())
{
myName = myNs+"::"+myName;
@@ -2377,13 +2380,13 @@ D
tcl_codify_cmd(NULL,1);
tcl_codify_cmd("NULL",2);
tcl_codify_cmd("NULL",3);
- tcl_name(myScan->ns,(*tcl.list_commandwords.at(2)).utf8(),myNs,myName);
+ tcl_name(myScan->ns,(*tcl.list_commandwords.at(2)),myNs,myName);
if (myNs.length())
{
myName = myNs+"::"+myName;
}
myEntryCl = tcl_entry_class(myName);
- myStr = (*tcl.list_commandwords.at(4)).utf8();
+ myStr = (*tcl.list_commandwords.at(4));
//
// special cases first
// oo::define classname method methodname args script
@@ -2400,7 +2403,7 @@ D
}
Entry *myEntry;
QCString myMethod;
- tcl_name(myScan->ns,(*tcl.list_commandwords.at(n==11?6:4)).utf8(),myNs,myMethod);
+ tcl_name(myScan->ns,(*tcl.list_commandwords.at(n==11?6:4)),myNs,myMethod);
// code snippet taken from tcl_command_METHOD()/tcl_command_CONSTRUCTOR
tcl.fn.remove(myMethod);
tcl.entry_current->section = Entry::FUNCTION_SEC;
@@ -2434,7 +2437,7 @@ D
{
for (uint i=5;i<tcl.list_commandwords.count();i++)
{
- myStr.append((*tcl.list_commandwords.at(i)).utf8());
+ myStr.append((*tcl.list_commandwords.at(i)));
}
tcl.word_is=' ';
}
@@ -2455,7 +2458,7 @@ D
{
tcl_codify_cmd(NULL,i);
}
- tcl_name(myScan->ns,(*tcl.list_commandwords.at(2)).utf8(),myNs,myName);
+ tcl_name(myScan->ns,(*tcl.list_commandwords.at(2)),myNs,myName);
if (myNs.length())
{// qualified variables go into namespace
myEntry = tcl_entry_namespace(myNs);
@@ -2535,7 +2538,7 @@ tcl_inf("->\n");
yy_pop_state();
// check command
- QCString myStr = (*tcl.list_commandwords.at(0)).utf8();
+ QCString myStr = (*tcl.list_commandwords.at(0));
tcl_scan *myScanBackup=tcl.scan.at(0);
int myLevel = 0;
Protection myProt = tcl.protection;
@@ -2580,7 +2583,7 @@ tcl_inf("->\n");
myProt = tcl.protection;
goto command_end;
}
- myStr = (*tcl.list_commandwords.at(0)).utf8();
+ myStr = (*tcl.list_commandwords.at(0));
// remove leading "::" and apply TCL_SUBST
if (myStr.left(2)=="::") myStr = myStr.mid(2);
if (tcl.config_subst.contains(myStr))
@@ -2624,7 +2627,7 @@ tcl_inf("->\n");
}
if (myStr=="namespace")
{
- if ((*tcl.list_commandwords.at(2)).utf8()=="eval")
+ if ((*tcl.list_commandwords.at(2))=="eval")
{
if (tcl.list_commandwords.count() < 7) {myLine=__LINE__;goto command_warn;}
tcl_command_NAMESPACE();
@@ -2647,7 +2650,7 @@ tcl_inf("->\n");
}
if (myStr=="oo::class")
{
- if ((*tcl.list_commandwords.at(2)).utf8()=="create")
+ if ((*tcl.list_commandwords.at(2))=="create")
{
if (tcl.list_commandwords.count() != 7) {myLine=__LINE__;goto command_warn;}
tcl_command_OO_CLASS();
@@ -2687,7 +2690,7 @@ tcl_inf("->\n");
{
for (unsigned int i = 2; i < tcl.list_commandwords.count(); i = i + 2)
{
- tcl.scan.at(0)->entry_cl->extends->append(new BaseInfo((*tcl.list_commandwords.at(i)).utf8(),Public,Normal));
+ tcl.scan.at(0)->entry_cl->extends->append(new BaseInfo((*tcl.list_commandwords.at(i)),Public,Normal));
}
}
goto command_end;
@@ -2731,12 +2734,12 @@ if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN?
*/
if (myStr=="if" && tcl.list_commandwords.count() > 4)
{
- QStringList myType;
+ QCStringList myType;
myType << "keyword" << "NULL" << "expr" << "NULL";
char myState='x';// last word: e'x'pr 't'hen 'b'ody 'e'lse else'i'f..
for (unsigned int i = 4; i < tcl.list_commandwords.count(); i = i + 2)
{
- QCString myStr=(*tcl.list_commandwords.at(i)).utf8();
+ QCString myStr=(*tcl.list_commandwords.at(i));
if (myState=='x')
{
if (myStr=="then")
@@ -2797,7 +2800,7 @@ if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN?
tcl_command_OTHER();
goto command_end;
command_warn:// print warning message because of wrong used syntax
- tcl_war("%d count=%d: %s\n",myLine,tcl.list_commandwords.count(),tcl.list_commandwords.join(" ").ascii());
+ tcl_war("%d count=%d: %s\n",myLine,tcl.list_commandwords.count(),tcl.list_commandwords.join(" ").data());
tcl_command_OTHER();
command_end:// add remaining text to current context
if (!myText.isEmpty())
diff --git a/src/types.h b/src/types.h
index 806e6fc..e58c8fc 100644
--- a/src/types.h
+++ b/src/types.h
@@ -16,6 +16,7 @@
#ifndef TYPES_H
#define TYPES_H
+#include <string.h>
#include <qcstring.h>
/** @file
@@ -218,4 +219,48 @@ enum FortranFormat
FortranFormat_Fixed
};
+class LocalToc
+{
+ public:
+ enum Type {
+ None = 0, // initial value
+ Html = 0, // index / also to be used as bit position in mask (1 << Html)
+ Latex = 1, // ...
+ Xml = 2, // ...
+ numTocTypes = 3 // number of enum values
+ };
+ LocalToc() : m_mask(None) { memset(m_level,0,sizeof(m_level)); }
+
+ // setters
+ void enableHtml(int level)
+ {
+ m_mask|=(1<<Html);
+ m_level[Html]=level;
+ }
+ void enableLatex(int level)
+ {
+ m_mask|=(1<<Latex);
+ m_level[Latex]=level;
+ }
+ void enableXml(int level)
+ {
+ m_mask|=(1<<Xml);
+ m_level[Xml]=level;
+ }
+
+ // getters
+ bool isHtmlEnabled() const { return (m_mask & (1<<Html))!=0; }
+ bool isLatexEnabled() const { return (m_mask & (1<<Latex))!=0; }
+ bool isXmlEnabled() const { return (m_mask & (1<<Xml))!=0; }
+ bool nothingEnabled() const { return m_mask == None; }
+ int htmlLevel() const { return m_level[Html]; }
+ int latexLevel() const { return m_level[Latex]; }
+ int xmlLevel() const { return m_level[Xml]; }
+ int mask() const { return m_mask; }
+
+ private:
+ int m_mask;
+ int m_level[numTocTypes];
+};
+
#endif
diff --git a/src/util.cpp b/src/util.cpp
index ea68cd7..b387a84 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -5290,6 +5290,22 @@ QCString substitute(const QCString &s,const QCString &src,const QCString &dst,in
return result;
}
+/// substitute all occurrences of \a srcChar in \a s by \a dstChar
+QCString substitute(const QCString &s,char srcChar,char dstChar)
+{
+ int l=s.length();
+ QCString result(l+1);
+ char *q=result.rawData();
+ if (l>0)
+ {
+ const char *p=s.data();
+ char c;
+ while ((c=*p++)) *q++ = (c==srcChar) ? dstChar : c;
+ }
+ *q='\0';
+ return result;
+}
+
//----------------------------------------------------------------------
QCString substituteKeywords(const QCString &s,const char *title,
@@ -6725,6 +6741,16 @@ void filterLatexString(FTextStream &t,const char *str,
{
switch(c)
{
+ case 0xef: // handle U+FFFD i.e. "Replacement character" caused by octal: 357 277 275 / hexadecimal 0xef 0xbf 0xbd
+ // the LaTeX command \ucr has been defined in doxygen.sty
+ if ((unsigned char)*(p) == 0xbf && (unsigned char)*(p+1) == 0xbd)
+ {
+ t << "{\\ucr}";
+ p += 2;
+ }
+ else
+ t << (char)c;
+ break;
case '\\': t << "\\(\\backslash\\)"; break;
case '{': t << "\\{"; break;
case '}': t << "\\}"; break;
@@ -6746,6 +6772,16 @@ void filterLatexString(FTextStream &t,const char *str,
{
switch(c)
{
+ case 0xef: // handle U+FFFD i.e. "Replacement character" caused by octal: 357 277 275 / hexadecimal 0xef 0xbf 0xbd
+ // the LaTeX command \ucr has been defined in doxygen.sty
+ if ((unsigned char)*(p) == 0xbf && (unsigned char)*(p+1) == 0xbd)
+ {
+ t << "{\\ucr}";
+ p += 2;
+ }
+ else
+ t << (char)c;
+ break;
case '#': t << "\\#"; break;
case '$': t << "\\$"; break;
case '%': t << "\\%"; break;
@@ -7913,8 +7949,8 @@ bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceC
int start=0;
if (size>=2 &&
- ((inBuf.at(0)==-1 && inBuf.at(1)==-2) || // Little endian BOM
- (inBuf.at(0)==-2 && inBuf.at(1)==-1) // big endian BOM
+ (((uchar)inBuf.at(0)==0xFF && (uchar)inBuf.at(1)==0xFE) || // Little endian BOM
+ ((uchar)inBuf.at(0)==0xFE && (uchar)inBuf.at(1)==0xFF) // big endian BOM
)
) // UCS-2 encoded file
{
@@ -8830,6 +8866,32 @@ void writeExtraLatexPackages(FTextStream &t)
}
}
+void writeLatexSpecialFormulaChars(FTextStream &t)
+{
+ unsigned char minus[4]; // Superscript minus
+ char *pminus = (char *)minus;
+ unsigned char sup2[3]; // Superscript two
+ char *psup2 = (char *)sup2;
+ unsigned char sup3[3];
+ char *psup3 = (char *)sup3; // Superscript three
+ minus[0]= 0xE2;
+ minus[1]= 0x81;
+ minus[2]= 0xBB;
+ minus[3]= 0;
+ sup2[0]= 0xC2;
+ sup2[1]= 0xB2;
+ sup2[2]= 0;
+ sup3[0]= 0xC2;
+ sup3[1]= 0xB3;
+ sup3[2]= 0;
+
+ t << "\\usepackage{newunicodechar}\n"
+ " \\newunicodechar{" << pminus << "}{${}^{-}$}% Superscript minus\n"
+ " \\newunicodechar{" << psup2 << "}{${}^{2}$}% Superscript two\n"
+ " \\newunicodechar{" << psup3 << "}{${}^{3}$}% Superscript three\n"
+ "\n";
+}
+
//------------------------------------------------------
static int g_usedTableLevels = 0;
diff --git a/src/util.h b/src/util.h
index 7cbe5e3..a9eee67 100644
--- a/src/util.h
+++ b/src/util.h
@@ -194,6 +194,7 @@ QCString substituteClassNames(const QCString &s);
QCString substitute(const QCString &s,const QCString &src,const QCString &dst);
QCString substitute(const QCString &s,const QCString &src,const QCString &dst,int skip_seq);
+QCString substitute(const QCString &s,char srcChar,char dstChar);
QCString clearBlock(const char *s,const char *begin,const char *end);
@@ -477,6 +478,7 @@ void convertProtectionLevel(
bool mainPageHasTitle();
bool openOutputFile(const char *outFile,QFile &f);
void writeExtraLatexPackages(FTextStream &t);
+void writeLatexSpecialFormulaChars(FTextStream &t);
int usedTableLevels();
void incUsedTableLevels();
diff --git a/src/vhdlcode.l b/src/vhdlcode.l
index 618258f..68dcafb 100644
--- a/src/vhdlcode.l
+++ b/src/vhdlcode.l
@@ -31,7 +31,7 @@
#include <ctype.h>
#include <qregexp.h>
#include <qdir.h>
-#include <qstringlist.h>
+#include <qcstringlist.h>
#include "entry.h"
#include "doxygen.h"
@@ -138,8 +138,8 @@ static bool checkVhdlString(QCString &name)
int len=name.length();
if (name.at(0)=='"' && name.at(len-1)=='"' && len > 2)
{
- QStringList qrl=QStringList::split(regg,name,FALSE);
- if (VhdlDocGen::isNumber(qrl[0].utf8()))
+ QCStringList qrl=QCStringList::split(regg,name);
+ if (VhdlDocGen::isNumber(qrl[0]))
{
g_code->codify("\"");
startFontClass("vhdllogic");
@@ -691,8 +691,8 @@ static void writeFuncProto()
codifyLines(g_FuncProto.data(),g_CurrClass.data());
return;
}
- QStringList qlist=QStringList::split(name,g_FuncProto,FALSE);
- QCString temp=qlist[0].utf8();
+ QCStringList qlist=QCStringList::split(name,g_FuncProto);
+ QCString temp=qlist[0];
codifyLines(temp.data(),g_CurrClass.data());
g_FuncProto.stripPrefix(temp.data());
temp.resize(0);
@@ -831,11 +831,11 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
QCString tt(vhdlcodeYYtext);
VhdlDocGen::deleteAllChars(tt,',');
QRegExp r("=>");
- QStringList ql=QStringList::split(r,tt,FALSE);
+ QCStringList ql=QCStringList::split(r,tt);
if (ql.count()>=2)
{
unsigned int index=0;
- QCString t1=ql[0].utf8();
+ QCString t1=ql[0];
char cc=t1.at(index);
while (cc==' ' || cc=='\t')
{
@@ -866,7 +866,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
}
codifyLines("=>");
index=0;
- QCString s2=ql[1].utf8();
+ QCString s2=ql[1];
t1=s2;
cc=t1.at(index);
while (cc==' ' || cc=='\t')
@@ -959,7 +959,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
tt=tt.lower();
VhdlDocGen::deleteAllChars(tt,';');
tt.stripWhiteSpace();
- QStringList ql=QStringList::split(regg,tt,FALSE);
+ QCStringList ql=QCStringList::split(regg,tt);
int index=ql.findIndex(QCString("if"))+1;
index+=ql.findIndex(QCString("case"))+1;
index+=ql.findIndex(QCString("loop"))+1;
@@ -1168,13 +1168,12 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
<ParsePackage>[^:;]* { //found package
QCString temp(vhdlcodeYYtext);
- QStringList strl=QStringList::split(".",temp,FALSE);
-
+ QCStringList strl=QCStringList::split(".",temp);
if (strl.count()>2)
{
- QCString s1=strl[0].utf8();
- QCString s2=strl[1].utf8();
- QCString s3=strl[2].utf8();
+ QCString s1=strl[0];
+ QCString s2=strl[1];
+ QCString s3=strl[2];
s1.append(".");
s3.prepend(".");
codifyLines(s1.data(),g_CurrClass.data());
@@ -1297,8 +1296,8 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
<Bases>^{B}*("package "){BN}*("body"){BN}*{FUNCNAME} { // found package body
QCString ss(vhdlcodeYYtext);
QCString temp=VhdlDocGen::getIndexWord(vhdlcodeYYtext,2);
- QStringList ql=QStringList::split(temp,ss,FALSE);
- QCString ll=ql[0].utf8();
+ QCStringList ql=QCStringList::split(temp,ss);
+ QCString ll=ql[0];
codifyLines(ll.data(),g_CurrClass.data());
temp=temp.stripWhiteSpace();
temp.prepend("_");
diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp
index 007c45f..287565b 100644
--- a/src/vhdldocgen.cpp
+++ b/src/vhdldocgen.cpp
@@ -26,7 +26,7 @@
#include <string.h>
#include <qcstring.h>
#include <qfileinfo.h>
-#include <qstringlist.h>
+#include <qcstringlist.h>
#include <qmap.h>
/* --------------------------------------------------------------- */
@@ -299,10 +299,10 @@ static QCString formatBriefNote(const QCString &brief,ClassDef * cd)
int k=cd->briefLine();
- QStringList qsl=QStringList::split(ep,brief);
+ QCStringList qsl=QCStringList::split(ep,brief);
for(uint j=0;j<qsl.count();j++)
{
- QCString qcs=qsl[j].data();
+ QCString qcs=qsl[j];
vForm+=parseCommentAsText(cd,NULL,qcs,file,k);
k++;
vForm+='\n';
@@ -1028,8 +1028,8 @@ void VhdlDocGen::writeInlineClassLink(const ClassDef* cd ,OutputList& ol)
}
else if (ii==VhdlDocGen::ARCHITECTURE)
{
- QStringList qlist=QStringList::split("-",nn,FALSE);
- nn=qlist[1].utf8();
+ QCStringList qlist=QCStringList::split("-",nn);
+ nn=qlist[1];
cd=VhdlDocGen::getClass(nn.data());
}
@@ -1041,9 +1041,9 @@ void VhdlDocGen::writeInlineClassLink(const ClassDef* cd ,OutputList& ol)
for (int i=0;i<j;i++)
{
QCString *temp=ql.at(i);
- QStringList qlist=QStringList::split("-",*temp,FALSE);
- QCString s1=qlist[0].utf8();
- QCString s2=qlist[1].utf8();
+ QCStringList qlist=QCStringList::split("-",*temp);
+ QCString s1=qlist[0];
+ QCString s2=qlist[1];
s1.stripPrefix("_");
if (j==1) s1.resize(0);
ClassDef*cc = getClass(temp->data());
@@ -1075,8 +1075,8 @@ void VhdlDocGen::findAllArchitectures(QList<QCString>& qll,const ClassDef *cd)
QCString jj=citer->className();
if (cd != citer && jj.contains('-')!=-1)
{
- QStringList ql=QStringList::split("-",jj,FALSE);
- QCString temp=ql[1].utf8();
+ QCStringList ql=QCStringList::split("-",jj);
+ QCString temp=ql[1];
if (qstricmp(cd->className(),temp)==0)
{
QCString *cl=new QCString(jj);
@@ -1095,10 +1095,10 @@ ClassDef* VhdlDocGen::findArchitecture(const ClassDef *cd)
for ( ; (citer=cli.current()) ; ++cli )
{
QCString jj=citer->name();
- QStringList ql=QStringList::split(":",jj,FALSE);
+ QCStringList ql=QCStringList::split(":",jj);
if (ql.count()>1)
{
- if (ql[0].utf8()==nn )
+ if (ql[0]==nn )
{
return citer;
}
@@ -1211,15 +1211,15 @@ void VhdlDocGen::parseFuncProto(const char* text,QList<Argument>& qlist,
QCString VhdlDocGen::getIndexWord(const char* c,int index)
{
- QStringList ql;
+ QCStringList ql;
QCString temp(c);
QRegExp reg("[\\s:|]");
- ql=QStringList::split(reg,temp,FALSE);
+ ql=QCStringList::split(reg,temp);
if (ql.count() > (unsigned int)index)
{
- return ql[index].utf8();
+ return ql[index];
}
return "";
@@ -2678,11 +2678,11 @@ QCString VhdlDocGen::parseForConfig(QCString & entity,QCString & arch)
if (!entity.contains(":")) return "";
QRegExp exp("[:()\\s]");
- QStringList ql=QStringList::split(exp,entity,FALSE);
+ QCStringList ql=QCStringList::split(exp,entity);
//int ii=ql.findIndex(ent);
assert(ql.count()>=2);
- label = ql[0].utf8();
- entity = ql[1].utf8();
+ label = ql[0];
+ entity = ql[1];
if ((index=entity.findRev("."))>=0)
{
entity.remove(0,index+1);
@@ -2690,8 +2690,8 @@ QCString VhdlDocGen::parseForConfig(QCString & entity,QCString & arch)
if (ql.count()==3)
{
- arch= ql[2].utf8();
- ql=QStringList::split(exp,arch,FALSE);
+ arch= ql[2];
+ ql=QCStringList::split(exp,arch);
if (ql.count()>1) // expression
{
arch="";
@@ -2708,16 +2708,16 @@ QCString VhdlDocGen::parseForBinding(QCString & entity,QCString & arch)
QRegExp exp("[()\\s]");
QCString label="";
- QStringList ql=QStringList::split(exp,entity,FALSE);
+ QCStringList ql=QCStringList::split(exp,entity);
if (ql.contains("open"))
{
return "open";
}
- label=ql[0].utf8();
+ label=ql[0];
- entity = ql[1].utf8();
+ entity = ql[1];
if ((index=entity.findRev("."))>=0)
{
entity.remove(0,index+1);
@@ -2725,7 +2725,7 @@ QCString VhdlDocGen::parseForBinding(QCString & entity,QCString & arch)
if (ql.count()==3)
{
- arch=ql[2].utf8();
+ arch=ql[2];
}
return label;
}
@@ -2843,7 +2843,7 @@ void assignBinding(VhdlConfNode * conf)
QCString inst1=VhdlDocGen::getIndexWord(archy.data(),0).lower();
QCString comp=VhdlDocGen::getIndexWord(archy.data(),1).lower();
- QStringList ql=QStringList::split(",",inst1);
+ QCStringList ql=QCStringList::split(",",inst1);
for (uint j=0;j<ql.count();j++)
{
@@ -2855,7 +2855,7 @@ void assignBinding(VhdlConfNode * conf)
}
else
{
- archy1=comp+":"+ql[j].utf8();
+ archy1=comp+":"+ql[j];
sign1=cur->type+":"+cur->name;
}
@@ -3029,11 +3029,11 @@ ferr:
void VhdlDocGen::writeRecorUnit(QCString & largs,OutputList& ol ,const MemberDef *mdef)
{
- QStringList ql=QStringList::split("#",largs,FALSE);
+ QCStringList ql=QCStringList::split("#",largs,FALSE);
uint len=ql.count();
for(uint i=0;i<len;i++)
{
- QCString n=ql[i].utf8();
+ QCString n=ql[i];
VhdlDocGen::formatString(n,ol,mdef);
if ((len-i)>1) ol.lineBreak();
}
@@ -3046,14 +3046,14 @@ void VhdlDocGen::writeRecUnitDocu(
QCString largs)
{
- QStringList ql=QStringList::split("#",largs,FALSE);
+ QCStringList ql=QCStringList::split("#",largs);
uint len=ql.count();
ol.startParameterList(TRUE);
bool first=TRUE;
for(uint i=0;i<len;i++)
{
- QCString n=ql[i].utf8();
+ QCString n=ql[i];
ol.startParameterType(first,"");
ol.endParameterType();
ol.startParameterName(TRUE);
@@ -3486,14 +3486,14 @@ void FlowChart::alignCommentNode(FTextStream &t,QCString com)
{
uint max=0;
QCString s;
- QStringList ql=QStringList::split("\n",com);
+ QCStringList ql=QCStringList::split("\n",com);
for (uint j=0;j<ql.count();j++)
{
- s=(QCString)ql[j].utf8();
+ s=(QCString)ql[j];
if (max<s.length()) max=s.length();
}
- s=ql.last().utf8();
+ s=ql.last();
int diff=max-s.length();
QCString n(1);
@@ -3508,7 +3508,7 @@ void FlowChart::alignCommentNode(FTextStream &t,QCString com)
for (uint j=0;j<ql.count();j++)
{
- s=(QCString)ql[j].utf8();
+ s=ql[j];
if (j<ql.count()-1)
{
s+="\n";
diff --git a/src/vhdljjparser.cpp b/src/vhdljjparser.cpp
index 706e8db..81a7ca1 100644
--- a/src/vhdljjparser.cpp
+++ b/src/vhdljjparser.cpp
@@ -12,7 +12,7 @@
#include <qcstring.h>
#include <qfileinfo.h>
-#include <qstringlist.h>
+#include <qcstringlist.h>
#include "vhdljjparser.h"
#include "vhdlcode.h"
#include "vhdldocgen.h"
@@ -381,11 +381,11 @@ void VhdlParser::addVhdlType(const char *n,int startLine,int section,
spec= VhdlDocGen::GENERIC;
}
- QStringList ql=QStringList::split(",",name,FALSE);
+ QCStringList ql=QCStringList::split(",",name);
for (uint u=0;u<ql.count();u++)
{
- current->name=ql[u].utf8();
+ current->name=ql[u];
current->startLine=startLine;
current->bodyLine=startLine;
current->section=section;
@@ -442,11 +442,11 @@ void VhdlParser::createFunction(const char *imp,uint64 spec,const char *fn)
VhdlDocGen::deleteAllChars(current->args,' ');
if (!fname.isEmpty())
{
- QStringList q1=QStringList::split(",",fname);
+ QCStringList q1=QCStringList::split(",",fname);
for (uint ii=0;ii<q1.count();ii++)
{
Argument *arg=new Argument;
- arg->name=q1[ii].utf8();
+ arg->name=q1[ii];
current->argList->append(arg);
}
}
@@ -540,12 +540,12 @@ void VhdlParser::addProto(const char *s1,const char *s2,const char *s3,
{
(void)s5; // avoid unused warning
QCString name=s2;
- QStringList ql=QStringList::split(",",name,FALSE);
+ QCStringList ql=QCStringList::split(",",name);
for (uint u=0;u<ql.count();u++)
{
Argument *arg=new Argument;
- arg->name=ql[u].utf8();
+ arg->name=ql[u];
if (s3)
{
arg->type=s3;
diff --git a/src/vhdljjparser.h b/src/vhdljjparser.h
index a0851d7..3a2ed61 100644
--- a/src/vhdljjparser.h
+++ b/src/vhdljjparser.h
@@ -7,6 +7,7 @@
#include <assert.h>
#include <ctype.h>
#include <qarray.h>
+#include <qcstringlist.h>
#include <qfile.h>
#include <qdict.h>
@@ -14,7 +15,6 @@
#include "types.h"
#include "entry.h"
#include "vhdldocgen.h"
-#include "qstringlist.h"
#include "vhdlcode.h"
#include "memberlist.h"
#include "config.h"
@@ -30,7 +30,6 @@ class ClassSDict;
class FileStorage;
class ClassDef;
class MemberDef;
-class QStringList;
struct VhdlConfNode;
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index 63fc8ad..e68c454 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -1838,9 +1838,62 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample)
}
}
writeInnerPages(pd->getSubPages(),t);
- if(pd->showToc())
- {
- t << " <tableofcontents/>" << endl;
+ if (pd->localToc().isXmlEnabled())
+ {
+ t << " <tableofcontents>" << endl;
+ SectionDict *sectionDict = pd->getSectionDict();
+ SDict<SectionInfo>::Iterator li(*sectionDict);
+ SectionInfo *si;
+ int level=1,l;
+ bool inLi[5]={ FALSE, FALSE, FALSE, FALSE };
+ int maxLevel = pd->localToc().xmlLevel();
+ for (li.toFirst();(si=li.current());++li)
+ {
+ if (si->type==SectionInfo::Section ||
+ si->type==SectionInfo::Subsection ||
+ si->type==SectionInfo::Subsubsection ||
+ si->type==SectionInfo::Paragraph)
+ {
+ //printf(" level=%d title=%s\n",level,si->title.data());
+ int nextLevel = (int)si->type;
+ if (nextLevel>level)
+ {
+ for (l=level;l<nextLevel;l++)
+ {
+ if (l < maxLevel) t << " <tableofcontents>" << endl;
+ }
+ }
+ else if (nextLevel<level)
+ {
+ for (l=level;l>nextLevel;l--)
+ {
+ if (l <= maxLevel && inLi[l]) t << " </tocsect>" << endl;
+ inLi[l]=FALSE;
+ if (l <= maxLevel) t << " </tableofcontents>" << endl;
+ }
+ }
+ if (l <= maxLevel && inLi[nextLevel]) t << " </tocsect>" << endl;
+ if (nextLevel <= maxLevel)
+ {
+ QCString titleDoc = convertToXML(si->title);
+ t << " <tocsect>" << endl;
+ t << " <name>" << (si->title.isEmpty()?si->label:titleDoc) << "</name>" << endl;
+ t << " <reference>" << convertToXML(pageName) << "_1" << convertToXML(si -> label) << "</reference>" << endl;
+ }
+ inLi[nextLevel]=TRUE;
+ level = nextLevel;
+ }
+ }
+ while (level>1 && level <= maxLevel)
+ {
+ if (inLi[level]) t << " </tocsect>" << endl;
+ inLi[level]=FALSE;
+ t << " </tableofcontents>" << endl;
+ level--;
+ }
+ if (level <= maxLevel && inLi[level]) t << " </tocsect>" << endl;
+ inLi[level]=FALSE;
+ t << " </tableofcontents>" << endl;
}
t << " <briefdescription>" << endl;
writeXMLDocBlock(t,pd->briefFile(),pd->briefLine(),pd,0,pd->briefDescription());
diff --git a/templates/html/doxygen.css b/templates/html/doxygen.css
index 3bc6d55..13d72c9 100644
--- a/templates/html/doxygen.css
+++ b/templates/html/doxygen.css
@@ -134,12 +134,12 @@ a.qindex {
a.qindexHL {
font-weight: bold;
background-color: ##AA;
- color: #ffffff;
+ color: ##ff;
border: 1px double ##98;
}
.contents a.qindexHL:visited {
- color: #ffffff;
+ color: ##ff;
}
a.el {
@@ -150,11 +150,11 @@ a.elRef {
}
a.code, a.code:visited, a.line, a.line:visited {
- color: #4665A2;
+ color: ##60;
}
a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited {
- color: #4665A2;
+ color: ##60;
}
/* @end */
@@ -183,8 +183,8 @@ ul {
}
pre.fragment {
- border: 1px solid #C4CFE5;
- background-color: #FBFCFD;
+ border: 1px solid ##CC;
+ background-color: ##FC;
padding: 4px 6px;
margin: 4px 8px 4px 2px;
overflow: auto;
@@ -267,7 +267,7 @@ span.lineno a:hover {
div.ah, span.ah {
background-color: black;
font-weight: bold;
- color: #ffffff;
+ color: ##ff;
margin-bottom: 3px;
margin-top: 3px;
padding: 0.2em;
@@ -423,7 +423,7 @@ blockquote {
blockquote.DocNodeRTL {
border-left: 0;
- border-right: 2px solid #9CAFD4;
+ border-right: 2px solid ##AA;
margin: 0 4px 0 24px;
padding: 0 16px 0 12px;
}
@@ -514,7 +514,7 @@ table.memberdecls {
}
.memSeparator {
- border-bottom: 1px solid #DEE4F0;
+ border-bottom: 1px solid ##E2;
line-height: 1px;
margin: 0px;
padding: 0px;
@@ -644,7 +644,7 @@ table.memberdecls {
border-top-width: 0;
background-image:url('nav_g.png');
background-repeat:repeat-x;
- background-color: #FFFFFF;
+ background-color: ##ff;
/* opera specific markup */
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
@@ -916,7 +916,7 @@ table.doxtable td, table.doxtable th {
table.doxtable th {
background-color: ##47;
- color: #FFFFFF;
+ color: ##ff;
font-size: 110%;
padding-bottom: 4px;
padding-top: 5px;
@@ -1112,14 +1112,12 @@ div.headertitle
direction: rtl;
}
-dl
-{
- padding: 0 0 0 10px;
+dl {
+ padding: 0 0 0 0;
}
-/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */
-dl.section
-{
+/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */
+dl.section {
margin-left: 0px;
padding-left: 0px;
}
@@ -1543,7 +1541,7 @@ tr.heading h2 {
}
#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after {
- border-top-color: #ffffff;
+ border-top-color: ##ff;
border-width: 10px;
margin: 0px -10px;
}
@@ -1571,7 +1569,7 @@ tr.heading h2 {
}
#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after {
- border-bottom-color: #ffffff;
+ border-bottom-color: ##ff;
border-width: 10px;
margin: 0px -10px;
}
@@ -1598,7 +1596,7 @@ tr.heading h2 {
left: 100%;
}
#powerTip.e:after {
- border-left-color: #ffffff;
+ border-left-color: ##ff;
border-width: 10px;
top: 50%;
margin-top: -10px;
@@ -1614,7 +1612,7 @@ tr.heading h2 {
right: 100%;
}
#powerTip.w:after {
- border-right-color: #ffffff;
+ border-right-color: ##ff;
border-width: 10px;
top: 50%;
margin-top: -10px;
@@ -1669,7 +1667,7 @@ table.markdownTableBodyLeft td, table.markdownTable th {
th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone {
background-color: ##47;
- color: #FFFFFF;
+ color: ##ff;
font-size: 110%;
padding-bottom: 4px;
padding-top: 5px;
@@ -1703,8 +1701,8 @@ table.markdownTable tr {
}
th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone {
- background-color: #374F7F;
- color: #FFFFFF;
+ background-color: ##47;
+ color: ##ff;
font-size: 110%;
padding-bottom: 4px;
padding-top: 5px;
diff --git a/templates/html/menu.js b/templates/html/menu.js
index 89aaf57..433c15b 100644
--- a/templates/html/menu.js
+++ b/templates/html/menu.js
@@ -40,7 +40,7 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
$('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu');
if (searchEnabled) {
if (serverSide) {
- $('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><div class="left"><form id="FSearchBox" action="'+searchPage+'" method="get"><img id="MSearchSelect" src="'+relPath+'search/mag.png" alt=""/><input type="text" id="MSearchField" name="query" value="'+search+'" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)"></form></div><div class="right"></div></div></li>');
+ $('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><div class="left"><form id="FSearchBox" action="'+relPath+searchPage+'" method="get"><img id="MSearchSelect" src="'+relPath+'search/mag.png" alt=""/><input type="text" id="MSearchField" name="query" value="'+search+'" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)"></form></div><div class="right"></div></div></li>');
} else {
$('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><span class="left"><img id="MSearchSelect" src="'+relPath+'search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/><input type="text" id="MSearchField" value="'+search+'" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/></span><span class="right"><a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="'+relPath+'search/close.png" alt=""/></a></span></div></li>');
}
diff --git a/templates/html/navtree.css b/templates/html/navtree.css
index 7d1cb67..81c54c2 100644
--- a/templates/html/navtree.css
+++ b/templates/html/navtree.css
@@ -96,7 +96,7 @@
.ui-resizable-e {
background-image:url("splitbar.png");
background-size:100%;
- background-repeat:no-repeat;
+ background-repeat:repeat-y;
background-attachment: scroll;
cursor:ew-resize;
height:100%;
diff --git a/templates/latex/doxygen.sty b/templates/latex/doxygen.sty
index 166e7ef..4b8c455 100644
--- a/templates/latex/doxygen.sty
+++ b/templates/latex/doxygen.sty
@@ -87,6 +87,8 @@
% Necessary for redefining not defined charcaters, i.e. "Replacement Character" in tex output.
\newlength{\CodeWidthChar}
\newlength{\CodeHeightChar}
+\settowidth{\CodeWidthChar}{?}
+\settoheight{\CodeHeightChar}{?}
% Necessary for hanging indent
\newlength{\DoxyCodeWidth}
@@ -117,22 +119,15 @@
}{%
\normalfont%
\normalsize%
+ \settowidth{\CodeWidthChar}{?}%
+ \settoheight{\CodeHeightChar}{?}%
}
-% Redefining not defined charcaters, i.e. "Replacement Character" in tex output.
+% Redefining not defined characters, i.e. "Replacement Character" in tex output.
\def\ucr{\adjustbox{width=\CodeWidthChar,height=\CodeHeightChar}{\stackinset{c}{}{c}{-.2pt}{%
\textcolor{white}{\sffamily\bfseries\small ?}}{%
\rotatebox{45}{$\blacksquare$}}}}
-% Choosing right setup for "Replacement character"
-\ifpdf
- \RequirePackage[utf8]{inputenc}
- \DeclareUnicodeCharacter{FFFD}{\ucr}
-\else
- \catcode`\�=13
- \def�{\ucr}
-\fi
-
% Used by @example, @include, @includelineno and @dontinclude
\newenvironment{DoxyCodeInclude}[1]{%
\DoxyCode{#1}%
diff --git a/templates/xml/compound.xsd b/templates/xml/compound.xsd
index c1be47a..61da4a7 100644
--- a/templates/xml/compound.xsd
+++ b/templates/xml/compound.xsd
@@ -29,7 +29,7 @@
<xsd:element name="innergroup" type="refType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="templateparamlist" type="templateparamlistType" minOccurs="0" />
<xsd:element name="sectiondef" type="sectiondefType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="tableofcontents" minOccurs="0" maxOccurs="1" />
+ <xsd:element name="tableofcontents" type="tableofcontentsType" minOccurs="0" maxOccurs="1" />
<xsd:element name="briefdescription" type="descriptionType" minOccurs="0" />
<xsd:element name="detaileddescription" type="descriptionType" minOccurs="0" />
<xsd:element name="inheritancegraph" type="graphType" minOccurs="0" />
@@ -881,5 +881,19 @@
</xsd:restriction>
</xsd:simpleType>
+ <xsd:complexType name="tableofcontentsType">
+ <xsd:sequence>
+ <xsd:element name="tocsect" type="tableofcontentsKindType" minOccurs="1" maxOccurs="unbounded" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="tableofcontentsKindType">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="reference" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="tableofcontents" type="tableofcontentsType" minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ </xsd:complexType>
+
</xsd:schema>
diff --git a/testing/043/mypage.xml b/testing/043/mypage.xml
index 79fb7ae..c9bd6d0 100644
--- a/testing/043/mypage.xml
+++ b/testing/043/mypage.xml
@@ -4,7 +4,34 @@
<compoundname>mypage</compoundname>
<title>Page Title</title>
<innerpage refid="another">Another Page</innerpage>
- <tableofcontents/>
+ <tableofcontents>
+ <tocsect>
+ <name>Section Title.</name>
+ <reference>mypage_1mysect</reference>
+ <tableofcontents>
+ <tocsect>
+ <name>Subsection Title.</name>
+ <reference>mypage_1mysubsect</reference>
+ <tableofcontents>
+ <tocsect>
+ <name>Subsubsection Title.</name>
+ <reference>mypage_1mysubsubsect</reference>
+ <tableofcontents>
+ <tocsect>
+ <name>Paragraph Title.</name>
+ <reference>mypage_1mypara</reference>
+ </tocsect>
+ </tableofcontents>
+ </tocsect>
+ </tableofcontents>
+ </tocsect>
+ </tableofcontents>
+ </tocsect>
+ <tocsect>
+ <name>Another Section Title.</name>
+ <reference>mypage_1mysect2</reference>
+ </tocsect>
+ </tableofcontents>
<briefdescription>
<para>Page brief description. </para>
</briefdescription>
diff --git a/testing/043_page.dox b/testing/043_page.dox
index 38c1894..d554da2 100644
--- a/testing/043_page.dox
+++ b/testing/043_page.dox
@@ -4,7 +4,7 @@
/** \page mypage Page Title
* \brief Page brief description.
*
- * @tableofcontents
+ * @tableofcontents{xml,html,latex}
*
* Text at page level. See \ref mysect for more.
* \section mysect Section Title.
diff --git a/vhdlparser/VhdlParser.cc b/vhdlparser/VhdlParser.cc
index a3de14a..4cf8ec0 100644
--- a/vhdlparser/VhdlParser.cc
+++ b/vhdlparser/VhdlParser.cc
@@ -10398,11 +10398,11 @@ s+=",";s+=s1;
jj_consume_token(SEMI_T);
}
-QStringList ql1=QStringList::split(",",s,FALSE);
+QCStringList ql1=QCStringList::split(",",s);
for (uint j=0;j<ql1.count();j++)
{
- QStringList ql=QStringList::split(".",ql1[j],FALSE);
- QCString it=ql[1].utf8();
+ QCStringList ql=QCStringList::split(".",ql1[j]);
+ QCString it=ql[1];
if ( parse_sec==0 && Config_getBool(SHOW_INCLUDE_FILES) )
{
VhdlParser::addVhdlType(it.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::USE,it.data(),"_use_",Public);
diff --git a/vhdlparser/vhdlparser.jj b/vhdlparser/vhdlparser.jj
index d21afe1..af1bd34 100644
--- a/vhdlparser/vhdlparser.jj
+++ b/vhdlparser/vhdlparser.jj
@@ -2412,11 +2412,11 @@ QCString unconstraint_array_definition() : {QCString s,s1,s2,s3;}
{
<USE_T> s=selected_name()(<COMMA_T> s1=selected_name(){s+=",";s+=s1;})* <SEMI_T>
{
- QStringList ql1=QStringList::split(",",s,FALSE);
+ QCStringList ql1=QCStringList::split(",",s);
for (uint j=0;j<ql1.count();j++)
{
- QStringList ql=QStringList::split(".",ql1[j],FALSE);
- QCString it=ql[1].utf8();
+ QCStringList ql=QCStringList::split(".",ql1[j]);
+ QCString it=ql[1];
if ( parse_sec==0 && Config_getBool(SHOW_INCLUDE_FILES) )
{
VhdlParser::addVhdlType(it.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::USE,it.data(),"_use_",Public);