summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt10
-rw-r--r--src/arguments.h2
-rw-r--r--src/bufstr.h2
-rw-r--r--src/caseconvert.h2906
-rw-r--r--src/caseconvert.py59
-rw-r--r--src/cite.cpp234
-rw-r--r--src/cite.h12
-rw-r--r--src/clangparser.cpp27
-rw-r--r--src/classdef.cpp525
-rw-r--r--src/classdef.h62
-rw-r--r--src/classlist.cpp2
-rw-r--r--src/classlist.h2
-rw-r--r--src/cmdmapper.cpp6
-rw-r--r--src/cmdmapper.h4
-rw-r--r--src/code.h10
-rw-r--r--src/code.l818
-rw-r--r--src/commentcnv.h9
-rw-r--r--src/commentcnv.l37
-rw-r--r--src/commentscan.h12
-rw-r--r--src/commentscan.l518
-rw-r--r--src/conceptdef.cpp733
-rw-r--r--src/conceptdef.h82
-rw-r--r--src/condparser.cpp39
-rw-r--r--src/condparser.h10
-rw-r--r--src/config.h10
-rw-r--r--src/config.xml14
-rwxr-xr-xsrc/configgen.py8
-rw-r--r--src/configimpl.h65
-rw-r--r--src/configimpl.l355
-rw-r--r--src/constexp.l2
-rw-r--r--src/context.cpp439
-rw-r--r--src/context.h80
-rw-r--r--src/cppvalue.cpp4
-rw-r--r--src/debug.cpp9
-rw-r--r--src/debug.h6
-rw-r--r--src/declinfo.h8
-rw-r--r--src/declinfo.l22
-rw-r--r--src/defargs.h2
-rw-r--r--src/defargs.l42
-rw-r--r--src/defgen.cpp292
-rw-r--r--src/define.h2
-rw-r--r--src/definition.cpp185
-rw-r--r--src/definition.h33
-rw-r--r--src/definitionimpl.h72
-rw-r--r--src/dia.cpp28
-rw-r--r--src/dia.h11
-rw-r--r--src/diagram.cpp526
-rw-r--r--src/diagram.h11
-rw-r--r--src/dir.cpp303
-rw-r--r--src/dir.h104
-rw-r--r--src/dirdef.cpp105
-rw-r--r--src/dirdef.h14
-rw-r--r--src/docbookgen.cpp538
-rw-r--r--src/docbookgen.h175
-rw-r--r--src/docbookvisitor.cpp294
-rw-r--r--src/docbookvisitor.h18
-rw-r--r--src/docgroup.cpp32
-rw-r--r--src/docgroup.h12
-rw-r--r--src/docparser.cpp270
-rw-r--r--src/docparser.h28
-rw-r--r--src/docsets.cpp292
-rw-r--r--src/docsets.h26
-rw-r--r--src/doctokenizer.h11
-rw-r--r--src/doctokenizer.l89
-rw-r--r--src/docvisitor.cpp4
-rw-r--r--src/docvisitor.h4
-rw-r--r--src/dot.cpp69
-rw-r--r--src/dot.h14
-rw-r--r--src/dotcallgraph.cpp14
-rw-r--r--src/dotcallgraph.h7
-rw-r--r--src/dotclassgraph.cpp63
-rw-r--r--src/dotclassgraph.h16
-rw-r--r--src/dotdirdeps.cpp28
-rw-r--r--src/dotdirdeps.h8
-rw-r--r--src/dotfilepatcher.cpp210
-rw-r--r--src/dotfilepatcher.h13
-rw-r--r--src/dotgfxhierarchytable.cpp62
-rw-r--r--src/dotgfxhierarchytable.h10
-rw-r--r--src/dotgraph.cpp127
-rw-r--r--src/dotgraph.h29
-rw-r--r--src/dotgroupcollaboration.cpp20
-rw-r--r--src/dotgroupcollaboration.h12
-rw-r--r--src/dotincldepgraph.cpp23
-rw-r--r--src/dotincldepgraph.h10
-rw-r--r--src/dotlegendgraph.cpp11
-rw-r--r--src/dotlegendgraph.h2
-rw-r--r--src/dotnode.cpp111
-rw-r--r--src/dotnode.h21
-rw-r--r--src/dotrunner.cpp112
-rw-r--r--src/dotrunner.h27
-rw-r--r--src/doxygen.cpp1512
-rw-r--r--src/doxygen.h6
-rw-r--r--src/eclipsehelp.cpp100
-rw-r--r--src/eclipsehelp.h27
-rw-r--r--src/emoji.cpp11
-rw-r--r--src/emoji.h8
-rw-r--r--src/entry.cpp15
-rw-r--r--src/entry.h16
-rw-r--r--src/example.h2
-rw-r--r--src/filedef.cpp235
-rw-r--r--src/filedef.h19
-rw-r--r--src/fileinfo.cpp161
-rw-r--r--src/fileinfo.h47
-rw-r--r--src/filename.h8
-rw-r--r--src/fileparser.cpp23
-rw-r--r--src/fileparser.h8
-rw-r--r--src/formula.cpp203
-rw-r--r--src/formula.h7
-rw-r--r--src/fortrancode.h4
-rw-r--r--src/fortrancode.l157
-rw-r--r--src/fortranscanner.h4
-rwxr-xr-xsrc/fortranscanner.l129
-rw-r--r--src/ftextstream.cpp260
-rw-r--r--src/ftextstream.h76
-rw-r--r--src/ftvhelp.cpp126
-rw-r--r--src/ftvhelp.h27
-rw-r--r--src/groupdef.cpp217
-rw-r--r--src/groupdef.h16
-rw-r--r--src/growbuf.h37
-rw-r--r--src/htags.cpp50
-rw-r--r--src/htmlattrib.h3
-rw-r--r--src/htmldocvisitor.cpp179
-rw-r--r--src/htmldocvisitor.h12
-rw-r--r--src/htmlentity.cpp4
-rw-r--r--src/htmlentity.h4
-rw-r--r--src/htmlgen.cpp1317
-rw-r--r--src/htmlgen.h255
-rw-r--r--src/htmlhelp.cpp121
-rw-r--r--src/htmlhelp.h16
-rw-r--r--src/image.cpp65
-rw-r--r--src/image.h11
-rw-r--r--src/index.cpp864
-rw-r--r--src/index.h42
-rw-r--r--src/language.cpp6
-rw-r--r--src/language.h8
-rw-r--r--src/latexdocvisitor.cpp126
-rw-r--r--src/latexdocvisitor.h12
-rw-r--r--src/latexgen.cpp1157
-rw-r--r--src/latexgen.h235
-rw-r--r--src/layout.cpp106
-rw-r--r--src/layout.h18
-rw-r--r--src/lexcode.h4
-rw-r--r--src/lexcode.l33
-rw-r--r--src/lexscanner.h4
-rw-r--r--src/lexscanner.l295
-rw-r--r--src/linkedmap.h144
-rw-r--r--src/mandocvisitor.cpp299
-rw-r--r--src/mandocvisitor.h12
-rw-r--r--src/mangen.cpp304
-rw-r--r--src/mangen.h138
-rw-r--r--src/markdown.cpp177
-rw-r--r--src/markdown.h10
-rw-r--r--src/memberdef.cpp664
-rw-r--r--src/memberdef.h66
-rw-r--r--src/membergroup.cpp30
-rw-r--r--src/membergroup.h14
-rw-r--r--src/memberlist.cpp69
-rw-r--r--src/memberlist.h12
-rw-r--r--src/membername.h8
-rw-r--r--src/message.cpp37
-rw-r--r--src/message.h15
-rw-r--r--src/msc.cpp79
-rw-r--r--src/msc.h16
-rw-r--r--src/namespacedef.cpp164
-rw-r--r--src/namespacedef.h19
-rw-r--r--src/outputgen.cpp21
-rw-r--r--src/outputgen.h148
-rw-r--r--src/outputlist.cpp8
-rw-r--r--src/outputlist.h136
-rw-r--r--src/pagedef.cpp36
-rw-r--r--src/pagedef.h7
-rw-r--r--src/parserintf.h40
-rw-r--r--src/perlmodgen.cpp384
-rw-r--r--src/plantuml.cpp25
-rw-r--r--src/plantuml.h15
-rw-r--r--src/portable.cpp164
-rw-r--r--src/portable.h31
-rw-r--r--src/pre.h11
-rw-r--r--src/pre.l357
-rw-r--r--src/printdocvisitor.h50
-rw-r--r--src/pycode.h4
-rw-r--r--src/pycode.l120
-rw-r--r--src/pyscanner.h4
-rw-r--r--src/pyscanner.l260
-rw-r--r--src/qcstring.cpp560
-rw-r--r--src/qcstring.h613
-rw-r--r--src/qhp.cpp91
-rw-r--r--src/qhp.h20
-rw-r--r--src/qhpxmlwriter.cpp76
-rw-r--r--src/qhpxmlwriter.h42
-rw-r--r--src/reflist.cpp7
-rw-r--r--src/reflist.h18
-rw-r--r--src/regex.cpp37
-rw-r--r--src/resourcemgr.cpp62
-rw-r--r--src/resourcemgr.h12
-rw-r--r--src/rtfdocvisitor.cpp304
-rw-r--r--src/rtfdocvisitor.h16
-rw-r--r--src/rtfgen.cpp1845
-rw-r--r--src/rtfgen.h162
-rw-r--r--src/rtfstyle.cpp16
-rw-r--r--src/rtfstyle.h7
-rw-r--r--src/scanner.h4
-rw-r--r--src/scanner.l771
-rw-r--r--src/scopedtypevariant.h5
-rw-r--r--src/searchindex.cpp350
-rw-r--r--src/searchindex.h24
-rw-r--r--src/section.h28
-rw-r--r--src/sqlcode.h4
-rw-r--r--src/sqlcode.l18
-rw-r--r--src/sqlite3gen.cpp146
-rw-r--r--src/stlsupport.cpp2
-rw-r--r--src/symbolmap.h16
-rw-r--r--src/symbolresolver.cpp110
-rw-r--r--src/symbolresolver.h5
-rw-r--r--src/tagreader.cpp356
-rwxr-xr-x[-rw-r--r--]src/template.cpp419
-rw-r--r--src/template.h20
-rw-r--r--src/textdocvisitor.cpp15
-rw-r--r--src/textdocvisitor.h11
-rw-r--r--src/textstream.h235
-rw-r--r--src/tooltip.cpp9
-rw-r--r--src/translator.h72
-rw-r--r--src/translator_adapter.h56
-rw-r--r--src/translator_am.h36
-rw-r--r--src/translator_ar.h24
-rw-r--r--src/translator_br.h60
-rw-r--r--src/translator_ca.h36
-rw-r--r--src/translator_cn.h46
-rw-r--r--src/translator_cz.h47
-rw-r--r--src/translator_de.h48
-rw-r--r--src/translator_dk.h36
-rw-r--r--src/translator_en.h95
-rw-r--r--src/translator_eo.h40
-rw-r--r--src/translator_es.h50
-rw-r--r--src/translator_fa.h34
-rw-r--r--src/translator_fi.h26
-rw-r--r--src/translator_fr.h50
-rw-r--r--src/translator_gr.h46
-rw-r--r--src/translator_hr.h40
-rw-r--r--src/translator_hu.h46
-rw-r--r--src/translator_id.h36
-rw-r--r--src/translator_it.h46
-rw-r--r--src/translator_jp.h46
-rw-r--r--src/translator_kr.h46
-rw-r--r--src/translator_lt.h24
-rw-r--r--src/translator_lv.h40
-rw-r--r--src/translator_mk.h28
-rw-r--r--src/translator_nl.h90
-rwxr-xr-xsrc/translator_no.h24
-rw-r--r--src/translator_pl.h40
-rw-r--r--src/translator_pt.h60
-rw-r--r--src/translator_ro.h46
-rw-r--r--src/translator_ru.h46
-rw-r--r--src/translator_sc.h28
-rw-r--r--src/translator_si.h24
-rw-r--r--src/translator_sk.h48
-rw-r--r--src/translator_sr.h28
-rw-r--r--src/translator_sv.h52
-rw-r--r--src/translator_tr.h34
-rw-r--r--src/translator_tw.h46
-rw-r--r--src/translator_ua.h40
-rw-r--r--src/translator_vi.h28
-rw-r--r--src/translator_za.h28
-rw-r--r--src/types.h4
-rw-r--r--src/utf8.cpp208
-rw-r--r--src/utf8.h72
-rw-r--r--src/util.cpp1179
-rw-r--r--src/util.h199
-rw-r--r--src/vhdlcode.h4
-rw-r--r--src/vhdlcode.l199
-rw-r--r--src/vhdldocgen.cpp413
-rw-r--r--src/vhdldocgen.h47
-rw-r--r--src/vhdljjparser.cpp57
-rwxr-xr-xsrc/vhdljjparser.h11
-rw-r--r--src/xmlcode.h4
-rw-r--r--src/xmlcode.l18
-rw-r--r--src/xmldocvisitor.cpp83
-rw-r--r--src/xmldocvisitor.h12
-rw-r--r--src/xmlgen.cpp800
-rw-r--r--src/xmlgen.h42
280 files changed, 21451 insertions, 14344 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7b421f6..1840648 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,7 +1,7 @@
# vim:ts=4:sw=4:expandtab:autoindent:
include_directories(
- ${PROJECT_SOURCE_DIR}/qtools
+ ${PROJECT_SOURCE_DIR}/filesystem
${PROJECT_SOURCE_DIR}/libmd5
${PROJECT_SOURCE_DIR}/liblodepng
${PROJECT_SOURCE_DIR}/libmscgen
@@ -166,7 +166,6 @@ add_library(doxycfg STATIC
${GENERATED_SRC}/settings.h
portable.cpp
portable_c.c
- ftextstream.cpp
message.cpp
debug.cpp
)
@@ -225,6 +224,7 @@ add_library(doxymain STATIC
classdef.cpp
classlist.cpp
cmdmapper.cpp
+ conceptdef.cpp
condparser.cpp
context.cpp
cppvalue.cpp
@@ -232,6 +232,7 @@ add_library(doxymain STATIC
definition.cpp
dia.cpp
diagram.cpp
+ dir.cpp
dirdef.cpp
docbookgen.cpp
docbookvisitor.cpp
@@ -256,6 +257,7 @@ add_library(doxymain STATIC
emoji.cpp
entry.cpp
filedef.cpp
+ fileinfo.cpp
fileparser.cpp
formula.cpp
ftvhelp.cpp
@@ -284,6 +286,7 @@ add_library(doxymain STATIC
pagedef.cpp
perlmodgen.cpp
plantuml.cpp
+ qcstring.cpp
qhp.cpp
qhpxmlwriter.cpp
reflist.cpp
@@ -300,6 +303,7 @@ add_library(doxymain STATIC
template.cpp
textdocvisitor.cpp
tooltip.cpp
+ utf8.cpp
util.cpp
vhdldocgen.cpp
vhdljjparser.cpp
@@ -349,7 +353,6 @@ endif()
target_link_libraries(doxygen PRIVATE
doxymain
doxycfg
- qtools
md5
lodepng
mscgen
@@ -369,7 +372,6 @@ set_project_warnings(doxycfg)
set_project_warnings(doxymain)
set_project_warnings(doxygen)
-set_project_coverage(qtools)
set_project_coverage(doxycfg)
set_project_coverage(doxymain)
set_project_coverage(doxygen)
diff --git a/src/arguments.h b/src/arguments.h
index 181a8d3..56dd7af 100644
--- a/src/arguments.h
+++ b/src/arguments.h
@@ -17,7 +17,7 @@
#define ARGUMENTS_H
#include <vector>
-#include <qcstring.h>
+#include "qcstring.h"
/*! \brief This class contains the information about the argument of a
* function or template
diff --git a/src/bufstr.h b/src/bufstr.h
index fcdce6b..323f4bc 100644
--- a/src/bufstr.h
+++ b/src/bufstr.h
@@ -19,7 +19,7 @@
#define _BUFSTR_H
#include <cstdlib>
-#include <qcstring.h>
+#include "qcstring.h"
/*! @brief Buffer used to store strings
*
diff --git a/src/caseconvert.h b/src/caseconvert.h
new file mode 100644
index 0000000..be0cafc
--- /dev/null
+++ b/src/caseconvert.h
@@ -0,0 +1,2906 @@
+/** This file is generated by python3 caseconvert.py. DO NOT EDIT! */
+
+#ifndef CASECONVERT_H
+#define CASECONVERT_H
+
+#include <cstdint>
+#include <string>
+
+#define BSEQ(...) { static unsigned char s[] = { __VA_ARGS__, 0x00 }; \
+ return reinterpret_cast<const char *>(s); }
+
+inline const char *convertUnicodeToUpper(uint32_t code)
+{
+ switch(code)
+ {
+ case 0x61 /* a */: BSEQ(0x41) /* A */;
+ case 0x62 /* b */: BSEQ(0x42) /* B */;
+ case 0x63 /* c */: BSEQ(0x43) /* C */;
+ case 0x64 /* d */: BSEQ(0x44) /* D */;
+ case 0x65 /* e */: BSEQ(0x45) /* E */;
+ case 0x66 /* f */: BSEQ(0x46) /* F */;
+ case 0x67 /* g */: BSEQ(0x47) /* G */;
+ case 0x68 /* h */: BSEQ(0x48) /* H */;
+ case 0x69 /* i */: BSEQ(0x49) /* I */;
+ case 0x6a /* j */: BSEQ(0x4a) /* J */;
+ case 0x6b /* k */: BSEQ(0x4b) /* K */;
+ case 0x6c /* l */: BSEQ(0x4c) /* L */;
+ case 0x6d /* m */: BSEQ(0x4d) /* M */;
+ case 0x6e /* n */: BSEQ(0x4e) /* N */;
+ case 0x6f /* o */: BSEQ(0x4f) /* O */;
+ case 0x70 /* p */: BSEQ(0x50) /* P */;
+ case 0x71 /* q */: BSEQ(0x51) /* Q */;
+ case 0x72 /* r */: BSEQ(0x52) /* R */;
+ case 0x73 /* s */: BSEQ(0x53) /* S */;
+ case 0x74 /* t */: BSEQ(0x54) /* T */;
+ case 0x75 /* u */: BSEQ(0x55) /* U */;
+ case 0x76 /* v */: BSEQ(0x56) /* V */;
+ case 0x77 /* w */: BSEQ(0x57) /* W */;
+ case 0x78 /* x */: BSEQ(0x58) /* X */;
+ case 0x79 /* y */: BSEQ(0x59) /* Y */;
+ case 0x7a /* z */: BSEQ(0x5a) /* Z */;
+ case 0xb5 /* µ */: BSEQ(0xce,0x9c) /* Μ */;
+ case 0xdf /* ß */: BSEQ(0x53,0x53) /* SS */;
+ case 0xe0 /* à */: BSEQ(0xc3,0x80) /* À */;
+ case 0xe1 /* á */: BSEQ(0xc3,0x81) /* Á */;
+ case 0xe2 /* â */: BSEQ(0xc3,0x82) /* Â */;
+ case 0xe3 /* ã */: BSEQ(0xc3,0x83) /* Ã */;
+ case 0xe4 /* ä */: BSEQ(0xc3,0x84) /* Ä */;
+ case 0xe5 /* å */: BSEQ(0xc3,0x85) /* Å */;
+ case 0xe6 /* æ */: BSEQ(0xc3,0x86) /* Æ */;
+ case 0xe7 /* ç */: BSEQ(0xc3,0x87) /* Ç */;
+ case 0xe8 /* è */: BSEQ(0xc3,0x88) /* È */;
+ case 0xe9 /* é */: BSEQ(0xc3,0x89) /* É */;
+ case 0xea /* ê */: BSEQ(0xc3,0x8a) /* Ê */;
+ case 0xeb /* ë */: BSEQ(0xc3,0x8b) /* Ë */;
+ case 0xec /* ì */: BSEQ(0xc3,0x8c) /* Ì */;
+ case 0xed /* í */: BSEQ(0xc3,0x8d) /* Í */;
+ case 0xee /* î */: BSEQ(0xc3,0x8e) /* Î */;
+ case 0xef /* ï */: BSEQ(0xc3,0x8f) /* Ï */;
+ case 0xf0 /* ð */: BSEQ(0xc3,0x90) /* Ð */;
+ case 0xf1 /* ñ */: BSEQ(0xc3,0x91) /* Ñ */;
+ case 0xf2 /* ò */: BSEQ(0xc3,0x92) /* Ò */;
+ case 0xf3 /* ó */: BSEQ(0xc3,0x93) /* Ó */;
+ case 0xf4 /* ô */: BSEQ(0xc3,0x94) /* Ô */;
+ case 0xf5 /* õ */: BSEQ(0xc3,0x95) /* Õ */;
+ case 0xf6 /* ö */: BSEQ(0xc3,0x96) /* Ö */;
+ case 0xf8 /* ø */: BSEQ(0xc3,0x98) /* Ø */;
+ case 0xf9 /* ù */: BSEQ(0xc3,0x99) /* Ù */;
+ case 0xfa /* ú */: BSEQ(0xc3,0x9a) /* Ú */;
+ case 0xfb /* û */: BSEQ(0xc3,0x9b) /* Û */;
+ case 0xfc /* ü */: BSEQ(0xc3,0x9c) /* Ü */;
+ case 0xfd /* ý */: BSEQ(0xc3,0x9d) /* Ý */;
+ case 0xfe /* þ */: BSEQ(0xc3,0x9e) /* Þ */;
+ case 0xff /* ÿ */: BSEQ(0xc5,0xb8) /* Ÿ */;
+ case 0x101 /* ā */: BSEQ(0xc4,0x80) /* Ā */;
+ case 0x103 /* ă */: BSEQ(0xc4,0x82) /* Ă */;
+ case 0x105 /* ą */: BSEQ(0xc4,0x84) /* Ą */;
+ case 0x107 /* ć */: BSEQ(0xc4,0x86) /* Ć */;
+ case 0x109 /* ĉ */: BSEQ(0xc4,0x88) /* Ĉ */;
+ case 0x10b /* ċ */: BSEQ(0xc4,0x8a) /* Ċ */;
+ case 0x10d /* č */: BSEQ(0xc4,0x8c) /* Č */;
+ case 0x10f /* ď */: BSEQ(0xc4,0x8e) /* Ď */;
+ case 0x111 /* đ */: BSEQ(0xc4,0x90) /* Đ */;
+ case 0x113 /* ē */: BSEQ(0xc4,0x92) /* Ē */;
+ case 0x115 /* ĕ */: BSEQ(0xc4,0x94) /* Ĕ */;
+ case 0x117 /* ė */: BSEQ(0xc4,0x96) /* Ė */;
+ case 0x119 /* ę */: BSEQ(0xc4,0x98) /* Ę */;
+ case 0x11b /* ě */: BSEQ(0xc4,0x9a) /* Ě */;
+ case 0x11d /* ĝ */: BSEQ(0xc4,0x9c) /* Ĝ */;
+ case 0x11f /* ğ */: BSEQ(0xc4,0x9e) /* Ğ */;
+ case 0x121 /* ġ */: BSEQ(0xc4,0xa0) /* Ġ */;
+ case 0x123 /* ģ */: BSEQ(0xc4,0xa2) /* Ģ */;
+ case 0x125 /* ĥ */: BSEQ(0xc4,0xa4) /* Ĥ */;
+ case 0x127 /* ħ */: BSEQ(0xc4,0xa6) /* Ħ */;
+ case 0x129 /* ĩ */: BSEQ(0xc4,0xa8) /* Ĩ */;
+ case 0x12b /* ī */: BSEQ(0xc4,0xaa) /* Ī */;
+ case 0x12d /* ĭ */: BSEQ(0xc4,0xac) /* Ĭ */;
+ case 0x12f /* į */: BSEQ(0xc4,0xae) /* Į */;
+ case 0x131 /* ı */: BSEQ(0x49) /* I */;
+ case 0x133 /* ij */: BSEQ(0xc4,0xb2) /* IJ */;
+ case 0x135 /* ĵ */: BSEQ(0xc4,0xb4) /* Ĵ */;
+ case 0x137 /* ķ */: BSEQ(0xc4,0xb6) /* Ķ */;
+ case 0x13a /* ĺ */: BSEQ(0xc4,0xb9) /* Ĺ */;
+ case 0x13c /* ļ */: BSEQ(0xc4,0xbb) /* Ļ */;
+ case 0x13e /* ľ */: BSEQ(0xc4,0xbd) /* Ľ */;
+ case 0x140 /* ŀ */: BSEQ(0xc4,0xbf) /* Ŀ */;
+ case 0x142 /* ł */: BSEQ(0xc5,0x81) /* Ł */;
+ case 0x144 /* ń */: BSEQ(0xc5,0x83) /* Ń */;
+ case 0x146 /* ņ */: BSEQ(0xc5,0x85) /* Ņ */;
+ case 0x148 /* ň */: BSEQ(0xc5,0x87) /* Ň */;
+ case 0x149 /* ʼn */: BSEQ(0xca,0xbc,0x4e) /* ʼN */;
+ case 0x14b /* ŋ */: BSEQ(0xc5,0x8a) /* Ŋ */;
+ case 0x14d /* ō */: BSEQ(0xc5,0x8c) /* Ō */;
+ case 0x14f /* ŏ */: BSEQ(0xc5,0x8e) /* Ŏ */;
+ case 0x151 /* ő */: BSEQ(0xc5,0x90) /* Ő */;
+ case 0x153 /* œ */: BSEQ(0xc5,0x92) /* Œ */;
+ case 0x155 /* ŕ */: BSEQ(0xc5,0x94) /* Ŕ */;
+ case 0x157 /* ŗ */: BSEQ(0xc5,0x96) /* Ŗ */;
+ case 0x159 /* ř */: BSEQ(0xc5,0x98) /* Ř */;
+ case 0x15b /* ś */: BSEQ(0xc5,0x9a) /* Ś */;
+ case 0x15d /* ŝ */: BSEQ(0xc5,0x9c) /* Ŝ */;
+ case 0x15f /* ş */: BSEQ(0xc5,0x9e) /* Ş */;
+ case 0x161 /* š */: BSEQ(0xc5,0xa0) /* Š */;
+ case 0x163 /* ţ */: BSEQ(0xc5,0xa2) /* Ţ */;
+ case 0x165 /* ť */: BSEQ(0xc5,0xa4) /* Ť */;
+ case 0x167 /* ŧ */: BSEQ(0xc5,0xa6) /* Ŧ */;
+ case 0x169 /* ũ */: BSEQ(0xc5,0xa8) /* Ũ */;
+ case 0x16b /* ū */: BSEQ(0xc5,0xaa) /* Ū */;
+ case 0x16d /* ŭ */: BSEQ(0xc5,0xac) /* Ŭ */;
+ case 0x16f /* ů */: BSEQ(0xc5,0xae) /* Ů */;
+ case 0x171 /* ű */: BSEQ(0xc5,0xb0) /* Ű */;
+ case 0x173 /* ų */: BSEQ(0xc5,0xb2) /* Ų */;
+ case 0x175 /* ŵ */: BSEQ(0xc5,0xb4) /* Ŵ */;
+ case 0x177 /* ŷ */: BSEQ(0xc5,0xb6) /* Ŷ */;
+ case 0x17a /* ź */: BSEQ(0xc5,0xb9) /* Ź */;
+ case 0x17c /* ż */: BSEQ(0xc5,0xbb) /* Ż */;
+ case 0x17e /* ž */: BSEQ(0xc5,0xbd) /* Ž */;
+ case 0x17f /* ſ */: BSEQ(0x53) /* S */;
+ case 0x180 /* ƀ */: BSEQ(0xc9,0x83) /* Ƀ */;
+ case 0x183 /* ƃ */: BSEQ(0xc6,0x82) /* Ƃ */;
+ case 0x185 /* ƅ */: BSEQ(0xc6,0x84) /* Ƅ */;
+ case 0x188 /* ƈ */: BSEQ(0xc6,0x87) /* Ƈ */;
+ case 0x18c /* ƌ */: BSEQ(0xc6,0x8b) /* Ƌ */;
+ case 0x192 /* ƒ */: BSEQ(0xc6,0x91) /* Ƒ */;
+ case 0x195 /* ƕ */: BSEQ(0xc7,0xb6) /* Ƕ */;
+ case 0x199 /* ƙ */: BSEQ(0xc6,0x98) /* Ƙ */;
+ case 0x19a /* ƚ */: BSEQ(0xc8,0xbd) /* Ƚ */;
+ case 0x19e /* ƞ */: BSEQ(0xc8,0xa0) /* Ƞ */;
+ case 0x1a1 /* ơ */: BSEQ(0xc6,0xa0) /* Ơ */;
+ case 0x1a3 /* ƣ */: BSEQ(0xc6,0xa2) /* Ƣ */;
+ case 0x1a5 /* ƥ */: BSEQ(0xc6,0xa4) /* Ƥ */;
+ case 0x1a8 /* ƨ */: BSEQ(0xc6,0xa7) /* Ƨ */;
+ case 0x1ad /* ƭ */: BSEQ(0xc6,0xac) /* Ƭ */;
+ case 0x1b0 /* ư */: BSEQ(0xc6,0xaf) /* Ư */;
+ case 0x1b4 /* ƴ */: BSEQ(0xc6,0xb3) /* Ƴ */;
+ case 0x1b6 /* ƶ */: BSEQ(0xc6,0xb5) /* Ƶ */;
+ case 0x1b9 /* ƹ */: BSEQ(0xc6,0xb8) /* Ƹ */;
+ case 0x1bd /* ƽ */: BSEQ(0xc6,0xbc) /* Ƽ */;
+ case 0x1bf /* ƿ */: BSEQ(0xc7,0xb7) /* Ƿ */;
+ case 0x1c5 /* Dž */: BSEQ(0xc7,0x84) /* DŽ */;
+ case 0x1c6 /* dž */: BSEQ(0xc7,0x84) /* DŽ */;
+ case 0x1c8 /* Lj */: BSEQ(0xc7,0x87) /* LJ */;
+ case 0x1c9 /* lj */: BSEQ(0xc7,0x87) /* LJ */;
+ case 0x1cb /* Nj */: BSEQ(0xc7,0x8a) /* NJ */;
+ case 0x1cc /* nj */: BSEQ(0xc7,0x8a) /* NJ */;
+ case 0x1ce /* ǎ */: BSEQ(0xc7,0x8d) /* Ǎ */;
+ case 0x1d0 /* ǐ */: BSEQ(0xc7,0x8f) /* Ǐ */;
+ case 0x1d2 /* ǒ */: BSEQ(0xc7,0x91) /* Ǒ */;
+ case 0x1d4 /* ǔ */: BSEQ(0xc7,0x93) /* Ǔ */;
+ case 0x1d6 /* ǖ */: BSEQ(0xc7,0x95) /* Ǖ */;
+ case 0x1d8 /* ǘ */: BSEQ(0xc7,0x97) /* Ǘ */;
+ case 0x1da /* ǚ */: BSEQ(0xc7,0x99) /* Ǚ */;
+ case 0x1dc /* ǜ */: BSEQ(0xc7,0x9b) /* Ǜ */;
+ case 0x1dd /* ǝ */: BSEQ(0xc6,0x8e) /* Ǝ */;
+ case 0x1df /* ǟ */: BSEQ(0xc7,0x9e) /* Ǟ */;
+ case 0x1e1 /* ǡ */: BSEQ(0xc7,0xa0) /* Ǡ */;
+ case 0x1e3 /* ǣ */: BSEQ(0xc7,0xa2) /* Ǣ */;
+ case 0x1e5 /* ǥ */: BSEQ(0xc7,0xa4) /* Ǥ */;
+ case 0x1e7 /* ǧ */: BSEQ(0xc7,0xa6) /* Ǧ */;
+ case 0x1e9 /* ǩ */: BSEQ(0xc7,0xa8) /* Ǩ */;
+ case 0x1eb /* ǫ */: BSEQ(0xc7,0xaa) /* Ǫ */;
+ case 0x1ed /* ǭ */: BSEQ(0xc7,0xac) /* Ǭ */;
+ case 0x1ef /* ǯ */: BSEQ(0xc7,0xae) /* Ǯ */;
+ case 0x1f0 /* ǰ */: BSEQ(0x4a,0xcc,0x8c) /* J̌ */;
+ case 0x1f2 /* Dz */: BSEQ(0xc7,0xb1) /* DZ */;
+ case 0x1f3 /* dz */: BSEQ(0xc7,0xb1) /* DZ */;
+ case 0x1f5 /* ǵ */: BSEQ(0xc7,0xb4) /* Ǵ */;
+ case 0x1f9 /* ǹ */: BSEQ(0xc7,0xb8) /* Ǹ */;
+ case 0x1fb /* ǻ */: BSEQ(0xc7,0xba) /* Ǻ */;
+ case 0x1fd /* ǽ */: BSEQ(0xc7,0xbc) /* Ǽ */;
+ case 0x1ff /* ǿ */: BSEQ(0xc7,0xbe) /* Ǿ */;
+ case 0x201 /* ȁ */: BSEQ(0xc8,0x80) /* Ȁ */;
+ case 0x203 /* ȃ */: BSEQ(0xc8,0x82) /* Ȃ */;
+ case 0x205 /* ȅ */: BSEQ(0xc8,0x84) /* Ȅ */;
+ case 0x207 /* ȇ */: BSEQ(0xc8,0x86) /* Ȇ */;
+ case 0x209 /* ȉ */: BSEQ(0xc8,0x88) /* Ȉ */;
+ case 0x20b /* ȋ */: BSEQ(0xc8,0x8a) /* Ȋ */;
+ case 0x20d /* ȍ */: BSEQ(0xc8,0x8c) /* Ȍ */;
+ case 0x20f /* ȏ */: BSEQ(0xc8,0x8e) /* Ȏ */;
+ case 0x211 /* ȑ */: BSEQ(0xc8,0x90) /* Ȑ */;
+ case 0x213 /* ȓ */: BSEQ(0xc8,0x92) /* Ȓ */;
+ case 0x215 /* ȕ */: BSEQ(0xc8,0x94) /* Ȕ */;
+ case 0x217 /* ȗ */: BSEQ(0xc8,0x96) /* Ȗ */;
+ case 0x219 /* ș */: BSEQ(0xc8,0x98) /* Ș */;
+ case 0x21b /* ț */: BSEQ(0xc8,0x9a) /* Ț */;
+ case 0x21d /* ȝ */: BSEQ(0xc8,0x9c) /* Ȝ */;
+ case 0x21f /* ȟ */: BSEQ(0xc8,0x9e) /* Ȟ */;
+ case 0x223 /* ȣ */: BSEQ(0xc8,0xa2) /* Ȣ */;
+ case 0x225 /* ȥ */: BSEQ(0xc8,0xa4) /* Ȥ */;
+ case 0x227 /* ȧ */: BSEQ(0xc8,0xa6) /* Ȧ */;
+ case 0x229 /* ȩ */: BSEQ(0xc8,0xa8) /* Ȩ */;
+ case 0x22b /* ȫ */: BSEQ(0xc8,0xaa) /* Ȫ */;
+ case 0x22d /* ȭ */: BSEQ(0xc8,0xac) /* Ȭ */;
+ case 0x22f /* ȯ */: BSEQ(0xc8,0xae) /* Ȯ */;
+ case 0x231 /* ȱ */: BSEQ(0xc8,0xb0) /* Ȱ */;
+ case 0x233 /* ȳ */: BSEQ(0xc8,0xb2) /* Ȳ */;
+ case 0x23c /* ȼ */: BSEQ(0xc8,0xbb) /* Ȼ */;
+ case 0x23f /* ȿ */: BSEQ(0xe2,0xb1,0xbe) /* Ȿ */;
+ case 0x240 /* ɀ */: BSEQ(0xe2,0xb1,0xbf) /* Ɀ */;
+ case 0x242 /* ɂ */: BSEQ(0xc9,0x81) /* Ɂ */;
+ case 0x247 /* ɇ */: BSEQ(0xc9,0x86) /* Ɇ */;
+ case 0x249 /* ɉ */: BSEQ(0xc9,0x88) /* Ɉ */;
+ case 0x24b /* ɋ */: BSEQ(0xc9,0x8a) /* Ɋ */;
+ case 0x24d /* ɍ */: BSEQ(0xc9,0x8c) /* Ɍ */;
+ case 0x24f /* ɏ */: BSEQ(0xc9,0x8e) /* Ɏ */;
+ case 0x250 /* ɐ */: BSEQ(0xe2,0xb1,0xaf) /* Ɐ */;
+ case 0x251 /* ɑ */: BSEQ(0xe2,0xb1,0xad) /* Ɑ */;
+ case 0x252 /* ɒ */: BSEQ(0xe2,0xb1,0xb0) /* Ɒ */;
+ case 0x253 /* ɓ */: BSEQ(0xc6,0x81) /* Ɓ */;
+ case 0x254 /* ɔ */: BSEQ(0xc6,0x86) /* Ɔ */;
+ case 0x256 /* ɖ */: BSEQ(0xc6,0x89) /* Ɖ */;
+ case 0x257 /* ɗ */: BSEQ(0xc6,0x8a) /* Ɗ */;
+ case 0x259 /* ə */: BSEQ(0xc6,0x8f) /* Ə */;
+ case 0x25b /* ɛ */: BSEQ(0xc6,0x90) /* Ɛ */;
+ case 0x25c /* ɜ */: BSEQ(0xea,0x9e,0xab) /* Ɜ */;
+ case 0x260 /* ɠ */: BSEQ(0xc6,0x93) /* Ɠ */;
+ case 0x261 /* ɡ */: BSEQ(0xea,0x9e,0xac) /* Ɡ */;
+ case 0x263 /* ɣ */: BSEQ(0xc6,0x94) /* Ɣ */;
+ case 0x265 /* ɥ */: BSEQ(0xea,0x9e,0x8d) /* Ɥ */;
+ case 0x266 /* ɦ */: BSEQ(0xea,0x9e,0xaa) /* Ɦ */;
+ case 0x268 /* ɨ */: BSEQ(0xc6,0x97) /* Ɨ */;
+ case 0x269 /* ɩ */: BSEQ(0xc6,0x96) /* Ɩ */;
+ case 0x26a /* ɪ */: BSEQ(0xea,0x9e,0xae) /* Ɪ */;
+ case 0x26b /* ɫ */: BSEQ(0xe2,0xb1,0xa2) /* Ɫ */;
+ case 0x26c /* ɬ */: BSEQ(0xea,0x9e,0xad) /* Ɬ */;
+ case 0x26f /* ɯ */: BSEQ(0xc6,0x9c) /* Ɯ */;
+ case 0x271 /* ɱ */: BSEQ(0xe2,0xb1,0xae) /* Ɱ */;
+ case 0x272 /* ɲ */: BSEQ(0xc6,0x9d) /* Ɲ */;
+ case 0x275 /* ɵ */: BSEQ(0xc6,0x9f) /* Ɵ */;
+ case 0x27d /* ɽ */: BSEQ(0xe2,0xb1,0xa4) /* Ɽ */;
+ case 0x280 /* ʀ */: BSEQ(0xc6,0xa6) /* Ʀ */;
+ case 0x282 /* ʂ */: BSEQ(0xea,0x9f,0x85) /* Ʂ */;
+ case 0x283 /* ʃ */: BSEQ(0xc6,0xa9) /* Ʃ */;
+ case 0x287 /* ʇ */: BSEQ(0xea,0x9e,0xb1) /* Ʇ */;
+ case 0x288 /* ʈ */: BSEQ(0xc6,0xae) /* Ʈ */;
+ case 0x289 /* ʉ */: BSEQ(0xc9,0x84) /* Ʉ */;
+ case 0x28a /* ʊ */: BSEQ(0xc6,0xb1) /* Ʊ */;
+ case 0x28b /* ʋ */: BSEQ(0xc6,0xb2) /* Ʋ */;
+ case 0x28c /* ʌ */: BSEQ(0xc9,0x85) /* Ʌ */;
+ case 0x292 /* ʒ */: BSEQ(0xc6,0xb7) /* Ʒ */;
+ case 0x29d /* ʝ */: BSEQ(0xea,0x9e,0xb2) /* Ʝ */;
+ case 0x29e /* ʞ */: BSEQ(0xea,0x9e,0xb0) /* Ʞ */;
+ case 0x345 /* ͅ */: BSEQ(0xce,0x99) /* Ι */;
+ case 0x371 /* ͱ */: BSEQ(0xcd,0xb0) /* Ͱ */;
+ case 0x373 /* ͳ */: BSEQ(0xcd,0xb2) /* Ͳ */;
+ case 0x377 /* ͷ */: BSEQ(0xcd,0xb6) /* Ͷ */;
+ case 0x37b /* ͻ */: BSEQ(0xcf,0xbd) /* Ͻ */;
+ case 0x37c /* ͼ */: BSEQ(0xcf,0xbe) /* Ͼ */;
+ case 0x37d /* ͽ */: BSEQ(0xcf,0xbf) /* Ͽ */;
+ case 0x390 /* ΐ */: BSEQ(0xce,0x99,0xcc,0x88,0xcc,0x81) /* Ϊ́ */;
+ case 0x3ac /* ά */: BSEQ(0xce,0x86) /* Ά */;
+ case 0x3ad /* έ */: BSEQ(0xce,0x88) /* Έ */;
+ case 0x3ae /* ή */: BSEQ(0xce,0x89) /* Ή */;
+ case 0x3af /* ί */: BSEQ(0xce,0x8a) /* Ί */;
+ case 0x3b0 /* ΰ */: BSEQ(0xce,0xa5,0xcc,0x88,0xcc,0x81) /* Ϋ́ */;
+ case 0x3b1 /* α */: BSEQ(0xce,0x91) /* Α */;
+ case 0x3b2 /* β */: BSEQ(0xce,0x92) /* Β */;
+ case 0x3b3 /* γ */: BSEQ(0xce,0x93) /* Γ */;
+ case 0x3b4 /* δ */: BSEQ(0xce,0x94) /* Δ */;
+ case 0x3b5 /* ε */: BSEQ(0xce,0x95) /* Ε */;
+ case 0x3b6 /* ζ */: BSEQ(0xce,0x96) /* Ζ */;
+ case 0x3b7 /* η */: BSEQ(0xce,0x97) /* Η */;
+ case 0x3b8 /* θ */: BSEQ(0xce,0x98) /* Θ */;
+ case 0x3b9 /* ι */: BSEQ(0xce,0x99) /* Ι */;
+ case 0x3ba /* κ */: BSEQ(0xce,0x9a) /* Κ */;
+ case 0x3bb /* λ */: BSEQ(0xce,0x9b) /* Λ */;
+ case 0x3bc /* μ */: BSEQ(0xce,0x9c) /* Μ */;
+ case 0x3bd /* ν */: BSEQ(0xce,0x9d) /* Ν */;
+ case 0x3be /* ξ */: BSEQ(0xce,0x9e) /* Ξ */;
+ case 0x3bf /* ο */: BSEQ(0xce,0x9f) /* Ο */;
+ case 0x3c0 /* π */: BSEQ(0xce,0xa0) /* Π */;
+ case 0x3c1 /* ρ */: BSEQ(0xce,0xa1) /* Ρ */;
+ case 0x3c2 /* ς */: BSEQ(0xce,0xa3) /* Σ */;
+ case 0x3c3 /* σ */: BSEQ(0xce,0xa3) /* Σ */;
+ case 0x3c4 /* τ */: BSEQ(0xce,0xa4) /* Τ */;
+ case 0x3c5 /* υ */: BSEQ(0xce,0xa5) /* Υ */;
+ case 0x3c6 /* φ */: BSEQ(0xce,0xa6) /* Φ */;
+ case 0x3c7 /* χ */: BSEQ(0xce,0xa7) /* Χ */;
+ case 0x3c8 /* ψ */: BSEQ(0xce,0xa8) /* Ψ */;
+ case 0x3c9 /* ω */: BSEQ(0xce,0xa9) /* Ω */;
+ case 0x3ca /* ϊ */: BSEQ(0xce,0xaa) /* Ϊ */;
+ case 0x3cb /* ϋ */: BSEQ(0xce,0xab) /* Ϋ */;
+ case 0x3cc /* ό */: BSEQ(0xce,0x8c) /* Ό */;
+ case 0x3cd /* ύ */: BSEQ(0xce,0x8e) /* Ύ */;
+ case 0x3ce /* ώ */: BSEQ(0xce,0x8f) /* Ώ */;
+ case 0x3d0 /* ϐ */: BSEQ(0xce,0x92) /* Β */;
+ case 0x3d1 /* ϑ */: BSEQ(0xce,0x98) /* Θ */;
+ case 0x3d5 /* ϕ */: BSEQ(0xce,0xa6) /* Φ */;
+ case 0x3d6 /* ϖ */: BSEQ(0xce,0xa0) /* Π */;
+ case 0x3d7 /* ϗ */: BSEQ(0xcf,0x8f) /* Ϗ */;
+ case 0x3d9 /* ϙ */: BSEQ(0xcf,0x98) /* Ϙ */;
+ case 0x3db /* ϛ */: BSEQ(0xcf,0x9a) /* Ϛ */;
+ case 0x3dd /* ϝ */: BSEQ(0xcf,0x9c) /* Ϝ */;
+ case 0x3df /* ϟ */: BSEQ(0xcf,0x9e) /* Ϟ */;
+ case 0x3e1 /* ϡ */: BSEQ(0xcf,0xa0) /* Ϡ */;
+ case 0x3e3 /* ϣ */: BSEQ(0xcf,0xa2) /* Ϣ */;
+ case 0x3e5 /* ϥ */: BSEQ(0xcf,0xa4) /* Ϥ */;
+ case 0x3e7 /* ϧ */: BSEQ(0xcf,0xa6) /* Ϧ */;
+ case 0x3e9 /* ϩ */: BSEQ(0xcf,0xa8) /* Ϩ */;
+ case 0x3eb /* ϫ */: BSEQ(0xcf,0xaa) /* Ϫ */;
+ case 0x3ed /* ϭ */: BSEQ(0xcf,0xac) /* Ϭ */;
+ case 0x3ef /* ϯ */: BSEQ(0xcf,0xae) /* Ϯ */;
+ case 0x3f0 /* ϰ */: BSEQ(0xce,0x9a) /* Κ */;
+ case 0x3f1 /* ϱ */: BSEQ(0xce,0xa1) /* Ρ */;
+ case 0x3f2 /* ϲ */: BSEQ(0xcf,0xb9) /* Ϲ */;
+ case 0x3f3 /* ϳ */: BSEQ(0xcd,0xbf) /* Ϳ */;
+ case 0x3f5 /* ϵ */: BSEQ(0xce,0x95) /* Ε */;
+ case 0x3f8 /* ϸ */: BSEQ(0xcf,0xb7) /* Ϸ */;
+ case 0x3fb /* ϻ */: BSEQ(0xcf,0xba) /* Ϻ */;
+ case 0x430 /* а */: BSEQ(0xd0,0x90) /* А */;
+ case 0x431 /* б */: BSEQ(0xd0,0x91) /* Б */;
+ case 0x432 /* в */: BSEQ(0xd0,0x92) /* В */;
+ case 0x433 /* г */: BSEQ(0xd0,0x93) /* Г */;
+ case 0x434 /* д */: BSEQ(0xd0,0x94) /* Д */;
+ case 0x435 /* е */: BSEQ(0xd0,0x95) /* Е */;
+ case 0x436 /* ж */: BSEQ(0xd0,0x96) /* Ж */;
+ case 0x437 /* з */: BSEQ(0xd0,0x97) /* З */;
+ case 0x438 /* и */: BSEQ(0xd0,0x98) /* И */;
+ case 0x439 /* й */: BSEQ(0xd0,0x99) /* Й */;
+ case 0x43a /* к */: BSEQ(0xd0,0x9a) /* К */;
+ case 0x43b /* л */: BSEQ(0xd0,0x9b) /* Л */;
+ case 0x43c /* м */: BSEQ(0xd0,0x9c) /* М */;
+ case 0x43d /* н */: BSEQ(0xd0,0x9d) /* Н */;
+ case 0x43e /* о */: BSEQ(0xd0,0x9e) /* О */;
+ case 0x43f /* п */: BSEQ(0xd0,0x9f) /* П */;
+ case 0x440 /* р */: BSEQ(0xd0,0xa0) /* Р */;
+ case 0x441 /* с */: BSEQ(0xd0,0xa1) /* С */;
+ case 0x442 /* т */: BSEQ(0xd0,0xa2) /* Т */;
+ case 0x443 /* у */: BSEQ(0xd0,0xa3) /* У */;
+ case 0x444 /* ф */: BSEQ(0xd0,0xa4) /* Ф */;
+ case 0x445 /* х */: BSEQ(0xd0,0xa5) /* Х */;
+ case 0x446 /* ц */: BSEQ(0xd0,0xa6) /* Ц */;
+ case 0x447 /* ч */: BSEQ(0xd0,0xa7) /* Ч */;
+ case 0x448 /* ш */: BSEQ(0xd0,0xa8) /* Ш */;
+ case 0x449 /* щ */: BSEQ(0xd0,0xa9) /* Щ */;
+ case 0x44a /* ъ */: BSEQ(0xd0,0xaa) /* Ъ */;
+ case 0x44b /* ы */: BSEQ(0xd0,0xab) /* Ы */;
+ case 0x44c /* ь */: BSEQ(0xd0,0xac) /* Ь */;
+ case 0x44d /* э */: BSEQ(0xd0,0xad) /* Э */;
+ case 0x44e /* ю */: BSEQ(0xd0,0xae) /* Ю */;
+ case 0x44f /* я */: BSEQ(0xd0,0xaf) /* Я */;
+ case 0x450 /* ѐ */: BSEQ(0xd0,0x80) /* Ѐ */;
+ case 0x451 /* ё */: BSEQ(0xd0,0x81) /* Ё */;
+ case 0x452 /* ђ */: BSEQ(0xd0,0x82) /* Ђ */;
+ case 0x453 /* ѓ */: BSEQ(0xd0,0x83) /* Ѓ */;
+ case 0x454 /* є */: BSEQ(0xd0,0x84) /* Є */;
+ case 0x455 /* ѕ */: BSEQ(0xd0,0x85) /* Ѕ */;
+ case 0x456 /* і */: BSEQ(0xd0,0x86) /* І */;
+ case 0x457 /* ї */: BSEQ(0xd0,0x87) /* Ї */;
+ case 0x458 /* ј */: BSEQ(0xd0,0x88) /* Ј */;
+ case 0x459 /* љ */: BSEQ(0xd0,0x89) /* Љ */;
+ case 0x45a /* њ */: BSEQ(0xd0,0x8a) /* Њ */;
+ case 0x45b /* ћ */: BSEQ(0xd0,0x8b) /* Ћ */;
+ case 0x45c /* ќ */: BSEQ(0xd0,0x8c) /* Ќ */;
+ case 0x45d /* ѝ */: BSEQ(0xd0,0x8d) /* Ѝ */;
+ case 0x45e /* ў */: BSEQ(0xd0,0x8e) /* Ў */;
+ case 0x45f /* џ */: BSEQ(0xd0,0x8f) /* Џ */;
+ case 0x461 /* ѡ */: BSEQ(0xd1,0xa0) /* Ѡ */;
+ case 0x463 /* ѣ */: BSEQ(0xd1,0xa2) /* Ѣ */;
+ case 0x465 /* ѥ */: BSEQ(0xd1,0xa4) /* Ѥ */;
+ case 0x467 /* ѧ */: BSEQ(0xd1,0xa6) /* Ѧ */;
+ case 0x469 /* ѩ */: BSEQ(0xd1,0xa8) /* Ѩ */;
+ case 0x46b /* ѫ */: BSEQ(0xd1,0xaa) /* Ѫ */;
+ case 0x46d /* ѭ */: BSEQ(0xd1,0xac) /* Ѭ */;
+ case 0x46f /* ѯ */: BSEQ(0xd1,0xae) /* Ѯ */;
+ case 0x471 /* ѱ */: BSEQ(0xd1,0xb0) /* Ѱ */;
+ case 0x473 /* ѳ */: BSEQ(0xd1,0xb2) /* Ѳ */;
+ case 0x475 /* ѵ */: BSEQ(0xd1,0xb4) /* Ѵ */;
+ case 0x477 /* ѷ */: BSEQ(0xd1,0xb6) /* Ѷ */;
+ case 0x479 /* ѹ */: BSEQ(0xd1,0xb8) /* Ѹ */;
+ case 0x47b /* ѻ */: BSEQ(0xd1,0xba) /* Ѻ */;
+ case 0x47d /* ѽ */: BSEQ(0xd1,0xbc) /* Ѽ */;
+ case 0x47f /* ѿ */: BSEQ(0xd1,0xbe) /* Ѿ */;
+ case 0x481 /* ҁ */: BSEQ(0xd2,0x80) /* Ҁ */;
+ case 0x48b /* ҋ */: BSEQ(0xd2,0x8a) /* Ҋ */;
+ case 0x48d /* ҍ */: BSEQ(0xd2,0x8c) /* Ҍ */;
+ case 0x48f /* ҏ */: BSEQ(0xd2,0x8e) /* Ҏ */;
+ case 0x491 /* ґ */: BSEQ(0xd2,0x90) /* Ґ */;
+ case 0x493 /* ғ */: BSEQ(0xd2,0x92) /* Ғ */;
+ case 0x495 /* ҕ */: BSEQ(0xd2,0x94) /* Ҕ */;
+ case 0x497 /* җ */: BSEQ(0xd2,0x96) /* Җ */;
+ case 0x499 /* ҙ */: BSEQ(0xd2,0x98) /* Ҙ */;
+ case 0x49b /* қ */: BSEQ(0xd2,0x9a) /* Қ */;
+ case 0x49d /* ҝ */: BSEQ(0xd2,0x9c) /* Ҝ */;
+ case 0x49f /* ҟ */: BSEQ(0xd2,0x9e) /* Ҟ */;
+ case 0x4a1 /* ҡ */: BSEQ(0xd2,0xa0) /* Ҡ */;
+ case 0x4a3 /* ң */: BSEQ(0xd2,0xa2) /* Ң */;
+ case 0x4a5 /* ҥ */: BSEQ(0xd2,0xa4) /* Ҥ */;
+ case 0x4a7 /* ҧ */: BSEQ(0xd2,0xa6) /* Ҧ */;
+ case 0x4a9 /* ҩ */: BSEQ(0xd2,0xa8) /* Ҩ */;
+ case 0x4ab /* ҫ */: BSEQ(0xd2,0xaa) /* Ҫ */;
+ case 0x4ad /* ҭ */: BSEQ(0xd2,0xac) /* Ҭ */;
+ case 0x4af /* ү */: BSEQ(0xd2,0xae) /* Ү */;
+ case 0x4b1 /* ұ */: BSEQ(0xd2,0xb0) /* Ұ */;
+ case 0x4b3 /* ҳ */: BSEQ(0xd2,0xb2) /* Ҳ */;
+ case 0x4b5 /* ҵ */: BSEQ(0xd2,0xb4) /* Ҵ */;
+ case 0x4b7 /* ҷ */: BSEQ(0xd2,0xb6) /* Ҷ */;
+ case 0x4b9 /* ҹ */: BSEQ(0xd2,0xb8) /* Ҹ */;
+ case 0x4bb /* һ */: BSEQ(0xd2,0xba) /* Һ */;
+ case 0x4bd /* ҽ */: BSEQ(0xd2,0xbc) /* Ҽ */;
+ case 0x4bf /* ҿ */: BSEQ(0xd2,0xbe) /* Ҿ */;
+ case 0x4c2 /* ӂ */: BSEQ(0xd3,0x81) /* Ӂ */;
+ case 0x4c4 /* ӄ */: BSEQ(0xd3,0x83) /* Ӄ */;
+ case 0x4c6 /* ӆ */: BSEQ(0xd3,0x85) /* Ӆ */;
+ case 0x4c8 /* ӈ */: BSEQ(0xd3,0x87) /* Ӈ */;
+ case 0x4ca /* ӊ */: BSEQ(0xd3,0x89) /* Ӊ */;
+ case 0x4cc /* ӌ */: BSEQ(0xd3,0x8b) /* Ӌ */;
+ case 0x4ce /* ӎ */: BSEQ(0xd3,0x8d) /* Ӎ */;
+ case 0x4cf /* ӏ */: BSEQ(0xd3,0x80) /* Ӏ */;
+ case 0x4d1 /* ӑ */: BSEQ(0xd3,0x90) /* Ӑ */;
+ case 0x4d3 /* ӓ */: BSEQ(0xd3,0x92) /* Ӓ */;
+ case 0x4d5 /* ӕ */: BSEQ(0xd3,0x94) /* Ӕ */;
+ case 0x4d7 /* ӗ */: BSEQ(0xd3,0x96) /* Ӗ */;
+ case 0x4d9 /* ә */: BSEQ(0xd3,0x98) /* Ә */;
+ case 0x4db /* ӛ */: BSEQ(0xd3,0x9a) /* Ӛ */;
+ case 0x4dd /* ӝ */: BSEQ(0xd3,0x9c) /* Ӝ */;
+ case 0x4df /* ӟ */: BSEQ(0xd3,0x9e) /* Ӟ */;
+ case 0x4e1 /* ӡ */: BSEQ(0xd3,0xa0) /* Ӡ */;
+ case 0x4e3 /* ӣ */: BSEQ(0xd3,0xa2) /* Ӣ */;
+ case 0x4e5 /* ӥ */: BSEQ(0xd3,0xa4) /* Ӥ */;
+ case 0x4e7 /* ӧ */: BSEQ(0xd3,0xa6) /* Ӧ */;
+ case 0x4e9 /* ө */: BSEQ(0xd3,0xa8) /* Ө */;
+ case 0x4eb /* ӫ */: BSEQ(0xd3,0xaa) /* Ӫ */;
+ case 0x4ed /* ӭ */: BSEQ(0xd3,0xac) /* Ӭ */;
+ case 0x4ef /* ӯ */: BSEQ(0xd3,0xae) /* Ӯ */;
+ case 0x4f1 /* ӱ */: BSEQ(0xd3,0xb0) /* Ӱ */;
+ case 0x4f3 /* ӳ */: BSEQ(0xd3,0xb2) /* Ӳ */;
+ case 0x4f5 /* ӵ */: BSEQ(0xd3,0xb4) /* Ӵ */;
+ case 0x4f7 /* ӷ */: BSEQ(0xd3,0xb6) /* Ӷ */;
+ case 0x4f9 /* ӹ */: BSEQ(0xd3,0xb8) /* Ӹ */;
+ case 0x4fb /* ӻ */: BSEQ(0xd3,0xba) /* Ӻ */;
+ case 0x4fd /* ӽ */: BSEQ(0xd3,0xbc) /* Ӽ */;
+ case 0x4ff /* ӿ */: BSEQ(0xd3,0xbe) /* Ӿ */;
+ case 0x501 /* ԁ */: BSEQ(0xd4,0x80) /* Ԁ */;
+ case 0x503 /* ԃ */: BSEQ(0xd4,0x82) /* Ԃ */;
+ case 0x505 /* ԅ */: BSEQ(0xd4,0x84) /* Ԅ */;
+ case 0x507 /* ԇ */: BSEQ(0xd4,0x86) /* Ԇ */;
+ case 0x509 /* ԉ */: BSEQ(0xd4,0x88) /* Ԉ */;
+ case 0x50b /* ԋ */: BSEQ(0xd4,0x8a) /* Ԋ */;
+ case 0x50d /* ԍ */: BSEQ(0xd4,0x8c) /* Ԍ */;
+ case 0x50f /* ԏ */: BSEQ(0xd4,0x8e) /* Ԏ */;
+ case 0x511 /* ԑ */: BSEQ(0xd4,0x90) /* Ԑ */;
+ case 0x513 /* ԓ */: BSEQ(0xd4,0x92) /* Ԓ */;
+ case 0x515 /* ԕ */: BSEQ(0xd4,0x94) /* Ԕ */;
+ case 0x517 /* ԗ */: BSEQ(0xd4,0x96) /* Ԗ */;
+ case 0x519 /* ԙ */: BSEQ(0xd4,0x98) /* Ԙ */;
+ case 0x51b /* ԛ */: BSEQ(0xd4,0x9a) /* Ԛ */;
+ case 0x51d /* ԝ */: BSEQ(0xd4,0x9c) /* Ԝ */;
+ case 0x51f /* ԟ */: BSEQ(0xd4,0x9e) /* Ԟ */;
+ case 0x521 /* ԡ */: BSEQ(0xd4,0xa0) /* Ԡ */;
+ case 0x523 /* ԣ */: BSEQ(0xd4,0xa2) /* Ԣ */;
+ case 0x525 /* ԥ */: BSEQ(0xd4,0xa4) /* Ԥ */;
+ case 0x527 /* ԧ */: BSEQ(0xd4,0xa6) /* Ԧ */;
+ case 0x529 /* ԩ */: BSEQ(0xd4,0xa8) /* Ԩ */;
+ case 0x52b /* ԫ */: BSEQ(0xd4,0xaa) /* Ԫ */;
+ case 0x52d /* ԭ */: BSEQ(0xd4,0xac) /* Ԭ */;
+ case 0x52f /* ԯ */: BSEQ(0xd4,0xae) /* Ԯ */;
+ case 0x561 /* ա */: BSEQ(0xd4,0xb1) /* Ա */;
+ case 0x562 /* բ */: BSEQ(0xd4,0xb2) /* Բ */;
+ case 0x563 /* գ */: BSEQ(0xd4,0xb3) /* Գ */;
+ case 0x564 /* դ */: BSEQ(0xd4,0xb4) /* Դ */;
+ case 0x565 /* ե */: BSEQ(0xd4,0xb5) /* Ե */;
+ case 0x566 /* զ */: BSEQ(0xd4,0xb6) /* Զ */;
+ case 0x567 /* է */: BSEQ(0xd4,0xb7) /* Է */;
+ case 0x568 /* ը */: BSEQ(0xd4,0xb8) /* Ը */;
+ case 0x569 /* թ */: BSEQ(0xd4,0xb9) /* Թ */;
+ case 0x56a /* ժ */: BSEQ(0xd4,0xba) /* Ժ */;
+ case 0x56b /* ի */: BSEQ(0xd4,0xbb) /* Ի */;
+ case 0x56c /* լ */: BSEQ(0xd4,0xbc) /* Լ */;
+ case 0x56d /* խ */: BSEQ(0xd4,0xbd) /* Խ */;
+ case 0x56e /* ծ */: BSEQ(0xd4,0xbe) /* Ծ */;
+ case 0x56f /* կ */: BSEQ(0xd4,0xbf) /* Կ */;
+ case 0x570 /* հ */: BSEQ(0xd5,0x80) /* Հ */;
+ case 0x571 /* ձ */: BSEQ(0xd5,0x81) /* Ձ */;
+ case 0x572 /* ղ */: BSEQ(0xd5,0x82) /* Ղ */;
+ case 0x573 /* ճ */: BSEQ(0xd5,0x83) /* Ճ */;
+ case 0x574 /* մ */: BSEQ(0xd5,0x84) /* Մ */;
+ case 0x575 /* յ */: BSEQ(0xd5,0x85) /* Յ */;
+ case 0x576 /* ն */: BSEQ(0xd5,0x86) /* Ն */;
+ case 0x577 /* շ */: BSEQ(0xd5,0x87) /* Շ */;
+ case 0x578 /* ո */: BSEQ(0xd5,0x88) /* Ո */;
+ case 0x579 /* չ */: BSEQ(0xd5,0x89) /* Չ */;
+ case 0x57a /* պ */: BSEQ(0xd5,0x8a) /* Պ */;
+ case 0x57b /* ջ */: BSEQ(0xd5,0x8b) /* Ջ */;
+ case 0x57c /* ռ */: BSEQ(0xd5,0x8c) /* Ռ */;
+ case 0x57d /* ս */: BSEQ(0xd5,0x8d) /* Ս */;
+ case 0x57e /* վ */: BSEQ(0xd5,0x8e) /* Վ */;
+ case 0x57f /* տ */: BSEQ(0xd5,0x8f) /* Տ */;
+ case 0x580 /* ր */: BSEQ(0xd5,0x90) /* Ր */;
+ case 0x581 /* ց */: BSEQ(0xd5,0x91) /* Ց */;
+ case 0x582 /* ւ */: BSEQ(0xd5,0x92) /* Ւ */;
+ case 0x583 /* փ */: BSEQ(0xd5,0x93) /* Փ */;
+ case 0x584 /* ք */: BSEQ(0xd5,0x94) /* Ք */;
+ case 0x585 /* օ */: BSEQ(0xd5,0x95) /* Օ */;
+ case 0x586 /* ֆ */: BSEQ(0xd5,0x96) /* Ֆ */;
+ case 0x587 /* և */: BSEQ(0xd4,0xb5,0xd5,0x92) /* ԵՒ */;
+ case 0x10d0 /* ა */: BSEQ(0xe1,0xb2,0x90) /* Ა */;
+ case 0x10d1 /* ბ */: BSEQ(0xe1,0xb2,0x91) /* Ბ */;
+ case 0x10d2 /* გ */: BSEQ(0xe1,0xb2,0x92) /* Გ */;
+ case 0x10d3 /* დ */: BSEQ(0xe1,0xb2,0x93) /* Დ */;
+ case 0x10d4 /* ე */: BSEQ(0xe1,0xb2,0x94) /* Ე */;
+ case 0x10d5 /* ვ */: BSEQ(0xe1,0xb2,0x95) /* Ვ */;
+ case 0x10d6 /* ზ */: BSEQ(0xe1,0xb2,0x96) /* Ზ */;
+ case 0x10d7 /* თ */: BSEQ(0xe1,0xb2,0x97) /* Თ */;
+ case 0x10d8 /* ი */: BSEQ(0xe1,0xb2,0x98) /* Ი */;
+ case 0x10d9 /* კ */: BSEQ(0xe1,0xb2,0x99) /* Კ */;
+ case 0x10da /* ლ */: BSEQ(0xe1,0xb2,0x9a) /* Ლ */;
+ case 0x10db /* მ */: BSEQ(0xe1,0xb2,0x9b) /* Მ */;
+ case 0x10dc /* ნ */: BSEQ(0xe1,0xb2,0x9c) /* Ნ */;
+ case 0x10dd /* ო */: BSEQ(0xe1,0xb2,0x9d) /* Ო */;
+ case 0x10de /* პ */: BSEQ(0xe1,0xb2,0x9e) /* Პ */;
+ case 0x10df /* ჟ */: BSEQ(0xe1,0xb2,0x9f) /* Ჟ */;
+ case 0x10e0 /* რ */: BSEQ(0xe1,0xb2,0xa0) /* Რ */;
+ case 0x10e1 /* ს */: BSEQ(0xe1,0xb2,0xa1) /* Ს */;
+ case 0x10e2 /* ტ */: BSEQ(0xe1,0xb2,0xa2) /* Ტ */;
+ case 0x10e3 /* უ */: BSEQ(0xe1,0xb2,0xa3) /* Უ */;
+ case 0x10e4 /* ფ */: BSEQ(0xe1,0xb2,0xa4) /* Ფ */;
+ case 0x10e5 /* ქ */: BSEQ(0xe1,0xb2,0xa5) /* Ქ */;
+ case 0x10e6 /* ღ */: BSEQ(0xe1,0xb2,0xa6) /* Ღ */;
+ case 0x10e7 /* ყ */: BSEQ(0xe1,0xb2,0xa7) /* Ყ */;
+ case 0x10e8 /* შ */: BSEQ(0xe1,0xb2,0xa8) /* Შ */;
+ case 0x10e9 /* ჩ */: BSEQ(0xe1,0xb2,0xa9) /* Ჩ */;
+ case 0x10ea /* ც */: BSEQ(0xe1,0xb2,0xaa) /* Ც */;
+ case 0x10eb /* ძ */: BSEQ(0xe1,0xb2,0xab) /* Ძ */;
+ case 0x10ec /* წ */: BSEQ(0xe1,0xb2,0xac) /* Წ */;
+ case 0x10ed /* ჭ */: BSEQ(0xe1,0xb2,0xad) /* Ჭ */;
+ case 0x10ee /* ხ */: BSEQ(0xe1,0xb2,0xae) /* Ხ */;
+ case 0x10ef /* ჯ */: BSEQ(0xe1,0xb2,0xaf) /* Ჯ */;
+ case 0x10f0 /* ჰ */: BSEQ(0xe1,0xb2,0xb0) /* Ჰ */;
+ case 0x10f1 /* ჱ */: BSEQ(0xe1,0xb2,0xb1) /* Ჱ */;
+ case 0x10f2 /* ჲ */: BSEQ(0xe1,0xb2,0xb2) /* Ჲ */;
+ case 0x10f3 /* ჳ */: BSEQ(0xe1,0xb2,0xb3) /* Ჳ */;
+ case 0x10f4 /* ჴ */: BSEQ(0xe1,0xb2,0xb4) /* Ჴ */;
+ case 0x10f5 /* ჵ */: BSEQ(0xe1,0xb2,0xb5) /* Ჵ */;
+ case 0x10f6 /* ჶ */: BSEQ(0xe1,0xb2,0xb6) /* Ჶ */;
+ case 0x10f7 /* ჷ */: BSEQ(0xe1,0xb2,0xb7) /* Ჷ */;
+ case 0x10f8 /* ჸ */: BSEQ(0xe1,0xb2,0xb8) /* Ჸ */;
+ case 0x10f9 /* ჹ */: BSEQ(0xe1,0xb2,0xb9) /* Ჹ */;
+ case 0x10fa /* ჺ */: BSEQ(0xe1,0xb2,0xba) /* Ჺ */;
+ case 0x10fd /* ჽ */: BSEQ(0xe1,0xb2,0xbd) /* Ჽ */;
+ case 0x10fe /* ჾ */: BSEQ(0xe1,0xb2,0xbe) /* Ჾ */;
+ case 0x10ff /* ჿ */: BSEQ(0xe1,0xb2,0xbf) /* Ჿ */;
+ case 0x13f8 /* ᏸ */: BSEQ(0xe1,0x8f,0xb0) /* Ᏸ */;
+ case 0x13f9 /* ᏹ */: BSEQ(0xe1,0x8f,0xb1) /* Ᏹ */;
+ case 0x13fa /* ᏺ */: BSEQ(0xe1,0x8f,0xb2) /* Ᏺ */;
+ case 0x13fb /* ᏻ */: BSEQ(0xe1,0x8f,0xb3) /* Ᏻ */;
+ case 0x13fc /* ᏼ */: BSEQ(0xe1,0x8f,0xb4) /* Ᏼ */;
+ case 0x13fd /* ᏽ */: BSEQ(0xe1,0x8f,0xb5) /* Ᏽ */;
+ case 0x1c80 /* ᲀ */: BSEQ(0xd0,0x92) /* В */;
+ case 0x1c81 /* ᲁ */: BSEQ(0xd0,0x94) /* Д */;
+ case 0x1c82 /* ᲂ */: BSEQ(0xd0,0x9e) /* О */;
+ case 0x1c83 /* ᲃ */: BSEQ(0xd0,0xa1) /* С */;
+ case 0x1c84 /* ᲄ */: BSEQ(0xd0,0xa2) /* Т */;
+ case 0x1c85 /* ᲅ */: BSEQ(0xd0,0xa2) /* Т */;
+ case 0x1c86 /* ᲆ */: BSEQ(0xd0,0xaa) /* Ъ */;
+ case 0x1c87 /* ᲇ */: BSEQ(0xd1,0xa2) /* Ѣ */;
+ case 0x1c88 /* ᲈ */: BSEQ(0xea,0x99,0x8a) /* Ꙋ */;
+ case 0x1d79 /* ᵹ */: BSEQ(0xea,0x9d,0xbd) /* Ᵹ */;
+ case 0x1d7d /* ᵽ */: BSEQ(0xe2,0xb1,0xa3) /* Ᵽ */;
+ case 0x1d8e /* ᶎ */: BSEQ(0xea,0x9f,0x86) /* Ᶎ */;
+ case 0x1e01 /* ḁ */: BSEQ(0xe1,0xb8,0x80) /* Ḁ */;
+ case 0x1e03 /* ḃ */: BSEQ(0xe1,0xb8,0x82) /* Ḃ */;
+ case 0x1e05 /* ḅ */: BSEQ(0xe1,0xb8,0x84) /* Ḅ */;
+ case 0x1e07 /* ḇ */: BSEQ(0xe1,0xb8,0x86) /* Ḇ */;
+ case 0x1e09 /* ḉ */: BSEQ(0xe1,0xb8,0x88) /* Ḉ */;
+ case 0x1e0b /* ḋ */: BSEQ(0xe1,0xb8,0x8a) /* Ḋ */;
+ case 0x1e0d /* ḍ */: BSEQ(0xe1,0xb8,0x8c) /* Ḍ */;
+ case 0x1e0f /* ḏ */: BSEQ(0xe1,0xb8,0x8e) /* Ḏ */;
+ case 0x1e11 /* ḑ */: BSEQ(0xe1,0xb8,0x90) /* Ḑ */;
+ case 0x1e13 /* ḓ */: BSEQ(0xe1,0xb8,0x92) /* Ḓ */;
+ case 0x1e15 /* ḕ */: BSEQ(0xe1,0xb8,0x94) /* Ḕ */;
+ case 0x1e17 /* ḗ */: BSEQ(0xe1,0xb8,0x96) /* Ḗ */;
+ case 0x1e19 /* ḙ */: BSEQ(0xe1,0xb8,0x98) /* Ḙ */;
+ case 0x1e1b /* ḛ */: BSEQ(0xe1,0xb8,0x9a) /* Ḛ */;
+ case 0x1e1d /* ḝ */: BSEQ(0xe1,0xb8,0x9c) /* Ḝ */;
+ case 0x1e1f /* ḟ */: BSEQ(0xe1,0xb8,0x9e) /* Ḟ */;
+ case 0x1e21 /* ḡ */: BSEQ(0xe1,0xb8,0xa0) /* Ḡ */;
+ case 0x1e23 /* ḣ */: BSEQ(0xe1,0xb8,0xa2) /* Ḣ */;
+ case 0x1e25 /* ḥ */: BSEQ(0xe1,0xb8,0xa4) /* Ḥ */;
+ case 0x1e27 /* ḧ */: BSEQ(0xe1,0xb8,0xa6) /* Ḧ */;
+ case 0x1e29 /* ḩ */: BSEQ(0xe1,0xb8,0xa8) /* Ḩ */;
+ case 0x1e2b /* ḫ */: BSEQ(0xe1,0xb8,0xaa) /* Ḫ */;
+ case 0x1e2d /* ḭ */: BSEQ(0xe1,0xb8,0xac) /* Ḭ */;
+ case 0x1e2f /* ḯ */: BSEQ(0xe1,0xb8,0xae) /* Ḯ */;
+ case 0x1e31 /* ḱ */: BSEQ(0xe1,0xb8,0xb0) /* Ḱ */;
+ case 0x1e33 /* ḳ */: BSEQ(0xe1,0xb8,0xb2) /* Ḳ */;
+ case 0x1e35 /* ḵ */: BSEQ(0xe1,0xb8,0xb4) /* Ḵ */;
+ case 0x1e37 /* ḷ */: BSEQ(0xe1,0xb8,0xb6) /* Ḷ */;
+ case 0x1e39 /* ḹ */: BSEQ(0xe1,0xb8,0xb8) /* Ḹ */;
+ case 0x1e3b /* ḻ */: BSEQ(0xe1,0xb8,0xba) /* Ḻ */;
+ case 0x1e3d /* ḽ */: BSEQ(0xe1,0xb8,0xbc) /* Ḽ */;
+ case 0x1e3f /* ḿ */: BSEQ(0xe1,0xb8,0xbe) /* Ḿ */;
+ case 0x1e41 /* ṁ */: BSEQ(0xe1,0xb9,0x80) /* Ṁ */;
+ case 0x1e43 /* ṃ */: BSEQ(0xe1,0xb9,0x82) /* Ṃ */;
+ case 0x1e45 /* ṅ */: BSEQ(0xe1,0xb9,0x84) /* Ṅ */;
+ case 0x1e47 /* ṇ */: BSEQ(0xe1,0xb9,0x86) /* Ṇ */;
+ case 0x1e49 /* ṉ */: BSEQ(0xe1,0xb9,0x88) /* Ṉ */;
+ case 0x1e4b /* ṋ */: BSEQ(0xe1,0xb9,0x8a) /* Ṋ */;
+ case 0x1e4d /* ṍ */: BSEQ(0xe1,0xb9,0x8c) /* Ṍ */;
+ case 0x1e4f /* ṏ */: BSEQ(0xe1,0xb9,0x8e) /* Ṏ */;
+ case 0x1e51 /* ṑ */: BSEQ(0xe1,0xb9,0x90) /* Ṑ */;
+ case 0x1e53 /* ṓ */: BSEQ(0xe1,0xb9,0x92) /* Ṓ */;
+ case 0x1e55 /* ṕ */: BSEQ(0xe1,0xb9,0x94) /* Ṕ */;
+ case 0x1e57 /* ṗ */: BSEQ(0xe1,0xb9,0x96) /* Ṗ */;
+ case 0x1e59 /* ṙ */: BSEQ(0xe1,0xb9,0x98) /* Ṙ */;
+ case 0x1e5b /* ṛ */: BSEQ(0xe1,0xb9,0x9a) /* Ṛ */;
+ case 0x1e5d /* ṝ */: BSEQ(0xe1,0xb9,0x9c) /* Ṝ */;
+ case 0x1e5f /* ṟ */: BSEQ(0xe1,0xb9,0x9e) /* Ṟ */;
+ case 0x1e61 /* ṡ */: BSEQ(0xe1,0xb9,0xa0) /* Ṡ */;
+ case 0x1e63 /* ṣ */: BSEQ(0xe1,0xb9,0xa2) /* Ṣ */;
+ case 0x1e65 /* ṥ */: BSEQ(0xe1,0xb9,0xa4) /* Ṥ */;
+ case 0x1e67 /* ṧ */: BSEQ(0xe1,0xb9,0xa6) /* Ṧ */;
+ case 0x1e69 /* ṩ */: BSEQ(0xe1,0xb9,0xa8) /* Ṩ */;
+ case 0x1e6b /* ṫ */: BSEQ(0xe1,0xb9,0xaa) /* Ṫ */;
+ case 0x1e6d /* ṭ */: BSEQ(0xe1,0xb9,0xac) /* Ṭ */;
+ case 0x1e6f /* ṯ */: BSEQ(0xe1,0xb9,0xae) /* Ṯ */;
+ case 0x1e71 /* ṱ */: BSEQ(0xe1,0xb9,0xb0) /* Ṱ */;
+ case 0x1e73 /* ṳ */: BSEQ(0xe1,0xb9,0xb2) /* Ṳ */;
+ case 0x1e75 /* ṵ */: BSEQ(0xe1,0xb9,0xb4) /* Ṵ */;
+ case 0x1e77 /* ṷ */: BSEQ(0xe1,0xb9,0xb6) /* Ṷ */;
+ case 0x1e79 /* ṹ */: BSEQ(0xe1,0xb9,0xb8) /* Ṹ */;
+ case 0x1e7b /* ṻ */: BSEQ(0xe1,0xb9,0xba) /* Ṻ */;
+ case 0x1e7d /* ṽ */: BSEQ(0xe1,0xb9,0xbc) /* Ṽ */;
+ case 0x1e7f /* ṿ */: BSEQ(0xe1,0xb9,0xbe) /* Ṿ */;
+ case 0x1e81 /* ẁ */: BSEQ(0xe1,0xba,0x80) /* Ẁ */;
+ case 0x1e83 /* ẃ */: BSEQ(0xe1,0xba,0x82) /* Ẃ */;
+ case 0x1e85 /* ẅ */: BSEQ(0xe1,0xba,0x84) /* Ẅ */;
+ case 0x1e87 /* ẇ */: BSEQ(0xe1,0xba,0x86) /* Ẇ */;
+ case 0x1e89 /* ẉ */: BSEQ(0xe1,0xba,0x88) /* Ẉ */;
+ case 0x1e8b /* ẋ */: BSEQ(0xe1,0xba,0x8a) /* Ẋ */;
+ case 0x1e8d /* ẍ */: BSEQ(0xe1,0xba,0x8c) /* Ẍ */;
+ case 0x1e8f /* ẏ */: BSEQ(0xe1,0xba,0x8e) /* Ẏ */;
+ case 0x1e91 /* ẑ */: BSEQ(0xe1,0xba,0x90) /* Ẑ */;
+ case 0x1e93 /* ẓ */: BSEQ(0xe1,0xba,0x92) /* Ẓ */;
+ case 0x1e95 /* ẕ */: BSEQ(0xe1,0xba,0x94) /* Ẕ */;
+ case 0x1e96 /* ẖ */: BSEQ(0x48,0xcc,0xb1) /* H̱ */;
+ case 0x1e97 /* ẗ */: BSEQ(0x54,0xcc,0x88) /* T̈ */;
+ case 0x1e98 /* ẘ */: BSEQ(0x57,0xcc,0x8a) /* W̊ */;
+ case 0x1e99 /* ẙ */: BSEQ(0x59,0xcc,0x8a) /* Y̊ */;
+ case 0x1e9a /* ẚ */: BSEQ(0x41,0xca,0xbe) /* Aʾ */;
+ case 0x1e9b /* ẛ */: BSEQ(0xe1,0xb9,0xa0) /* Ṡ */;
+ case 0x1ea1 /* ạ */: BSEQ(0xe1,0xba,0xa0) /* Ạ */;
+ case 0x1ea3 /* ả */: BSEQ(0xe1,0xba,0xa2) /* Ả */;
+ case 0x1ea5 /* ấ */: BSEQ(0xe1,0xba,0xa4) /* Ấ */;
+ case 0x1ea7 /* ầ */: BSEQ(0xe1,0xba,0xa6) /* Ầ */;
+ case 0x1ea9 /* ẩ */: BSEQ(0xe1,0xba,0xa8) /* Ẩ */;
+ case 0x1eab /* ẫ */: BSEQ(0xe1,0xba,0xaa) /* Ẫ */;
+ case 0x1ead /* ậ */: BSEQ(0xe1,0xba,0xac) /* Ậ */;
+ case 0x1eaf /* ắ */: BSEQ(0xe1,0xba,0xae) /* Ắ */;
+ case 0x1eb1 /* ằ */: BSEQ(0xe1,0xba,0xb0) /* Ằ */;
+ case 0x1eb3 /* ẳ */: BSEQ(0xe1,0xba,0xb2) /* Ẳ */;
+ case 0x1eb5 /* ẵ */: BSEQ(0xe1,0xba,0xb4) /* Ẵ */;
+ case 0x1eb7 /* ặ */: BSEQ(0xe1,0xba,0xb6) /* Ặ */;
+ case 0x1eb9 /* ẹ */: BSEQ(0xe1,0xba,0xb8) /* Ẹ */;
+ case 0x1ebb /* ẻ */: BSEQ(0xe1,0xba,0xba) /* Ẻ */;
+ case 0x1ebd /* ẽ */: BSEQ(0xe1,0xba,0xbc) /* Ẽ */;
+ case 0x1ebf /* ế */: BSEQ(0xe1,0xba,0xbe) /* Ế */;
+ case 0x1ec1 /* ề */: BSEQ(0xe1,0xbb,0x80) /* Ề */;
+ case 0x1ec3 /* ể */: BSEQ(0xe1,0xbb,0x82) /* Ể */;
+ case 0x1ec5 /* ễ */: BSEQ(0xe1,0xbb,0x84) /* Ễ */;
+ case 0x1ec7 /* ệ */: BSEQ(0xe1,0xbb,0x86) /* Ệ */;
+ case 0x1ec9 /* ỉ */: BSEQ(0xe1,0xbb,0x88) /* Ỉ */;
+ case 0x1ecb /* ị */: BSEQ(0xe1,0xbb,0x8a) /* Ị */;
+ case 0x1ecd /* ọ */: BSEQ(0xe1,0xbb,0x8c) /* Ọ */;
+ case 0x1ecf /* ỏ */: BSEQ(0xe1,0xbb,0x8e) /* Ỏ */;
+ case 0x1ed1 /* ố */: BSEQ(0xe1,0xbb,0x90) /* Ố */;
+ case 0x1ed3 /* ồ */: BSEQ(0xe1,0xbb,0x92) /* Ồ */;
+ case 0x1ed5 /* ổ */: BSEQ(0xe1,0xbb,0x94) /* Ổ */;
+ case 0x1ed7 /* ỗ */: BSEQ(0xe1,0xbb,0x96) /* Ỗ */;
+ case 0x1ed9 /* ộ */: BSEQ(0xe1,0xbb,0x98) /* Ộ */;
+ case 0x1edb /* ớ */: BSEQ(0xe1,0xbb,0x9a) /* Ớ */;
+ case 0x1edd /* ờ */: BSEQ(0xe1,0xbb,0x9c) /* Ờ */;
+ case 0x1edf /* ở */: BSEQ(0xe1,0xbb,0x9e) /* Ở */;
+ case 0x1ee1 /* ỡ */: BSEQ(0xe1,0xbb,0xa0) /* Ỡ */;
+ case 0x1ee3 /* ợ */: BSEQ(0xe1,0xbb,0xa2) /* Ợ */;
+ case 0x1ee5 /* ụ */: BSEQ(0xe1,0xbb,0xa4) /* Ụ */;
+ case 0x1ee7 /* ủ */: BSEQ(0xe1,0xbb,0xa6) /* Ủ */;
+ case 0x1ee9 /* ứ */: BSEQ(0xe1,0xbb,0xa8) /* Ứ */;
+ case 0x1eeb /* ừ */: BSEQ(0xe1,0xbb,0xaa) /* Ừ */;
+ case 0x1eed /* ử */: BSEQ(0xe1,0xbb,0xac) /* Ử */;
+ case 0x1eef /* ữ */: BSEQ(0xe1,0xbb,0xae) /* Ữ */;
+ case 0x1ef1 /* ự */: BSEQ(0xe1,0xbb,0xb0) /* Ự */;
+ case 0x1ef3 /* ỳ */: BSEQ(0xe1,0xbb,0xb2) /* Ỳ */;
+ case 0x1ef5 /* ỵ */: BSEQ(0xe1,0xbb,0xb4) /* Ỵ */;
+ case 0x1ef7 /* ỷ */: BSEQ(0xe1,0xbb,0xb6) /* Ỷ */;
+ case 0x1ef9 /* ỹ */: BSEQ(0xe1,0xbb,0xb8) /* Ỹ */;
+ case 0x1efb /* ỻ */: BSEQ(0xe1,0xbb,0xba) /* Ỻ */;
+ case 0x1efd /* ỽ */: BSEQ(0xe1,0xbb,0xbc) /* Ỽ */;
+ case 0x1eff /* ỿ */: BSEQ(0xe1,0xbb,0xbe) /* Ỿ */;
+ case 0x1f00 /* ἀ */: BSEQ(0xe1,0xbc,0x88) /* Ἀ */;
+ case 0x1f01 /* ἁ */: BSEQ(0xe1,0xbc,0x89) /* Ἁ */;
+ case 0x1f02 /* ἂ */: BSEQ(0xe1,0xbc,0x8a) /* Ἂ */;
+ case 0x1f03 /* ἃ */: BSEQ(0xe1,0xbc,0x8b) /* Ἃ */;
+ case 0x1f04 /* ἄ */: BSEQ(0xe1,0xbc,0x8c) /* Ἄ */;
+ case 0x1f05 /* ἅ */: BSEQ(0xe1,0xbc,0x8d) /* Ἅ */;
+ case 0x1f06 /* ἆ */: BSEQ(0xe1,0xbc,0x8e) /* Ἆ */;
+ case 0x1f07 /* ἇ */: BSEQ(0xe1,0xbc,0x8f) /* Ἇ */;
+ case 0x1f10 /* ἐ */: BSEQ(0xe1,0xbc,0x98) /* Ἐ */;
+ case 0x1f11 /* ἑ */: BSEQ(0xe1,0xbc,0x99) /* Ἑ */;
+ case 0x1f12 /* ἒ */: BSEQ(0xe1,0xbc,0x9a) /* Ἒ */;
+ case 0x1f13 /* ἓ */: BSEQ(0xe1,0xbc,0x9b) /* Ἓ */;
+ case 0x1f14 /* ἔ */: BSEQ(0xe1,0xbc,0x9c) /* Ἔ */;
+ case 0x1f15 /* ἕ */: BSEQ(0xe1,0xbc,0x9d) /* Ἕ */;
+ case 0x1f20 /* ἠ */: BSEQ(0xe1,0xbc,0xa8) /* Ἠ */;
+ case 0x1f21 /* ἡ */: BSEQ(0xe1,0xbc,0xa9) /* Ἡ */;
+ case 0x1f22 /* ἢ */: BSEQ(0xe1,0xbc,0xaa) /* Ἢ */;
+ case 0x1f23 /* ἣ */: BSEQ(0xe1,0xbc,0xab) /* Ἣ */;
+ case 0x1f24 /* ἤ */: BSEQ(0xe1,0xbc,0xac) /* Ἤ */;
+ case 0x1f25 /* ἥ */: BSEQ(0xe1,0xbc,0xad) /* Ἥ */;
+ case 0x1f26 /* ἦ */: BSEQ(0xe1,0xbc,0xae) /* Ἦ */;
+ case 0x1f27 /* ἧ */: BSEQ(0xe1,0xbc,0xaf) /* Ἧ */;
+ case 0x1f30 /* ἰ */: BSEQ(0xe1,0xbc,0xb8) /* Ἰ */;
+ case 0x1f31 /* ἱ */: BSEQ(0xe1,0xbc,0xb9) /* Ἱ */;
+ case 0x1f32 /* ἲ */: BSEQ(0xe1,0xbc,0xba) /* Ἲ */;
+ case 0x1f33 /* ἳ */: BSEQ(0xe1,0xbc,0xbb) /* Ἳ */;
+ case 0x1f34 /* ἴ */: BSEQ(0xe1,0xbc,0xbc) /* Ἴ */;
+ case 0x1f35 /* ἵ */: BSEQ(0xe1,0xbc,0xbd) /* Ἵ */;
+ case 0x1f36 /* ἶ */: BSEQ(0xe1,0xbc,0xbe) /* Ἶ */;
+ case 0x1f37 /* ἷ */: BSEQ(0xe1,0xbc,0xbf) /* Ἷ */;
+ case 0x1f40 /* ὀ */: BSEQ(0xe1,0xbd,0x88) /* Ὀ */;
+ case 0x1f41 /* ὁ */: BSEQ(0xe1,0xbd,0x89) /* Ὁ */;
+ case 0x1f42 /* ὂ */: BSEQ(0xe1,0xbd,0x8a) /* Ὂ */;
+ case 0x1f43 /* ὃ */: BSEQ(0xe1,0xbd,0x8b) /* Ὃ */;
+ case 0x1f44 /* ὄ */: BSEQ(0xe1,0xbd,0x8c) /* Ὄ */;
+ case 0x1f45 /* ὅ */: BSEQ(0xe1,0xbd,0x8d) /* Ὅ */;
+ case 0x1f50 /* ὐ */: BSEQ(0xce,0xa5,0xcc,0x93) /* Υ̓ */;
+ case 0x1f51 /* ὑ */: BSEQ(0xe1,0xbd,0x99) /* Ὑ */;
+ case 0x1f52 /* ὒ */: BSEQ(0xce,0xa5,0xcc,0x93,0xcc,0x80) /* Υ̓̀ */;
+ case 0x1f53 /* ὓ */: BSEQ(0xe1,0xbd,0x9b) /* Ὓ */;
+ case 0x1f54 /* ὔ */: BSEQ(0xce,0xa5,0xcc,0x93,0xcc,0x81) /* Υ̓́ */;
+ case 0x1f55 /* ὕ */: BSEQ(0xe1,0xbd,0x9d) /* Ὕ */;
+ case 0x1f56 /* ὖ */: BSEQ(0xce,0xa5,0xcc,0x93,0xcd,0x82) /* Υ̓͂ */;
+ case 0x1f57 /* ὗ */: BSEQ(0xe1,0xbd,0x9f) /* Ὗ */;
+ case 0x1f60 /* ὠ */: BSEQ(0xe1,0xbd,0xa8) /* Ὠ */;
+ case 0x1f61 /* ὡ */: BSEQ(0xe1,0xbd,0xa9) /* Ὡ */;
+ case 0x1f62 /* ὢ */: BSEQ(0xe1,0xbd,0xaa) /* Ὢ */;
+ case 0x1f63 /* ὣ */: BSEQ(0xe1,0xbd,0xab) /* Ὣ */;
+ case 0x1f64 /* ὤ */: BSEQ(0xe1,0xbd,0xac) /* Ὤ */;
+ case 0x1f65 /* ὥ */: BSEQ(0xe1,0xbd,0xad) /* Ὥ */;
+ case 0x1f66 /* ὦ */: BSEQ(0xe1,0xbd,0xae) /* Ὦ */;
+ case 0x1f67 /* ὧ */: BSEQ(0xe1,0xbd,0xaf) /* Ὧ */;
+ case 0x1f70 /* ὰ */: BSEQ(0xe1,0xbe,0xba) /* Ὰ */;
+ case 0x1f71 /* ά */: BSEQ(0xe1,0xbe,0xbb) /* Ά */;
+ case 0x1f72 /* ὲ */: BSEQ(0xe1,0xbf,0x88) /* Ὲ */;
+ case 0x1f73 /* έ */: BSEQ(0xe1,0xbf,0x89) /* Έ */;
+ case 0x1f74 /* ὴ */: BSEQ(0xe1,0xbf,0x8a) /* Ὴ */;
+ case 0x1f75 /* ή */: BSEQ(0xe1,0xbf,0x8b) /* Ή */;
+ case 0x1f76 /* ὶ */: BSEQ(0xe1,0xbf,0x9a) /* Ὶ */;
+ case 0x1f77 /* ί */: BSEQ(0xe1,0xbf,0x9b) /* Ί */;
+ case 0x1f78 /* ὸ */: BSEQ(0xe1,0xbf,0xb8) /* Ὸ */;
+ case 0x1f79 /* ό */: BSEQ(0xe1,0xbf,0xb9) /* Ό */;
+ case 0x1f7a /* ὺ */: BSEQ(0xe1,0xbf,0xaa) /* Ὺ */;
+ case 0x1f7b /* ύ */: BSEQ(0xe1,0xbf,0xab) /* Ύ */;
+ case 0x1f7c /* ὼ */: BSEQ(0xe1,0xbf,0xba) /* Ὼ */;
+ case 0x1f7d /* ώ */: BSEQ(0xe1,0xbf,0xbb) /* Ώ */;
+ case 0x1f80 /* ᾀ */: BSEQ(0xe1,0xbc,0x88,0xce,0x99) /* ἈΙ */;
+ case 0x1f81 /* ᾁ */: BSEQ(0xe1,0xbc,0x89,0xce,0x99) /* ἉΙ */;
+ case 0x1f82 /* ᾂ */: BSEQ(0xe1,0xbc,0x8a,0xce,0x99) /* ἊΙ */;
+ case 0x1f83 /* ᾃ */: BSEQ(0xe1,0xbc,0x8b,0xce,0x99) /* ἋΙ */;
+ case 0x1f84 /* ᾄ */: BSEQ(0xe1,0xbc,0x8c,0xce,0x99) /* ἌΙ */;
+ case 0x1f85 /* ᾅ */: BSEQ(0xe1,0xbc,0x8d,0xce,0x99) /* ἍΙ */;
+ case 0x1f86 /* ᾆ */: BSEQ(0xe1,0xbc,0x8e,0xce,0x99) /* ἎΙ */;
+ case 0x1f87 /* ᾇ */: BSEQ(0xe1,0xbc,0x8f,0xce,0x99) /* ἏΙ */;
+ case 0x1f88 /* ᾈ */: BSEQ(0xe1,0xbc,0x88,0xce,0x99) /* ἈΙ */;
+ case 0x1f89 /* ᾉ */: BSEQ(0xe1,0xbc,0x89,0xce,0x99) /* ἉΙ */;
+ case 0x1f8a /* ᾊ */: BSEQ(0xe1,0xbc,0x8a,0xce,0x99) /* ἊΙ */;
+ case 0x1f8b /* ᾋ */: BSEQ(0xe1,0xbc,0x8b,0xce,0x99) /* ἋΙ */;
+ case 0x1f8c /* ᾌ */: BSEQ(0xe1,0xbc,0x8c,0xce,0x99) /* ἌΙ */;
+ case 0x1f8d /* ᾍ */: BSEQ(0xe1,0xbc,0x8d,0xce,0x99) /* ἍΙ */;
+ case 0x1f8e /* ᾎ */: BSEQ(0xe1,0xbc,0x8e,0xce,0x99) /* ἎΙ */;
+ case 0x1f8f /* ᾏ */: BSEQ(0xe1,0xbc,0x8f,0xce,0x99) /* ἏΙ */;
+ case 0x1f90 /* ᾐ */: BSEQ(0xe1,0xbc,0xa8,0xce,0x99) /* ἨΙ */;
+ case 0x1f91 /* ᾑ */: BSEQ(0xe1,0xbc,0xa9,0xce,0x99) /* ἩΙ */;
+ case 0x1f92 /* ᾒ */: BSEQ(0xe1,0xbc,0xaa,0xce,0x99) /* ἪΙ */;
+ case 0x1f93 /* ᾓ */: BSEQ(0xe1,0xbc,0xab,0xce,0x99) /* ἫΙ */;
+ case 0x1f94 /* ᾔ */: BSEQ(0xe1,0xbc,0xac,0xce,0x99) /* ἬΙ */;
+ case 0x1f95 /* ᾕ */: BSEQ(0xe1,0xbc,0xad,0xce,0x99) /* ἭΙ */;
+ case 0x1f96 /* ᾖ */: BSEQ(0xe1,0xbc,0xae,0xce,0x99) /* ἮΙ */;
+ case 0x1f97 /* ᾗ */: BSEQ(0xe1,0xbc,0xaf,0xce,0x99) /* ἯΙ */;
+ case 0x1f98 /* ᾘ */: BSEQ(0xe1,0xbc,0xa8,0xce,0x99) /* ἨΙ */;
+ case 0x1f99 /* ᾙ */: BSEQ(0xe1,0xbc,0xa9,0xce,0x99) /* ἩΙ */;
+ case 0x1f9a /* ᾚ */: BSEQ(0xe1,0xbc,0xaa,0xce,0x99) /* ἪΙ */;
+ case 0x1f9b /* ᾛ */: BSEQ(0xe1,0xbc,0xab,0xce,0x99) /* ἫΙ */;
+ case 0x1f9c /* ᾜ */: BSEQ(0xe1,0xbc,0xac,0xce,0x99) /* ἬΙ */;
+ case 0x1f9d /* ᾝ */: BSEQ(0xe1,0xbc,0xad,0xce,0x99) /* ἭΙ */;
+ case 0x1f9e /* ᾞ */: BSEQ(0xe1,0xbc,0xae,0xce,0x99) /* ἮΙ */;
+ case 0x1f9f /* ᾟ */: BSEQ(0xe1,0xbc,0xaf,0xce,0x99) /* ἯΙ */;
+ case 0x1fa0 /* ᾠ */: BSEQ(0xe1,0xbd,0xa8,0xce,0x99) /* ὨΙ */;
+ case 0x1fa1 /* ᾡ */: BSEQ(0xe1,0xbd,0xa9,0xce,0x99) /* ὩΙ */;
+ case 0x1fa2 /* ᾢ */: BSEQ(0xe1,0xbd,0xaa,0xce,0x99) /* ὪΙ */;
+ case 0x1fa3 /* ᾣ */: BSEQ(0xe1,0xbd,0xab,0xce,0x99) /* ὫΙ */;
+ case 0x1fa4 /* ᾤ */: BSEQ(0xe1,0xbd,0xac,0xce,0x99) /* ὬΙ */;
+ case 0x1fa5 /* ᾥ */: BSEQ(0xe1,0xbd,0xad,0xce,0x99) /* ὭΙ */;
+ case 0x1fa6 /* ᾦ */: BSEQ(0xe1,0xbd,0xae,0xce,0x99) /* ὮΙ */;
+ case 0x1fa7 /* ᾧ */: BSEQ(0xe1,0xbd,0xaf,0xce,0x99) /* ὯΙ */;
+ case 0x1fa8 /* ᾨ */: BSEQ(0xe1,0xbd,0xa8,0xce,0x99) /* ὨΙ */;
+ case 0x1fa9 /* ᾩ */: BSEQ(0xe1,0xbd,0xa9,0xce,0x99) /* ὩΙ */;
+ case 0x1faa /* ᾪ */: BSEQ(0xe1,0xbd,0xaa,0xce,0x99) /* ὪΙ */;
+ case 0x1fab /* ᾫ */: BSEQ(0xe1,0xbd,0xab,0xce,0x99) /* ὫΙ */;
+ case 0x1fac /* ᾬ */: BSEQ(0xe1,0xbd,0xac,0xce,0x99) /* ὬΙ */;
+ case 0x1fad /* ᾭ */: BSEQ(0xe1,0xbd,0xad,0xce,0x99) /* ὭΙ */;
+ case 0x1fae /* ᾮ */: BSEQ(0xe1,0xbd,0xae,0xce,0x99) /* ὮΙ */;
+ case 0x1faf /* ᾯ */: BSEQ(0xe1,0xbd,0xaf,0xce,0x99) /* ὯΙ */;
+ case 0x1fb0 /* ᾰ */: BSEQ(0xe1,0xbe,0xb8) /* Ᾰ */;
+ case 0x1fb1 /* ᾱ */: BSEQ(0xe1,0xbe,0xb9) /* Ᾱ */;
+ case 0x1fb2 /* ᾲ */: BSEQ(0xe1,0xbe,0xba,0xce,0x99) /* ᾺΙ */;
+ case 0x1fb3 /* ᾳ */: BSEQ(0xce,0x91,0xce,0x99) /* ΑΙ */;
+ case 0x1fb4 /* ᾴ */: BSEQ(0xce,0x86,0xce,0x99) /* ΆΙ */;
+ case 0x1fb6 /* ᾶ */: BSEQ(0xce,0x91,0xcd,0x82) /* Α͂ */;
+ case 0x1fb7 /* ᾷ */: BSEQ(0xce,0x91,0xcd,0x82,0xce,0x99) /* Α͂Ι */;
+ case 0x1fbc /* ᾼ */: BSEQ(0xce,0x91,0xce,0x99) /* ΑΙ */;
+ case 0x1fbe /* ι */: BSEQ(0xce,0x99) /* Ι */;
+ case 0x1fc2 /* ῂ */: BSEQ(0xe1,0xbf,0x8a,0xce,0x99) /* ῊΙ */;
+ case 0x1fc3 /* ῃ */: BSEQ(0xce,0x97,0xce,0x99) /* ΗΙ */;
+ case 0x1fc4 /* ῄ */: BSEQ(0xce,0x89,0xce,0x99) /* ΉΙ */;
+ case 0x1fc6 /* ῆ */: BSEQ(0xce,0x97,0xcd,0x82) /* Η͂ */;
+ case 0x1fc7 /* ῇ */: BSEQ(0xce,0x97,0xcd,0x82,0xce,0x99) /* Η͂Ι */;
+ case 0x1fcc /* ῌ */: BSEQ(0xce,0x97,0xce,0x99) /* ΗΙ */;
+ case 0x1fd0 /* ῐ */: BSEQ(0xe1,0xbf,0x98) /* Ῐ */;
+ case 0x1fd1 /* ῑ */: BSEQ(0xe1,0xbf,0x99) /* Ῑ */;
+ case 0x1fd2 /* ῒ */: BSEQ(0xce,0x99,0xcc,0x88,0xcc,0x80) /* Ϊ̀ */;
+ case 0x1fd3 /* ΐ */: BSEQ(0xce,0x99,0xcc,0x88,0xcc,0x81) /* Ϊ́ */;
+ case 0x1fd6 /* ῖ */: BSEQ(0xce,0x99,0xcd,0x82) /* Ι͂ */;
+ case 0x1fd7 /* ῗ */: BSEQ(0xce,0x99,0xcc,0x88,0xcd,0x82) /* Ϊ͂ */;
+ case 0x1fe0 /* ῠ */: BSEQ(0xe1,0xbf,0xa8) /* Ῠ */;
+ case 0x1fe1 /* ῡ */: BSEQ(0xe1,0xbf,0xa9) /* Ῡ */;
+ case 0x1fe2 /* ῢ */: BSEQ(0xce,0xa5,0xcc,0x88,0xcc,0x80) /* Ϋ̀ */;
+ case 0x1fe3 /* ΰ */: BSEQ(0xce,0xa5,0xcc,0x88,0xcc,0x81) /* Ϋ́ */;
+ case 0x1fe4 /* ῤ */: BSEQ(0xce,0xa1,0xcc,0x93) /* Ρ̓ */;
+ case 0x1fe5 /* ῥ */: BSEQ(0xe1,0xbf,0xac) /* Ῥ */;
+ case 0x1fe6 /* ῦ */: BSEQ(0xce,0xa5,0xcd,0x82) /* Υ͂ */;
+ case 0x1fe7 /* ῧ */: BSEQ(0xce,0xa5,0xcc,0x88,0xcd,0x82) /* Ϋ͂ */;
+ case 0x1ff2 /* ῲ */: BSEQ(0xe1,0xbf,0xba,0xce,0x99) /* ῺΙ */;
+ case 0x1ff3 /* ῳ */: BSEQ(0xce,0xa9,0xce,0x99) /* ΩΙ */;
+ case 0x1ff4 /* ῴ */: BSEQ(0xce,0x8f,0xce,0x99) /* ΏΙ */;
+ case 0x1ff6 /* ῶ */: BSEQ(0xce,0xa9,0xcd,0x82) /* Ω͂ */;
+ case 0x1ff7 /* ῷ */: BSEQ(0xce,0xa9,0xcd,0x82,0xce,0x99) /* Ω͂Ι */;
+ case 0x1ffc /* ῼ */: BSEQ(0xce,0xa9,0xce,0x99) /* ΩΙ */;
+ case 0x214e /* ⅎ */: BSEQ(0xe2,0x84,0xb2) /* Ⅎ */;
+ case 0x2170 /* ⅰ */: BSEQ(0xe2,0x85,0xa0) /* Ⅰ */;
+ case 0x2171 /* ⅱ */: BSEQ(0xe2,0x85,0xa1) /* Ⅱ */;
+ case 0x2172 /* ⅲ */: BSEQ(0xe2,0x85,0xa2) /* Ⅲ */;
+ case 0x2173 /* ⅳ */: BSEQ(0xe2,0x85,0xa3) /* Ⅳ */;
+ case 0x2174 /* ⅴ */: BSEQ(0xe2,0x85,0xa4) /* Ⅴ */;
+ case 0x2175 /* ⅵ */: BSEQ(0xe2,0x85,0xa5) /* Ⅵ */;
+ case 0x2176 /* ⅶ */: BSEQ(0xe2,0x85,0xa6) /* Ⅶ */;
+ case 0x2177 /* ⅷ */: BSEQ(0xe2,0x85,0xa7) /* Ⅷ */;
+ case 0x2178 /* ⅸ */: BSEQ(0xe2,0x85,0xa8) /* Ⅸ */;
+ case 0x2179 /* ⅹ */: BSEQ(0xe2,0x85,0xa9) /* Ⅹ */;
+ case 0x217a /* ⅺ */: BSEQ(0xe2,0x85,0xaa) /* Ⅺ */;
+ case 0x217b /* ⅻ */: BSEQ(0xe2,0x85,0xab) /* Ⅻ */;
+ case 0x217c /* ⅼ */: BSEQ(0xe2,0x85,0xac) /* Ⅼ */;
+ case 0x217d /* ⅽ */: BSEQ(0xe2,0x85,0xad) /* Ⅽ */;
+ case 0x217e /* ⅾ */: BSEQ(0xe2,0x85,0xae) /* Ⅾ */;
+ case 0x217f /* ⅿ */: BSEQ(0xe2,0x85,0xaf) /* Ⅿ */;
+ case 0x2184 /* ↄ */: BSEQ(0xe2,0x86,0x83) /* Ↄ */;
+ case 0x24d0 /* ⓐ */: BSEQ(0xe2,0x92,0xb6) /* Ⓐ */;
+ case 0x24d1 /* ⓑ */: BSEQ(0xe2,0x92,0xb7) /* Ⓑ */;
+ case 0x24d2 /* ⓒ */: BSEQ(0xe2,0x92,0xb8) /* Ⓒ */;
+ case 0x24d3 /* ⓓ */: BSEQ(0xe2,0x92,0xb9) /* Ⓓ */;
+ case 0x24d4 /* ⓔ */: BSEQ(0xe2,0x92,0xba) /* Ⓔ */;
+ case 0x24d5 /* ⓕ */: BSEQ(0xe2,0x92,0xbb) /* Ⓕ */;
+ case 0x24d6 /* ⓖ */: BSEQ(0xe2,0x92,0xbc) /* Ⓖ */;
+ case 0x24d7 /* ⓗ */: BSEQ(0xe2,0x92,0xbd) /* Ⓗ */;
+ case 0x24d8 /* ⓘ */: BSEQ(0xe2,0x92,0xbe) /* Ⓘ */;
+ case 0x24d9 /* ⓙ */: BSEQ(0xe2,0x92,0xbf) /* Ⓙ */;
+ case 0x24da /* ⓚ */: BSEQ(0xe2,0x93,0x80) /* Ⓚ */;
+ case 0x24db /* ⓛ */: BSEQ(0xe2,0x93,0x81) /* Ⓛ */;
+ case 0x24dc /* ⓜ */: BSEQ(0xe2,0x93,0x82) /* Ⓜ */;
+ case 0x24dd /* ⓝ */: BSEQ(0xe2,0x93,0x83) /* Ⓝ */;
+ case 0x24de /* ⓞ */: BSEQ(0xe2,0x93,0x84) /* Ⓞ */;
+ case 0x24df /* ⓟ */: BSEQ(0xe2,0x93,0x85) /* Ⓟ */;
+ case 0x24e0 /* ⓠ */: BSEQ(0xe2,0x93,0x86) /* Ⓠ */;
+ case 0x24e1 /* ⓡ */: BSEQ(0xe2,0x93,0x87) /* Ⓡ */;
+ case 0x24e2 /* ⓢ */: BSEQ(0xe2,0x93,0x88) /* Ⓢ */;
+ case 0x24e3 /* ⓣ */: BSEQ(0xe2,0x93,0x89) /* Ⓣ */;
+ case 0x24e4 /* ⓤ */: BSEQ(0xe2,0x93,0x8a) /* Ⓤ */;
+ case 0x24e5 /* ⓥ */: BSEQ(0xe2,0x93,0x8b) /* Ⓥ */;
+ case 0x24e6 /* ⓦ */: BSEQ(0xe2,0x93,0x8c) /* Ⓦ */;
+ case 0x24e7 /* ⓧ */: BSEQ(0xe2,0x93,0x8d) /* Ⓧ */;
+ case 0x24e8 /* ⓨ */: BSEQ(0xe2,0x93,0x8e) /* Ⓨ */;
+ case 0x24e9 /* ⓩ */: BSEQ(0xe2,0x93,0x8f) /* Ⓩ */;
+ case 0x2c30 /* ⰰ */: BSEQ(0xe2,0xb0,0x80) /* Ⰰ */;
+ case 0x2c31 /* ⰱ */: BSEQ(0xe2,0xb0,0x81) /* Ⰱ */;
+ case 0x2c32 /* ⰲ */: BSEQ(0xe2,0xb0,0x82) /* Ⰲ */;
+ case 0x2c33 /* ⰳ */: BSEQ(0xe2,0xb0,0x83) /* Ⰳ */;
+ case 0x2c34 /* ⰴ */: BSEQ(0xe2,0xb0,0x84) /* Ⰴ */;
+ case 0x2c35 /* ⰵ */: BSEQ(0xe2,0xb0,0x85) /* Ⰵ */;
+ case 0x2c36 /* ⰶ */: BSEQ(0xe2,0xb0,0x86) /* Ⰶ */;
+ case 0x2c37 /* ⰷ */: BSEQ(0xe2,0xb0,0x87) /* Ⰷ */;
+ case 0x2c38 /* ⰸ */: BSEQ(0xe2,0xb0,0x88) /* Ⰸ */;
+ case 0x2c39 /* ⰹ */: BSEQ(0xe2,0xb0,0x89) /* Ⰹ */;
+ case 0x2c3a /* ⰺ */: BSEQ(0xe2,0xb0,0x8a) /* Ⰺ */;
+ case 0x2c3b /* ⰻ */: BSEQ(0xe2,0xb0,0x8b) /* Ⰻ */;
+ case 0x2c3c /* ⰼ */: BSEQ(0xe2,0xb0,0x8c) /* Ⰼ */;
+ case 0x2c3d /* ⰽ */: BSEQ(0xe2,0xb0,0x8d) /* Ⰽ */;
+ case 0x2c3e /* ⰾ */: BSEQ(0xe2,0xb0,0x8e) /* Ⰾ */;
+ case 0x2c3f /* ⰿ */: BSEQ(0xe2,0xb0,0x8f) /* Ⰿ */;
+ case 0x2c40 /* ⱀ */: BSEQ(0xe2,0xb0,0x90) /* Ⱀ */;
+ case 0x2c41 /* ⱁ */: BSEQ(0xe2,0xb0,0x91) /* Ⱁ */;
+ case 0x2c42 /* ⱂ */: BSEQ(0xe2,0xb0,0x92) /* Ⱂ */;
+ case 0x2c43 /* ⱃ */: BSEQ(0xe2,0xb0,0x93) /* Ⱃ */;
+ case 0x2c44 /* ⱄ */: BSEQ(0xe2,0xb0,0x94) /* Ⱄ */;
+ case 0x2c45 /* ⱅ */: BSEQ(0xe2,0xb0,0x95) /* Ⱅ */;
+ case 0x2c46 /* ⱆ */: BSEQ(0xe2,0xb0,0x96) /* Ⱆ */;
+ case 0x2c47 /* ⱇ */: BSEQ(0xe2,0xb0,0x97) /* Ⱇ */;
+ case 0x2c48 /* ⱈ */: BSEQ(0xe2,0xb0,0x98) /* Ⱈ */;
+ case 0x2c49 /* ⱉ */: BSEQ(0xe2,0xb0,0x99) /* Ⱉ */;
+ case 0x2c4a /* ⱊ */: BSEQ(0xe2,0xb0,0x9a) /* Ⱊ */;
+ case 0x2c4b /* ⱋ */: BSEQ(0xe2,0xb0,0x9b) /* Ⱋ */;
+ case 0x2c4c /* ⱌ */: BSEQ(0xe2,0xb0,0x9c) /* Ⱌ */;
+ case 0x2c4d /* ⱍ */: BSEQ(0xe2,0xb0,0x9d) /* Ⱍ */;
+ case 0x2c4e /* ⱎ */: BSEQ(0xe2,0xb0,0x9e) /* Ⱎ */;
+ case 0x2c4f /* ⱏ */: BSEQ(0xe2,0xb0,0x9f) /* Ⱏ */;
+ case 0x2c50 /* ⱐ */: BSEQ(0xe2,0xb0,0xa0) /* Ⱐ */;
+ case 0x2c51 /* ⱑ */: BSEQ(0xe2,0xb0,0xa1) /* Ⱑ */;
+ case 0x2c52 /* ⱒ */: BSEQ(0xe2,0xb0,0xa2) /* Ⱒ */;
+ case 0x2c53 /* ⱓ */: BSEQ(0xe2,0xb0,0xa3) /* Ⱓ */;
+ case 0x2c54 /* ⱔ */: BSEQ(0xe2,0xb0,0xa4) /* Ⱔ */;
+ case 0x2c55 /* ⱕ */: BSEQ(0xe2,0xb0,0xa5) /* Ⱕ */;
+ case 0x2c56 /* ⱖ */: BSEQ(0xe2,0xb0,0xa6) /* Ⱖ */;
+ case 0x2c57 /* ⱗ */: BSEQ(0xe2,0xb0,0xa7) /* Ⱗ */;
+ case 0x2c58 /* ⱘ */: BSEQ(0xe2,0xb0,0xa8) /* Ⱘ */;
+ case 0x2c59 /* ⱙ */: BSEQ(0xe2,0xb0,0xa9) /* Ⱙ */;
+ case 0x2c5a /* ⱚ */: BSEQ(0xe2,0xb0,0xaa) /* Ⱚ */;
+ case 0x2c5b /* ⱛ */: BSEQ(0xe2,0xb0,0xab) /* Ⱛ */;
+ case 0x2c5c /* ⱜ */: BSEQ(0xe2,0xb0,0xac) /* Ⱜ */;
+ case 0x2c5d /* ⱝ */: BSEQ(0xe2,0xb0,0xad) /* Ⱝ */;
+ case 0x2c5e /* ⱞ */: BSEQ(0xe2,0xb0,0xae) /* Ⱞ */;
+ case 0x2c61 /* ⱡ */: BSEQ(0xe2,0xb1,0xa0) /* Ⱡ */;
+ case 0x2c65 /* ⱥ */: BSEQ(0xc8,0xba) /* Ⱥ */;
+ case 0x2c66 /* ⱦ */: BSEQ(0xc8,0xbe) /* Ⱦ */;
+ case 0x2c68 /* ⱨ */: BSEQ(0xe2,0xb1,0xa7) /* Ⱨ */;
+ case 0x2c6a /* ⱪ */: BSEQ(0xe2,0xb1,0xa9) /* Ⱪ */;
+ case 0x2c6c /* ⱬ */: BSEQ(0xe2,0xb1,0xab) /* Ⱬ */;
+ case 0x2c73 /* ⱳ */: BSEQ(0xe2,0xb1,0xb2) /* Ⱳ */;
+ case 0x2c76 /* ⱶ */: BSEQ(0xe2,0xb1,0xb5) /* Ⱶ */;
+ case 0x2c81 /* ⲁ */: BSEQ(0xe2,0xb2,0x80) /* Ⲁ */;
+ case 0x2c83 /* ⲃ */: BSEQ(0xe2,0xb2,0x82) /* Ⲃ */;
+ case 0x2c85 /* ⲅ */: BSEQ(0xe2,0xb2,0x84) /* Ⲅ */;
+ case 0x2c87 /* ⲇ */: BSEQ(0xe2,0xb2,0x86) /* Ⲇ */;
+ case 0x2c89 /* ⲉ */: BSEQ(0xe2,0xb2,0x88) /* Ⲉ */;
+ case 0x2c8b /* ⲋ */: BSEQ(0xe2,0xb2,0x8a) /* Ⲋ */;
+ case 0x2c8d /* ⲍ */: BSEQ(0xe2,0xb2,0x8c) /* Ⲍ */;
+ case 0x2c8f /* ⲏ */: BSEQ(0xe2,0xb2,0x8e) /* Ⲏ */;
+ case 0x2c91 /* ⲑ */: BSEQ(0xe2,0xb2,0x90) /* Ⲑ */;
+ case 0x2c93 /* ⲓ */: BSEQ(0xe2,0xb2,0x92) /* Ⲓ */;
+ case 0x2c95 /* ⲕ */: BSEQ(0xe2,0xb2,0x94) /* Ⲕ */;
+ case 0x2c97 /* ⲗ */: BSEQ(0xe2,0xb2,0x96) /* Ⲗ */;
+ case 0x2c99 /* ⲙ */: BSEQ(0xe2,0xb2,0x98) /* Ⲙ */;
+ case 0x2c9b /* ⲛ */: BSEQ(0xe2,0xb2,0x9a) /* Ⲛ */;
+ case 0x2c9d /* ⲝ */: BSEQ(0xe2,0xb2,0x9c) /* Ⲝ */;
+ case 0x2c9f /* ⲟ */: BSEQ(0xe2,0xb2,0x9e) /* Ⲟ */;
+ case 0x2ca1 /* ⲡ */: BSEQ(0xe2,0xb2,0xa0) /* Ⲡ */;
+ case 0x2ca3 /* ⲣ */: BSEQ(0xe2,0xb2,0xa2) /* Ⲣ */;
+ case 0x2ca5 /* ⲥ */: BSEQ(0xe2,0xb2,0xa4) /* Ⲥ */;
+ case 0x2ca7 /* ⲧ */: BSEQ(0xe2,0xb2,0xa6) /* Ⲧ */;
+ case 0x2ca9 /* ⲩ */: BSEQ(0xe2,0xb2,0xa8) /* Ⲩ */;
+ case 0x2cab /* ⲫ */: BSEQ(0xe2,0xb2,0xaa) /* Ⲫ */;
+ case 0x2cad /* ⲭ */: BSEQ(0xe2,0xb2,0xac) /* Ⲭ */;
+ case 0x2caf /* ⲯ */: BSEQ(0xe2,0xb2,0xae) /* Ⲯ */;
+ case 0x2cb1 /* ⲱ */: BSEQ(0xe2,0xb2,0xb0) /* Ⲱ */;
+ case 0x2cb3 /* ⲳ */: BSEQ(0xe2,0xb2,0xb2) /* Ⲳ */;
+ case 0x2cb5 /* ⲵ */: BSEQ(0xe2,0xb2,0xb4) /* Ⲵ */;
+ case 0x2cb7 /* ⲷ */: BSEQ(0xe2,0xb2,0xb6) /* Ⲷ */;
+ case 0x2cb9 /* ⲹ */: BSEQ(0xe2,0xb2,0xb8) /* Ⲹ */;
+ case 0x2cbb /* ⲻ */: BSEQ(0xe2,0xb2,0xba) /* Ⲻ */;
+ case 0x2cbd /* ⲽ */: BSEQ(0xe2,0xb2,0xbc) /* Ⲽ */;
+ case 0x2cbf /* ⲿ */: BSEQ(0xe2,0xb2,0xbe) /* Ⲿ */;
+ case 0x2cc1 /* ⳁ */: BSEQ(0xe2,0xb3,0x80) /* Ⳁ */;
+ case 0x2cc3 /* ⳃ */: BSEQ(0xe2,0xb3,0x82) /* Ⳃ */;
+ case 0x2cc5 /* ⳅ */: BSEQ(0xe2,0xb3,0x84) /* Ⳅ */;
+ case 0x2cc7 /* ⳇ */: BSEQ(0xe2,0xb3,0x86) /* Ⳇ */;
+ case 0x2cc9 /* ⳉ */: BSEQ(0xe2,0xb3,0x88) /* Ⳉ */;
+ case 0x2ccb /* ⳋ */: BSEQ(0xe2,0xb3,0x8a) /* Ⳋ */;
+ case 0x2ccd /* ⳍ */: BSEQ(0xe2,0xb3,0x8c) /* Ⳍ */;
+ case 0x2ccf /* ⳏ */: BSEQ(0xe2,0xb3,0x8e) /* Ⳏ */;
+ case 0x2cd1 /* ⳑ */: BSEQ(0xe2,0xb3,0x90) /* Ⳑ */;
+ case 0x2cd3 /* ⳓ */: BSEQ(0xe2,0xb3,0x92) /* Ⳓ */;
+ case 0x2cd5 /* ⳕ */: BSEQ(0xe2,0xb3,0x94) /* Ⳕ */;
+ case 0x2cd7 /* ⳗ */: BSEQ(0xe2,0xb3,0x96) /* Ⳗ */;
+ case 0x2cd9 /* ⳙ */: BSEQ(0xe2,0xb3,0x98) /* Ⳙ */;
+ case 0x2cdb /* ⳛ */: BSEQ(0xe2,0xb3,0x9a) /* Ⳛ */;
+ case 0x2cdd /* ⳝ */: BSEQ(0xe2,0xb3,0x9c) /* Ⳝ */;
+ case 0x2cdf /* ⳟ */: BSEQ(0xe2,0xb3,0x9e) /* Ⳟ */;
+ case 0x2ce1 /* ⳡ */: BSEQ(0xe2,0xb3,0xa0) /* Ⳡ */;
+ case 0x2ce3 /* ⳣ */: BSEQ(0xe2,0xb3,0xa2) /* Ⳣ */;
+ case 0x2cec /* ⳬ */: BSEQ(0xe2,0xb3,0xab) /* Ⳬ */;
+ case 0x2cee /* ⳮ */: BSEQ(0xe2,0xb3,0xad) /* Ⳮ */;
+ case 0x2cf3 /* ⳳ */: BSEQ(0xe2,0xb3,0xb2) /* Ⳳ */;
+ case 0x2d00 /* ⴀ */: BSEQ(0xe1,0x82,0xa0) /* Ⴀ */;
+ case 0x2d01 /* ⴁ */: BSEQ(0xe1,0x82,0xa1) /* Ⴁ */;
+ case 0x2d02 /* ⴂ */: BSEQ(0xe1,0x82,0xa2) /* Ⴂ */;
+ case 0x2d03 /* ⴃ */: BSEQ(0xe1,0x82,0xa3) /* Ⴃ */;
+ case 0x2d04 /* ⴄ */: BSEQ(0xe1,0x82,0xa4) /* Ⴄ */;
+ case 0x2d05 /* ⴅ */: BSEQ(0xe1,0x82,0xa5) /* Ⴅ */;
+ case 0x2d06 /* ⴆ */: BSEQ(0xe1,0x82,0xa6) /* Ⴆ */;
+ case 0x2d07 /* ⴇ */: BSEQ(0xe1,0x82,0xa7) /* Ⴇ */;
+ case 0x2d08 /* ⴈ */: BSEQ(0xe1,0x82,0xa8) /* Ⴈ */;
+ case 0x2d09 /* ⴉ */: BSEQ(0xe1,0x82,0xa9) /* Ⴉ */;
+ case 0x2d0a /* ⴊ */: BSEQ(0xe1,0x82,0xaa) /* Ⴊ */;
+ case 0x2d0b /* ⴋ */: BSEQ(0xe1,0x82,0xab) /* Ⴋ */;
+ case 0x2d0c /* ⴌ */: BSEQ(0xe1,0x82,0xac) /* Ⴌ */;
+ case 0x2d0d /* ⴍ */: BSEQ(0xe1,0x82,0xad) /* Ⴍ */;
+ case 0x2d0e /* ⴎ */: BSEQ(0xe1,0x82,0xae) /* Ⴎ */;
+ case 0x2d0f /* ⴏ */: BSEQ(0xe1,0x82,0xaf) /* Ⴏ */;
+ case 0x2d10 /* ⴐ */: BSEQ(0xe1,0x82,0xb0) /* Ⴐ */;
+ case 0x2d11 /* ⴑ */: BSEQ(0xe1,0x82,0xb1) /* Ⴑ */;
+ case 0x2d12 /* ⴒ */: BSEQ(0xe1,0x82,0xb2) /* Ⴒ */;
+ case 0x2d13 /* ⴓ */: BSEQ(0xe1,0x82,0xb3) /* Ⴓ */;
+ case 0x2d14 /* ⴔ */: BSEQ(0xe1,0x82,0xb4) /* Ⴔ */;
+ case 0x2d15 /* ⴕ */: BSEQ(0xe1,0x82,0xb5) /* Ⴕ */;
+ case 0x2d16 /* ⴖ */: BSEQ(0xe1,0x82,0xb6) /* Ⴖ */;
+ case 0x2d17 /* ⴗ */: BSEQ(0xe1,0x82,0xb7) /* Ⴗ */;
+ case 0x2d18 /* ⴘ */: BSEQ(0xe1,0x82,0xb8) /* Ⴘ */;
+ case 0x2d19 /* ⴙ */: BSEQ(0xe1,0x82,0xb9) /* Ⴙ */;
+ case 0x2d1a /* ⴚ */: BSEQ(0xe1,0x82,0xba) /* Ⴚ */;
+ case 0x2d1b /* ⴛ */: BSEQ(0xe1,0x82,0xbb) /* Ⴛ */;
+ case 0x2d1c /* ⴜ */: BSEQ(0xe1,0x82,0xbc) /* Ⴜ */;
+ case 0x2d1d /* ⴝ */: BSEQ(0xe1,0x82,0xbd) /* Ⴝ */;
+ case 0x2d1e /* ⴞ */: BSEQ(0xe1,0x82,0xbe) /* Ⴞ */;
+ case 0x2d1f /* ⴟ */: BSEQ(0xe1,0x82,0xbf) /* Ⴟ */;
+ case 0x2d20 /* ⴠ */: BSEQ(0xe1,0x83,0x80) /* Ⴠ */;
+ case 0x2d21 /* ⴡ */: BSEQ(0xe1,0x83,0x81) /* Ⴡ */;
+ case 0x2d22 /* ⴢ */: BSEQ(0xe1,0x83,0x82) /* Ⴢ */;
+ case 0x2d23 /* ⴣ */: BSEQ(0xe1,0x83,0x83) /* Ⴣ */;
+ case 0x2d24 /* ⴤ */: BSEQ(0xe1,0x83,0x84) /* Ⴤ */;
+ case 0x2d25 /* ⴥ */: BSEQ(0xe1,0x83,0x85) /* Ⴥ */;
+ case 0x2d27 /* ⴧ */: BSEQ(0xe1,0x83,0x87) /* Ⴧ */;
+ case 0x2d2d /* ⴭ */: BSEQ(0xe1,0x83,0x8d) /* Ⴭ */;
+ case 0xa641 /* ꙁ */: BSEQ(0xea,0x99,0x80) /* Ꙁ */;
+ case 0xa643 /* ꙃ */: BSEQ(0xea,0x99,0x82) /* Ꙃ */;
+ case 0xa645 /* ꙅ */: BSEQ(0xea,0x99,0x84) /* Ꙅ */;
+ case 0xa647 /* ꙇ */: BSEQ(0xea,0x99,0x86) /* Ꙇ */;
+ case 0xa649 /* ꙉ */: BSEQ(0xea,0x99,0x88) /* Ꙉ */;
+ case 0xa64b /* ꙋ */: BSEQ(0xea,0x99,0x8a) /* Ꙋ */;
+ case 0xa64d /* ꙍ */: BSEQ(0xea,0x99,0x8c) /* Ꙍ */;
+ case 0xa64f /* ꙏ */: BSEQ(0xea,0x99,0x8e) /* Ꙏ */;
+ case 0xa651 /* ꙑ */: BSEQ(0xea,0x99,0x90) /* Ꙑ */;
+ case 0xa653 /* ꙓ */: BSEQ(0xea,0x99,0x92) /* Ꙓ */;
+ case 0xa655 /* ꙕ */: BSEQ(0xea,0x99,0x94) /* Ꙕ */;
+ case 0xa657 /* ꙗ */: BSEQ(0xea,0x99,0x96) /* Ꙗ */;
+ case 0xa659 /* ꙙ */: BSEQ(0xea,0x99,0x98) /* Ꙙ */;
+ case 0xa65b /* ꙛ */: BSEQ(0xea,0x99,0x9a) /* Ꙛ */;
+ case 0xa65d /* ꙝ */: BSEQ(0xea,0x99,0x9c) /* Ꙝ */;
+ case 0xa65f /* ꙟ */: BSEQ(0xea,0x99,0x9e) /* Ꙟ */;
+ case 0xa661 /* ꙡ */: BSEQ(0xea,0x99,0xa0) /* Ꙡ */;
+ case 0xa663 /* ꙣ */: BSEQ(0xea,0x99,0xa2) /* Ꙣ */;
+ case 0xa665 /* ꙥ */: BSEQ(0xea,0x99,0xa4) /* Ꙥ */;
+ case 0xa667 /* ꙧ */: BSEQ(0xea,0x99,0xa6) /* Ꙧ */;
+ case 0xa669 /* ꙩ */: BSEQ(0xea,0x99,0xa8) /* Ꙩ */;
+ case 0xa66b /* ꙫ */: BSEQ(0xea,0x99,0xaa) /* Ꙫ */;
+ case 0xa66d /* ꙭ */: BSEQ(0xea,0x99,0xac) /* Ꙭ */;
+ case 0xa681 /* ꚁ */: BSEQ(0xea,0x9a,0x80) /* Ꚁ */;
+ case 0xa683 /* ꚃ */: BSEQ(0xea,0x9a,0x82) /* Ꚃ */;
+ case 0xa685 /* ꚅ */: BSEQ(0xea,0x9a,0x84) /* Ꚅ */;
+ case 0xa687 /* ꚇ */: BSEQ(0xea,0x9a,0x86) /* Ꚇ */;
+ case 0xa689 /* ꚉ */: BSEQ(0xea,0x9a,0x88) /* Ꚉ */;
+ case 0xa68b /* ꚋ */: BSEQ(0xea,0x9a,0x8a) /* Ꚋ */;
+ case 0xa68d /* ꚍ */: BSEQ(0xea,0x9a,0x8c) /* Ꚍ */;
+ case 0xa68f /* ꚏ */: BSEQ(0xea,0x9a,0x8e) /* Ꚏ */;
+ case 0xa691 /* ꚑ */: BSEQ(0xea,0x9a,0x90) /* Ꚑ */;
+ case 0xa693 /* ꚓ */: BSEQ(0xea,0x9a,0x92) /* Ꚓ */;
+ case 0xa695 /* ꚕ */: BSEQ(0xea,0x9a,0x94) /* Ꚕ */;
+ case 0xa697 /* ꚗ */: BSEQ(0xea,0x9a,0x96) /* Ꚗ */;
+ case 0xa699 /* ꚙ */: BSEQ(0xea,0x9a,0x98) /* Ꚙ */;
+ case 0xa69b /* ꚛ */: BSEQ(0xea,0x9a,0x9a) /* Ꚛ */;
+ case 0xa723 /* ꜣ */: BSEQ(0xea,0x9c,0xa2) /* Ꜣ */;
+ case 0xa725 /* ꜥ */: BSEQ(0xea,0x9c,0xa4) /* Ꜥ */;
+ case 0xa727 /* ꜧ */: BSEQ(0xea,0x9c,0xa6) /* Ꜧ */;
+ case 0xa729 /* ꜩ */: BSEQ(0xea,0x9c,0xa8) /* Ꜩ */;
+ case 0xa72b /* ꜫ */: BSEQ(0xea,0x9c,0xaa) /* Ꜫ */;
+ case 0xa72d /* ꜭ */: BSEQ(0xea,0x9c,0xac) /* Ꜭ */;
+ case 0xa72f /* ꜯ */: BSEQ(0xea,0x9c,0xae) /* Ꜯ */;
+ case 0xa733 /* ꜳ */: BSEQ(0xea,0x9c,0xb2) /* Ꜳ */;
+ case 0xa735 /* ꜵ */: BSEQ(0xea,0x9c,0xb4) /* Ꜵ */;
+ case 0xa737 /* ꜷ */: BSEQ(0xea,0x9c,0xb6) /* Ꜷ */;
+ case 0xa739 /* ꜹ */: BSEQ(0xea,0x9c,0xb8) /* Ꜹ */;
+ case 0xa73b /* ꜻ */: BSEQ(0xea,0x9c,0xba) /* Ꜻ */;
+ case 0xa73d /* ꜽ */: BSEQ(0xea,0x9c,0xbc) /* Ꜽ */;
+ case 0xa73f /* ꜿ */: BSEQ(0xea,0x9c,0xbe) /* Ꜿ */;
+ case 0xa741 /* ꝁ */: BSEQ(0xea,0x9d,0x80) /* Ꝁ */;
+ case 0xa743 /* ꝃ */: BSEQ(0xea,0x9d,0x82) /* Ꝃ */;
+ case 0xa745 /* ꝅ */: BSEQ(0xea,0x9d,0x84) /* Ꝅ */;
+ case 0xa747 /* ꝇ */: BSEQ(0xea,0x9d,0x86) /* Ꝇ */;
+ case 0xa749 /* ꝉ */: BSEQ(0xea,0x9d,0x88) /* Ꝉ */;
+ case 0xa74b /* ꝋ */: BSEQ(0xea,0x9d,0x8a) /* Ꝋ */;
+ case 0xa74d /* ꝍ */: BSEQ(0xea,0x9d,0x8c) /* Ꝍ */;
+ case 0xa74f /* ꝏ */: BSEQ(0xea,0x9d,0x8e) /* Ꝏ */;
+ case 0xa751 /* ꝑ */: BSEQ(0xea,0x9d,0x90) /* Ꝑ */;
+ case 0xa753 /* ꝓ */: BSEQ(0xea,0x9d,0x92) /* Ꝓ */;
+ case 0xa755 /* ꝕ */: BSEQ(0xea,0x9d,0x94) /* Ꝕ */;
+ case 0xa757 /* ꝗ */: BSEQ(0xea,0x9d,0x96) /* Ꝗ */;
+ case 0xa759 /* ꝙ */: BSEQ(0xea,0x9d,0x98) /* Ꝙ */;
+ case 0xa75b /* ꝛ */: BSEQ(0xea,0x9d,0x9a) /* Ꝛ */;
+ case 0xa75d /* ꝝ */: BSEQ(0xea,0x9d,0x9c) /* Ꝝ */;
+ case 0xa75f /* ꝟ */: BSEQ(0xea,0x9d,0x9e) /* Ꝟ */;
+ case 0xa761 /* ꝡ */: BSEQ(0xea,0x9d,0xa0) /* Ꝡ */;
+ case 0xa763 /* ꝣ */: BSEQ(0xea,0x9d,0xa2) /* Ꝣ */;
+ case 0xa765 /* ꝥ */: BSEQ(0xea,0x9d,0xa4) /* Ꝥ */;
+ case 0xa767 /* ꝧ */: BSEQ(0xea,0x9d,0xa6) /* Ꝧ */;
+ case 0xa769 /* ꝩ */: BSEQ(0xea,0x9d,0xa8) /* Ꝩ */;
+ case 0xa76b /* ꝫ */: BSEQ(0xea,0x9d,0xaa) /* Ꝫ */;
+ case 0xa76d /* ꝭ */: BSEQ(0xea,0x9d,0xac) /* Ꝭ */;
+ case 0xa76f /* ꝯ */: BSEQ(0xea,0x9d,0xae) /* Ꝯ */;
+ case 0xa77a /* ꝺ */: BSEQ(0xea,0x9d,0xb9) /* Ꝺ */;
+ case 0xa77c /* ꝼ */: BSEQ(0xea,0x9d,0xbb) /* Ꝼ */;
+ case 0xa77f /* ꝿ */: BSEQ(0xea,0x9d,0xbe) /* Ꝿ */;
+ case 0xa781 /* ꞁ */: BSEQ(0xea,0x9e,0x80) /* Ꞁ */;
+ case 0xa783 /* ꞃ */: BSEQ(0xea,0x9e,0x82) /* Ꞃ */;
+ case 0xa785 /* ꞅ */: BSEQ(0xea,0x9e,0x84) /* Ꞅ */;
+ case 0xa787 /* ꞇ */: BSEQ(0xea,0x9e,0x86) /* Ꞇ */;
+ case 0xa78c /* ꞌ */: BSEQ(0xea,0x9e,0x8b) /* Ꞌ */;
+ case 0xa791 /* ꞑ */: BSEQ(0xea,0x9e,0x90) /* Ꞑ */;
+ case 0xa793 /* ꞓ */: BSEQ(0xea,0x9e,0x92) /* Ꞓ */;
+ case 0xa794 /* ꞔ */: BSEQ(0xea,0x9f,0x84) /* Ꞔ */;
+ case 0xa797 /* ꞗ */: BSEQ(0xea,0x9e,0x96) /* Ꞗ */;
+ case 0xa799 /* ꞙ */: BSEQ(0xea,0x9e,0x98) /* Ꞙ */;
+ case 0xa79b /* ꞛ */: BSEQ(0xea,0x9e,0x9a) /* Ꞛ */;
+ case 0xa79d /* ꞝ */: BSEQ(0xea,0x9e,0x9c) /* Ꞝ */;
+ case 0xa79f /* ꞟ */: BSEQ(0xea,0x9e,0x9e) /* Ꞟ */;
+ case 0xa7a1 /* ꞡ */: BSEQ(0xea,0x9e,0xa0) /* Ꞡ */;
+ case 0xa7a3 /* ꞣ */: BSEQ(0xea,0x9e,0xa2) /* Ꞣ */;
+ case 0xa7a5 /* ꞥ */: BSEQ(0xea,0x9e,0xa4) /* Ꞥ */;
+ case 0xa7a7 /* ꞧ */: BSEQ(0xea,0x9e,0xa6) /* Ꞧ */;
+ case 0xa7a9 /* ꞩ */: BSEQ(0xea,0x9e,0xa8) /* Ꞩ */;
+ case 0xa7b5 /* ꞵ */: BSEQ(0xea,0x9e,0xb4) /* Ꞵ */;
+ case 0xa7b7 /* ꞷ */: BSEQ(0xea,0x9e,0xb6) /* Ꞷ */;
+ case 0xa7b9 /* ꞹ */: BSEQ(0xea,0x9e,0xb8) /* Ꞹ */;
+ case 0xa7bb /* ꞻ */: BSEQ(0xea,0x9e,0xba) /* Ꞻ */;
+ case 0xa7bd /* ꞽ */: BSEQ(0xea,0x9e,0xbc) /* Ꞽ */;
+ case 0xa7bf /* ꞿ */: BSEQ(0xea,0x9e,0xbe) /* Ꞿ */;
+ case 0xa7c3 /* ꟃ */: BSEQ(0xea,0x9f,0x82) /* Ꟃ */;
+ case 0xa7c8 /* ꟈ */: BSEQ(0xea,0x9f,0x87) /* Ꟈ */;
+ case 0xa7ca /* ꟊ */: BSEQ(0xea,0x9f,0x89) /* Ꟊ */;
+ case 0xa7f6 /* ꟶ */: BSEQ(0xea,0x9f,0xb5) /* Ꟶ */;
+ case 0xab53 /* ꭓ */: BSEQ(0xea,0x9e,0xb3) /* Ꭓ */;
+ case 0xab70 /* ꭰ */: BSEQ(0xe1,0x8e,0xa0) /* Ꭰ */;
+ case 0xab71 /* ꭱ */: BSEQ(0xe1,0x8e,0xa1) /* Ꭱ */;
+ case 0xab72 /* ꭲ */: BSEQ(0xe1,0x8e,0xa2) /* Ꭲ */;
+ case 0xab73 /* ꭳ */: BSEQ(0xe1,0x8e,0xa3) /* Ꭳ */;
+ case 0xab74 /* ꭴ */: BSEQ(0xe1,0x8e,0xa4) /* Ꭴ */;
+ case 0xab75 /* ꭵ */: BSEQ(0xe1,0x8e,0xa5) /* Ꭵ */;
+ case 0xab76 /* ꭶ */: BSEQ(0xe1,0x8e,0xa6) /* Ꭶ */;
+ case 0xab77 /* ꭷ */: BSEQ(0xe1,0x8e,0xa7) /* Ꭷ */;
+ case 0xab78 /* ꭸ */: BSEQ(0xe1,0x8e,0xa8) /* Ꭸ */;
+ case 0xab79 /* ꭹ */: BSEQ(0xe1,0x8e,0xa9) /* Ꭹ */;
+ case 0xab7a /* ꭺ */: BSEQ(0xe1,0x8e,0xaa) /* Ꭺ */;
+ case 0xab7b /* ꭻ */: BSEQ(0xe1,0x8e,0xab) /* Ꭻ */;
+ case 0xab7c /* ꭼ */: BSEQ(0xe1,0x8e,0xac) /* Ꭼ */;
+ case 0xab7d /* ꭽ */: BSEQ(0xe1,0x8e,0xad) /* Ꭽ */;
+ case 0xab7e /* ꭾ */: BSEQ(0xe1,0x8e,0xae) /* Ꭾ */;
+ case 0xab7f /* ꭿ */: BSEQ(0xe1,0x8e,0xaf) /* Ꭿ */;
+ case 0xab80 /* ꮀ */: BSEQ(0xe1,0x8e,0xb0) /* Ꮀ */;
+ case 0xab81 /* ꮁ */: BSEQ(0xe1,0x8e,0xb1) /* Ꮁ */;
+ case 0xab82 /* ꮂ */: BSEQ(0xe1,0x8e,0xb2) /* Ꮂ */;
+ case 0xab83 /* ꮃ */: BSEQ(0xe1,0x8e,0xb3) /* Ꮃ */;
+ case 0xab84 /* ꮄ */: BSEQ(0xe1,0x8e,0xb4) /* Ꮄ */;
+ case 0xab85 /* ꮅ */: BSEQ(0xe1,0x8e,0xb5) /* Ꮅ */;
+ case 0xab86 /* ꮆ */: BSEQ(0xe1,0x8e,0xb6) /* Ꮆ */;
+ case 0xab87 /* ꮇ */: BSEQ(0xe1,0x8e,0xb7) /* Ꮇ */;
+ case 0xab88 /* ꮈ */: BSEQ(0xe1,0x8e,0xb8) /* Ꮈ */;
+ case 0xab89 /* ꮉ */: BSEQ(0xe1,0x8e,0xb9) /* Ꮉ */;
+ case 0xab8a /* ꮊ */: BSEQ(0xe1,0x8e,0xba) /* Ꮊ */;
+ case 0xab8b /* ꮋ */: BSEQ(0xe1,0x8e,0xbb) /* Ꮋ */;
+ case 0xab8c /* ꮌ */: BSEQ(0xe1,0x8e,0xbc) /* Ꮌ */;
+ case 0xab8d /* ꮍ */: BSEQ(0xe1,0x8e,0xbd) /* Ꮍ */;
+ case 0xab8e /* ꮎ */: BSEQ(0xe1,0x8e,0xbe) /* Ꮎ */;
+ case 0xab8f /* ꮏ */: BSEQ(0xe1,0x8e,0xbf) /* Ꮏ */;
+ case 0xab90 /* ꮐ */: BSEQ(0xe1,0x8f,0x80) /* Ꮐ */;
+ case 0xab91 /* ꮑ */: BSEQ(0xe1,0x8f,0x81) /* Ꮑ */;
+ case 0xab92 /* ꮒ */: BSEQ(0xe1,0x8f,0x82) /* Ꮒ */;
+ case 0xab93 /* ꮓ */: BSEQ(0xe1,0x8f,0x83) /* Ꮓ */;
+ case 0xab94 /* ꮔ */: BSEQ(0xe1,0x8f,0x84) /* Ꮔ */;
+ case 0xab95 /* ꮕ */: BSEQ(0xe1,0x8f,0x85) /* Ꮕ */;
+ case 0xab96 /* ꮖ */: BSEQ(0xe1,0x8f,0x86) /* Ꮖ */;
+ case 0xab97 /* ꮗ */: BSEQ(0xe1,0x8f,0x87) /* Ꮗ */;
+ case 0xab98 /* ꮘ */: BSEQ(0xe1,0x8f,0x88) /* Ꮘ */;
+ case 0xab99 /* ꮙ */: BSEQ(0xe1,0x8f,0x89) /* Ꮙ */;
+ case 0xab9a /* ꮚ */: BSEQ(0xe1,0x8f,0x8a) /* Ꮚ */;
+ case 0xab9b /* ꮛ */: BSEQ(0xe1,0x8f,0x8b) /* Ꮛ */;
+ case 0xab9c /* ꮜ */: BSEQ(0xe1,0x8f,0x8c) /* Ꮜ */;
+ case 0xab9d /* ꮝ */: BSEQ(0xe1,0x8f,0x8d) /* Ꮝ */;
+ case 0xab9e /* ꮞ */: BSEQ(0xe1,0x8f,0x8e) /* Ꮞ */;
+ case 0xab9f /* ꮟ */: BSEQ(0xe1,0x8f,0x8f) /* Ꮟ */;
+ case 0xaba0 /* ꮠ */: BSEQ(0xe1,0x8f,0x90) /* Ꮠ */;
+ case 0xaba1 /* ꮡ */: BSEQ(0xe1,0x8f,0x91) /* Ꮡ */;
+ case 0xaba2 /* ꮢ */: BSEQ(0xe1,0x8f,0x92) /* Ꮢ */;
+ case 0xaba3 /* ꮣ */: BSEQ(0xe1,0x8f,0x93) /* Ꮣ */;
+ case 0xaba4 /* ꮤ */: BSEQ(0xe1,0x8f,0x94) /* Ꮤ */;
+ case 0xaba5 /* ꮥ */: BSEQ(0xe1,0x8f,0x95) /* Ꮥ */;
+ case 0xaba6 /* ꮦ */: BSEQ(0xe1,0x8f,0x96) /* Ꮦ */;
+ case 0xaba7 /* ꮧ */: BSEQ(0xe1,0x8f,0x97) /* Ꮧ */;
+ case 0xaba8 /* ꮨ */: BSEQ(0xe1,0x8f,0x98) /* Ꮨ */;
+ case 0xaba9 /* ꮩ */: BSEQ(0xe1,0x8f,0x99) /* Ꮩ */;
+ case 0xabaa /* ꮪ */: BSEQ(0xe1,0x8f,0x9a) /* Ꮪ */;
+ case 0xabab /* ꮫ */: BSEQ(0xe1,0x8f,0x9b) /* Ꮫ */;
+ case 0xabac /* ꮬ */: BSEQ(0xe1,0x8f,0x9c) /* Ꮬ */;
+ case 0xabad /* ꮭ */: BSEQ(0xe1,0x8f,0x9d) /* Ꮭ */;
+ case 0xabae /* ꮮ */: BSEQ(0xe1,0x8f,0x9e) /* Ꮮ */;
+ case 0xabaf /* ꮯ */: BSEQ(0xe1,0x8f,0x9f) /* Ꮯ */;
+ case 0xabb0 /* ꮰ */: BSEQ(0xe1,0x8f,0xa0) /* Ꮰ */;
+ case 0xabb1 /* ꮱ */: BSEQ(0xe1,0x8f,0xa1) /* Ꮱ */;
+ case 0xabb2 /* ꮲ */: BSEQ(0xe1,0x8f,0xa2) /* Ꮲ */;
+ case 0xabb3 /* ꮳ */: BSEQ(0xe1,0x8f,0xa3) /* Ꮳ */;
+ case 0xabb4 /* ꮴ */: BSEQ(0xe1,0x8f,0xa4) /* Ꮴ */;
+ case 0xabb5 /* ꮵ */: BSEQ(0xe1,0x8f,0xa5) /* Ꮵ */;
+ case 0xabb6 /* ꮶ */: BSEQ(0xe1,0x8f,0xa6) /* Ꮶ */;
+ case 0xabb7 /* ꮷ */: BSEQ(0xe1,0x8f,0xa7) /* Ꮷ */;
+ case 0xabb8 /* ꮸ */: BSEQ(0xe1,0x8f,0xa8) /* Ꮸ */;
+ case 0xabb9 /* ꮹ */: BSEQ(0xe1,0x8f,0xa9) /* Ꮹ */;
+ case 0xabba /* ꮺ */: BSEQ(0xe1,0x8f,0xaa) /* Ꮺ */;
+ case 0xabbb /* ꮻ */: BSEQ(0xe1,0x8f,0xab) /* Ꮻ */;
+ case 0xabbc /* ꮼ */: BSEQ(0xe1,0x8f,0xac) /* Ꮼ */;
+ case 0xabbd /* ꮽ */: BSEQ(0xe1,0x8f,0xad) /* Ꮽ */;
+ case 0xabbe /* ꮾ */: BSEQ(0xe1,0x8f,0xae) /* Ꮾ */;
+ case 0xabbf /* ꮿ */: BSEQ(0xe1,0x8f,0xaf) /* Ꮿ */;
+ case 0xfb00 /* ff */: BSEQ(0x46,0x46) /* FF */;
+ case 0xfb01 /* fi */: BSEQ(0x46,0x49) /* FI */;
+ case 0xfb02 /* fl */: BSEQ(0x46,0x4c) /* FL */;
+ case 0xfb03 /* ffi */: BSEQ(0x46,0x46,0x49) /* FFI */;
+ case 0xfb04 /* ffl */: BSEQ(0x46,0x46,0x4c) /* FFL */;
+ case 0xfb05 /* ſt */: BSEQ(0x53,0x54) /* ST */;
+ case 0xfb06 /* st */: BSEQ(0x53,0x54) /* ST */;
+ case 0xfb13 /* ﬓ */: BSEQ(0xd5,0x84,0xd5,0x86) /* ՄՆ */;
+ case 0xfb14 /* ﬔ */: BSEQ(0xd5,0x84,0xd4,0xb5) /* ՄԵ */;
+ case 0xfb15 /* ﬕ */: BSEQ(0xd5,0x84,0xd4,0xbb) /* ՄԻ */;
+ case 0xfb16 /* ﬖ */: BSEQ(0xd5,0x8e,0xd5,0x86) /* ՎՆ */;
+ case 0xfb17 /* ﬗ */: BSEQ(0xd5,0x84,0xd4,0xbd) /* ՄԽ */;
+ case 0xff41 /* a */: BSEQ(0xef,0xbc,0xa1) /* A */;
+ case 0xff42 /* b */: BSEQ(0xef,0xbc,0xa2) /* B */;
+ case 0xff43 /* c */: BSEQ(0xef,0xbc,0xa3) /* C */;
+ case 0xff44 /* d */: BSEQ(0xef,0xbc,0xa4) /* D */;
+ case 0xff45 /* e */: BSEQ(0xef,0xbc,0xa5) /* E */;
+ case 0xff46 /* f */: BSEQ(0xef,0xbc,0xa6) /* F */;
+ case 0xff47 /* g */: BSEQ(0xef,0xbc,0xa7) /* G */;
+ case 0xff48 /* h */: BSEQ(0xef,0xbc,0xa8) /* H */;
+ case 0xff49 /* i */: BSEQ(0xef,0xbc,0xa9) /* I */;
+ case 0xff4a /* j */: BSEQ(0xef,0xbc,0xaa) /* J */;
+ case 0xff4b /* k */: BSEQ(0xef,0xbc,0xab) /* K */;
+ case 0xff4c /* l */: BSEQ(0xef,0xbc,0xac) /* L */;
+ case 0xff4d /* m */: BSEQ(0xef,0xbc,0xad) /* M */;
+ case 0xff4e /* n */: BSEQ(0xef,0xbc,0xae) /* N */;
+ case 0xff4f /* o */: BSEQ(0xef,0xbc,0xaf) /* O */;
+ case 0xff50 /* p */: BSEQ(0xef,0xbc,0xb0) /* P */;
+ case 0xff51 /* q */: BSEQ(0xef,0xbc,0xb1) /* Q */;
+ case 0xff52 /* r */: BSEQ(0xef,0xbc,0xb2) /* R */;
+ case 0xff53 /* s */: BSEQ(0xef,0xbc,0xb3) /* S */;
+ case 0xff54 /* t */: BSEQ(0xef,0xbc,0xb4) /* T */;
+ case 0xff55 /* u */: BSEQ(0xef,0xbc,0xb5) /* U */;
+ case 0xff56 /* v */: BSEQ(0xef,0xbc,0xb6) /* V */;
+ case 0xff57 /* w */: BSEQ(0xef,0xbc,0xb7) /* W */;
+ case 0xff58 /* x */: BSEQ(0xef,0xbc,0xb8) /* X */;
+ case 0xff59 /* y */: BSEQ(0xef,0xbc,0xb9) /* Y */;
+ case 0xff5a /* z */: BSEQ(0xef,0xbc,0xba) /* Z */;
+ case 0x10428 /* 𐐨 */: BSEQ(0xf0,0x90,0x90,0x80) /* 𐐀 */;
+ case 0x10429 /* 𐐩 */: BSEQ(0xf0,0x90,0x90,0x81) /* 𐐁 */;
+ case 0x1042a /* 𐐪 */: BSEQ(0xf0,0x90,0x90,0x82) /* 𐐂 */;
+ case 0x1042b /* 𐐫 */: BSEQ(0xf0,0x90,0x90,0x83) /* 𐐃 */;
+ case 0x1042c /* 𐐬 */: BSEQ(0xf0,0x90,0x90,0x84) /* 𐐄 */;
+ case 0x1042d /* 𐐭 */: BSEQ(0xf0,0x90,0x90,0x85) /* 𐐅 */;
+ case 0x1042e /* 𐐮 */: BSEQ(0xf0,0x90,0x90,0x86) /* 𐐆 */;
+ case 0x1042f /* 𐐯 */: BSEQ(0xf0,0x90,0x90,0x87) /* 𐐇 */;
+ case 0x10430 /* 𐐰 */: BSEQ(0xf0,0x90,0x90,0x88) /* 𐐈 */;
+ case 0x10431 /* 𐐱 */: BSEQ(0xf0,0x90,0x90,0x89) /* 𐐉 */;
+ case 0x10432 /* 𐐲 */: BSEQ(0xf0,0x90,0x90,0x8a) /* 𐐊 */;
+ case 0x10433 /* 𐐳 */: BSEQ(0xf0,0x90,0x90,0x8b) /* 𐐋 */;
+ case 0x10434 /* 𐐴 */: BSEQ(0xf0,0x90,0x90,0x8c) /* 𐐌 */;
+ case 0x10435 /* 𐐵 */: BSEQ(0xf0,0x90,0x90,0x8d) /* 𐐍 */;
+ case 0x10436 /* 𐐶 */: BSEQ(0xf0,0x90,0x90,0x8e) /* 𐐎 */;
+ case 0x10437 /* 𐐷 */: BSEQ(0xf0,0x90,0x90,0x8f) /* 𐐏 */;
+ case 0x10438 /* 𐐸 */: BSEQ(0xf0,0x90,0x90,0x90) /* 𐐐 */;
+ case 0x10439 /* 𐐹 */: BSEQ(0xf0,0x90,0x90,0x91) /* 𐐑 */;
+ case 0x1043a /* 𐐺 */: BSEQ(0xf0,0x90,0x90,0x92) /* 𐐒 */;
+ case 0x1043b /* 𐐻 */: BSEQ(0xf0,0x90,0x90,0x93) /* 𐐓 */;
+ case 0x1043c /* 𐐼 */: BSEQ(0xf0,0x90,0x90,0x94) /* 𐐔 */;
+ case 0x1043d /* 𐐽 */: BSEQ(0xf0,0x90,0x90,0x95) /* 𐐕 */;
+ case 0x1043e /* 𐐾 */: BSEQ(0xf0,0x90,0x90,0x96) /* 𐐖 */;
+ case 0x1043f /* 𐐿 */: BSEQ(0xf0,0x90,0x90,0x97) /* 𐐗 */;
+ case 0x10440 /* 𐑀 */: BSEQ(0xf0,0x90,0x90,0x98) /* 𐐘 */;
+ case 0x10441 /* 𐑁 */: BSEQ(0xf0,0x90,0x90,0x99) /* 𐐙 */;
+ case 0x10442 /* 𐑂 */: BSEQ(0xf0,0x90,0x90,0x9a) /* 𐐚 */;
+ case 0x10443 /* 𐑃 */: BSEQ(0xf0,0x90,0x90,0x9b) /* 𐐛 */;
+ case 0x10444 /* 𐑄 */: BSEQ(0xf0,0x90,0x90,0x9c) /* 𐐜 */;
+ case 0x10445 /* 𐑅 */: BSEQ(0xf0,0x90,0x90,0x9d) /* 𐐝 */;
+ case 0x10446 /* 𐑆 */: BSEQ(0xf0,0x90,0x90,0x9e) /* 𐐞 */;
+ case 0x10447 /* 𐑇 */: BSEQ(0xf0,0x90,0x90,0x9f) /* 𐐟 */;
+ case 0x10448 /* 𐑈 */: BSEQ(0xf0,0x90,0x90,0xa0) /* 𐐠 */;
+ case 0x10449 /* 𐑉 */: BSEQ(0xf0,0x90,0x90,0xa1) /* 𐐡 */;
+ case 0x1044a /* 𐑊 */: BSEQ(0xf0,0x90,0x90,0xa2) /* 𐐢 */;
+ case 0x1044b /* 𐑋 */: BSEQ(0xf0,0x90,0x90,0xa3) /* 𐐣 */;
+ case 0x1044c /* 𐑌 */: BSEQ(0xf0,0x90,0x90,0xa4) /* 𐐤 */;
+ case 0x1044d /* 𐑍 */: BSEQ(0xf0,0x90,0x90,0xa5) /* 𐐥 */;
+ case 0x1044e /* 𐑎 */: BSEQ(0xf0,0x90,0x90,0xa6) /* 𐐦 */;
+ case 0x1044f /* 𐑏 */: BSEQ(0xf0,0x90,0x90,0xa7) /* 𐐧 */;
+ case 0x104d8 /* 𐓘 */: BSEQ(0xf0,0x90,0x92,0xb0) /* 𐒰 */;
+ case 0x104d9 /* 𐓙 */: BSEQ(0xf0,0x90,0x92,0xb1) /* 𐒱 */;
+ case 0x104da /* 𐓚 */: BSEQ(0xf0,0x90,0x92,0xb2) /* 𐒲 */;
+ case 0x104db /* 𐓛 */: BSEQ(0xf0,0x90,0x92,0xb3) /* 𐒳 */;
+ case 0x104dc /* 𐓜 */: BSEQ(0xf0,0x90,0x92,0xb4) /* 𐒴 */;
+ case 0x104dd /* 𐓝 */: BSEQ(0xf0,0x90,0x92,0xb5) /* 𐒵 */;
+ case 0x104de /* 𐓞 */: BSEQ(0xf0,0x90,0x92,0xb6) /* 𐒶 */;
+ case 0x104df /* 𐓟 */: BSEQ(0xf0,0x90,0x92,0xb7) /* 𐒷 */;
+ case 0x104e0 /* 𐓠 */: BSEQ(0xf0,0x90,0x92,0xb8) /* 𐒸 */;
+ case 0x104e1 /* 𐓡 */: BSEQ(0xf0,0x90,0x92,0xb9) /* 𐒹 */;
+ case 0x104e2 /* 𐓢 */: BSEQ(0xf0,0x90,0x92,0xba) /* 𐒺 */;
+ case 0x104e3 /* 𐓣 */: BSEQ(0xf0,0x90,0x92,0xbb) /* 𐒻 */;
+ case 0x104e4 /* 𐓤 */: BSEQ(0xf0,0x90,0x92,0xbc) /* 𐒼 */;
+ case 0x104e5 /* 𐓥 */: BSEQ(0xf0,0x90,0x92,0xbd) /* 𐒽 */;
+ case 0x104e6 /* 𐓦 */: BSEQ(0xf0,0x90,0x92,0xbe) /* 𐒾 */;
+ case 0x104e7 /* 𐓧 */: BSEQ(0xf0,0x90,0x92,0xbf) /* 𐒿 */;
+ case 0x104e8 /* 𐓨 */: BSEQ(0xf0,0x90,0x93,0x80) /* 𐓀 */;
+ case 0x104e9 /* 𐓩 */: BSEQ(0xf0,0x90,0x93,0x81) /* 𐓁 */;
+ case 0x104ea /* 𐓪 */: BSEQ(0xf0,0x90,0x93,0x82) /* 𐓂 */;
+ case 0x104eb /* 𐓫 */: BSEQ(0xf0,0x90,0x93,0x83) /* 𐓃 */;
+ case 0x104ec /* 𐓬 */: BSEQ(0xf0,0x90,0x93,0x84) /* 𐓄 */;
+ case 0x104ed /* 𐓭 */: BSEQ(0xf0,0x90,0x93,0x85) /* 𐓅 */;
+ case 0x104ee /* 𐓮 */: BSEQ(0xf0,0x90,0x93,0x86) /* 𐓆 */;
+ case 0x104ef /* 𐓯 */: BSEQ(0xf0,0x90,0x93,0x87) /* 𐓇 */;
+ case 0x104f0 /* 𐓰 */: BSEQ(0xf0,0x90,0x93,0x88) /* 𐓈 */;
+ case 0x104f1 /* 𐓱 */: BSEQ(0xf0,0x90,0x93,0x89) /* 𐓉 */;
+ case 0x104f2 /* 𐓲 */: BSEQ(0xf0,0x90,0x93,0x8a) /* 𐓊 */;
+ case 0x104f3 /* 𐓳 */: BSEQ(0xf0,0x90,0x93,0x8b) /* 𐓋 */;
+ case 0x104f4 /* 𐓴 */: BSEQ(0xf0,0x90,0x93,0x8c) /* 𐓌 */;
+ case 0x104f5 /* 𐓵 */: BSEQ(0xf0,0x90,0x93,0x8d) /* 𐓍 */;
+ case 0x104f6 /* 𐓶 */: BSEQ(0xf0,0x90,0x93,0x8e) /* 𐓎 */;
+ case 0x104f7 /* 𐓷 */: BSEQ(0xf0,0x90,0x93,0x8f) /* 𐓏 */;
+ case 0x104f8 /* 𐓸 */: BSEQ(0xf0,0x90,0x93,0x90) /* 𐓐 */;
+ case 0x104f9 /* 𐓹 */: BSEQ(0xf0,0x90,0x93,0x91) /* 𐓑 */;
+ case 0x104fa /* 𐓺 */: BSEQ(0xf0,0x90,0x93,0x92) /* 𐓒 */;
+ case 0x104fb /* 𐓻 */: BSEQ(0xf0,0x90,0x93,0x93) /* 𐓓 */;
+ case 0x10cc0 /* 𐳀 */: BSEQ(0xf0,0x90,0xb2,0x80) /* 𐲀 */;
+ case 0x10cc1 /* 𐳁 */: BSEQ(0xf0,0x90,0xb2,0x81) /* 𐲁 */;
+ case 0x10cc2 /* 𐳂 */: BSEQ(0xf0,0x90,0xb2,0x82) /* 𐲂 */;
+ case 0x10cc3 /* 𐳃 */: BSEQ(0xf0,0x90,0xb2,0x83) /* 𐲃 */;
+ case 0x10cc4 /* 𐳄 */: BSEQ(0xf0,0x90,0xb2,0x84) /* 𐲄 */;
+ case 0x10cc5 /* 𐳅 */: BSEQ(0xf0,0x90,0xb2,0x85) /* 𐲅 */;
+ case 0x10cc6 /* 𐳆 */: BSEQ(0xf0,0x90,0xb2,0x86) /* 𐲆 */;
+ case 0x10cc7 /* 𐳇 */: BSEQ(0xf0,0x90,0xb2,0x87) /* 𐲇 */;
+ case 0x10cc8 /* 𐳈 */: BSEQ(0xf0,0x90,0xb2,0x88) /* 𐲈 */;
+ case 0x10cc9 /* 𐳉 */: BSEQ(0xf0,0x90,0xb2,0x89) /* 𐲉 */;
+ case 0x10cca /* 𐳊 */: BSEQ(0xf0,0x90,0xb2,0x8a) /* 𐲊 */;
+ case 0x10ccb /* 𐳋 */: BSEQ(0xf0,0x90,0xb2,0x8b) /* 𐲋 */;
+ case 0x10ccc /* 𐳌 */: BSEQ(0xf0,0x90,0xb2,0x8c) /* 𐲌 */;
+ case 0x10ccd /* 𐳍 */: BSEQ(0xf0,0x90,0xb2,0x8d) /* 𐲍 */;
+ case 0x10cce /* 𐳎 */: BSEQ(0xf0,0x90,0xb2,0x8e) /* 𐲎 */;
+ case 0x10ccf /* 𐳏 */: BSEQ(0xf0,0x90,0xb2,0x8f) /* 𐲏 */;
+ case 0x10cd0 /* 𐳐 */: BSEQ(0xf0,0x90,0xb2,0x90) /* 𐲐 */;
+ case 0x10cd1 /* 𐳑 */: BSEQ(0xf0,0x90,0xb2,0x91) /* 𐲑 */;
+ case 0x10cd2 /* 𐳒 */: BSEQ(0xf0,0x90,0xb2,0x92) /* 𐲒 */;
+ case 0x10cd3 /* 𐳓 */: BSEQ(0xf0,0x90,0xb2,0x93) /* 𐲓 */;
+ case 0x10cd4 /* 𐳔 */: BSEQ(0xf0,0x90,0xb2,0x94) /* 𐲔 */;
+ case 0x10cd5 /* 𐳕 */: BSEQ(0xf0,0x90,0xb2,0x95) /* 𐲕 */;
+ case 0x10cd6 /* 𐳖 */: BSEQ(0xf0,0x90,0xb2,0x96) /* 𐲖 */;
+ case 0x10cd7 /* 𐳗 */: BSEQ(0xf0,0x90,0xb2,0x97) /* 𐲗 */;
+ case 0x10cd8 /* 𐳘 */: BSEQ(0xf0,0x90,0xb2,0x98) /* 𐲘 */;
+ case 0x10cd9 /* 𐳙 */: BSEQ(0xf0,0x90,0xb2,0x99) /* 𐲙 */;
+ case 0x10cda /* 𐳚 */: BSEQ(0xf0,0x90,0xb2,0x9a) /* 𐲚 */;
+ case 0x10cdb /* 𐳛 */: BSEQ(0xf0,0x90,0xb2,0x9b) /* 𐲛 */;
+ case 0x10cdc /* 𐳜 */: BSEQ(0xf0,0x90,0xb2,0x9c) /* 𐲜 */;
+ case 0x10cdd /* 𐳝 */: BSEQ(0xf0,0x90,0xb2,0x9d) /* 𐲝 */;
+ case 0x10cde /* 𐳞 */: BSEQ(0xf0,0x90,0xb2,0x9e) /* 𐲞 */;
+ case 0x10cdf /* 𐳟 */: BSEQ(0xf0,0x90,0xb2,0x9f) /* 𐲟 */;
+ case 0x10ce0 /* 𐳠 */: BSEQ(0xf0,0x90,0xb2,0xa0) /* 𐲠 */;
+ case 0x10ce1 /* 𐳡 */: BSEQ(0xf0,0x90,0xb2,0xa1) /* 𐲡 */;
+ case 0x10ce2 /* 𐳢 */: BSEQ(0xf0,0x90,0xb2,0xa2) /* 𐲢 */;
+ case 0x10ce3 /* 𐳣 */: BSEQ(0xf0,0x90,0xb2,0xa3) /* 𐲣 */;
+ case 0x10ce4 /* 𐳤 */: BSEQ(0xf0,0x90,0xb2,0xa4) /* 𐲤 */;
+ case 0x10ce5 /* 𐳥 */: BSEQ(0xf0,0x90,0xb2,0xa5) /* 𐲥 */;
+ case 0x10ce6 /* 𐳦 */: BSEQ(0xf0,0x90,0xb2,0xa6) /* 𐲦 */;
+ case 0x10ce7 /* 𐳧 */: BSEQ(0xf0,0x90,0xb2,0xa7) /* 𐲧 */;
+ case 0x10ce8 /* 𐳨 */: BSEQ(0xf0,0x90,0xb2,0xa8) /* 𐲨 */;
+ case 0x10ce9 /* 𐳩 */: BSEQ(0xf0,0x90,0xb2,0xa9) /* 𐲩 */;
+ case 0x10cea /* 𐳪 */: BSEQ(0xf0,0x90,0xb2,0xaa) /* 𐲪 */;
+ case 0x10ceb /* 𐳫 */: BSEQ(0xf0,0x90,0xb2,0xab) /* 𐲫 */;
+ case 0x10cec /* 𐳬 */: BSEQ(0xf0,0x90,0xb2,0xac) /* 𐲬 */;
+ case 0x10ced /* 𐳭 */: BSEQ(0xf0,0x90,0xb2,0xad) /* 𐲭 */;
+ case 0x10cee /* 𐳮 */: BSEQ(0xf0,0x90,0xb2,0xae) /* 𐲮 */;
+ case 0x10cef /* 𐳯 */: BSEQ(0xf0,0x90,0xb2,0xaf) /* 𐲯 */;
+ case 0x10cf0 /* 𐳰 */: BSEQ(0xf0,0x90,0xb2,0xb0) /* 𐲰 */;
+ case 0x10cf1 /* 𐳱 */: BSEQ(0xf0,0x90,0xb2,0xb1) /* 𐲱 */;
+ case 0x10cf2 /* 𐳲 */: BSEQ(0xf0,0x90,0xb2,0xb2) /* 𐲲 */;
+ case 0x118c0 /* 𑣀 */: BSEQ(0xf0,0x91,0xa2,0xa0) /* 𑢠 */;
+ case 0x118c1 /* 𑣁 */: BSEQ(0xf0,0x91,0xa2,0xa1) /* 𑢡 */;
+ case 0x118c2 /* 𑣂 */: BSEQ(0xf0,0x91,0xa2,0xa2) /* 𑢢 */;
+ case 0x118c3 /* 𑣃 */: BSEQ(0xf0,0x91,0xa2,0xa3) /* 𑢣 */;
+ case 0x118c4 /* 𑣄 */: BSEQ(0xf0,0x91,0xa2,0xa4) /* 𑢤 */;
+ case 0x118c5 /* 𑣅 */: BSEQ(0xf0,0x91,0xa2,0xa5) /* 𑢥 */;
+ case 0x118c6 /* 𑣆 */: BSEQ(0xf0,0x91,0xa2,0xa6) /* 𑢦 */;
+ case 0x118c7 /* 𑣇 */: BSEQ(0xf0,0x91,0xa2,0xa7) /* 𑢧 */;
+ case 0x118c8 /* 𑣈 */: BSEQ(0xf0,0x91,0xa2,0xa8) /* 𑢨 */;
+ case 0x118c9 /* 𑣉 */: BSEQ(0xf0,0x91,0xa2,0xa9) /* 𑢩 */;
+ case 0x118ca /* 𑣊 */: BSEQ(0xf0,0x91,0xa2,0xaa) /* 𑢪 */;
+ case 0x118cb /* 𑣋 */: BSEQ(0xf0,0x91,0xa2,0xab) /* 𑢫 */;
+ case 0x118cc /* 𑣌 */: BSEQ(0xf0,0x91,0xa2,0xac) /* 𑢬 */;
+ case 0x118cd /* 𑣍 */: BSEQ(0xf0,0x91,0xa2,0xad) /* 𑢭 */;
+ case 0x118ce /* 𑣎 */: BSEQ(0xf0,0x91,0xa2,0xae) /* 𑢮 */;
+ case 0x118cf /* 𑣏 */: BSEQ(0xf0,0x91,0xa2,0xaf) /* 𑢯 */;
+ case 0x118d0 /* 𑣐 */: BSEQ(0xf0,0x91,0xa2,0xb0) /* 𑢰 */;
+ case 0x118d1 /* 𑣑 */: BSEQ(0xf0,0x91,0xa2,0xb1) /* 𑢱 */;
+ case 0x118d2 /* 𑣒 */: BSEQ(0xf0,0x91,0xa2,0xb2) /* 𑢲 */;
+ case 0x118d3 /* 𑣓 */: BSEQ(0xf0,0x91,0xa2,0xb3) /* 𑢳 */;
+ case 0x118d4 /* 𑣔 */: BSEQ(0xf0,0x91,0xa2,0xb4) /* 𑢴 */;
+ case 0x118d5 /* 𑣕 */: BSEQ(0xf0,0x91,0xa2,0xb5) /* 𑢵 */;
+ case 0x118d6 /* 𑣖 */: BSEQ(0xf0,0x91,0xa2,0xb6) /* 𑢶 */;
+ case 0x118d7 /* 𑣗 */: BSEQ(0xf0,0x91,0xa2,0xb7) /* 𑢷 */;
+ case 0x118d8 /* 𑣘 */: BSEQ(0xf0,0x91,0xa2,0xb8) /* 𑢸 */;
+ case 0x118d9 /* 𑣙 */: BSEQ(0xf0,0x91,0xa2,0xb9) /* 𑢹 */;
+ case 0x118da /* 𑣚 */: BSEQ(0xf0,0x91,0xa2,0xba) /* 𑢺 */;
+ case 0x118db /* 𑣛 */: BSEQ(0xf0,0x91,0xa2,0xbb) /* 𑢻 */;
+ case 0x118dc /* 𑣜 */: BSEQ(0xf0,0x91,0xa2,0xbc) /* 𑢼 */;
+ case 0x118dd /* 𑣝 */: BSEQ(0xf0,0x91,0xa2,0xbd) /* 𑢽 */;
+ case 0x118de /* 𑣞 */: BSEQ(0xf0,0x91,0xa2,0xbe) /* 𑢾 */;
+ case 0x118df /* 𑣟 */: BSEQ(0xf0,0x91,0xa2,0xbf) /* 𑢿 */;
+ case 0x16e60 /* 𖹠 */: BSEQ(0xf0,0x96,0xb9,0x80) /* 𖹀 */;
+ case 0x16e61 /* 𖹡 */: BSEQ(0xf0,0x96,0xb9,0x81) /* 𖹁 */;
+ case 0x16e62 /* 𖹢 */: BSEQ(0xf0,0x96,0xb9,0x82) /* 𖹂 */;
+ case 0x16e63 /* 𖹣 */: BSEQ(0xf0,0x96,0xb9,0x83) /* 𖹃 */;
+ case 0x16e64 /* 𖹤 */: BSEQ(0xf0,0x96,0xb9,0x84) /* 𖹄 */;
+ case 0x16e65 /* 𖹥 */: BSEQ(0xf0,0x96,0xb9,0x85) /* 𖹅 */;
+ case 0x16e66 /* 𖹦 */: BSEQ(0xf0,0x96,0xb9,0x86) /* 𖹆 */;
+ case 0x16e67 /* 𖹧 */: BSEQ(0xf0,0x96,0xb9,0x87) /* 𖹇 */;
+ case 0x16e68 /* 𖹨 */: BSEQ(0xf0,0x96,0xb9,0x88) /* 𖹈 */;
+ case 0x16e69 /* 𖹩 */: BSEQ(0xf0,0x96,0xb9,0x89) /* 𖹉 */;
+ case 0x16e6a /* 𖹪 */: BSEQ(0xf0,0x96,0xb9,0x8a) /* 𖹊 */;
+ case 0x16e6b /* 𖹫 */: BSEQ(0xf0,0x96,0xb9,0x8b) /* 𖹋 */;
+ case 0x16e6c /* 𖹬 */: BSEQ(0xf0,0x96,0xb9,0x8c) /* 𖹌 */;
+ case 0x16e6d /* 𖹭 */: BSEQ(0xf0,0x96,0xb9,0x8d) /* 𖹍 */;
+ case 0x16e6e /* 𖹮 */: BSEQ(0xf0,0x96,0xb9,0x8e) /* 𖹎 */;
+ case 0x16e6f /* 𖹯 */: BSEQ(0xf0,0x96,0xb9,0x8f) /* 𖹏 */;
+ case 0x16e70 /* 𖹰 */: BSEQ(0xf0,0x96,0xb9,0x90) /* 𖹐 */;
+ case 0x16e71 /* 𖹱 */: BSEQ(0xf0,0x96,0xb9,0x91) /* 𖹑 */;
+ case 0x16e72 /* 𖹲 */: BSEQ(0xf0,0x96,0xb9,0x92) /* 𖹒 */;
+ case 0x16e73 /* 𖹳 */: BSEQ(0xf0,0x96,0xb9,0x93) /* 𖹓 */;
+ case 0x16e74 /* 𖹴 */: BSEQ(0xf0,0x96,0xb9,0x94) /* 𖹔 */;
+ case 0x16e75 /* 𖹵 */: BSEQ(0xf0,0x96,0xb9,0x95) /* 𖹕 */;
+ case 0x16e76 /* 𖹶 */: BSEQ(0xf0,0x96,0xb9,0x96) /* 𖹖 */;
+ case 0x16e77 /* 𖹷 */: BSEQ(0xf0,0x96,0xb9,0x97) /* 𖹗 */;
+ case 0x16e78 /* 𖹸 */: BSEQ(0xf0,0x96,0xb9,0x98) /* 𖹘 */;
+ case 0x16e79 /* 𖹹 */: BSEQ(0xf0,0x96,0xb9,0x99) /* 𖹙 */;
+ case 0x16e7a /* 𖹺 */: BSEQ(0xf0,0x96,0xb9,0x9a) /* 𖹚 */;
+ case 0x16e7b /* 𖹻 */: BSEQ(0xf0,0x96,0xb9,0x9b) /* 𖹛 */;
+ case 0x16e7c /* 𖹼 */: BSEQ(0xf0,0x96,0xb9,0x9c) /* 𖹜 */;
+ case 0x16e7d /* 𖹽 */: BSEQ(0xf0,0x96,0xb9,0x9d) /* 𖹝 */;
+ case 0x16e7e /* 𖹾 */: BSEQ(0xf0,0x96,0xb9,0x9e) /* 𖹞 */;
+ case 0x16e7f /* 𖹿 */: BSEQ(0xf0,0x96,0xb9,0x9f) /* 𖹟 */;
+ case 0x1e922 /* 𞤢 */: BSEQ(0xf0,0x9e,0xa4,0x80) /* 𞤀 */;
+ case 0x1e923 /* 𞤣 */: BSEQ(0xf0,0x9e,0xa4,0x81) /* 𞤁 */;
+ case 0x1e924 /* 𞤤 */: BSEQ(0xf0,0x9e,0xa4,0x82) /* 𞤂 */;
+ case 0x1e925 /* 𞤥 */: BSEQ(0xf0,0x9e,0xa4,0x83) /* 𞤃 */;
+ case 0x1e926 /* 𞤦 */: BSEQ(0xf0,0x9e,0xa4,0x84) /* 𞤄 */;
+ case 0x1e927 /* 𞤧 */: BSEQ(0xf0,0x9e,0xa4,0x85) /* 𞤅 */;
+ case 0x1e928 /* 𞤨 */: BSEQ(0xf0,0x9e,0xa4,0x86) /* 𞤆 */;
+ case 0x1e929 /* 𞤩 */: BSEQ(0xf0,0x9e,0xa4,0x87) /* 𞤇 */;
+ case 0x1e92a /* 𞤪 */: BSEQ(0xf0,0x9e,0xa4,0x88) /* 𞤈 */;
+ case 0x1e92b /* 𞤫 */: BSEQ(0xf0,0x9e,0xa4,0x89) /* 𞤉 */;
+ case 0x1e92c /* 𞤬 */: BSEQ(0xf0,0x9e,0xa4,0x8a) /* 𞤊 */;
+ case 0x1e92d /* 𞤭 */: BSEQ(0xf0,0x9e,0xa4,0x8b) /* 𞤋 */;
+ case 0x1e92e /* 𞤮 */: BSEQ(0xf0,0x9e,0xa4,0x8c) /* 𞤌 */;
+ case 0x1e92f /* 𞤯 */: BSEQ(0xf0,0x9e,0xa4,0x8d) /* 𞤍 */;
+ case 0x1e930 /* 𞤰 */: BSEQ(0xf0,0x9e,0xa4,0x8e) /* 𞤎 */;
+ case 0x1e931 /* 𞤱 */: BSEQ(0xf0,0x9e,0xa4,0x8f) /* 𞤏 */;
+ case 0x1e932 /* 𞤲 */: BSEQ(0xf0,0x9e,0xa4,0x90) /* 𞤐 */;
+ case 0x1e933 /* 𞤳 */: BSEQ(0xf0,0x9e,0xa4,0x91) /* 𞤑 */;
+ case 0x1e934 /* 𞤴 */: BSEQ(0xf0,0x9e,0xa4,0x92) /* 𞤒 */;
+ case 0x1e935 /* 𞤵 */: BSEQ(0xf0,0x9e,0xa4,0x93) /* 𞤓 */;
+ case 0x1e936 /* 𞤶 */: BSEQ(0xf0,0x9e,0xa4,0x94) /* 𞤔 */;
+ case 0x1e937 /* 𞤷 */: BSEQ(0xf0,0x9e,0xa4,0x95) /* 𞤕 */;
+ case 0x1e938 /* 𞤸 */: BSEQ(0xf0,0x9e,0xa4,0x96) /* 𞤖 */;
+ case 0x1e939 /* 𞤹 */: BSEQ(0xf0,0x9e,0xa4,0x97) /* 𞤗 */;
+ case 0x1e93a /* 𞤺 */: BSEQ(0xf0,0x9e,0xa4,0x98) /* 𞤘 */;
+ case 0x1e93b /* 𞤻 */: BSEQ(0xf0,0x9e,0xa4,0x99) /* 𞤙 */;
+ case 0x1e93c /* 𞤼 */: BSEQ(0xf0,0x9e,0xa4,0x9a) /* 𞤚 */;
+ case 0x1e93d /* 𞤽 */: BSEQ(0xf0,0x9e,0xa4,0x9b) /* 𞤛 */;
+ case 0x1e93e /* 𞤾 */: BSEQ(0xf0,0x9e,0xa4,0x9c) /* 𞤜 */;
+ case 0x1e93f /* 𞤿 */: BSEQ(0xf0,0x9e,0xa4,0x9d) /* 𞤝 */;
+ case 0x1e940 /* 𞥀 */: BSEQ(0xf0,0x9e,0xa4,0x9e) /* 𞤞 */;
+ case 0x1e941 /* 𞥁 */: BSEQ(0xf0,0x9e,0xa4,0x9f) /* 𞤟 */;
+ case 0x1e942 /* 𞥂 */: BSEQ(0xf0,0x9e,0xa4,0xa0) /* 𞤠 */;
+ case 0x1e943 /* 𞥃 */: BSEQ(0xf0,0x9e,0xa4,0xa1) /* 𞤡 */;
+ default: return nullptr;
+ }
+}
+
+inline const char *convertUnicodeToLower(uint32_t code)
+{
+ switch(code)
+ {
+ case 0x41 /* A */: BSEQ(0x61) /* a */;
+ case 0x42 /* B */: BSEQ(0x62) /* b */;
+ case 0x43 /* C */: BSEQ(0x63) /* c */;
+ case 0x44 /* D */: BSEQ(0x64) /* d */;
+ case 0x45 /* E */: BSEQ(0x65) /* e */;
+ case 0x46 /* F */: BSEQ(0x66) /* f */;
+ case 0x47 /* G */: BSEQ(0x67) /* g */;
+ case 0x48 /* H */: BSEQ(0x68) /* h */;
+ case 0x49 /* I */: BSEQ(0x69) /* i */;
+ case 0x4a /* J */: BSEQ(0x6a) /* j */;
+ case 0x4b /* K */: BSEQ(0x6b) /* k */;
+ case 0x4c /* L */: BSEQ(0x6c) /* l */;
+ case 0x4d /* M */: BSEQ(0x6d) /* m */;
+ case 0x4e /* N */: BSEQ(0x6e) /* n */;
+ case 0x4f /* O */: BSEQ(0x6f) /* o */;
+ case 0x50 /* P */: BSEQ(0x70) /* p */;
+ case 0x51 /* Q */: BSEQ(0x71) /* q */;
+ case 0x52 /* R */: BSEQ(0x72) /* r */;
+ case 0x53 /* S */: BSEQ(0x73) /* s */;
+ case 0x54 /* T */: BSEQ(0x74) /* t */;
+ case 0x55 /* U */: BSEQ(0x75) /* u */;
+ case 0x56 /* V */: BSEQ(0x76) /* v */;
+ case 0x57 /* W */: BSEQ(0x77) /* w */;
+ case 0x58 /* X */: BSEQ(0x78) /* x */;
+ case 0x59 /* Y */: BSEQ(0x79) /* y */;
+ case 0x5a /* Z */: BSEQ(0x7a) /* z */;
+ case 0xc0 /* À */: BSEQ(0xc3,0xa0) /* à */;
+ case 0xc1 /* Á */: BSEQ(0xc3,0xa1) /* á */;
+ case 0xc2 /* Â */: BSEQ(0xc3,0xa2) /* â */;
+ case 0xc3 /* Ã */: BSEQ(0xc3,0xa3) /* ã */;
+ case 0xc4 /* Ä */: BSEQ(0xc3,0xa4) /* ä */;
+ case 0xc5 /* Å */: BSEQ(0xc3,0xa5) /* å */;
+ case 0xc6 /* Æ */: BSEQ(0xc3,0xa6) /* æ */;
+ case 0xc7 /* Ç */: BSEQ(0xc3,0xa7) /* ç */;
+ case 0xc8 /* È */: BSEQ(0xc3,0xa8) /* è */;
+ case 0xc9 /* É */: BSEQ(0xc3,0xa9) /* é */;
+ case 0xca /* Ê */: BSEQ(0xc3,0xaa) /* ê */;
+ case 0xcb /* Ë */: BSEQ(0xc3,0xab) /* ë */;
+ case 0xcc /* Ì */: BSEQ(0xc3,0xac) /* ì */;
+ case 0xcd /* Í */: BSEQ(0xc3,0xad) /* í */;
+ case 0xce /* Î */: BSEQ(0xc3,0xae) /* î */;
+ case 0xcf /* Ï */: BSEQ(0xc3,0xaf) /* ï */;
+ case 0xd0 /* Ð */: BSEQ(0xc3,0xb0) /* ð */;
+ case 0xd1 /* Ñ */: BSEQ(0xc3,0xb1) /* ñ */;
+ case 0xd2 /* Ò */: BSEQ(0xc3,0xb2) /* ò */;
+ case 0xd3 /* Ó */: BSEQ(0xc3,0xb3) /* ó */;
+ case 0xd4 /* Ô */: BSEQ(0xc3,0xb4) /* ô */;
+ case 0xd5 /* Õ */: BSEQ(0xc3,0xb5) /* õ */;
+ case 0xd6 /* Ö */: BSEQ(0xc3,0xb6) /* ö */;
+ case 0xd8 /* Ø */: BSEQ(0xc3,0xb8) /* ø */;
+ case 0xd9 /* Ù */: BSEQ(0xc3,0xb9) /* ù */;
+ case 0xda /* Ú */: BSEQ(0xc3,0xba) /* ú */;
+ case 0xdb /* Û */: BSEQ(0xc3,0xbb) /* û */;
+ case 0xdc /* Ü */: BSEQ(0xc3,0xbc) /* ü */;
+ case 0xdd /* Ý */: BSEQ(0xc3,0xbd) /* ý */;
+ case 0xde /* Þ */: BSEQ(0xc3,0xbe) /* þ */;
+ case 0x100 /* Ā */: BSEQ(0xc4,0x81) /* ā */;
+ case 0x102 /* Ă */: BSEQ(0xc4,0x83) /* ă */;
+ case 0x104 /* Ą */: BSEQ(0xc4,0x85) /* ą */;
+ case 0x106 /* Ć */: BSEQ(0xc4,0x87) /* ć */;
+ case 0x108 /* Ĉ */: BSEQ(0xc4,0x89) /* ĉ */;
+ case 0x10a /* Ċ */: BSEQ(0xc4,0x8b) /* ċ */;
+ case 0x10c /* Č */: BSEQ(0xc4,0x8d) /* č */;
+ case 0x10e /* Ď */: BSEQ(0xc4,0x8f) /* ď */;
+ case 0x110 /* Đ */: BSEQ(0xc4,0x91) /* đ */;
+ case 0x112 /* Ē */: BSEQ(0xc4,0x93) /* ē */;
+ case 0x114 /* Ĕ */: BSEQ(0xc4,0x95) /* ĕ */;
+ case 0x116 /* Ė */: BSEQ(0xc4,0x97) /* ė */;
+ case 0x118 /* Ę */: BSEQ(0xc4,0x99) /* ę */;
+ case 0x11a /* Ě */: BSEQ(0xc4,0x9b) /* ě */;
+ case 0x11c /* Ĝ */: BSEQ(0xc4,0x9d) /* ĝ */;
+ case 0x11e /* Ğ */: BSEQ(0xc4,0x9f) /* ğ */;
+ case 0x120 /* Ġ */: BSEQ(0xc4,0xa1) /* ġ */;
+ case 0x122 /* Ģ */: BSEQ(0xc4,0xa3) /* ģ */;
+ case 0x124 /* Ĥ */: BSEQ(0xc4,0xa5) /* ĥ */;
+ case 0x126 /* Ħ */: BSEQ(0xc4,0xa7) /* ħ */;
+ case 0x128 /* Ĩ */: BSEQ(0xc4,0xa9) /* ĩ */;
+ case 0x12a /* Ī */: BSEQ(0xc4,0xab) /* ī */;
+ case 0x12c /* Ĭ */: BSEQ(0xc4,0xad) /* ĭ */;
+ case 0x12e /* Į */: BSEQ(0xc4,0xaf) /* į */;
+ case 0x130 /* İ */: BSEQ(0x69,0xcc,0x87) /* i̇ */;
+ case 0x132 /* IJ */: BSEQ(0xc4,0xb3) /* ij */;
+ case 0x134 /* Ĵ */: BSEQ(0xc4,0xb5) /* ĵ */;
+ case 0x136 /* Ķ */: BSEQ(0xc4,0xb7) /* ķ */;
+ case 0x139 /* Ĺ */: BSEQ(0xc4,0xba) /* ĺ */;
+ case 0x13b /* Ļ */: BSEQ(0xc4,0xbc) /* ļ */;
+ case 0x13d /* Ľ */: BSEQ(0xc4,0xbe) /* ľ */;
+ case 0x13f /* Ŀ */: BSEQ(0xc5,0x80) /* ŀ */;
+ case 0x141 /* Ł */: BSEQ(0xc5,0x82) /* ł */;
+ case 0x143 /* Ń */: BSEQ(0xc5,0x84) /* ń */;
+ case 0x145 /* Ņ */: BSEQ(0xc5,0x86) /* ņ */;
+ case 0x147 /* Ň */: BSEQ(0xc5,0x88) /* ň */;
+ case 0x14a /* Ŋ */: BSEQ(0xc5,0x8b) /* ŋ */;
+ case 0x14c /* Ō */: BSEQ(0xc5,0x8d) /* ō */;
+ case 0x14e /* Ŏ */: BSEQ(0xc5,0x8f) /* ŏ */;
+ case 0x150 /* Ő */: BSEQ(0xc5,0x91) /* ő */;
+ case 0x152 /* Œ */: BSEQ(0xc5,0x93) /* œ */;
+ case 0x154 /* Ŕ */: BSEQ(0xc5,0x95) /* ŕ */;
+ case 0x156 /* Ŗ */: BSEQ(0xc5,0x97) /* ŗ */;
+ case 0x158 /* Ř */: BSEQ(0xc5,0x99) /* ř */;
+ case 0x15a /* Ś */: BSEQ(0xc5,0x9b) /* ś */;
+ case 0x15c /* Ŝ */: BSEQ(0xc5,0x9d) /* ŝ */;
+ case 0x15e /* Ş */: BSEQ(0xc5,0x9f) /* ş */;
+ case 0x160 /* Š */: BSEQ(0xc5,0xa1) /* š */;
+ case 0x162 /* Ţ */: BSEQ(0xc5,0xa3) /* ţ */;
+ case 0x164 /* Ť */: BSEQ(0xc5,0xa5) /* ť */;
+ case 0x166 /* Ŧ */: BSEQ(0xc5,0xa7) /* ŧ */;
+ case 0x168 /* Ũ */: BSEQ(0xc5,0xa9) /* ũ */;
+ case 0x16a /* Ū */: BSEQ(0xc5,0xab) /* ū */;
+ case 0x16c /* Ŭ */: BSEQ(0xc5,0xad) /* ŭ */;
+ case 0x16e /* Ů */: BSEQ(0xc5,0xaf) /* ů */;
+ case 0x170 /* Ű */: BSEQ(0xc5,0xb1) /* ű */;
+ case 0x172 /* Ų */: BSEQ(0xc5,0xb3) /* ų */;
+ case 0x174 /* Ŵ */: BSEQ(0xc5,0xb5) /* ŵ */;
+ case 0x176 /* Ŷ */: BSEQ(0xc5,0xb7) /* ŷ */;
+ case 0x178 /* Ÿ */: BSEQ(0xc3,0xbf) /* ÿ */;
+ case 0x179 /* Ź */: BSEQ(0xc5,0xba) /* ź */;
+ case 0x17b /* Ż */: BSEQ(0xc5,0xbc) /* ż */;
+ case 0x17d /* Ž */: BSEQ(0xc5,0xbe) /* ž */;
+ case 0x181 /* Ɓ */: BSEQ(0xc9,0x93) /* ɓ */;
+ case 0x182 /* Ƃ */: BSEQ(0xc6,0x83) /* ƃ */;
+ case 0x184 /* Ƅ */: BSEQ(0xc6,0x85) /* ƅ */;
+ case 0x186 /* Ɔ */: BSEQ(0xc9,0x94) /* ɔ */;
+ case 0x187 /* Ƈ */: BSEQ(0xc6,0x88) /* ƈ */;
+ case 0x189 /* Ɖ */: BSEQ(0xc9,0x96) /* ɖ */;
+ case 0x18a /* Ɗ */: BSEQ(0xc9,0x97) /* ɗ */;
+ case 0x18b /* Ƌ */: BSEQ(0xc6,0x8c) /* ƌ */;
+ case 0x18e /* Ǝ */: BSEQ(0xc7,0x9d) /* ǝ */;
+ case 0x18f /* Ə */: BSEQ(0xc9,0x99) /* ə */;
+ case 0x190 /* Ɛ */: BSEQ(0xc9,0x9b) /* ɛ */;
+ case 0x191 /* Ƒ */: BSEQ(0xc6,0x92) /* ƒ */;
+ case 0x193 /* Ɠ */: BSEQ(0xc9,0xa0) /* ɠ */;
+ case 0x194 /* Ɣ */: BSEQ(0xc9,0xa3) /* ɣ */;
+ case 0x196 /* Ɩ */: BSEQ(0xc9,0xa9) /* ɩ */;
+ case 0x197 /* Ɨ */: BSEQ(0xc9,0xa8) /* ɨ */;
+ case 0x198 /* Ƙ */: BSEQ(0xc6,0x99) /* ƙ */;
+ case 0x19c /* Ɯ */: BSEQ(0xc9,0xaf) /* ɯ */;
+ case 0x19d /* Ɲ */: BSEQ(0xc9,0xb2) /* ɲ */;
+ case 0x19f /* Ɵ */: BSEQ(0xc9,0xb5) /* ɵ */;
+ case 0x1a0 /* Ơ */: BSEQ(0xc6,0xa1) /* ơ */;
+ case 0x1a2 /* Ƣ */: BSEQ(0xc6,0xa3) /* ƣ */;
+ case 0x1a4 /* Ƥ */: BSEQ(0xc6,0xa5) /* ƥ */;
+ case 0x1a6 /* Ʀ */: BSEQ(0xca,0x80) /* ʀ */;
+ case 0x1a7 /* Ƨ */: BSEQ(0xc6,0xa8) /* ƨ */;
+ case 0x1a9 /* Ʃ */: BSEQ(0xca,0x83) /* ʃ */;
+ case 0x1ac /* Ƭ */: BSEQ(0xc6,0xad) /* ƭ */;
+ case 0x1ae /* Ʈ */: BSEQ(0xca,0x88) /* ʈ */;
+ case 0x1af /* Ư */: BSEQ(0xc6,0xb0) /* ư */;
+ case 0x1b1 /* Ʊ */: BSEQ(0xca,0x8a) /* ʊ */;
+ case 0x1b2 /* Ʋ */: BSEQ(0xca,0x8b) /* ʋ */;
+ case 0x1b3 /* Ƴ */: BSEQ(0xc6,0xb4) /* ƴ */;
+ case 0x1b5 /* Ƶ */: BSEQ(0xc6,0xb6) /* ƶ */;
+ case 0x1b7 /* Ʒ */: BSEQ(0xca,0x92) /* ʒ */;
+ case 0x1b8 /* Ƹ */: BSEQ(0xc6,0xb9) /* ƹ */;
+ case 0x1bc /* Ƽ */: BSEQ(0xc6,0xbd) /* ƽ */;
+ case 0x1c4 /* DŽ */: BSEQ(0xc7,0x86) /* dž */;
+ case 0x1c5 /* Dž */: BSEQ(0xc7,0x86) /* dž */;
+ case 0x1c7 /* LJ */: BSEQ(0xc7,0x89) /* lj */;
+ case 0x1c8 /* Lj */: BSEQ(0xc7,0x89) /* lj */;
+ case 0x1ca /* NJ */: BSEQ(0xc7,0x8c) /* nj */;
+ case 0x1cb /* Nj */: BSEQ(0xc7,0x8c) /* nj */;
+ case 0x1cd /* Ǎ */: BSEQ(0xc7,0x8e) /* ǎ */;
+ case 0x1cf /* Ǐ */: BSEQ(0xc7,0x90) /* ǐ */;
+ case 0x1d1 /* Ǒ */: BSEQ(0xc7,0x92) /* ǒ */;
+ case 0x1d3 /* Ǔ */: BSEQ(0xc7,0x94) /* ǔ */;
+ case 0x1d5 /* Ǖ */: BSEQ(0xc7,0x96) /* ǖ */;
+ case 0x1d7 /* Ǘ */: BSEQ(0xc7,0x98) /* ǘ */;
+ case 0x1d9 /* Ǚ */: BSEQ(0xc7,0x9a) /* ǚ */;
+ case 0x1db /* Ǜ */: BSEQ(0xc7,0x9c) /* ǜ */;
+ case 0x1de /* Ǟ */: BSEQ(0xc7,0x9f) /* ǟ */;
+ case 0x1e0 /* Ǡ */: BSEQ(0xc7,0xa1) /* ǡ */;
+ case 0x1e2 /* Ǣ */: BSEQ(0xc7,0xa3) /* ǣ */;
+ case 0x1e4 /* Ǥ */: BSEQ(0xc7,0xa5) /* ǥ */;
+ case 0x1e6 /* Ǧ */: BSEQ(0xc7,0xa7) /* ǧ */;
+ case 0x1e8 /* Ǩ */: BSEQ(0xc7,0xa9) /* ǩ */;
+ case 0x1ea /* Ǫ */: BSEQ(0xc7,0xab) /* ǫ */;
+ case 0x1ec /* Ǭ */: BSEQ(0xc7,0xad) /* ǭ */;
+ case 0x1ee /* Ǯ */: BSEQ(0xc7,0xaf) /* ǯ */;
+ case 0x1f1 /* DZ */: BSEQ(0xc7,0xb3) /* dz */;
+ case 0x1f2 /* Dz */: BSEQ(0xc7,0xb3) /* dz */;
+ case 0x1f4 /* Ǵ */: BSEQ(0xc7,0xb5) /* ǵ */;
+ case 0x1f6 /* Ƕ */: BSEQ(0xc6,0x95) /* ƕ */;
+ case 0x1f7 /* Ƿ */: BSEQ(0xc6,0xbf) /* ƿ */;
+ case 0x1f8 /* Ǹ */: BSEQ(0xc7,0xb9) /* ǹ */;
+ case 0x1fa /* Ǻ */: BSEQ(0xc7,0xbb) /* ǻ */;
+ case 0x1fc /* Ǽ */: BSEQ(0xc7,0xbd) /* ǽ */;
+ case 0x1fe /* Ǿ */: BSEQ(0xc7,0xbf) /* ǿ */;
+ case 0x200 /* Ȁ */: BSEQ(0xc8,0x81) /* ȁ */;
+ case 0x202 /* Ȃ */: BSEQ(0xc8,0x83) /* ȃ */;
+ case 0x204 /* Ȅ */: BSEQ(0xc8,0x85) /* ȅ */;
+ case 0x206 /* Ȇ */: BSEQ(0xc8,0x87) /* ȇ */;
+ case 0x208 /* Ȉ */: BSEQ(0xc8,0x89) /* ȉ */;
+ case 0x20a /* Ȋ */: BSEQ(0xc8,0x8b) /* ȋ */;
+ case 0x20c /* Ȍ */: BSEQ(0xc8,0x8d) /* ȍ */;
+ case 0x20e /* Ȏ */: BSEQ(0xc8,0x8f) /* ȏ */;
+ case 0x210 /* Ȑ */: BSEQ(0xc8,0x91) /* ȑ */;
+ case 0x212 /* Ȓ */: BSEQ(0xc8,0x93) /* ȓ */;
+ case 0x214 /* Ȕ */: BSEQ(0xc8,0x95) /* ȕ */;
+ case 0x216 /* Ȗ */: BSEQ(0xc8,0x97) /* ȗ */;
+ case 0x218 /* Ș */: BSEQ(0xc8,0x99) /* ș */;
+ case 0x21a /* Ț */: BSEQ(0xc8,0x9b) /* ț */;
+ case 0x21c /* Ȝ */: BSEQ(0xc8,0x9d) /* ȝ */;
+ case 0x21e /* Ȟ */: BSEQ(0xc8,0x9f) /* ȟ */;
+ case 0x220 /* Ƞ */: BSEQ(0xc6,0x9e) /* ƞ */;
+ case 0x222 /* Ȣ */: BSEQ(0xc8,0xa3) /* ȣ */;
+ case 0x224 /* Ȥ */: BSEQ(0xc8,0xa5) /* ȥ */;
+ case 0x226 /* Ȧ */: BSEQ(0xc8,0xa7) /* ȧ */;
+ case 0x228 /* Ȩ */: BSEQ(0xc8,0xa9) /* ȩ */;
+ case 0x22a /* Ȫ */: BSEQ(0xc8,0xab) /* ȫ */;
+ case 0x22c /* Ȭ */: BSEQ(0xc8,0xad) /* ȭ */;
+ case 0x22e /* Ȯ */: BSEQ(0xc8,0xaf) /* ȯ */;
+ case 0x230 /* Ȱ */: BSEQ(0xc8,0xb1) /* ȱ */;
+ case 0x232 /* Ȳ */: BSEQ(0xc8,0xb3) /* ȳ */;
+ case 0x23a /* Ⱥ */: BSEQ(0xe2,0xb1,0xa5) /* ⱥ */;
+ case 0x23b /* Ȼ */: BSEQ(0xc8,0xbc) /* ȼ */;
+ case 0x23d /* Ƚ */: BSEQ(0xc6,0x9a) /* ƚ */;
+ case 0x23e /* Ⱦ */: BSEQ(0xe2,0xb1,0xa6) /* ⱦ */;
+ case 0x241 /* Ɂ */: BSEQ(0xc9,0x82) /* ɂ */;
+ case 0x243 /* Ƀ */: BSEQ(0xc6,0x80) /* ƀ */;
+ case 0x244 /* Ʉ */: BSEQ(0xca,0x89) /* ʉ */;
+ case 0x245 /* Ʌ */: BSEQ(0xca,0x8c) /* ʌ */;
+ case 0x246 /* Ɇ */: BSEQ(0xc9,0x87) /* ɇ */;
+ case 0x248 /* Ɉ */: BSEQ(0xc9,0x89) /* ɉ */;
+ case 0x24a /* Ɋ */: BSEQ(0xc9,0x8b) /* ɋ */;
+ case 0x24c /* Ɍ */: BSEQ(0xc9,0x8d) /* ɍ */;
+ case 0x24e /* Ɏ */: BSEQ(0xc9,0x8f) /* ɏ */;
+ case 0x370 /* Ͱ */: BSEQ(0xcd,0xb1) /* ͱ */;
+ case 0x372 /* Ͳ */: BSEQ(0xcd,0xb3) /* ͳ */;
+ case 0x376 /* Ͷ */: BSEQ(0xcd,0xb7) /* ͷ */;
+ case 0x37f /* Ϳ */: BSEQ(0xcf,0xb3) /* ϳ */;
+ case 0x386 /* Ά */: BSEQ(0xce,0xac) /* ά */;
+ case 0x388 /* Έ */: BSEQ(0xce,0xad) /* έ */;
+ case 0x389 /* Ή */: BSEQ(0xce,0xae) /* ή */;
+ case 0x38a /* Ί */: BSEQ(0xce,0xaf) /* ί */;
+ case 0x38c /* Ό */: BSEQ(0xcf,0x8c) /* ό */;
+ case 0x38e /* Ύ */: BSEQ(0xcf,0x8d) /* ύ */;
+ case 0x38f /* Ώ */: BSEQ(0xcf,0x8e) /* ώ */;
+ case 0x391 /* Α */: BSEQ(0xce,0xb1) /* α */;
+ case 0x392 /* Β */: BSEQ(0xce,0xb2) /* β */;
+ case 0x393 /* Γ */: BSEQ(0xce,0xb3) /* γ */;
+ case 0x394 /* Δ */: BSEQ(0xce,0xb4) /* δ */;
+ case 0x395 /* Ε */: BSEQ(0xce,0xb5) /* ε */;
+ case 0x396 /* Ζ */: BSEQ(0xce,0xb6) /* ζ */;
+ case 0x397 /* Η */: BSEQ(0xce,0xb7) /* η */;
+ case 0x398 /* Θ */: BSEQ(0xce,0xb8) /* θ */;
+ case 0x399 /* Ι */: BSEQ(0xce,0xb9) /* ι */;
+ case 0x39a /* Κ */: BSEQ(0xce,0xba) /* κ */;
+ case 0x39b /* Λ */: BSEQ(0xce,0xbb) /* λ */;
+ case 0x39c /* Μ */: BSEQ(0xce,0xbc) /* μ */;
+ case 0x39d /* Ν */: BSEQ(0xce,0xbd) /* ν */;
+ case 0x39e /* Ξ */: BSEQ(0xce,0xbe) /* ξ */;
+ case 0x39f /* Ο */: BSEQ(0xce,0xbf) /* ο */;
+ case 0x3a0 /* Π */: BSEQ(0xcf,0x80) /* π */;
+ case 0x3a1 /* Ρ */: BSEQ(0xcf,0x81) /* ρ */;
+ case 0x3a3 /* Σ */: BSEQ(0xcf,0x83) /* σ */;
+ case 0x3a4 /* Τ */: BSEQ(0xcf,0x84) /* τ */;
+ case 0x3a5 /* Υ */: BSEQ(0xcf,0x85) /* υ */;
+ case 0x3a6 /* Φ */: BSEQ(0xcf,0x86) /* φ */;
+ case 0x3a7 /* Χ */: BSEQ(0xcf,0x87) /* χ */;
+ case 0x3a8 /* Ψ */: BSEQ(0xcf,0x88) /* ψ */;
+ case 0x3a9 /* Ω */: BSEQ(0xcf,0x89) /* ω */;
+ case 0x3aa /* Ϊ */: BSEQ(0xcf,0x8a) /* ϊ */;
+ case 0x3ab /* Ϋ */: BSEQ(0xcf,0x8b) /* ϋ */;
+ case 0x3cf /* Ϗ */: BSEQ(0xcf,0x97) /* ϗ */;
+ case 0x3d8 /* Ϙ */: BSEQ(0xcf,0x99) /* ϙ */;
+ case 0x3da /* Ϛ */: BSEQ(0xcf,0x9b) /* ϛ */;
+ case 0x3dc /* Ϝ */: BSEQ(0xcf,0x9d) /* ϝ */;
+ case 0x3de /* Ϟ */: BSEQ(0xcf,0x9f) /* ϟ */;
+ case 0x3e0 /* Ϡ */: BSEQ(0xcf,0xa1) /* ϡ */;
+ case 0x3e2 /* Ϣ */: BSEQ(0xcf,0xa3) /* ϣ */;
+ case 0x3e4 /* Ϥ */: BSEQ(0xcf,0xa5) /* ϥ */;
+ case 0x3e6 /* Ϧ */: BSEQ(0xcf,0xa7) /* ϧ */;
+ case 0x3e8 /* Ϩ */: BSEQ(0xcf,0xa9) /* ϩ */;
+ case 0x3ea /* Ϫ */: BSEQ(0xcf,0xab) /* ϫ */;
+ case 0x3ec /* Ϭ */: BSEQ(0xcf,0xad) /* ϭ */;
+ case 0x3ee /* Ϯ */: BSEQ(0xcf,0xaf) /* ϯ */;
+ case 0x3f4 /* ϴ */: BSEQ(0xce,0xb8) /* θ */;
+ case 0x3f7 /* Ϸ */: BSEQ(0xcf,0xb8) /* ϸ */;
+ case 0x3f9 /* Ϲ */: BSEQ(0xcf,0xb2) /* ϲ */;
+ case 0x3fa /* Ϻ */: BSEQ(0xcf,0xbb) /* ϻ */;
+ case 0x3fd /* Ͻ */: BSEQ(0xcd,0xbb) /* ͻ */;
+ case 0x3fe /* Ͼ */: BSEQ(0xcd,0xbc) /* ͼ */;
+ case 0x3ff /* Ͽ */: BSEQ(0xcd,0xbd) /* ͽ */;
+ case 0x400 /* Ѐ */: BSEQ(0xd1,0x90) /* ѐ */;
+ case 0x401 /* Ё */: BSEQ(0xd1,0x91) /* ё */;
+ case 0x402 /* Ђ */: BSEQ(0xd1,0x92) /* ђ */;
+ case 0x403 /* Ѓ */: BSEQ(0xd1,0x93) /* ѓ */;
+ case 0x404 /* Є */: BSEQ(0xd1,0x94) /* є */;
+ case 0x405 /* Ѕ */: BSEQ(0xd1,0x95) /* ѕ */;
+ case 0x406 /* І */: BSEQ(0xd1,0x96) /* і */;
+ case 0x407 /* Ї */: BSEQ(0xd1,0x97) /* ї */;
+ case 0x408 /* Ј */: BSEQ(0xd1,0x98) /* ј */;
+ case 0x409 /* Љ */: BSEQ(0xd1,0x99) /* љ */;
+ case 0x40a /* Њ */: BSEQ(0xd1,0x9a) /* њ */;
+ case 0x40b /* Ћ */: BSEQ(0xd1,0x9b) /* ћ */;
+ case 0x40c /* Ќ */: BSEQ(0xd1,0x9c) /* ќ */;
+ case 0x40d /* Ѝ */: BSEQ(0xd1,0x9d) /* ѝ */;
+ case 0x40e /* Ў */: BSEQ(0xd1,0x9e) /* ў */;
+ case 0x40f /* Џ */: BSEQ(0xd1,0x9f) /* џ */;
+ case 0x410 /* А */: BSEQ(0xd0,0xb0) /* а */;
+ case 0x411 /* Б */: BSEQ(0xd0,0xb1) /* б */;
+ case 0x412 /* В */: BSEQ(0xd0,0xb2) /* в */;
+ case 0x413 /* Г */: BSEQ(0xd0,0xb3) /* г */;
+ case 0x414 /* Д */: BSEQ(0xd0,0xb4) /* д */;
+ case 0x415 /* Е */: BSEQ(0xd0,0xb5) /* е */;
+ case 0x416 /* Ж */: BSEQ(0xd0,0xb6) /* ж */;
+ case 0x417 /* З */: BSEQ(0xd0,0xb7) /* з */;
+ case 0x418 /* И */: BSEQ(0xd0,0xb8) /* и */;
+ case 0x419 /* Й */: BSEQ(0xd0,0xb9) /* й */;
+ case 0x41a /* К */: BSEQ(0xd0,0xba) /* к */;
+ case 0x41b /* Л */: BSEQ(0xd0,0xbb) /* л */;
+ case 0x41c /* М */: BSEQ(0xd0,0xbc) /* м */;
+ case 0x41d /* Н */: BSEQ(0xd0,0xbd) /* н */;
+ case 0x41e /* О */: BSEQ(0xd0,0xbe) /* о */;
+ case 0x41f /* П */: BSEQ(0xd0,0xbf) /* п */;
+ case 0x420 /* Р */: BSEQ(0xd1,0x80) /* р */;
+ case 0x421 /* С */: BSEQ(0xd1,0x81) /* с */;
+ case 0x422 /* Т */: BSEQ(0xd1,0x82) /* т */;
+ case 0x423 /* У */: BSEQ(0xd1,0x83) /* у */;
+ case 0x424 /* Ф */: BSEQ(0xd1,0x84) /* ф */;
+ case 0x425 /* Х */: BSEQ(0xd1,0x85) /* х */;
+ case 0x426 /* Ц */: BSEQ(0xd1,0x86) /* ц */;
+ case 0x427 /* Ч */: BSEQ(0xd1,0x87) /* ч */;
+ case 0x428 /* Ш */: BSEQ(0xd1,0x88) /* ш */;
+ case 0x429 /* Щ */: BSEQ(0xd1,0x89) /* щ */;
+ case 0x42a /* Ъ */: BSEQ(0xd1,0x8a) /* ъ */;
+ case 0x42b /* Ы */: BSEQ(0xd1,0x8b) /* ы */;
+ case 0x42c /* Ь */: BSEQ(0xd1,0x8c) /* ь */;
+ case 0x42d /* Э */: BSEQ(0xd1,0x8d) /* э */;
+ case 0x42e /* Ю */: BSEQ(0xd1,0x8e) /* ю */;
+ case 0x42f /* Я */: BSEQ(0xd1,0x8f) /* я */;
+ case 0x460 /* Ѡ */: BSEQ(0xd1,0xa1) /* ѡ */;
+ case 0x462 /* Ѣ */: BSEQ(0xd1,0xa3) /* ѣ */;
+ case 0x464 /* Ѥ */: BSEQ(0xd1,0xa5) /* ѥ */;
+ case 0x466 /* Ѧ */: BSEQ(0xd1,0xa7) /* ѧ */;
+ case 0x468 /* Ѩ */: BSEQ(0xd1,0xa9) /* ѩ */;
+ case 0x46a /* Ѫ */: BSEQ(0xd1,0xab) /* ѫ */;
+ case 0x46c /* Ѭ */: BSEQ(0xd1,0xad) /* ѭ */;
+ case 0x46e /* Ѯ */: BSEQ(0xd1,0xaf) /* ѯ */;
+ case 0x470 /* Ѱ */: BSEQ(0xd1,0xb1) /* ѱ */;
+ case 0x472 /* Ѳ */: BSEQ(0xd1,0xb3) /* ѳ */;
+ case 0x474 /* Ѵ */: BSEQ(0xd1,0xb5) /* ѵ */;
+ case 0x476 /* Ѷ */: BSEQ(0xd1,0xb7) /* ѷ */;
+ case 0x478 /* Ѹ */: BSEQ(0xd1,0xb9) /* ѹ */;
+ case 0x47a /* Ѻ */: BSEQ(0xd1,0xbb) /* ѻ */;
+ case 0x47c /* Ѽ */: BSEQ(0xd1,0xbd) /* ѽ */;
+ case 0x47e /* Ѿ */: BSEQ(0xd1,0xbf) /* ѿ */;
+ case 0x480 /* Ҁ */: BSEQ(0xd2,0x81) /* ҁ */;
+ case 0x48a /* Ҋ */: BSEQ(0xd2,0x8b) /* ҋ */;
+ case 0x48c /* Ҍ */: BSEQ(0xd2,0x8d) /* ҍ */;
+ case 0x48e /* Ҏ */: BSEQ(0xd2,0x8f) /* ҏ */;
+ case 0x490 /* Ґ */: BSEQ(0xd2,0x91) /* ґ */;
+ case 0x492 /* Ғ */: BSEQ(0xd2,0x93) /* ғ */;
+ case 0x494 /* Ҕ */: BSEQ(0xd2,0x95) /* ҕ */;
+ case 0x496 /* Җ */: BSEQ(0xd2,0x97) /* җ */;
+ case 0x498 /* Ҙ */: BSEQ(0xd2,0x99) /* ҙ */;
+ case 0x49a /* Қ */: BSEQ(0xd2,0x9b) /* қ */;
+ case 0x49c /* Ҝ */: BSEQ(0xd2,0x9d) /* ҝ */;
+ case 0x49e /* Ҟ */: BSEQ(0xd2,0x9f) /* ҟ */;
+ case 0x4a0 /* Ҡ */: BSEQ(0xd2,0xa1) /* ҡ */;
+ case 0x4a2 /* Ң */: BSEQ(0xd2,0xa3) /* ң */;
+ case 0x4a4 /* Ҥ */: BSEQ(0xd2,0xa5) /* ҥ */;
+ case 0x4a6 /* Ҧ */: BSEQ(0xd2,0xa7) /* ҧ */;
+ case 0x4a8 /* Ҩ */: BSEQ(0xd2,0xa9) /* ҩ */;
+ case 0x4aa /* Ҫ */: BSEQ(0xd2,0xab) /* ҫ */;
+ case 0x4ac /* Ҭ */: BSEQ(0xd2,0xad) /* ҭ */;
+ case 0x4ae /* Ү */: BSEQ(0xd2,0xaf) /* ү */;
+ case 0x4b0 /* Ұ */: BSEQ(0xd2,0xb1) /* ұ */;
+ case 0x4b2 /* Ҳ */: BSEQ(0xd2,0xb3) /* ҳ */;
+ case 0x4b4 /* Ҵ */: BSEQ(0xd2,0xb5) /* ҵ */;
+ case 0x4b6 /* Ҷ */: BSEQ(0xd2,0xb7) /* ҷ */;
+ case 0x4b8 /* Ҹ */: BSEQ(0xd2,0xb9) /* ҹ */;
+ case 0x4ba /* Һ */: BSEQ(0xd2,0xbb) /* һ */;
+ case 0x4bc /* Ҽ */: BSEQ(0xd2,0xbd) /* ҽ */;
+ case 0x4be /* Ҿ */: BSEQ(0xd2,0xbf) /* ҿ */;
+ case 0x4c0 /* Ӏ */: BSEQ(0xd3,0x8f) /* ӏ */;
+ case 0x4c1 /* Ӂ */: BSEQ(0xd3,0x82) /* ӂ */;
+ case 0x4c3 /* Ӄ */: BSEQ(0xd3,0x84) /* ӄ */;
+ case 0x4c5 /* Ӆ */: BSEQ(0xd3,0x86) /* ӆ */;
+ case 0x4c7 /* Ӈ */: BSEQ(0xd3,0x88) /* ӈ */;
+ case 0x4c9 /* Ӊ */: BSEQ(0xd3,0x8a) /* ӊ */;
+ case 0x4cb /* Ӌ */: BSEQ(0xd3,0x8c) /* ӌ */;
+ case 0x4cd /* Ӎ */: BSEQ(0xd3,0x8e) /* ӎ */;
+ case 0x4d0 /* Ӑ */: BSEQ(0xd3,0x91) /* ӑ */;
+ case 0x4d2 /* Ӓ */: BSEQ(0xd3,0x93) /* ӓ */;
+ case 0x4d4 /* Ӕ */: BSEQ(0xd3,0x95) /* ӕ */;
+ case 0x4d6 /* Ӗ */: BSEQ(0xd3,0x97) /* ӗ */;
+ case 0x4d8 /* Ә */: BSEQ(0xd3,0x99) /* ә */;
+ case 0x4da /* Ӛ */: BSEQ(0xd3,0x9b) /* ӛ */;
+ case 0x4dc /* Ӝ */: BSEQ(0xd3,0x9d) /* ӝ */;
+ case 0x4de /* Ӟ */: BSEQ(0xd3,0x9f) /* ӟ */;
+ case 0x4e0 /* Ӡ */: BSEQ(0xd3,0xa1) /* ӡ */;
+ case 0x4e2 /* Ӣ */: BSEQ(0xd3,0xa3) /* ӣ */;
+ case 0x4e4 /* Ӥ */: BSEQ(0xd3,0xa5) /* ӥ */;
+ case 0x4e6 /* Ӧ */: BSEQ(0xd3,0xa7) /* ӧ */;
+ case 0x4e8 /* Ө */: BSEQ(0xd3,0xa9) /* ө */;
+ case 0x4ea /* Ӫ */: BSEQ(0xd3,0xab) /* ӫ */;
+ case 0x4ec /* Ӭ */: BSEQ(0xd3,0xad) /* ӭ */;
+ case 0x4ee /* Ӯ */: BSEQ(0xd3,0xaf) /* ӯ */;
+ case 0x4f0 /* Ӱ */: BSEQ(0xd3,0xb1) /* ӱ */;
+ case 0x4f2 /* Ӳ */: BSEQ(0xd3,0xb3) /* ӳ */;
+ case 0x4f4 /* Ӵ */: BSEQ(0xd3,0xb5) /* ӵ */;
+ case 0x4f6 /* Ӷ */: BSEQ(0xd3,0xb7) /* ӷ */;
+ case 0x4f8 /* Ӹ */: BSEQ(0xd3,0xb9) /* ӹ */;
+ case 0x4fa /* Ӻ */: BSEQ(0xd3,0xbb) /* ӻ */;
+ case 0x4fc /* Ӽ */: BSEQ(0xd3,0xbd) /* ӽ */;
+ case 0x4fe /* Ӿ */: BSEQ(0xd3,0xbf) /* ӿ */;
+ case 0x500 /* Ԁ */: BSEQ(0xd4,0x81) /* ԁ */;
+ case 0x502 /* Ԃ */: BSEQ(0xd4,0x83) /* ԃ */;
+ case 0x504 /* Ԅ */: BSEQ(0xd4,0x85) /* ԅ */;
+ case 0x506 /* Ԇ */: BSEQ(0xd4,0x87) /* ԇ */;
+ case 0x508 /* Ԉ */: BSEQ(0xd4,0x89) /* ԉ */;
+ case 0x50a /* Ԋ */: BSEQ(0xd4,0x8b) /* ԋ */;
+ case 0x50c /* Ԍ */: BSEQ(0xd4,0x8d) /* ԍ */;
+ case 0x50e /* Ԏ */: BSEQ(0xd4,0x8f) /* ԏ */;
+ case 0x510 /* Ԑ */: BSEQ(0xd4,0x91) /* ԑ */;
+ case 0x512 /* Ԓ */: BSEQ(0xd4,0x93) /* ԓ */;
+ case 0x514 /* Ԕ */: BSEQ(0xd4,0x95) /* ԕ */;
+ case 0x516 /* Ԗ */: BSEQ(0xd4,0x97) /* ԗ */;
+ case 0x518 /* Ԙ */: BSEQ(0xd4,0x99) /* ԙ */;
+ case 0x51a /* Ԛ */: BSEQ(0xd4,0x9b) /* ԛ */;
+ case 0x51c /* Ԝ */: BSEQ(0xd4,0x9d) /* ԝ */;
+ case 0x51e /* Ԟ */: BSEQ(0xd4,0x9f) /* ԟ */;
+ case 0x520 /* Ԡ */: BSEQ(0xd4,0xa1) /* ԡ */;
+ case 0x522 /* Ԣ */: BSEQ(0xd4,0xa3) /* ԣ */;
+ case 0x524 /* Ԥ */: BSEQ(0xd4,0xa5) /* ԥ */;
+ case 0x526 /* Ԧ */: BSEQ(0xd4,0xa7) /* ԧ */;
+ case 0x528 /* Ԩ */: BSEQ(0xd4,0xa9) /* ԩ */;
+ case 0x52a /* Ԫ */: BSEQ(0xd4,0xab) /* ԫ */;
+ case 0x52c /* Ԭ */: BSEQ(0xd4,0xad) /* ԭ */;
+ case 0x52e /* Ԯ */: BSEQ(0xd4,0xaf) /* ԯ */;
+ case 0x531 /* Ա */: BSEQ(0xd5,0xa1) /* ա */;
+ case 0x532 /* Բ */: BSEQ(0xd5,0xa2) /* բ */;
+ case 0x533 /* Գ */: BSEQ(0xd5,0xa3) /* գ */;
+ case 0x534 /* Դ */: BSEQ(0xd5,0xa4) /* դ */;
+ case 0x535 /* Ե */: BSEQ(0xd5,0xa5) /* ե */;
+ case 0x536 /* Զ */: BSEQ(0xd5,0xa6) /* զ */;
+ case 0x537 /* Է */: BSEQ(0xd5,0xa7) /* է */;
+ case 0x538 /* Ը */: BSEQ(0xd5,0xa8) /* ը */;
+ case 0x539 /* Թ */: BSEQ(0xd5,0xa9) /* թ */;
+ case 0x53a /* Ժ */: BSEQ(0xd5,0xaa) /* ժ */;
+ case 0x53b /* Ի */: BSEQ(0xd5,0xab) /* ի */;
+ case 0x53c /* Լ */: BSEQ(0xd5,0xac) /* լ */;
+ case 0x53d /* Խ */: BSEQ(0xd5,0xad) /* խ */;
+ case 0x53e /* Ծ */: BSEQ(0xd5,0xae) /* ծ */;
+ case 0x53f /* Կ */: BSEQ(0xd5,0xaf) /* կ */;
+ case 0x540 /* Հ */: BSEQ(0xd5,0xb0) /* հ */;
+ case 0x541 /* Ձ */: BSEQ(0xd5,0xb1) /* ձ */;
+ case 0x542 /* Ղ */: BSEQ(0xd5,0xb2) /* ղ */;
+ case 0x543 /* Ճ */: BSEQ(0xd5,0xb3) /* ճ */;
+ case 0x544 /* Մ */: BSEQ(0xd5,0xb4) /* մ */;
+ case 0x545 /* Յ */: BSEQ(0xd5,0xb5) /* յ */;
+ case 0x546 /* Ն */: BSEQ(0xd5,0xb6) /* ն */;
+ case 0x547 /* Շ */: BSEQ(0xd5,0xb7) /* շ */;
+ case 0x548 /* Ո */: BSEQ(0xd5,0xb8) /* ո */;
+ case 0x549 /* Չ */: BSEQ(0xd5,0xb9) /* չ */;
+ case 0x54a /* Պ */: BSEQ(0xd5,0xba) /* պ */;
+ case 0x54b /* Ջ */: BSEQ(0xd5,0xbb) /* ջ */;
+ case 0x54c /* Ռ */: BSEQ(0xd5,0xbc) /* ռ */;
+ case 0x54d /* Ս */: BSEQ(0xd5,0xbd) /* ս */;
+ case 0x54e /* Վ */: BSEQ(0xd5,0xbe) /* վ */;
+ case 0x54f /* Տ */: BSEQ(0xd5,0xbf) /* տ */;
+ case 0x550 /* Ր */: BSEQ(0xd6,0x80) /* ր */;
+ case 0x551 /* Ց */: BSEQ(0xd6,0x81) /* ց */;
+ case 0x552 /* Ւ */: BSEQ(0xd6,0x82) /* ւ */;
+ case 0x553 /* Փ */: BSEQ(0xd6,0x83) /* փ */;
+ case 0x554 /* Ք */: BSEQ(0xd6,0x84) /* ք */;
+ case 0x555 /* Օ */: BSEQ(0xd6,0x85) /* օ */;
+ case 0x556 /* Ֆ */: BSEQ(0xd6,0x86) /* ֆ */;
+ case 0x10a0 /* Ⴀ */: BSEQ(0xe2,0xb4,0x80) /* ⴀ */;
+ case 0x10a1 /* Ⴁ */: BSEQ(0xe2,0xb4,0x81) /* ⴁ */;
+ case 0x10a2 /* Ⴂ */: BSEQ(0xe2,0xb4,0x82) /* ⴂ */;
+ case 0x10a3 /* Ⴃ */: BSEQ(0xe2,0xb4,0x83) /* ⴃ */;
+ case 0x10a4 /* Ⴄ */: BSEQ(0xe2,0xb4,0x84) /* ⴄ */;
+ case 0x10a5 /* Ⴅ */: BSEQ(0xe2,0xb4,0x85) /* ⴅ */;
+ case 0x10a6 /* Ⴆ */: BSEQ(0xe2,0xb4,0x86) /* ⴆ */;
+ case 0x10a7 /* Ⴇ */: BSEQ(0xe2,0xb4,0x87) /* ⴇ */;
+ case 0x10a8 /* Ⴈ */: BSEQ(0xe2,0xb4,0x88) /* ⴈ */;
+ case 0x10a9 /* Ⴉ */: BSEQ(0xe2,0xb4,0x89) /* ⴉ */;
+ case 0x10aa /* Ⴊ */: BSEQ(0xe2,0xb4,0x8a) /* ⴊ */;
+ case 0x10ab /* Ⴋ */: BSEQ(0xe2,0xb4,0x8b) /* ⴋ */;
+ case 0x10ac /* Ⴌ */: BSEQ(0xe2,0xb4,0x8c) /* ⴌ */;
+ case 0x10ad /* Ⴍ */: BSEQ(0xe2,0xb4,0x8d) /* ⴍ */;
+ case 0x10ae /* Ⴎ */: BSEQ(0xe2,0xb4,0x8e) /* ⴎ */;
+ case 0x10af /* Ⴏ */: BSEQ(0xe2,0xb4,0x8f) /* ⴏ */;
+ case 0x10b0 /* Ⴐ */: BSEQ(0xe2,0xb4,0x90) /* ⴐ */;
+ case 0x10b1 /* Ⴑ */: BSEQ(0xe2,0xb4,0x91) /* ⴑ */;
+ case 0x10b2 /* Ⴒ */: BSEQ(0xe2,0xb4,0x92) /* ⴒ */;
+ case 0x10b3 /* Ⴓ */: BSEQ(0xe2,0xb4,0x93) /* ⴓ */;
+ case 0x10b4 /* Ⴔ */: BSEQ(0xe2,0xb4,0x94) /* ⴔ */;
+ case 0x10b5 /* Ⴕ */: BSEQ(0xe2,0xb4,0x95) /* ⴕ */;
+ case 0x10b6 /* Ⴖ */: BSEQ(0xe2,0xb4,0x96) /* ⴖ */;
+ case 0x10b7 /* Ⴗ */: BSEQ(0xe2,0xb4,0x97) /* ⴗ */;
+ case 0x10b8 /* Ⴘ */: BSEQ(0xe2,0xb4,0x98) /* ⴘ */;
+ case 0x10b9 /* Ⴙ */: BSEQ(0xe2,0xb4,0x99) /* ⴙ */;
+ case 0x10ba /* Ⴚ */: BSEQ(0xe2,0xb4,0x9a) /* ⴚ */;
+ case 0x10bb /* Ⴛ */: BSEQ(0xe2,0xb4,0x9b) /* ⴛ */;
+ case 0x10bc /* Ⴜ */: BSEQ(0xe2,0xb4,0x9c) /* ⴜ */;
+ case 0x10bd /* Ⴝ */: BSEQ(0xe2,0xb4,0x9d) /* ⴝ */;
+ case 0x10be /* Ⴞ */: BSEQ(0xe2,0xb4,0x9e) /* ⴞ */;
+ case 0x10bf /* Ⴟ */: BSEQ(0xe2,0xb4,0x9f) /* ⴟ */;
+ case 0x10c0 /* Ⴠ */: BSEQ(0xe2,0xb4,0xa0) /* ⴠ */;
+ case 0x10c1 /* Ⴡ */: BSEQ(0xe2,0xb4,0xa1) /* ⴡ */;
+ case 0x10c2 /* Ⴢ */: BSEQ(0xe2,0xb4,0xa2) /* ⴢ */;
+ case 0x10c3 /* Ⴣ */: BSEQ(0xe2,0xb4,0xa3) /* ⴣ */;
+ case 0x10c4 /* Ⴤ */: BSEQ(0xe2,0xb4,0xa4) /* ⴤ */;
+ case 0x10c5 /* Ⴥ */: BSEQ(0xe2,0xb4,0xa5) /* ⴥ */;
+ case 0x10c7 /* Ⴧ */: BSEQ(0xe2,0xb4,0xa7) /* ⴧ */;
+ case 0x10cd /* Ⴭ */: BSEQ(0xe2,0xb4,0xad) /* ⴭ */;
+ case 0x13a0 /* Ꭰ */: BSEQ(0xea,0xad,0xb0) /* ꭰ */;
+ case 0x13a1 /* Ꭱ */: BSEQ(0xea,0xad,0xb1) /* ꭱ */;
+ case 0x13a2 /* Ꭲ */: BSEQ(0xea,0xad,0xb2) /* ꭲ */;
+ case 0x13a3 /* Ꭳ */: BSEQ(0xea,0xad,0xb3) /* ꭳ */;
+ case 0x13a4 /* Ꭴ */: BSEQ(0xea,0xad,0xb4) /* ꭴ */;
+ case 0x13a5 /* Ꭵ */: BSEQ(0xea,0xad,0xb5) /* ꭵ */;
+ case 0x13a6 /* Ꭶ */: BSEQ(0xea,0xad,0xb6) /* ꭶ */;
+ case 0x13a7 /* Ꭷ */: BSEQ(0xea,0xad,0xb7) /* ꭷ */;
+ case 0x13a8 /* Ꭸ */: BSEQ(0xea,0xad,0xb8) /* ꭸ */;
+ case 0x13a9 /* Ꭹ */: BSEQ(0xea,0xad,0xb9) /* ꭹ */;
+ case 0x13aa /* Ꭺ */: BSEQ(0xea,0xad,0xba) /* ꭺ */;
+ case 0x13ab /* Ꭻ */: BSEQ(0xea,0xad,0xbb) /* ꭻ */;
+ case 0x13ac /* Ꭼ */: BSEQ(0xea,0xad,0xbc) /* ꭼ */;
+ case 0x13ad /* Ꭽ */: BSEQ(0xea,0xad,0xbd) /* ꭽ */;
+ case 0x13ae /* Ꭾ */: BSEQ(0xea,0xad,0xbe) /* ꭾ */;
+ case 0x13af /* Ꭿ */: BSEQ(0xea,0xad,0xbf) /* ꭿ */;
+ case 0x13b0 /* Ꮀ */: BSEQ(0xea,0xae,0x80) /* ꮀ */;
+ case 0x13b1 /* Ꮁ */: BSEQ(0xea,0xae,0x81) /* ꮁ */;
+ case 0x13b2 /* Ꮂ */: BSEQ(0xea,0xae,0x82) /* ꮂ */;
+ case 0x13b3 /* Ꮃ */: BSEQ(0xea,0xae,0x83) /* ꮃ */;
+ case 0x13b4 /* Ꮄ */: BSEQ(0xea,0xae,0x84) /* ꮄ */;
+ case 0x13b5 /* Ꮅ */: BSEQ(0xea,0xae,0x85) /* ꮅ */;
+ case 0x13b6 /* Ꮆ */: BSEQ(0xea,0xae,0x86) /* ꮆ */;
+ case 0x13b7 /* Ꮇ */: BSEQ(0xea,0xae,0x87) /* ꮇ */;
+ case 0x13b8 /* Ꮈ */: BSEQ(0xea,0xae,0x88) /* ꮈ */;
+ case 0x13b9 /* Ꮉ */: BSEQ(0xea,0xae,0x89) /* ꮉ */;
+ case 0x13ba /* Ꮊ */: BSEQ(0xea,0xae,0x8a) /* ꮊ */;
+ case 0x13bb /* Ꮋ */: BSEQ(0xea,0xae,0x8b) /* ꮋ */;
+ case 0x13bc /* Ꮌ */: BSEQ(0xea,0xae,0x8c) /* ꮌ */;
+ case 0x13bd /* Ꮍ */: BSEQ(0xea,0xae,0x8d) /* ꮍ */;
+ case 0x13be /* Ꮎ */: BSEQ(0xea,0xae,0x8e) /* ꮎ */;
+ case 0x13bf /* Ꮏ */: BSEQ(0xea,0xae,0x8f) /* ꮏ */;
+ case 0x13c0 /* Ꮐ */: BSEQ(0xea,0xae,0x90) /* ꮐ */;
+ case 0x13c1 /* Ꮑ */: BSEQ(0xea,0xae,0x91) /* ꮑ */;
+ case 0x13c2 /* Ꮒ */: BSEQ(0xea,0xae,0x92) /* ꮒ */;
+ case 0x13c3 /* Ꮓ */: BSEQ(0xea,0xae,0x93) /* ꮓ */;
+ case 0x13c4 /* Ꮔ */: BSEQ(0xea,0xae,0x94) /* ꮔ */;
+ case 0x13c5 /* Ꮕ */: BSEQ(0xea,0xae,0x95) /* ꮕ */;
+ case 0x13c6 /* Ꮖ */: BSEQ(0xea,0xae,0x96) /* ꮖ */;
+ case 0x13c7 /* Ꮗ */: BSEQ(0xea,0xae,0x97) /* ꮗ */;
+ case 0x13c8 /* Ꮘ */: BSEQ(0xea,0xae,0x98) /* ꮘ */;
+ case 0x13c9 /* Ꮙ */: BSEQ(0xea,0xae,0x99) /* ꮙ */;
+ case 0x13ca /* Ꮚ */: BSEQ(0xea,0xae,0x9a) /* ꮚ */;
+ case 0x13cb /* Ꮛ */: BSEQ(0xea,0xae,0x9b) /* ꮛ */;
+ case 0x13cc /* Ꮜ */: BSEQ(0xea,0xae,0x9c) /* ꮜ */;
+ case 0x13cd /* Ꮝ */: BSEQ(0xea,0xae,0x9d) /* ꮝ */;
+ case 0x13ce /* Ꮞ */: BSEQ(0xea,0xae,0x9e) /* ꮞ */;
+ case 0x13cf /* Ꮟ */: BSEQ(0xea,0xae,0x9f) /* ꮟ */;
+ case 0x13d0 /* Ꮠ */: BSEQ(0xea,0xae,0xa0) /* ꮠ */;
+ case 0x13d1 /* Ꮡ */: BSEQ(0xea,0xae,0xa1) /* ꮡ */;
+ case 0x13d2 /* Ꮢ */: BSEQ(0xea,0xae,0xa2) /* ꮢ */;
+ case 0x13d3 /* Ꮣ */: BSEQ(0xea,0xae,0xa3) /* ꮣ */;
+ case 0x13d4 /* Ꮤ */: BSEQ(0xea,0xae,0xa4) /* ꮤ */;
+ case 0x13d5 /* Ꮥ */: BSEQ(0xea,0xae,0xa5) /* ꮥ */;
+ case 0x13d6 /* Ꮦ */: BSEQ(0xea,0xae,0xa6) /* ꮦ */;
+ case 0x13d7 /* Ꮧ */: BSEQ(0xea,0xae,0xa7) /* ꮧ */;
+ case 0x13d8 /* Ꮨ */: BSEQ(0xea,0xae,0xa8) /* ꮨ */;
+ case 0x13d9 /* Ꮩ */: BSEQ(0xea,0xae,0xa9) /* ꮩ */;
+ case 0x13da /* Ꮪ */: BSEQ(0xea,0xae,0xaa) /* ꮪ */;
+ case 0x13db /* Ꮫ */: BSEQ(0xea,0xae,0xab) /* ꮫ */;
+ case 0x13dc /* Ꮬ */: BSEQ(0xea,0xae,0xac) /* ꮬ */;
+ case 0x13dd /* Ꮭ */: BSEQ(0xea,0xae,0xad) /* ꮭ */;
+ case 0x13de /* Ꮮ */: BSEQ(0xea,0xae,0xae) /* ꮮ */;
+ case 0x13df /* Ꮯ */: BSEQ(0xea,0xae,0xaf) /* ꮯ */;
+ case 0x13e0 /* Ꮰ */: BSEQ(0xea,0xae,0xb0) /* ꮰ */;
+ case 0x13e1 /* Ꮱ */: BSEQ(0xea,0xae,0xb1) /* ꮱ */;
+ case 0x13e2 /* Ꮲ */: BSEQ(0xea,0xae,0xb2) /* ꮲ */;
+ case 0x13e3 /* Ꮳ */: BSEQ(0xea,0xae,0xb3) /* ꮳ */;
+ case 0x13e4 /* Ꮴ */: BSEQ(0xea,0xae,0xb4) /* ꮴ */;
+ case 0x13e5 /* Ꮵ */: BSEQ(0xea,0xae,0xb5) /* ꮵ */;
+ case 0x13e6 /* Ꮶ */: BSEQ(0xea,0xae,0xb6) /* ꮶ */;
+ case 0x13e7 /* Ꮷ */: BSEQ(0xea,0xae,0xb7) /* ꮷ */;
+ case 0x13e8 /* Ꮸ */: BSEQ(0xea,0xae,0xb8) /* ꮸ */;
+ case 0x13e9 /* Ꮹ */: BSEQ(0xea,0xae,0xb9) /* ꮹ */;
+ case 0x13ea /* Ꮺ */: BSEQ(0xea,0xae,0xba) /* ꮺ */;
+ case 0x13eb /* Ꮻ */: BSEQ(0xea,0xae,0xbb) /* ꮻ */;
+ case 0x13ec /* Ꮼ */: BSEQ(0xea,0xae,0xbc) /* ꮼ */;
+ case 0x13ed /* Ꮽ */: BSEQ(0xea,0xae,0xbd) /* ꮽ */;
+ case 0x13ee /* Ꮾ */: BSEQ(0xea,0xae,0xbe) /* ꮾ */;
+ case 0x13ef /* Ꮿ */: BSEQ(0xea,0xae,0xbf) /* ꮿ */;
+ case 0x13f0 /* Ᏸ */: BSEQ(0xe1,0x8f,0xb8) /* ᏸ */;
+ case 0x13f1 /* Ᏹ */: BSEQ(0xe1,0x8f,0xb9) /* ᏹ */;
+ case 0x13f2 /* Ᏺ */: BSEQ(0xe1,0x8f,0xba) /* ᏺ */;
+ case 0x13f3 /* Ᏻ */: BSEQ(0xe1,0x8f,0xbb) /* ᏻ */;
+ case 0x13f4 /* Ᏼ */: BSEQ(0xe1,0x8f,0xbc) /* ᏼ */;
+ case 0x13f5 /* Ᏽ */: BSEQ(0xe1,0x8f,0xbd) /* ᏽ */;
+ case 0x1c90 /* Ა */: BSEQ(0xe1,0x83,0x90) /* ა */;
+ case 0x1c91 /* Ბ */: BSEQ(0xe1,0x83,0x91) /* ბ */;
+ case 0x1c92 /* Გ */: BSEQ(0xe1,0x83,0x92) /* გ */;
+ case 0x1c93 /* Დ */: BSEQ(0xe1,0x83,0x93) /* დ */;
+ case 0x1c94 /* Ე */: BSEQ(0xe1,0x83,0x94) /* ე */;
+ case 0x1c95 /* Ვ */: BSEQ(0xe1,0x83,0x95) /* ვ */;
+ case 0x1c96 /* Ზ */: BSEQ(0xe1,0x83,0x96) /* ზ */;
+ case 0x1c97 /* Თ */: BSEQ(0xe1,0x83,0x97) /* თ */;
+ case 0x1c98 /* Ი */: BSEQ(0xe1,0x83,0x98) /* ი */;
+ case 0x1c99 /* Კ */: BSEQ(0xe1,0x83,0x99) /* კ */;
+ case 0x1c9a /* Ლ */: BSEQ(0xe1,0x83,0x9a) /* ლ */;
+ case 0x1c9b /* Მ */: BSEQ(0xe1,0x83,0x9b) /* მ */;
+ case 0x1c9c /* Ნ */: BSEQ(0xe1,0x83,0x9c) /* ნ */;
+ case 0x1c9d /* Ო */: BSEQ(0xe1,0x83,0x9d) /* ო */;
+ case 0x1c9e /* Პ */: BSEQ(0xe1,0x83,0x9e) /* პ */;
+ case 0x1c9f /* Ჟ */: BSEQ(0xe1,0x83,0x9f) /* ჟ */;
+ case 0x1ca0 /* Რ */: BSEQ(0xe1,0x83,0xa0) /* რ */;
+ case 0x1ca1 /* Ს */: BSEQ(0xe1,0x83,0xa1) /* ს */;
+ case 0x1ca2 /* Ტ */: BSEQ(0xe1,0x83,0xa2) /* ტ */;
+ case 0x1ca3 /* Უ */: BSEQ(0xe1,0x83,0xa3) /* უ */;
+ case 0x1ca4 /* Ფ */: BSEQ(0xe1,0x83,0xa4) /* ფ */;
+ case 0x1ca5 /* Ქ */: BSEQ(0xe1,0x83,0xa5) /* ქ */;
+ case 0x1ca6 /* Ღ */: BSEQ(0xe1,0x83,0xa6) /* ღ */;
+ case 0x1ca7 /* Ყ */: BSEQ(0xe1,0x83,0xa7) /* ყ */;
+ case 0x1ca8 /* Შ */: BSEQ(0xe1,0x83,0xa8) /* შ */;
+ case 0x1ca9 /* Ჩ */: BSEQ(0xe1,0x83,0xa9) /* ჩ */;
+ case 0x1caa /* Ც */: BSEQ(0xe1,0x83,0xaa) /* ც */;
+ case 0x1cab /* Ძ */: BSEQ(0xe1,0x83,0xab) /* ძ */;
+ case 0x1cac /* Წ */: BSEQ(0xe1,0x83,0xac) /* წ */;
+ case 0x1cad /* Ჭ */: BSEQ(0xe1,0x83,0xad) /* ჭ */;
+ case 0x1cae /* Ხ */: BSEQ(0xe1,0x83,0xae) /* ხ */;
+ case 0x1caf /* Ჯ */: BSEQ(0xe1,0x83,0xaf) /* ჯ */;
+ case 0x1cb0 /* Ჰ */: BSEQ(0xe1,0x83,0xb0) /* ჰ */;
+ case 0x1cb1 /* Ჱ */: BSEQ(0xe1,0x83,0xb1) /* ჱ */;
+ case 0x1cb2 /* Ჲ */: BSEQ(0xe1,0x83,0xb2) /* ჲ */;
+ case 0x1cb3 /* Ჳ */: BSEQ(0xe1,0x83,0xb3) /* ჳ */;
+ case 0x1cb4 /* Ჴ */: BSEQ(0xe1,0x83,0xb4) /* ჴ */;
+ case 0x1cb5 /* Ჵ */: BSEQ(0xe1,0x83,0xb5) /* ჵ */;
+ case 0x1cb6 /* Ჶ */: BSEQ(0xe1,0x83,0xb6) /* ჶ */;
+ case 0x1cb7 /* Ჷ */: BSEQ(0xe1,0x83,0xb7) /* ჷ */;
+ case 0x1cb8 /* Ჸ */: BSEQ(0xe1,0x83,0xb8) /* ჸ */;
+ case 0x1cb9 /* Ჹ */: BSEQ(0xe1,0x83,0xb9) /* ჹ */;
+ case 0x1cba /* Ჺ */: BSEQ(0xe1,0x83,0xba) /* ჺ */;
+ case 0x1cbd /* Ჽ */: BSEQ(0xe1,0x83,0xbd) /* ჽ */;
+ case 0x1cbe /* Ჾ */: BSEQ(0xe1,0x83,0xbe) /* ჾ */;
+ case 0x1cbf /* Ჿ */: BSEQ(0xe1,0x83,0xbf) /* ჿ */;
+ case 0x1e00 /* Ḁ */: BSEQ(0xe1,0xb8,0x81) /* ḁ */;
+ case 0x1e02 /* Ḃ */: BSEQ(0xe1,0xb8,0x83) /* ḃ */;
+ case 0x1e04 /* Ḅ */: BSEQ(0xe1,0xb8,0x85) /* ḅ */;
+ case 0x1e06 /* Ḇ */: BSEQ(0xe1,0xb8,0x87) /* ḇ */;
+ case 0x1e08 /* Ḉ */: BSEQ(0xe1,0xb8,0x89) /* ḉ */;
+ case 0x1e0a /* Ḋ */: BSEQ(0xe1,0xb8,0x8b) /* ḋ */;
+ case 0x1e0c /* Ḍ */: BSEQ(0xe1,0xb8,0x8d) /* ḍ */;
+ case 0x1e0e /* Ḏ */: BSEQ(0xe1,0xb8,0x8f) /* ḏ */;
+ case 0x1e10 /* Ḑ */: BSEQ(0xe1,0xb8,0x91) /* ḑ */;
+ case 0x1e12 /* Ḓ */: BSEQ(0xe1,0xb8,0x93) /* ḓ */;
+ case 0x1e14 /* Ḕ */: BSEQ(0xe1,0xb8,0x95) /* ḕ */;
+ case 0x1e16 /* Ḗ */: BSEQ(0xe1,0xb8,0x97) /* ḗ */;
+ case 0x1e18 /* Ḙ */: BSEQ(0xe1,0xb8,0x99) /* ḙ */;
+ case 0x1e1a /* Ḛ */: BSEQ(0xe1,0xb8,0x9b) /* ḛ */;
+ case 0x1e1c /* Ḝ */: BSEQ(0xe1,0xb8,0x9d) /* ḝ */;
+ case 0x1e1e /* Ḟ */: BSEQ(0xe1,0xb8,0x9f) /* ḟ */;
+ case 0x1e20 /* Ḡ */: BSEQ(0xe1,0xb8,0xa1) /* ḡ */;
+ case 0x1e22 /* Ḣ */: BSEQ(0xe1,0xb8,0xa3) /* ḣ */;
+ case 0x1e24 /* Ḥ */: BSEQ(0xe1,0xb8,0xa5) /* ḥ */;
+ case 0x1e26 /* Ḧ */: BSEQ(0xe1,0xb8,0xa7) /* ḧ */;
+ case 0x1e28 /* Ḩ */: BSEQ(0xe1,0xb8,0xa9) /* ḩ */;
+ case 0x1e2a /* Ḫ */: BSEQ(0xe1,0xb8,0xab) /* ḫ */;
+ case 0x1e2c /* Ḭ */: BSEQ(0xe1,0xb8,0xad) /* ḭ */;
+ case 0x1e2e /* Ḯ */: BSEQ(0xe1,0xb8,0xaf) /* ḯ */;
+ case 0x1e30 /* Ḱ */: BSEQ(0xe1,0xb8,0xb1) /* ḱ */;
+ case 0x1e32 /* Ḳ */: BSEQ(0xe1,0xb8,0xb3) /* ḳ */;
+ case 0x1e34 /* Ḵ */: BSEQ(0xe1,0xb8,0xb5) /* ḵ */;
+ case 0x1e36 /* Ḷ */: BSEQ(0xe1,0xb8,0xb7) /* ḷ */;
+ case 0x1e38 /* Ḹ */: BSEQ(0xe1,0xb8,0xb9) /* ḹ */;
+ case 0x1e3a /* Ḻ */: BSEQ(0xe1,0xb8,0xbb) /* ḻ */;
+ case 0x1e3c /* Ḽ */: BSEQ(0xe1,0xb8,0xbd) /* ḽ */;
+ case 0x1e3e /* Ḿ */: BSEQ(0xe1,0xb8,0xbf) /* ḿ */;
+ case 0x1e40 /* Ṁ */: BSEQ(0xe1,0xb9,0x81) /* ṁ */;
+ case 0x1e42 /* Ṃ */: BSEQ(0xe1,0xb9,0x83) /* ṃ */;
+ case 0x1e44 /* Ṅ */: BSEQ(0xe1,0xb9,0x85) /* ṅ */;
+ case 0x1e46 /* Ṇ */: BSEQ(0xe1,0xb9,0x87) /* ṇ */;
+ case 0x1e48 /* Ṉ */: BSEQ(0xe1,0xb9,0x89) /* ṉ */;
+ case 0x1e4a /* Ṋ */: BSEQ(0xe1,0xb9,0x8b) /* ṋ */;
+ case 0x1e4c /* Ṍ */: BSEQ(0xe1,0xb9,0x8d) /* ṍ */;
+ case 0x1e4e /* Ṏ */: BSEQ(0xe1,0xb9,0x8f) /* ṏ */;
+ case 0x1e50 /* Ṑ */: BSEQ(0xe1,0xb9,0x91) /* ṑ */;
+ case 0x1e52 /* Ṓ */: BSEQ(0xe1,0xb9,0x93) /* ṓ */;
+ case 0x1e54 /* Ṕ */: BSEQ(0xe1,0xb9,0x95) /* ṕ */;
+ case 0x1e56 /* Ṗ */: BSEQ(0xe1,0xb9,0x97) /* ṗ */;
+ case 0x1e58 /* Ṙ */: BSEQ(0xe1,0xb9,0x99) /* ṙ */;
+ case 0x1e5a /* Ṛ */: BSEQ(0xe1,0xb9,0x9b) /* ṛ */;
+ case 0x1e5c /* Ṝ */: BSEQ(0xe1,0xb9,0x9d) /* ṝ */;
+ case 0x1e5e /* Ṟ */: BSEQ(0xe1,0xb9,0x9f) /* ṟ */;
+ case 0x1e60 /* Ṡ */: BSEQ(0xe1,0xb9,0xa1) /* ṡ */;
+ case 0x1e62 /* Ṣ */: BSEQ(0xe1,0xb9,0xa3) /* ṣ */;
+ case 0x1e64 /* Ṥ */: BSEQ(0xe1,0xb9,0xa5) /* ṥ */;
+ case 0x1e66 /* Ṧ */: BSEQ(0xe1,0xb9,0xa7) /* ṧ */;
+ case 0x1e68 /* Ṩ */: BSEQ(0xe1,0xb9,0xa9) /* ṩ */;
+ case 0x1e6a /* Ṫ */: BSEQ(0xe1,0xb9,0xab) /* ṫ */;
+ case 0x1e6c /* Ṭ */: BSEQ(0xe1,0xb9,0xad) /* ṭ */;
+ case 0x1e6e /* Ṯ */: BSEQ(0xe1,0xb9,0xaf) /* ṯ */;
+ case 0x1e70 /* Ṱ */: BSEQ(0xe1,0xb9,0xb1) /* ṱ */;
+ case 0x1e72 /* Ṳ */: BSEQ(0xe1,0xb9,0xb3) /* ṳ */;
+ case 0x1e74 /* Ṵ */: BSEQ(0xe1,0xb9,0xb5) /* ṵ */;
+ case 0x1e76 /* Ṷ */: BSEQ(0xe1,0xb9,0xb7) /* ṷ */;
+ case 0x1e78 /* Ṹ */: BSEQ(0xe1,0xb9,0xb9) /* ṹ */;
+ case 0x1e7a /* Ṻ */: BSEQ(0xe1,0xb9,0xbb) /* ṻ */;
+ case 0x1e7c /* Ṽ */: BSEQ(0xe1,0xb9,0xbd) /* ṽ */;
+ case 0x1e7e /* Ṿ */: BSEQ(0xe1,0xb9,0xbf) /* ṿ */;
+ case 0x1e80 /* Ẁ */: BSEQ(0xe1,0xba,0x81) /* ẁ */;
+ case 0x1e82 /* Ẃ */: BSEQ(0xe1,0xba,0x83) /* ẃ */;
+ case 0x1e84 /* Ẅ */: BSEQ(0xe1,0xba,0x85) /* ẅ */;
+ case 0x1e86 /* Ẇ */: BSEQ(0xe1,0xba,0x87) /* ẇ */;
+ case 0x1e88 /* Ẉ */: BSEQ(0xe1,0xba,0x89) /* ẉ */;
+ case 0x1e8a /* Ẋ */: BSEQ(0xe1,0xba,0x8b) /* ẋ */;
+ case 0x1e8c /* Ẍ */: BSEQ(0xe1,0xba,0x8d) /* ẍ */;
+ case 0x1e8e /* Ẏ */: BSEQ(0xe1,0xba,0x8f) /* ẏ */;
+ case 0x1e90 /* Ẑ */: BSEQ(0xe1,0xba,0x91) /* ẑ */;
+ case 0x1e92 /* Ẓ */: BSEQ(0xe1,0xba,0x93) /* ẓ */;
+ case 0x1e94 /* Ẕ */: BSEQ(0xe1,0xba,0x95) /* ẕ */;
+ case 0x1e9e /* ẞ */: BSEQ(0xc3,0x9f) /* ß */;
+ case 0x1ea0 /* Ạ */: BSEQ(0xe1,0xba,0xa1) /* ạ */;
+ case 0x1ea2 /* Ả */: BSEQ(0xe1,0xba,0xa3) /* ả */;
+ case 0x1ea4 /* Ấ */: BSEQ(0xe1,0xba,0xa5) /* ấ */;
+ case 0x1ea6 /* Ầ */: BSEQ(0xe1,0xba,0xa7) /* ầ */;
+ case 0x1ea8 /* Ẩ */: BSEQ(0xe1,0xba,0xa9) /* ẩ */;
+ case 0x1eaa /* Ẫ */: BSEQ(0xe1,0xba,0xab) /* ẫ */;
+ case 0x1eac /* Ậ */: BSEQ(0xe1,0xba,0xad) /* ậ */;
+ case 0x1eae /* Ắ */: BSEQ(0xe1,0xba,0xaf) /* ắ */;
+ case 0x1eb0 /* Ằ */: BSEQ(0xe1,0xba,0xb1) /* ằ */;
+ case 0x1eb2 /* Ẳ */: BSEQ(0xe1,0xba,0xb3) /* ẳ */;
+ case 0x1eb4 /* Ẵ */: BSEQ(0xe1,0xba,0xb5) /* ẵ */;
+ case 0x1eb6 /* Ặ */: BSEQ(0xe1,0xba,0xb7) /* ặ */;
+ case 0x1eb8 /* Ẹ */: BSEQ(0xe1,0xba,0xb9) /* ẹ */;
+ case 0x1eba /* Ẻ */: BSEQ(0xe1,0xba,0xbb) /* ẻ */;
+ case 0x1ebc /* Ẽ */: BSEQ(0xe1,0xba,0xbd) /* ẽ */;
+ case 0x1ebe /* Ế */: BSEQ(0xe1,0xba,0xbf) /* ế */;
+ case 0x1ec0 /* Ề */: BSEQ(0xe1,0xbb,0x81) /* ề */;
+ case 0x1ec2 /* Ể */: BSEQ(0xe1,0xbb,0x83) /* ể */;
+ case 0x1ec4 /* Ễ */: BSEQ(0xe1,0xbb,0x85) /* ễ */;
+ case 0x1ec6 /* Ệ */: BSEQ(0xe1,0xbb,0x87) /* ệ */;
+ case 0x1ec8 /* Ỉ */: BSEQ(0xe1,0xbb,0x89) /* ỉ */;
+ case 0x1eca /* Ị */: BSEQ(0xe1,0xbb,0x8b) /* ị */;
+ case 0x1ecc /* Ọ */: BSEQ(0xe1,0xbb,0x8d) /* ọ */;
+ case 0x1ece /* Ỏ */: BSEQ(0xe1,0xbb,0x8f) /* ỏ */;
+ case 0x1ed0 /* Ố */: BSEQ(0xe1,0xbb,0x91) /* ố */;
+ case 0x1ed2 /* Ồ */: BSEQ(0xe1,0xbb,0x93) /* ồ */;
+ case 0x1ed4 /* Ổ */: BSEQ(0xe1,0xbb,0x95) /* ổ */;
+ case 0x1ed6 /* Ỗ */: BSEQ(0xe1,0xbb,0x97) /* ỗ */;
+ case 0x1ed8 /* Ộ */: BSEQ(0xe1,0xbb,0x99) /* ộ */;
+ case 0x1eda /* Ớ */: BSEQ(0xe1,0xbb,0x9b) /* ớ */;
+ case 0x1edc /* Ờ */: BSEQ(0xe1,0xbb,0x9d) /* ờ */;
+ case 0x1ede /* Ở */: BSEQ(0xe1,0xbb,0x9f) /* ở */;
+ case 0x1ee0 /* Ỡ */: BSEQ(0xe1,0xbb,0xa1) /* ỡ */;
+ case 0x1ee2 /* Ợ */: BSEQ(0xe1,0xbb,0xa3) /* ợ */;
+ case 0x1ee4 /* Ụ */: BSEQ(0xe1,0xbb,0xa5) /* ụ */;
+ case 0x1ee6 /* Ủ */: BSEQ(0xe1,0xbb,0xa7) /* ủ */;
+ case 0x1ee8 /* Ứ */: BSEQ(0xe1,0xbb,0xa9) /* ứ */;
+ case 0x1eea /* Ừ */: BSEQ(0xe1,0xbb,0xab) /* ừ */;
+ case 0x1eec /* Ử */: BSEQ(0xe1,0xbb,0xad) /* ử */;
+ case 0x1eee /* Ữ */: BSEQ(0xe1,0xbb,0xaf) /* ữ */;
+ case 0x1ef0 /* Ự */: BSEQ(0xe1,0xbb,0xb1) /* ự */;
+ case 0x1ef2 /* Ỳ */: BSEQ(0xe1,0xbb,0xb3) /* ỳ */;
+ case 0x1ef4 /* Ỵ */: BSEQ(0xe1,0xbb,0xb5) /* ỵ */;
+ case 0x1ef6 /* Ỷ */: BSEQ(0xe1,0xbb,0xb7) /* ỷ */;
+ case 0x1ef8 /* Ỹ */: BSEQ(0xe1,0xbb,0xb9) /* ỹ */;
+ case 0x1efa /* Ỻ */: BSEQ(0xe1,0xbb,0xbb) /* ỻ */;
+ case 0x1efc /* Ỽ */: BSEQ(0xe1,0xbb,0xbd) /* ỽ */;
+ case 0x1efe /* Ỿ */: BSEQ(0xe1,0xbb,0xbf) /* ỿ */;
+ case 0x1f08 /* Ἀ */: BSEQ(0xe1,0xbc,0x80) /* ἀ */;
+ case 0x1f09 /* Ἁ */: BSEQ(0xe1,0xbc,0x81) /* ἁ */;
+ case 0x1f0a /* Ἂ */: BSEQ(0xe1,0xbc,0x82) /* ἂ */;
+ case 0x1f0b /* Ἃ */: BSEQ(0xe1,0xbc,0x83) /* ἃ */;
+ case 0x1f0c /* Ἄ */: BSEQ(0xe1,0xbc,0x84) /* ἄ */;
+ case 0x1f0d /* Ἅ */: BSEQ(0xe1,0xbc,0x85) /* ἅ */;
+ case 0x1f0e /* Ἆ */: BSEQ(0xe1,0xbc,0x86) /* ἆ */;
+ case 0x1f0f /* Ἇ */: BSEQ(0xe1,0xbc,0x87) /* ἇ */;
+ case 0x1f18 /* Ἐ */: BSEQ(0xe1,0xbc,0x90) /* ἐ */;
+ case 0x1f19 /* Ἑ */: BSEQ(0xe1,0xbc,0x91) /* ἑ */;
+ case 0x1f1a /* Ἒ */: BSEQ(0xe1,0xbc,0x92) /* ἒ */;
+ case 0x1f1b /* Ἓ */: BSEQ(0xe1,0xbc,0x93) /* ἓ */;
+ case 0x1f1c /* Ἔ */: BSEQ(0xe1,0xbc,0x94) /* ἔ */;
+ case 0x1f1d /* Ἕ */: BSEQ(0xe1,0xbc,0x95) /* ἕ */;
+ case 0x1f28 /* Ἠ */: BSEQ(0xe1,0xbc,0xa0) /* ἠ */;
+ case 0x1f29 /* Ἡ */: BSEQ(0xe1,0xbc,0xa1) /* ἡ */;
+ case 0x1f2a /* Ἢ */: BSEQ(0xe1,0xbc,0xa2) /* ἢ */;
+ case 0x1f2b /* Ἣ */: BSEQ(0xe1,0xbc,0xa3) /* ἣ */;
+ case 0x1f2c /* Ἤ */: BSEQ(0xe1,0xbc,0xa4) /* ἤ */;
+ case 0x1f2d /* Ἥ */: BSEQ(0xe1,0xbc,0xa5) /* ἥ */;
+ case 0x1f2e /* Ἦ */: BSEQ(0xe1,0xbc,0xa6) /* ἦ */;
+ case 0x1f2f /* Ἧ */: BSEQ(0xe1,0xbc,0xa7) /* ἧ */;
+ case 0x1f38 /* Ἰ */: BSEQ(0xe1,0xbc,0xb0) /* ἰ */;
+ case 0x1f39 /* Ἱ */: BSEQ(0xe1,0xbc,0xb1) /* ἱ */;
+ case 0x1f3a /* Ἲ */: BSEQ(0xe1,0xbc,0xb2) /* ἲ */;
+ case 0x1f3b /* Ἳ */: BSEQ(0xe1,0xbc,0xb3) /* ἳ */;
+ case 0x1f3c /* Ἴ */: BSEQ(0xe1,0xbc,0xb4) /* ἴ */;
+ case 0x1f3d /* Ἵ */: BSEQ(0xe1,0xbc,0xb5) /* ἵ */;
+ case 0x1f3e /* Ἶ */: BSEQ(0xe1,0xbc,0xb6) /* ἶ */;
+ case 0x1f3f /* Ἷ */: BSEQ(0xe1,0xbc,0xb7) /* ἷ */;
+ case 0x1f48 /* Ὀ */: BSEQ(0xe1,0xbd,0x80) /* ὀ */;
+ case 0x1f49 /* Ὁ */: BSEQ(0xe1,0xbd,0x81) /* ὁ */;
+ case 0x1f4a /* Ὂ */: BSEQ(0xe1,0xbd,0x82) /* ὂ */;
+ case 0x1f4b /* Ὃ */: BSEQ(0xe1,0xbd,0x83) /* ὃ */;
+ case 0x1f4c /* Ὄ */: BSEQ(0xe1,0xbd,0x84) /* ὄ */;
+ case 0x1f4d /* Ὅ */: BSEQ(0xe1,0xbd,0x85) /* ὅ */;
+ case 0x1f59 /* Ὑ */: BSEQ(0xe1,0xbd,0x91) /* ὑ */;
+ case 0x1f5b /* Ὓ */: BSEQ(0xe1,0xbd,0x93) /* ὓ */;
+ case 0x1f5d /* Ὕ */: BSEQ(0xe1,0xbd,0x95) /* ὕ */;
+ case 0x1f5f /* Ὗ */: BSEQ(0xe1,0xbd,0x97) /* ὗ */;
+ case 0x1f68 /* Ὠ */: BSEQ(0xe1,0xbd,0xa0) /* ὠ */;
+ case 0x1f69 /* Ὡ */: BSEQ(0xe1,0xbd,0xa1) /* ὡ */;
+ case 0x1f6a /* Ὢ */: BSEQ(0xe1,0xbd,0xa2) /* ὢ */;
+ case 0x1f6b /* Ὣ */: BSEQ(0xe1,0xbd,0xa3) /* ὣ */;
+ case 0x1f6c /* Ὤ */: BSEQ(0xe1,0xbd,0xa4) /* ὤ */;
+ case 0x1f6d /* Ὥ */: BSEQ(0xe1,0xbd,0xa5) /* ὥ */;
+ case 0x1f6e /* Ὦ */: BSEQ(0xe1,0xbd,0xa6) /* ὦ */;
+ case 0x1f6f /* Ὧ */: BSEQ(0xe1,0xbd,0xa7) /* ὧ */;
+ case 0x1f88 /* ᾈ */: BSEQ(0xe1,0xbe,0x80) /* ᾀ */;
+ case 0x1f89 /* ᾉ */: BSEQ(0xe1,0xbe,0x81) /* ᾁ */;
+ case 0x1f8a /* ᾊ */: BSEQ(0xe1,0xbe,0x82) /* ᾂ */;
+ case 0x1f8b /* ᾋ */: BSEQ(0xe1,0xbe,0x83) /* ᾃ */;
+ case 0x1f8c /* ᾌ */: BSEQ(0xe1,0xbe,0x84) /* ᾄ */;
+ case 0x1f8d /* ᾍ */: BSEQ(0xe1,0xbe,0x85) /* ᾅ */;
+ case 0x1f8e /* ᾎ */: BSEQ(0xe1,0xbe,0x86) /* ᾆ */;
+ case 0x1f8f /* ᾏ */: BSEQ(0xe1,0xbe,0x87) /* ᾇ */;
+ case 0x1f98 /* ᾘ */: BSEQ(0xe1,0xbe,0x90) /* ᾐ */;
+ case 0x1f99 /* ᾙ */: BSEQ(0xe1,0xbe,0x91) /* ᾑ */;
+ case 0x1f9a /* ᾚ */: BSEQ(0xe1,0xbe,0x92) /* ᾒ */;
+ case 0x1f9b /* ᾛ */: BSEQ(0xe1,0xbe,0x93) /* ᾓ */;
+ case 0x1f9c /* ᾜ */: BSEQ(0xe1,0xbe,0x94) /* ᾔ */;
+ case 0x1f9d /* ᾝ */: BSEQ(0xe1,0xbe,0x95) /* ᾕ */;
+ case 0x1f9e /* ᾞ */: BSEQ(0xe1,0xbe,0x96) /* ᾖ */;
+ case 0x1f9f /* ᾟ */: BSEQ(0xe1,0xbe,0x97) /* ᾗ */;
+ case 0x1fa8 /* ᾨ */: BSEQ(0xe1,0xbe,0xa0) /* ᾠ */;
+ case 0x1fa9 /* ᾩ */: BSEQ(0xe1,0xbe,0xa1) /* ᾡ */;
+ case 0x1faa /* ᾪ */: BSEQ(0xe1,0xbe,0xa2) /* ᾢ */;
+ case 0x1fab /* ᾫ */: BSEQ(0xe1,0xbe,0xa3) /* ᾣ */;
+ case 0x1fac /* ᾬ */: BSEQ(0xe1,0xbe,0xa4) /* ᾤ */;
+ case 0x1fad /* ᾭ */: BSEQ(0xe1,0xbe,0xa5) /* ᾥ */;
+ case 0x1fae /* ᾮ */: BSEQ(0xe1,0xbe,0xa6) /* ᾦ */;
+ case 0x1faf /* ᾯ */: BSEQ(0xe1,0xbe,0xa7) /* ᾧ */;
+ case 0x1fb8 /* Ᾰ */: BSEQ(0xe1,0xbe,0xb0) /* ᾰ */;
+ case 0x1fb9 /* Ᾱ */: BSEQ(0xe1,0xbe,0xb1) /* ᾱ */;
+ case 0x1fba /* Ὰ */: BSEQ(0xe1,0xbd,0xb0) /* ὰ */;
+ case 0x1fbb /* Ά */: BSEQ(0xe1,0xbd,0xb1) /* ά */;
+ case 0x1fbc /* ᾼ */: BSEQ(0xe1,0xbe,0xb3) /* ᾳ */;
+ case 0x1fc8 /* Ὲ */: BSEQ(0xe1,0xbd,0xb2) /* ὲ */;
+ case 0x1fc9 /* Έ */: BSEQ(0xe1,0xbd,0xb3) /* έ */;
+ case 0x1fca /* Ὴ */: BSEQ(0xe1,0xbd,0xb4) /* ὴ */;
+ case 0x1fcb /* Ή */: BSEQ(0xe1,0xbd,0xb5) /* ή */;
+ case 0x1fcc /* ῌ */: BSEQ(0xe1,0xbf,0x83) /* ῃ */;
+ case 0x1fd8 /* Ῐ */: BSEQ(0xe1,0xbf,0x90) /* ῐ */;
+ case 0x1fd9 /* Ῑ */: BSEQ(0xe1,0xbf,0x91) /* ῑ */;
+ case 0x1fda /* Ὶ */: BSEQ(0xe1,0xbd,0xb6) /* ὶ */;
+ case 0x1fdb /* Ί */: BSEQ(0xe1,0xbd,0xb7) /* ί */;
+ case 0x1fe8 /* Ῠ */: BSEQ(0xe1,0xbf,0xa0) /* ῠ */;
+ case 0x1fe9 /* Ῡ */: BSEQ(0xe1,0xbf,0xa1) /* ῡ */;
+ case 0x1fea /* Ὺ */: BSEQ(0xe1,0xbd,0xba) /* ὺ */;
+ case 0x1feb /* Ύ */: BSEQ(0xe1,0xbd,0xbb) /* ύ */;
+ case 0x1fec /* Ῥ */: BSEQ(0xe1,0xbf,0xa5) /* ῥ */;
+ case 0x1ff8 /* Ὸ */: BSEQ(0xe1,0xbd,0xb8) /* ὸ */;
+ case 0x1ff9 /* Ό */: BSEQ(0xe1,0xbd,0xb9) /* ό */;
+ case 0x1ffa /* Ὼ */: BSEQ(0xe1,0xbd,0xbc) /* ὼ */;
+ case 0x1ffb /* Ώ */: BSEQ(0xe1,0xbd,0xbd) /* ώ */;
+ case 0x1ffc /* ῼ */: BSEQ(0xe1,0xbf,0xb3) /* ῳ */;
+ case 0x2126 /* Ω */: BSEQ(0xcf,0x89) /* ω */;
+ case 0x212a /* K */: BSEQ(0x6b) /* k */;
+ case 0x212b /* Å */: BSEQ(0xc3,0xa5) /* å */;
+ case 0x2132 /* Ⅎ */: BSEQ(0xe2,0x85,0x8e) /* ⅎ */;
+ case 0x2160 /* Ⅰ */: BSEQ(0xe2,0x85,0xb0) /* ⅰ */;
+ case 0x2161 /* Ⅱ */: BSEQ(0xe2,0x85,0xb1) /* ⅱ */;
+ case 0x2162 /* Ⅲ */: BSEQ(0xe2,0x85,0xb2) /* ⅲ */;
+ case 0x2163 /* Ⅳ */: BSEQ(0xe2,0x85,0xb3) /* ⅳ */;
+ case 0x2164 /* Ⅴ */: BSEQ(0xe2,0x85,0xb4) /* ⅴ */;
+ case 0x2165 /* Ⅵ */: BSEQ(0xe2,0x85,0xb5) /* ⅵ */;
+ case 0x2166 /* Ⅶ */: BSEQ(0xe2,0x85,0xb6) /* ⅶ */;
+ case 0x2167 /* Ⅷ */: BSEQ(0xe2,0x85,0xb7) /* ⅷ */;
+ case 0x2168 /* Ⅸ */: BSEQ(0xe2,0x85,0xb8) /* ⅸ */;
+ case 0x2169 /* Ⅹ */: BSEQ(0xe2,0x85,0xb9) /* ⅹ */;
+ case 0x216a /* Ⅺ */: BSEQ(0xe2,0x85,0xba) /* ⅺ */;
+ case 0x216b /* Ⅻ */: BSEQ(0xe2,0x85,0xbb) /* ⅻ */;
+ case 0x216c /* Ⅼ */: BSEQ(0xe2,0x85,0xbc) /* ⅼ */;
+ case 0x216d /* Ⅽ */: BSEQ(0xe2,0x85,0xbd) /* ⅽ */;
+ case 0x216e /* Ⅾ */: BSEQ(0xe2,0x85,0xbe) /* ⅾ */;
+ case 0x216f /* Ⅿ */: BSEQ(0xe2,0x85,0xbf) /* ⅿ */;
+ case 0x2183 /* Ↄ */: BSEQ(0xe2,0x86,0x84) /* ↄ */;
+ case 0x24b6 /* Ⓐ */: BSEQ(0xe2,0x93,0x90) /* ⓐ */;
+ case 0x24b7 /* Ⓑ */: BSEQ(0xe2,0x93,0x91) /* ⓑ */;
+ case 0x24b8 /* Ⓒ */: BSEQ(0xe2,0x93,0x92) /* ⓒ */;
+ case 0x24b9 /* Ⓓ */: BSEQ(0xe2,0x93,0x93) /* ⓓ */;
+ case 0x24ba /* Ⓔ */: BSEQ(0xe2,0x93,0x94) /* ⓔ */;
+ case 0x24bb /* Ⓕ */: BSEQ(0xe2,0x93,0x95) /* ⓕ */;
+ case 0x24bc /* Ⓖ */: BSEQ(0xe2,0x93,0x96) /* ⓖ */;
+ case 0x24bd /* Ⓗ */: BSEQ(0xe2,0x93,0x97) /* ⓗ */;
+ case 0x24be /* Ⓘ */: BSEQ(0xe2,0x93,0x98) /* ⓘ */;
+ case 0x24bf /* Ⓙ */: BSEQ(0xe2,0x93,0x99) /* ⓙ */;
+ case 0x24c0 /* Ⓚ */: BSEQ(0xe2,0x93,0x9a) /* ⓚ */;
+ case 0x24c1 /* Ⓛ */: BSEQ(0xe2,0x93,0x9b) /* ⓛ */;
+ case 0x24c2 /* Ⓜ */: BSEQ(0xe2,0x93,0x9c) /* ⓜ */;
+ case 0x24c3 /* Ⓝ */: BSEQ(0xe2,0x93,0x9d) /* ⓝ */;
+ case 0x24c4 /* Ⓞ */: BSEQ(0xe2,0x93,0x9e) /* ⓞ */;
+ case 0x24c5 /* Ⓟ */: BSEQ(0xe2,0x93,0x9f) /* ⓟ */;
+ case 0x24c6 /* Ⓠ */: BSEQ(0xe2,0x93,0xa0) /* ⓠ */;
+ case 0x24c7 /* Ⓡ */: BSEQ(0xe2,0x93,0xa1) /* ⓡ */;
+ case 0x24c8 /* Ⓢ */: BSEQ(0xe2,0x93,0xa2) /* ⓢ */;
+ case 0x24c9 /* Ⓣ */: BSEQ(0xe2,0x93,0xa3) /* ⓣ */;
+ case 0x24ca /* Ⓤ */: BSEQ(0xe2,0x93,0xa4) /* ⓤ */;
+ case 0x24cb /* Ⓥ */: BSEQ(0xe2,0x93,0xa5) /* ⓥ */;
+ case 0x24cc /* Ⓦ */: BSEQ(0xe2,0x93,0xa6) /* ⓦ */;
+ case 0x24cd /* Ⓧ */: BSEQ(0xe2,0x93,0xa7) /* ⓧ */;
+ case 0x24ce /* Ⓨ */: BSEQ(0xe2,0x93,0xa8) /* ⓨ */;
+ case 0x24cf /* Ⓩ */: BSEQ(0xe2,0x93,0xa9) /* ⓩ */;
+ case 0x2c00 /* Ⰰ */: BSEQ(0xe2,0xb0,0xb0) /* ⰰ */;
+ case 0x2c01 /* Ⰱ */: BSEQ(0xe2,0xb0,0xb1) /* ⰱ */;
+ case 0x2c02 /* Ⰲ */: BSEQ(0xe2,0xb0,0xb2) /* ⰲ */;
+ case 0x2c03 /* Ⰳ */: BSEQ(0xe2,0xb0,0xb3) /* ⰳ */;
+ case 0x2c04 /* Ⰴ */: BSEQ(0xe2,0xb0,0xb4) /* ⰴ */;
+ case 0x2c05 /* Ⰵ */: BSEQ(0xe2,0xb0,0xb5) /* ⰵ */;
+ case 0x2c06 /* Ⰶ */: BSEQ(0xe2,0xb0,0xb6) /* ⰶ */;
+ case 0x2c07 /* Ⰷ */: BSEQ(0xe2,0xb0,0xb7) /* ⰷ */;
+ case 0x2c08 /* Ⰸ */: BSEQ(0xe2,0xb0,0xb8) /* ⰸ */;
+ case 0x2c09 /* Ⰹ */: BSEQ(0xe2,0xb0,0xb9) /* ⰹ */;
+ case 0x2c0a /* Ⰺ */: BSEQ(0xe2,0xb0,0xba) /* ⰺ */;
+ case 0x2c0b /* Ⰻ */: BSEQ(0xe2,0xb0,0xbb) /* ⰻ */;
+ case 0x2c0c /* Ⰼ */: BSEQ(0xe2,0xb0,0xbc) /* ⰼ */;
+ case 0x2c0d /* Ⰽ */: BSEQ(0xe2,0xb0,0xbd) /* ⰽ */;
+ case 0x2c0e /* Ⰾ */: BSEQ(0xe2,0xb0,0xbe) /* ⰾ */;
+ case 0x2c0f /* Ⰿ */: BSEQ(0xe2,0xb0,0xbf) /* ⰿ */;
+ case 0x2c10 /* Ⱀ */: BSEQ(0xe2,0xb1,0x80) /* ⱀ */;
+ case 0x2c11 /* Ⱁ */: BSEQ(0xe2,0xb1,0x81) /* ⱁ */;
+ case 0x2c12 /* Ⱂ */: BSEQ(0xe2,0xb1,0x82) /* ⱂ */;
+ case 0x2c13 /* Ⱃ */: BSEQ(0xe2,0xb1,0x83) /* ⱃ */;
+ case 0x2c14 /* Ⱄ */: BSEQ(0xe2,0xb1,0x84) /* ⱄ */;
+ case 0x2c15 /* Ⱅ */: BSEQ(0xe2,0xb1,0x85) /* ⱅ */;
+ case 0x2c16 /* Ⱆ */: BSEQ(0xe2,0xb1,0x86) /* ⱆ */;
+ case 0x2c17 /* Ⱇ */: BSEQ(0xe2,0xb1,0x87) /* ⱇ */;
+ case 0x2c18 /* Ⱈ */: BSEQ(0xe2,0xb1,0x88) /* ⱈ */;
+ case 0x2c19 /* Ⱉ */: BSEQ(0xe2,0xb1,0x89) /* ⱉ */;
+ case 0x2c1a /* Ⱊ */: BSEQ(0xe2,0xb1,0x8a) /* ⱊ */;
+ case 0x2c1b /* Ⱋ */: BSEQ(0xe2,0xb1,0x8b) /* ⱋ */;
+ case 0x2c1c /* Ⱌ */: BSEQ(0xe2,0xb1,0x8c) /* ⱌ */;
+ case 0x2c1d /* Ⱍ */: BSEQ(0xe2,0xb1,0x8d) /* ⱍ */;
+ case 0x2c1e /* Ⱎ */: BSEQ(0xe2,0xb1,0x8e) /* ⱎ */;
+ case 0x2c1f /* Ⱏ */: BSEQ(0xe2,0xb1,0x8f) /* ⱏ */;
+ case 0x2c20 /* Ⱐ */: BSEQ(0xe2,0xb1,0x90) /* ⱐ */;
+ case 0x2c21 /* Ⱑ */: BSEQ(0xe2,0xb1,0x91) /* ⱑ */;
+ case 0x2c22 /* Ⱒ */: BSEQ(0xe2,0xb1,0x92) /* ⱒ */;
+ case 0x2c23 /* Ⱓ */: BSEQ(0xe2,0xb1,0x93) /* ⱓ */;
+ case 0x2c24 /* Ⱔ */: BSEQ(0xe2,0xb1,0x94) /* ⱔ */;
+ case 0x2c25 /* Ⱕ */: BSEQ(0xe2,0xb1,0x95) /* ⱕ */;
+ case 0x2c26 /* Ⱖ */: BSEQ(0xe2,0xb1,0x96) /* ⱖ */;
+ case 0x2c27 /* Ⱗ */: BSEQ(0xe2,0xb1,0x97) /* ⱗ */;
+ case 0x2c28 /* Ⱘ */: BSEQ(0xe2,0xb1,0x98) /* ⱘ */;
+ case 0x2c29 /* Ⱙ */: BSEQ(0xe2,0xb1,0x99) /* ⱙ */;
+ case 0x2c2a /* Ⱚ */: BSEQ(0xe2,0xb1,0x9a) /* ⱚ */;
+ case 0x2c2b /* Ⱛ */: BSEQ(0xe2,0xb1,0x9b) /* ⱛ */;
+ case 0x2c2c /* Ⱜ */: BSEQ(0xe2,0xb1,0x9c) /* ⱜ */;
+ case 0x2c2d /* Ⱝ */: BSEQ(0xe2,0xb1,0x9d) /* ⱝ */;
+ case 0x2c2e /* Ⱞ */: BSEQ(0xe2,0xb1,0x9e) /* ⱞ */;
+ case 0x2c60 /* Ⱡ */: BSEQ(0xe2,0xb1,0xa1) /* ⱡ */;
+ case 0x2c62 /* Ɫ */: BSEQ(0xc9,0xab) /* ɫ */;
+ case 0x2c63 /* Ᵽ */: BSEQ(0xe1,0xb5,0xbd) /* ᵽ */;
+ case 0x2c64 /* Ɽ */: BSEQ(0xc9,0xbd) /* ɽ */;
+ case 0x2c67 /* Ⱨ */: BSEQ(0xe2,0xb1,0xa8) /* ⱨ */;
+ case 0x2c69 /* Ⱪ */: BSEQ(0xe2,0xb1,0xaa) /* ⱪ */;
+ case 0x2c6b /* Ⱬ */: BSEQ(0xe2,0xb1,0xac) /* ⱬ */;
+ case 0x2c6d /* Ɑ */: BSEQ(0xc9,0x91) /* ɑ */;
+ case 0x2c6e /* Ɱ */: BSEQ(0xc9,0xb1) /* ɱ */;
+ case 0x2c6f /* Ɐ */: BSEQ(0xc9,0x90) /* ɐ */;
+ case 0x2c70 /* Ɒ */: BSEQ(0xc9,0x92) /* ɒ */;
+ case 0x2c72 /* Ⱳ */: BSEQ(0xe2,0xb1,0xb3) /* ⱳ */;
+ case 0x2c75 /* Ⱶ */: BSEQ(0xe2,0xb1,0xb6) /* ⱶ */;
+ case 0x2c7e /* Ȿ */: BSEQ(0xc8,0xbf) /* ȿ */;
+ case 0x2c7f /* Ɀ */: BSEQ(0xc9,0x80) /* ɀ */;
+ case 0x2c80 /* Ⲁ */: BSEQ(0xe2,0xb2,0x81) /* ⲁ */;
+ case 0x2c82 /* Ⲃ */: BSEQ(0xe2,0xb2,0x83) /* ⲃ */;
+ case 0x2c84 /* Ⲅ */: BSEQ(0xe2,0xb2,0x85) /* ⲅ */;
+ case 0x2c86 /* Ⲇ */: BSEQ(0xe2,0xb2,0x87) /* ⲇ */;
+ case 0x2c88 /* Ⲉ */: BSEQ(0xe2,0xb2,0x89) /* ⲉ */;
+ case 0x2c8a /* Ⲋ */: BSEQ(0xe2,0xb2,0x8b) /* ⲋ */;
+ case 0x2c8c /* Ⲍ */: BSEQ(0xe2,0xb2,0x8d) /* ⲍ */;
+ case 0x2c8e /* Ⲏ */: BSEQ(0xe2,0xb2,0x8f) /* ⲏ */;
+ case 0x2c90 /* Ⲑ */: BSEQ(0xe2,0xb2,0x91) /* ⲑ */;
+ case 0x2c92 /* Ⲓ */: BSEQ(0xe2,0xb2,0x93) /* ⲓ */;
+ case 0x2c94 /* Ⲕ */: BSEQ(0xe2,0xb2,0x95) /* ⲕ */;
+ case 0x2c96 /* Ⲗ */: BSEQ(0xe2,0xb2,0x97) /* ⲗ */;
+ case 0x2c98 /* Ⲙ */: BSEQ(0xe2,0xb2,0x99) /* ⲙ */;
+ case 0x2c9a /* Ⲛ */: BSEQ(0xe2,0xb2,0x9b) /* ⲛ */;
+ case 0x2c9c /* Ⲝ */: BSEQ(0xe2,0xb2,0x9d) /* ⲝ */;
+ case 0x2c9e /* Ⲟ */: BSEQ(0xe2,0xb2,0x9f) /* ⲟ */;
+ case 0x2ca0 /* Ⲡ */: BSEQ(0xe2,0xb2,0xa1) /* ⲡ */;
+ case 0x2ca2 /* Ⲣ */: BSEQ(0xe2,0xb2,0xa3) /* ⲣ */;
+ case 0x2ca4 /* Ⲥ */: BSEQ(0xe2,0xb2,0xa5) /* ⲥ */;
+ case 0x2ca6 /* Ⲧ */: BSEQ(0xe2,0xb2,0xa7) /* ⲧ */;
+ case 0x2ca8 /* Ⲩ */: BSEQ(0xe2,0xb2,0xa9) /* ⲩ */;
+ case 0x2caa /* Ⲫ */: BSEQ(0xe2,0xb2,0xab) /* ⲫ */;
+ case 0x2cac /* Ⲭ */: BSEQ(0xe2,0xb2,0xad) /* ⲭ */;
+ case 0x2cae /* Ⲯ */: BSEQ(0xe2,0xb2,0xaf) /* ⲯ */;
+ case 0x2cb0 /* Ⲱ */: BSEQ(0xe2,0xb2,0xb1) /* ⲱ */;
+ case 0x2cb2 /* Ⲳ */: BSEQ(0xe2,0xb2,0xb3) /* ⲳ */;
+ case 0x2cb4 /* Ⲵ */: BSEQ(0xe2,0xb2,0xb5) /* ⲵ */;
+ case 0x2cb6 /* Ⲷ */: BSEQ(0xe2,0xb2,0xb7) /* ⲷ */;
+ case 0x2cb8 /* Ⲹ */: BSEQ(0xe2,0xb2,0xb9) /* ⲹ */;
+ case 0x2cba /* Ⲻ */: BSEQ(0xe2,0xb2,0xbb) /* ⲻ */;
+ case 0x2cbc /* Ⲽ */: BSEQ(0xe2,0xb2,0xbd) /* ⲽ */;
+ case 0x2cbe /* Ⲿ */: BSEQ(0xe2,0xb2,0xbf) /* ⲿ */;
+ case 0x2cc0 /* Ⳁ */: BSEQ(0xe2,0xb3,0x81) /* ⳁ */;
+ case 0x2cc2 /* Ⳃ */: BSEQ(0xe2,0xb3,0x83) /* ⳃ */;
+ case 0x2cc4 /* Ⳅ */: BSEQ(0xe2,0xb3,0x85) /* ⳅ */;
+ case 0x2cc6 /* Ⳇ */: BSEQ(0xe2,0xb3,0x87) /* ⳇ */;
+ case 0x2cc8 /* Ⳉ */: BSEQ(0xe2,0xb3,0x89) /* ⳉ */;
+ case 0x2cca /* Ⳋ */: BSEQ(0xe2,0xb3,0x8b) /* ⳋ */;
+ case 0x2ccc /* Ⳍ */: BSEQ(0xe2,0xb3,0x8d) /* ⳍ */;
+ case 0x2cce /* Ⳏ */: BSEQ(0xe2,0xb3,0x8f) /* ⳏ */;
+ case 0x2cd0 /* Ⳑ */: BSEQ(0xe2,0xb3,0x91) /* ⳑ */;
+ case 0x2cd2 /* Ⳓ */: BSEQ(0xe2,0xb3,0x93) /* ⳓ */;
+ case 0x2cd4 /* Ⳕ */: BSEQ(0xe2,0xb3,0x95) /* ⳕ */;
+ case 0x2cd6 /* Ⳗ */: BSEQ(0xe2,0xb3,0x97) /* ⳗ */;
+ case 0x2cd8 /* Ⳙ */: BSEQ(0xe2,0xb3,0x99) /* ⳙ */;
+ case 0x2cda /* Ⳛ */: BSEQ(0xe2,0xb3,0x9b) /* ⳛ */;
+ case 0x2cdc /* Ⳝ */: BSEQ(0xe2,0xb3,0x9d) /* ⳝ */;
+ case 0x2cde /* Ⳟ */: BSEQ(0xe2,0xb3,0x9f) /* ⳟ */;
+ case 0x2ce0 /* Ⳡ */: BSEQ(0xe2,0xb3,0xa1) /* ⳡ */;
+ case 0x2ce2 /* Ⳣ */: BSEQ(0xe2,0xb3,0xa3) /* ⳣ */;
+ case 0x2ceb /* Ⳬ */: BSEQ(0xe2,0xb3,0xac) /* ⳬ */;
+ case 0x2ced /* Ⳮ */: BSEQ(0xe2,0xb3,0xae) /* ⳮ */;
+ case 0x2cf2 /* Ⳳ */: BSEQ(0xe2,0xb3,0xb3) /* ⳳ */;
+ case 0xa640 /* Ꙁ */: BSEQ(0xea,0x99,0x81) /* ꙁ */;
+ case 0xa642 /* Ꙃ */: BSEQ(0xea,0x99,0x83) /* ꙃ */;
+ case 0xa644 /* Ꙅ */: BSEQ(0xea,0x99,0x85) /* ꙅ */;
+ case 0xa646 /* Ꙇ */: BSEQ(0xea,0x99,0x87) /* ꙇ */;
+ case 0xa648 /* Ꙉ */: BSEQ(0xea,0x99,0x89) /* ꙉ */;
+ case 0xa64a /* Ꙋ */: BSEQ(0xea,0x99,0x8b) /* ꙋ */;
+ case 0xa64c /* Ꙍ */: BSEQ(0xea,0x99,0x8d) /* ꙍ */;
+ case 0xa64e /* Ꙏ */: BSEQ(0xea,0x99,0x8f) /* ꙏ */;
+ case 0xa650 /* Ꙑ */: BSEQ(0xea,0x99,0x91) /* ꙑ */;
+ case 0xa652 /* Ꙓ */: BSEQ(0xea,0x99,0x93) /* ꙓ */;
+ case 0xa654 /* Ꙕ */: BSEQ(0xea,0x99,0x95) /* ꙕ */;
+ case 0xa656 /* Ꙗ */: BSEQ(0xea,0x99,0x97) /* ꙗ */;
+ case 0xa658 /* Ꙙ */: BSEQ(0xea,0x99,0x99) /* ꙙ */;
+ case 0xa65a /* Ꙛ */: BSEQ(0xea,0x99,0x9b) /* ꙛ */;
+ case 0xa65c /* Ꙝ */: BSEQ(0xea,0x99,0x9d) /* ꙝ */;
+ case 0xa65e /* Ꙟ */: BSEQ(0xea,0x99,0x9f) /* ꙟ */;
+ case 0xa660 /* Ꙡ */: BSEQ(0xea,0x99,0xa1) /* ꙡ */;
+ case 0xa662 /* Ꙣ */: BSEQ(0xea,0x99,0xa3) /* ꙣ */;
+ case 0xa664 /* Ꙥ */: BSEQ(0xea,0x99,0xa5) /* ꙥ */;
+ case 0xa666 /* Ꙧ */: BSEQ(0xea,0x99,0xa7) /* ꙧ */;
+ case 0xa668 /* Ꙩ */: BSEQ(0xea,0x99,0xa9) /* ꙩ */;
+ case 0xa66a /* Ꙫ */: BSEQ(0xea,0x99,0xab) /* ꙫ */;
+ case 0xa66c /* Ꙭ */: BSEQ(0xea,0x99,0xad) /* ꙭ */;
+ case 0xa680 /* Ꚁ */: BSEQ(0xea,0x9a,0x81) /* ꚁ */;
+ case 0xa682 /* Ꚃ */: BSEQ(0xea,0x9a,0x83) /* ꚃ */;
+ case 0xa684 /* Ꚅ */: BSEQ(0xea,0x9a,0x85) /* ꚅ */;
+ case 0xa686 /* Ꚇ */: BSEQ(0xea,0x9a,0x87) /* ꚇ */;
+ case 0xa688 /* Ꚉ */: BSEQ(0xea,0x9a,0x89) /* ꚉ */;
+ case 0xa68a /* Ꚋ */: BSEQ(0xea,0x9a,0x8b) /* ꚋ */;
+ case 0xa68c /* Ꚍ */: BSEQ(0xea,0x9a,0x8d) /* ꚍ */;
+ case 0xa68e /* Ꚏ */: BSEQ(0xea,0x9a,0x8f) /* ꚏ */;
+ case 0xa690 /* Ꚑ */: BSEQ(0xea,0x9a,0x91) /* ꚑ */;
+ case 0xa692 /* Ꚓ */: BSEQ(0xea,0x9a,0x93) /* ꚓ */;
+ case 0xa694 /* Ꚕ */: BSEQ(0xea,0x9a,0x95) /* ꚕ */;
+ case 0xa696 /* Ꚗ */: BSEQ(0xea,0x9a,0x97) /* ꚗ */;
+ case 0xa698 /* Ꚙ */: BSEQ(0xea,0x9a,0x99) /* ꚙ */;
+ case 0xa69a /* Ꚛ */: BSEQ(0xea,0x9a,0x9b) /* ꚛ */;
+ case 0xa722 /* Ꜣ */: BSEQ(0xea,0x9c,0xa3) /* ꜣ */;
+ case 0xa724 /* Ꜥ */: BSEQ(0xea,0x9c,0xa5) /* ꜥ */;
+ case 0xa726 /* Ꜧ */: BSEQ(0xea,0x9c,0xa7) /* ꜧ */;
+ case 0xa728 /* Ꜩ */: BSEQ(0xea,0x9c,0xa9) /* ꜩ */;
+ case 0xa72a /* Ꜫ */: BSEQ(0xea,0x9c,0xab) /* ꜫ */;
+ case 0xa72c /* Ꜭ */: BSEQ(0xea,0x9c,0xad) /* ꜭ */;
+ case 0xa72e /* Ꜯ */: BSEQ(0xea,0x9c,0xaf) /* ꜯ */;
+ case 0xa732 /* Ꜳ */: BSEQ(0xea,0x9c,0xb3) /* ꜳ */;
+ case 0xa734 /* Ꜵ */: BSEQ(0xea,0x9c,0xb5) /* ꜵ */;
+ case 0xa736 /* Ꜷ */: BSEQ(0xea,0x9c,0xb7) /* ꜷ */;
+ case 0xa738 /* Ꜹ */: BSEQ(0xea,0x9c,0xb9) /* ꜹ */;
+ case 0xa73a /* Ꜻ */: BSEQ(0xea,0x9c,0xbb) /* ꜻ */;
+ case 0xa73c /* Ꜽ */: BSEQ(0xea,0x9c,0xbd) /* ꜽ */;
+ case 0xa73e /* Ꜿ */: BSEQ(0xea,0x9c,0xbf) /* ꜿ */;
+ case 0xa740 /* Ꝁ */: BSEQ(0xea,0x9d,0x81) /* ꝁ */;
+ case 0xa742 /* Ꝃ */: BSEQ(0xea,0x9d,0x83) /* ꝃ */;
+ case 0xa744 /* Ꝅ */: BSEQ(0xea,0x9d,0x85) /* ꝅ */;
+ case 0xa746 /* Ꝇ */: BSEQ(0xea,0x9d,0x87) /* ꝇ */;
+ case 0xa748 /* Ꝉ */: BSEQ(0xea,0x9d,0x89) /* ꝉ */;
+ case 0xa74a /* Ꝋ */: BSEQ(0xea,0x9d,0x8b) /* ꝋ */;
+ case 0xa74c /* Ꝍ */: BSEQ(0xea,0x9d,0x8d) /* ꝍ */;
+ case 0xa74e /* Ꝏ */: BSEQ(0xea,0x9d,0x8f) /* ꝏ */;
+ case 0xa750 /* Ꝑ */: BSEQ(0xea,0x9d,0x91) /* ꝑ */;
+ case 0xa752 /* Ꝓ */: BSEQ(0xea,0x9d,0x93) /* ꝓ */;
+ case 0xa754 /* Ꝕ */: BSEQ(0xea,0x9d,0x95) /* ꝕ */;
+ case 0xa756 /* Ꝗ */: BSEQ(0xea,0x9d,0x97) /* ꝗ */;
+ case 0xa758 /* Ꝙ */: BSEQ(0xea,0x9d,0x99) /* ꝙ */;
+ case 0xa75a /* Ꝛ */: BSEQ(0xea,0x9d,0x9b) /* ꝛ */;
+ case 0xa75c /* Ꝝ */: BSEQ(0xea,0x9d,0x9d) /* ꝝ */;
+ case 0xa75e /* Ꝟ */: BSEQ(0xea,0x9d,0x9f) /* ꝟ */;
+ case 0xa760 /* Ꝡ */: BSEQ(0xea,0x9d,0xa1) /* ꝡ */;
+ case 0xa762 /* Ꝣ */: BSEQ(0xea,0x9d,0xa3) /* ꝣ */;
+ case 0xa764 /* Ꝥ */: BSEQ(0xea,0x9d,0xa5) /* ꝥ */;
+ case 0xa766 /* Ꝧ */: BSEQ(0xea,0x9d,0xa7) /* ꝧ */;
+ case 0xa768 /* Ꝩ */: BSEQ(0xea,0x9d,0xa9) /* ꝩ */;
+ case 0xa76a /* Ꝫ */: BSEQ(0xea,0x9d,0xab) /* ꝫ */;
+ case 0xa76c /* Ꝭ */: BSEQ(0xea,0x9d,0xad) /* ꝭ */;
+ case 0xa76e /* Ꝯ */: BSEQ(0xea,0x9d,0xaf) /* ꝯ */;
+ case 0xa779 /* Ꝺ */: BSEQ(0xea,0x9d,0xba) /* ꝺ */;
+ case 0xa77b /* Ꝼ */: BSEQ(0xea,0x9d,0xbc) /* ꝼ */;
+ case 0xa77d /* Ᵹ */: BSEQ(0xe1,0xb5,0xb9) /* ᵹ */;
+ case 0xa77e /* Ꝿ */: BSEQ(0xea,0x9d,0xbf) /* ꝿ */;
+ case 0xa780 /* Ꞁ */: BSEQ(0xea,0x9e,0x81) /* ꞁ */;
+ case 0xa782 /* Ꞃ */: BSEQ(0xea,0x9e,0x83) /* ꞃ */;
+ case 0xa784 /* Ꞅ */: BSEQ(0xea,0x9e,0x85) /* ꞅ */;
+ case 0xa786 /* Ꞇ */: BSEQ(0xea,0x9e,0x87) /* ꞇ */;
+ case 0xa78b /* Ꞌ */: BSEQ(0xea,0x9e,0x8c) /* ꞌ */;
+ case 0xa78d /* Ɥ */: BSEQ(0xc9,0xa5) /* ɥ */;
+ case 0xa790 /* Ꞑ */: BSEQ(0xea,0x9e,0x91) /* ꞑ */;
+ case 0xa792 /* Ꞓ */: BSEQ(0xea,0x9e,0x93) /* ꞓ */;
+ case 0xa796 /* Ꞗ */: BSEQ(0xea,0x9e,0x97) /* ꞗ */;
+ case 0xa798 /* Ꞙ */: BSEQ(0xea,0x9e,0x99) /* ꞙ */;
+ case 0xa79a /* Ꞛ */: BSEQ(0xea,0x9e,0x9b) /* ꞛ */;
+ case 0xa79c /* Ꞝ */: BSEQ(0xea,0x9e,0x9d) /* ꞝ */;
+ case 0xa79e /* Ꞟ */: BSEQ(0xea,0x9e,0x9f) /* ꞟ */;
+ case 0xa7a0 /* Ꞡ */: BSEQ(0xea,0x9e,0xa1) /* ꞡ */;
+ case 0xa7a2 /* Ꞣ */: BSEQ(0xea,0x9e,0xa3) /* ꞣ */;
+ case 0xa7a4 /* Ꞥ */: BSEQ(0xea,0x9e,0xa5) /* ꞥ */;
+ case 0xa7a6 /* Ꞧ */: BSEQ(0xea,0x9e,0xa7) /* ꞧ */;
+ case 0xa7a8 /* Ꞩ */: BSEQ(0xea,0x9e,0xa9) /* ꞩ */;
+ case 0xa7aa /* Ɦ */: BSEQ(0xc9,0xa6) /* ɦ */;
+ case 0xa7ab /* Ɜ */: BSEQ(0xc9,0x9c) /* ɜ */;
+ case 0xa7ac /* Ɡ */: BSEQ(0xc9,0xa1) /* ɡ */;
+ case 0xa7ad /* Ɬ */: BSEQ(0xc9,0xac) /* ɬ */;
+ case 0xa7ae /* Ɪ */: BSEQ(0xc9,0xaa) /* ɪ */;
+ case 0xa7b0 /* Ʞ */: BSEQ(0xca,0x9e) /* ʞ */;
+ case 0xa7b1 /* Ʇ */: BSEQ(0xca,0x87) /* ʇ */;
+ case 0xa7b2 /* Ʝ */: BSEQ(0xca,0x9d) /* ʝ */;
+ case 0xa7b3 /* Ꭓ */: BSEQ(0xea,0xad,0x93) /* ꭓ */;
+ case 0xa7b4 /* Ꞵ */: BSEQ(0xea,0x9e,0xb5) /* ꞵ */;
+ case 0xa7b6 /* Ꞷ */: BSEQ(0xea,0x9e,0xb7) /* ꞷ */;
+ case 0xa7b8 /* Ꞹ */: BSEQ(0xea,0x9e,0xb9) /* ꞹ */;
+ case 0xa7ba /* Ꞻ */: BSEQ(0xea,0x9e,0xbb) /* ꞻ */;
+ case 0xa7bc /* Ꞽ */: BSEQ(0xea,0x9e,0xbd) /* ꞽ */;
+ case 0xa7be /* Ꞿ */: BSEQ(0xea,0x9e,0xbf) /* ꞿ */;
+ case 0xa7c2 /* Ꟃ */: BSEQ(0xea,0x9f,0x83) /* ꟃ */;
+ case 0xa7c4 /* Ꞔ */: BSEQ(0xea,0x9e,0x94) /* ꞔ */;
+ case 0xa7c5 /* Ʂ */: BSEQ(0xca,0x82) /* ʂ */;
+ case 0xa7c6 /* Ᶎ */: BSEQ(0xe1,0xb6,0x8e) /* ᶎ */;
+ case 0xa7c7 /* Ꟈ */: BSEQ(0xea,0x9f,0x88) /* ꟈ */;
+ case 0xa7c9 /* Ꟊ */: BSEQ(0xea,0x9f,0x8a) /* ꟊ */;
+ case 0xa7f5 /* Ꟶ */: BSEQ(0xea,0x9f,0xb6) /* ꟶ */;
+ case 0xff21 /* A */: BSEQ(0xef,0xbd,0x81) /* a */;
+ case 0xff22 /* B */: BSEQ(0xef,0xbd,0x82) /* b */;
+ case 0xff23 /* C */: BSEQ(0xef,0xbd,0x83) /* c */;
+ case 0xff24 /* D */: BSEQ(0xef,0xbd,0x84) /* d */;
+ case 0xff25 /* E */: BSEQ(0xef,0xbd,0x85) /* e */;
+ case 0xff26 /* F */: BSEQ(0xef,0xbd,0x86) /* f */;
+ case 0xff27 /* G */: BSEQ(0xef,0xbd,0x87) /* g */;
+ case 0xff28 /* H */: BSEQ(0xef,0xbd,0x88) /* h */;
+ case 0xff29 /* I */: BSEQ(0xef,0xbd,0x89) /* i */;
+ case 0xff2a /* J */: BSEQ(0xef,0xbd,0x8a) /* j */;
+ case 0xff2b /* K */: BSEQ(0xef,0xbd,0x8b) /* k */;
+ case 0xff2c /* L */: BSEQ(0xef,0xbd,0x8c) /* l */;
+ case 0xff2d /* M */: BSEQ(0xef,0xbd,0x8d) /* m */;
+ case 0xff2e /* N */: BSEQ(0xef,0xbd,0x8e) /* n */;
+ case 0xff2f /* O */: BSEQ(0xef,0xbd,0x8f) /* o */;
+ case 0xff30 /* P */: BSEQ(0xef,0xbd,0x90) /* p */;
+ case 0xff31 /* Q */: BSEQ(0xef,0xbd,0x91) /* q */;
+ case 0xff32 /* R */: BSEQ(0xef,0xbd,0x92) /* r */;
+ case 0xff33 /* S */: BSEQ(0xef,0xbd,0x93) /* s */;
+ case 0xff34 /* T */: BSEQ(0xef,0xbd,0x94) /* t */;
+ case 0xff35 /* U */: BSEQ(0xef,0xbd,0x95) /* u */;
+ case 0xff36 /* V */: BSEQ(0xef,0xbd,0x96) /* v */;
+ case 0xff37 /* W */: BSEQ(0xef,0xbd,0x97) /* w */;
+ case 0xff38 /* X */: BSEQ(0xef,0xbd,0x98) /* x */;
+ case 0xff39 /* Y */: BSEQ(0xef,0xbd,0x99) /* y */;
+ case 0xff3a /* Z */: BSEQ(0xef,0xbd,0x9a) /* z */;
+ case 0x10400 /* 𐐀 */: BSEQ(0xf0,0x90,0x90,0xa8) /* 𐐨 */;
+ case 0x10401 /* 𐐁 */: BSEQ(0xf0,0x90,0x90,0xa9) /* 𐐩 */;
+ case 0x10402 /* 𐐂 */: BSEQ(0xf0,0x90,0x90,0xaa) /* 𐐪 */;
+ case 0x10403 /* 𐐃 */: BSEQ(0xf0,0x90,0x90,0xab) /* 𐐫 */;
+ case 0x10404 /* 𐐄 */: BSEQ(0xf0,0x90,0x90,0xac) /* 𐐬 */;
+ case 0x10405 /* 𐐅 */: BSEQ(0xf0,0x90,0x90,0xad) /* 𐐭 */;
+ case 0x10406 /* 𐐆 */: BSEQ(0xf0,0x90,0x90,0xae) /* 𐐮 */;
+ case 0x10407 /* 𐐇 */: BSEQ(0xf0,0x90,0x90,0xaf) /* 𐐯 */;
+ case 0x10408 /* 𐐈 */: BSEQ(0xf0,0x90,0x90,0xb0) /* 𐐰 */;
+ case 0x10409 /* 𐐉 */: BSEQ(0xf0,0x90,0x90,0xb1) /* 𐐱 */;
+ case 0x1040a /* 𐐊 */: BSEQ(0xf0,0x90,0x90,0xb2) /* 𐐲 */;
+ case 0x1040b /* 𐐋 */: BSEQ(0xf0,0x90,0x90,0xb3) /* 𐐳 */;
+ case 0x1040c /* 𐐌 */: BSEQ(0xf0,0x90,0x90,0xb4) /* 𐐴 */;
+ case 0x1040d /* 𐐍 */: BSEQ(0xf0,0x90,0x90,0xb5) /* 𐐵 */;
+ case 0x1040e /* 𐐎 */: BSEQ(0xf0,0x90,0x90,0xb6) /* 𐐶 */;
+ case 0x1040f /* 𐐏 */: BSEQ(0xf0,0x90,0x90,0xb7) /* 𐐷 */;
+ case 0x10410 /* 𐐐 */: BSEQ(0xf0,0x90,0x90,0xb8) /* 𐐸 */;
+ case 0x10411 /* 𐐑 */: BSEQ(0xf0,0x90,0x90,0xb9) /* 𐐹 */;
+ case 0x10412 /* 𐐒 */: BSEQ(0xf0,0x90,0x90,0xba) /* 𐐺 */;
+ case 0x10413 /* 𐐓 */: BSEQ(0xf0,0x90,0x90,0xbb) /* 𐐻 */;
+ case 0x10414 /* 𐐔 */: BSEQ(0xf0,0x90,0x90,0xbc) /* 𐐼 */;
+ case 0x10415 /* 𐐕 */: BSEQ(0xf0,0x90,0x90,0xbd) /* 𐐽 */;
+ case 0x10416 /* 𐐖 */: BSEQ(0xf0,0x90,0x90,0xbe) /* 𐐾 */;
+ case 0x10417 /* 𐐗 */: BSEQ(0xf0,0x90,0x90,0xbf) /* 𐐿 */;
+ case 0x10418 /* 𐐘 */: BSEQ(0xf0,0x90,0x91,0x80) /* 𐑀 */;
+ case 0x10419 /* 𐐙 */: BSEQ(0xf0,0x90,0x91,0x81) /* 𐑁 */;
+ case 0x1041a /* 𐐚 */: BSEQ(0xf0,0x90,0x91,0x82) /* 𐑂 */;
+ case 0x1041b /* 𐐛 */: BSEQ(0xf0,0x90,0x91,0x83) /* 𐑃 */;
+ case 0x1041c /* 𐐜 */: BSEQ(0xf0,0x90,0x91,0x84) /* 𐑄 */;
+ case 0x1041d /* 𐐝 */: BSEQ(0xf0,0x90,0x91,0x85) /* 𐑅 */;
+ case 0x1041e /* 𐐞 */: BSEQ(0xf0,0x90,0x91,0x86) /* 𐑆 */;
+ case 0x1041f /* 𐐟 */: BSEQ(0xf0,0x90,0x91,0x87) /* 𐑇 */;
+ case 0x10420 /* 𐐠 */: BSEQ(0xf0,0x90,0x91,0x88) /* 𐑈 */;
+ case 0x10421 /* 𐐡 */: BSEQ(0xf0,0x90,0x91,0x89) /* 𐑉 */;
+ case 0x10422 /* 𐐢 */: BSEQ(0xf0,0x90,0x91,0x8a) /* 𐑊 */;
+ case 0x10423 /* 𐐣 */: BSEQ(0xf0,0x90,0x91,0x8b) /* 𐑋 */;
+ case 0x10424 /* 𐐤 */: BSEQ(0xf0,0x90,0x91,0x8c) /* 𐑌 */;
+ case 0x10425 /* 𐐥 */: BSEQ(0xf0,0x90,0x91,0x8d) /* 𐑍 */;
+ case 0x10426 /* 𐐦 */: BSEQ(0xf0,0x90,0x91,0x8e) /* 𐑎 */;
+ case 0x10427 /* 𐐧 */: BSEQ(0xf0,0x90,0x91,0x8f) /* 𐑏 */;
+ case 0x104b0 /* 𐒰 */: BSEQ(0xf0,0x90,0x93,0x98) /* 𐓘 */;
+ case 0x104b1 /* 𐒱 */: BSEQ(0xf0,0x90,0x93,0x99) /* 𐓙 */;
+ case 0x104b2 /* 𐒲 */: BSEQ(0xf0,0x90,0x93,0x9a) /* 𐓚 */;
+ case 0x104b3 /* 𐒳 */: BSEQ(0xf0,0x90,0x93,0x9b) /* 𐓛 */;
+ case 0x104b4 /* 𐒴 */: BSEQ(0xf0,0x90,0x93,0x9c) /* 𐓜 */;
+ case 0x104b5 /* 𐒵 */: BSEQ(0xf0,0x90,0x93,0x9d) /* 𐓝 */;
+ case 0x104b6 /* 𐒶 */: BSEQ(0xf0,0x90,0x93,0x9e) /* 𐓞 */;
+ case 0x104b7 /* 𐒷 */: BSEQ(0xf0,0x90,0x93,0x9f) /* 𐓟 */;
+ case 0x104b8 /* 𐒸 */: BSEQ(0xf0,0x90,0x93,0xa0) /* 𐓠 */;
+ case 0x104b9 /* 𐒹 */: BSEQ(0xf0,0x90,0x93,0xa1) /* 𐓡 */;
+ case 0x104ba /* 𐒺 */: BSEQ(0xf0,0x90,0x93,0xa2) /* 𐓢 */;
+ case 0x104bb /* 𐒻 */: BSEQ(0xf0,0x90,0x93,0xa3) /* 𐓣 */;
+ case 0x104bc /* 𐒼 */: BSEQ(0xf0,0x90,0x93,0xa4) /* 𐓤 */;
+ case 0x104bd /* 𐒽 */: BSEQ(0xf0,0x90,0x93,0xa5) /* 𐓥 */;
+ case 0x104be /* 𐒾 */: BSEQ(0xf0,0x90,0x93,0xa6) /* 𐓦 */;
+ case 0x104bf /* 𐒿 */: BSEQ(0xf0,0x90,0x93,0xa7) /* 𐓧 */;
+ case 0x104c0 /* 𐓀 */: BSEQ(0xf0,0x90,0x93,0xa8) /* 𐓨 */;
+ case 0x104c1 /* 𐓁 */: BSEQ(0xf0,0x90,0x93,0xa9) /* 𐓩 */;
+ case 0x104c2 /* 𐓂 */: BSEQ(0xf0,0x90,0x93,0xaa) /* 𐓪 */;
+ case 0x104c3 /* 𐓃 */: BSEQ(0xf0,0x90,0x93,0xab) /* 𐓫 */;
+ case 0x104c4 /* 𐓄 */: BSEQ(0xf0,0x90,0x93,0xac) /* 𐓬 */;
+ case 0x104c5 /* 𐓅 */: BSEQ(0xf0,0x90,0x93,0xad) /* 𐓭 */;
+ case 0x104c6 /* 𐓆 */: BSEQ(0xf0,0x90,0x93,0xae) /* 𐓮 */;
+ case 0x104c7 /* 𐓇 */: BSEQ(0xf0,0x90,0x93,0xaf) /* 𐓯 */;
+ case 0x104c8 /* 𐓈 */: BSEQ(0xf0,0x90,0x93,0xb0) /* 𐓰 */;
+ case 0x104c9 /* 𐓉 */: BSEQ(0xf0,0x90,0x93,0xb1) /* 𐓱 */;
+ case 0x104ca /* 𐓊 */: BSEQ(0xf0,0x90,0x93,0xb2) /* 𐓲 */;
+ case 0x104cb /* 𐓋 */: BSEQ(0xf0,0x90,0x93,0xb3) /* 𐓳 */;
+ case 0x104cc /* 𐓌 */: BSEQ(0xf0,0x90,0x93,0xb4) /* 𐓴 */;
+ case 0x104cd /* 𐓍 */: BSEQ(0xf0,0x90,0x93,0xb5) /* 𐓵 */;
+ case 0x104ce /* 𐓎 */: BSEQ(0xf0,0x90,0x93,0xb6) /* 𐓶 */;
+ case 0x104cf /* 𐓏 */: BSEQ(0xf0,0x90,0x93,0xb7) /* 𐓷 */;
+ case 0x104d0 /* 𐓐 */: BSEQ(0xf0,0x90,0x93,0xb8) /* 𐓸 */;
+ case 0x104d1 /* 𐓑 */: BSEQ(0xf0,0x90,0x93,0xb9) /* 𐓹 */;
+ case 0x104d2 /* 𐓒 */: BSEQ(0xf0,0x90,0x93,0xba) /* 𐓺 */;
+ case 0x104d3 /* 𐓓 */: BSEQ(0xf0,0x90,0x93,0xbb) /* 𐓻 */;
+ case 0x10c80 /* 𐲀 */: BSEQ(0xf0,0x90,0xb3,0x80) /* 𐳀 */;
+ case 0x10c81 /* 𐲁 */: BSEQ(0xf0,0x90,0xb3,0x81) /* 𐳁 */;
+ case 0x10c82 /* 𐲂 */: BSEQ(0xf0,0x90,0xb3,0x82) /* 𐳂 */;
+ case 0x10c83 /* 𐲃 */: BSEQ(0xf0,0x90,0xb3,0x83) /* 𐳃 */;
+ case 0x10c84 /* 𐲄 */: BSEQ(0xf0,0x90,0xb3,0x84) /* 𐳄 */;
+ case 0x10c85 /* 𐲅 */: BSEQ(0xf0,0x90,0xb3,0x85) /* 𐳅 */;
+ case 0x10c86 /* 𐲆 */: BSEQ(0xf0,0x90,0xb3,0x86) /* 𐳆 */;
+ case 0x10c87 /* 𐲇 */: BSEQ(0xf0,0x90,0xb3,0x87) /* 𐳇 */;
+ case 0x10c88 /* 𐲈 */: BSEQ(0xf0,0x90,0xb3,0x88) /* 𐳈 */;
+ case 0x10c89 /* 𐲉 */: BSEQ(0xf0,0x90,0xb3,0x89) /* 𐳉 */;
+ case 0x10c8a /* 𐲊 */: BSEQ(0xf0,0x90,0xb3,0x8a) /* 𐳊 */;
+ case 0x10c8b /* 𐲋 */: BSEQ(0xf0,0x90,0xb3,0x8b) /* 𐳋 */;
+ case 0x10c8c /* 𐲌 */: BSEQ(0xf0,0x90,0xb3,0x8c) /* 𐳌 */;
+ case 0x10c8d /* 𐲍 */: BSEQ(0xf0,0x90,0xb3,0x8d) /* 𐳍 */;
+ case 0x10c8e /* 𐲎 */: BSEQ(0xf0,0x90,0xb3,0x8e) /* 𐳎 */;
+ case 0x10c8f /* 𐲏 */: BSEQ(0xf0,0x90,0xb3,0x8f) /* 𐳏 */;
+ case 0x10c90 /* 𐲐 */: BSEQ(0xf0,0x90,0xb3,0x90) /* 𐳐 */;
+ case 0x10c91 /* 𐲑 */: BSEQ(0xf0,0x90,0xb3,0x91) /* 𐳑 */;
+ case 0x10c92 /* 𐲒 */: BSEQ(0xf0,0x90,0xb3,0x92) /* 𐳒 */;
+ case 0x10c93 /* 𐲓 */: BSEQ(0xf0,0x90,0xb3,0x93) /* 𐳓 */;
+ case 0x10c94 /* 𐲔 */: BSEQ(0xf0,0x90,0xb3,0x94) /* 𐳔 */;
+ case 0x10c95 /* 𐲕 */: BSEQ(0xf0,0x90,0xb3,0x95) /* 𐳕 */;
+ case 0x10c96 /* 𐲖 */: BSEQ(0xf0,0x90,0xb3,0x96) /* 𐳖 */;
+ case 0x10c97 /* 𐲗 */: BSEQ(0xf0,0x90,0xb3,0x97) /* 𐳗 */;
+ case 0x10c98 /* 𐲘 */: BSEQ(0xf0,0x90,0xb3,0x98) /* 𐳘 */;
+ case 0x10c99 /* 𐲙 */: BSEQ(0xf0,0x90,0xb3,0x99) /* 𐳙 */;
+ case 0x10c9a /* 𐲚 */: BSEQ(0xf0,0x90,0xb3,0x9a) /* 𐳚 */;
+ case 0x10c9b /* 𐲛 */: BSEQ(0xf0,0x90,0xb3,0x9b) /* 𐳛 */;
+ case 0x10c9c /* 𐲜 */: BSEQ(0xf0,0x90,0xb3,0x9c) /* 𐳜 */;
+ case 0x10c9d /* 𐲝 */: BSEQ(0xf0,0x90,0xb3,0x9d) /* 𐳝 */;
+ case 0x10c9e /* 𐲞 */: BSEQ(0xf0,0x90,0xb3,0x9e) /* 𐳞 */;
+ case 0x10c9f /* 𐲟 */: BSEQ(0xf0,0x90,0xb3,0x9f) /* 𐳟 */;
+ case 0x10ca0 /* 𐲠 */: BSEQ(0xf0,0x90,0xb3,0xa0) /* 𐳠 */;
+ case 0x10ca1 /* 𐲡 */: BSEQ(0xf0,0x90,0xb3,0xa1) /* 𐳡 */;
+ case 0x10ca2 /* 𐲢 */: BSEQ(0xf0,0x90,0xb3,0xa2) /* 𐳢 */;
+ case 0x10ca3 /* 𐲣 */: BSEQ(0xf0,0x90,0xb3,0xa3) /* 𐳣 */;
+ case 0x10ca4 /* 𐲤 */: BSEQ(0xf0,0x90,0xb3,0xa4) /* 𐳤 */;
+ case 0x10ca5 /* 𐲥 */: BSEQ(0xf0,0x90,0xb3,0xa5) /* 𐳥 */;
+ case 0x10ca6 /* 𐲦 */: BSEQ(0xf0,0x90,0xb3,0xa6) /* 𐳦 */;
+ case 0x10ca7 /* 𐲧 */: BSEQ(0xf0,0x90,0xb3,0xa7) /* 𐳧 */;
+ case 0x10ca8 /* 𐲨 */: BSEQ(0xf0,0x90,0xb3,0xa8) /* 𐳨 */;
+ case 0x10ca9 /* 𐲩 */: BSEQ(0xf0,0x90,0xb3,0xa9) /* 𐳩 */;
+ case 0x10caa /* 𐲪 */: BSEQ(0xf0,0x90,0xb3,0xaa) /* 𐳪 */;
+ case 0x10cab /* 𐲫 */: BSEQ(0xf0,0x90,0xb3,0xab) /* 𐳫 */;
+ case 0x10cac /* 𐲬 */: BSEQ(0xf0,0x90,0xb3,0xac) /* 𐳬 */;
+ case 0x10cad /* 𐲭 */: BSEQ(0xf0,0x90,0xb3,0xad) /* 𐳭 */;
+ case 0x10cae /* 𐲮 */: BSEQ(0xf0,0x90,0xb3,0xae) /* 𐳮 */;
+ case 0x10caf /* 𐲯 */: BSEQ(0xf0,0x90,0xb3,0xaf) /* 𐳯 */;
+ case 0x10cb0 /* 𐲰 */: BSEQ(0xf0,0x90,0xb3,0xb0) /* 𐳰 */;
+ case 0x10cb1 /* 𐲱 */: BSEQ(0xf0,0x90,0xb3,0xb1) /* 𐳱 */;
+ case 0x10cb2 /* 𐲲 */: BSEQ(0xf0,0x90,0xb3,0xb2) /* 𐳲 */;
+ case 0x118a0 /* 𑢠 */: BSEQ(0xf0,0x91,0xa3,0x80) /* 𑣀 */;
+ case 0x118a1 /* 𑢡 */: BSEQ(0xf0,0x91,0xa3,0x81) /* 𑣁 */;
+ case 0x118a2 /* 𑢢 */: BSEQ(0xf0,0x91,0xa3,0x82) /* 𑣂 */;
+ case 0x118a3 /* 𑢣 */: BSEQ(0xf0,0x91,0xa3,0x83) /* 𑣃 */;
+ case 0x118a4 /* 𑢤 */: BSEQ(0xf0,0x91,0xa3,0x84) /* 𑣄 */;
+ case 0x118a5 /* 𑢥 */: BSEQ(0xf0,0x91,0xa3,0x85) /* 𑣅 */;
+ case 0x118a6 /* 𑢦 */: BSEQ(0xf0,0x91,0xa3,0x86) /* 𑣆 */;
+ case 0x118a7 /* 𑢧 */: BSEQ(0xf0,0x91,0xa3,0x87) /* 𑣇 */;
+ case 0x118a8 /* 𑢨 */: BSEQ(0xf0,0x91,0xa3,0x88) /* 𑣈 */;
+ case 0x118a9 /* 𑢩 */: BSEQ(0xf0,0x91,0xa3,0x89) /* 𑣉 */;
+ case 0x118aa /* 𑢪 */: BSEQ(0xf0,0x91,0xa3,0x8a) /* 𑣊 */;
+ case 0x118ab /* 𑢫 */: BSEQ(0xf0,0x91,0xa3,0x8b) /* 𑣋 */;
+ case 0x118ac /* 𑢬 */: BSEQ(0xf0,0x91,0xa3,0x8c) /* 𑣌 */;
+ case 0x118ad /* 𑢭 */: BSEQ(0xf0,0x91,0xa3,0x8d) /* 𑣍 */;
+ case 0x118ae /* 𑢮 */: BSEQ(0xf0,0x91,0xa3,0x8e) /* 𑣎 */;
+ case 0x118af /* 𑢯 */: BSEQ(0xf0,0x91,0xa3,0x8f) /* 𑣏 */;
+ case 0x118b0 /* 𑢰 */: BSEQ(0xf0,0x91,0xa3,0x90) /* 𑣐 */;
+ case 0x118b1 /* 𑢱 */: BSEQ(0xf0,0x91,0xa3,0x91) /* 𑣑 */;
+ case 0x118b2 /* 𑢲 */: BSEQ(0xf0,0x91,0xa3,0x92) /* 𑣒 */;
+ case 0x118b3 /* 𑢳 */: BSEQ(0xf0,0x91,0xa3,0x93) /* 𑣓 */;
+ case 0x118b4 /* 𑢴 */: BSEQ(0xf0,0x91,0xa3,0x94) /* 𑣔 */;
+ case 0x118b5 /* 𑢵 */: BSEQ(0xf0,0x91,0xa3,0x95) /* 𑣕 */;
+ case 0x118b6 /* 𑢶 */: BSEQ(0xf0,0x91,0xa3,0x96) /* 𑣖 */;
+ case 0x118b7 /* 𑢷 */: BSEQ(0xf0,0x91,0xa3,0x97) /* 𑣗 */;
+ case 0x118b8 /* 𑢸 */: BSEQ(0xf0,0x91,0xa3,0x98) /* 𑣘 */;
+ case 0x118b9 /* 𑢹 */: BSEQ(0xf0,0x91,0xa3,0x99) /* 𑣙 */;
+ case 0x118ba /* 𑢺 */: BSEQ(0xf0,0x91,0xa3,0x9a) /* 𑣚 */;
+ case 0x118bb /* 𑢻 */: BSEQ(0xf0,0x91,0xa3,0x9b) /* 𑣛 */;
+ case 0x118bc /* 𑢼 */: BSEQ(0xf0,0x91,0xa3,0x9c) /* 𑣜 */;
+ case 0x118bd /* 𑢽 */: BSEQ(0xf0,0x91,0xa3,0x9d) /* 𑣝 */;
+ case 0x118be /* 𑢾 */: BSEQ(0xf0,0x91,0xa3,0x9e) /* 𑣞 */;
+ case 0x118bf /* 𑢿 */: BSEQ(0xf0,0x91,0xa3,0x9f) /* 𑣟 */;
+ case 0x16e40 /* 𖹀 */: BSEQ(0xf0,0x96,0xb9,0xa0) /* 𖹠 */;
+ case 0x16e41 /* 𖹁 */: BSEQ(0xf0,0x96,0xb9,0xa1) /* 𖹡 */;
+ case 0x16e42 /* 𖹂 */: BSEQ(0xf0,0x96,0xb9,0xa2) /* 𖹢 */;
+ case 0x16e43 /* 𖹃 */: BSEQ(0xf0,0x96,0xb9,0xa3) /* 𖹣 */;
+ case 0x16e44 /* 𖹄 */: BSEQ(0xf0,0x96,0xb9,0xa4) /* 𖹤 */;
+ case 0x16e45 /* 𖹅 */: BSEQ(0xf0,0x96,0xb9,0xa5) /* 𖹥 */;
+ case 0x16e46 /* 𖹆 */: BSEQ(0xf0,0x96,0xb9,0xa6) /* 𖹦 */;
+ case 0x16e47 /* 𖹇 */: BSEQ(0xf0,0x96,0xb9,0xa7) /* 𖹧 */;
+ case 0x16e48 /* 𖹈 */: BSEQ(0xf0,0x96,0xb9,0xa8) /* 𖹨 */;
+ case 0x16e49 /* 𖹉 */: BSEQ(0xf0,0x96,0xb9,0xa9) /* 𖹩 */;
+ case 0x16e4a /* 𖹊 */: BSEQ(0xf0,0x96,0xb9,0xaa) /* 𖹪 */;
+ case 0x16e4b /* 𖹋 */: BSEQ(0xf0,0x96,0xb9,0xab) /* 𖹫 */;
+ case 0x16e4c /* 𖹌 */: BSEQ(0xf0,0x96,0xb9,0xac) /* 𖹬 */;
+ case 0x16e4d /* 𖹍 */: BSEQ(0xf0,0x96,0xb9,0xad) /* 𖹭 */;
+ case 0x16e4e /* 𖹎 */: BSEQ(0xf0,0x96,0xb9,0xae) /* 𖹮 */;
+ case 0x16e4f /* 𖹏 */: BSEQ(0xf0,0x96,0xb9,0xaf) /* 𖹯 */;
+ case 0x16e50 /* 𖹐 */: BSEQ(0xf0,0x96,0xb9,0xb0) /* 𖹰 */;
+ case 0x16e51 /* 𖹑 */: BSEQ(0xf0,0x96,0xb9,0xb1) /* 𖹱 */;
+ case 0x16e52 /* 𖹒 */: BSEQ(0xf0,0x96,0xb9,0xb2) /* 𖹲 */;
+ case 0x16e53 /* 𖹓 */: BSEQ(0xf0,0x96,0xb9,0xb3) /* 𖹳 */;
+ case 0x16e54 /* 𖹔 */: BSEQ(0xf0,0x96,0xb9,0xb4) /* 𖹴 */;
+ case 0x16e55 /* 𖹕 */: BSEQ(0xf0,0x96,0xb9,0xb5) /* 𖹵 */;
+ case 0x16e56 /* 𖹖 */: BSEQ(0xf0,0x96,0xb9,0xb6) /* 𖹶 */;
+ case 0x16e57 /* 𖹗 */: BSEQ(0xf0,0x96,0xb9,0xb7) /* 𖹷 */;
+ case 0x16e58 /* 𖹘 */: BSEQ(0xf0,0x96,0xb9,0xb8) /* 𖹸 */;
+ case 0x16e59 /* 𖹙 */: BSEQ(0xf0,0x96,0xb9,0xb9) /* 𖹹 */;
+ case 0x16e5a /* 𖹚 */: BSEQ(0xf0,0x96,0xb9,0xba) /* 𖹺 */;
+ case 0x16e5b /* 𖹛 */: BSEQ(0xf0,0x96,0xb9,0xbb) /* 𖹻 */;
+ case 0x16e5c /* 𖹜 */: BSEQ(0xf0,0x96,0xb9,0xbc) /* 𖹼 */;
+ case 0x16e5d /* 𖹝 */: BSEQ(0xf0,0x96,0xb9,0xbd) /* 𖹽 */;
+ case 0x16e5e /* 𖹞 */: BSEQ(0xf0,0x96,0xb9,0xbe) /* 𖹾 */;
+ case 0x16e5f /* 𖹟 */: BSEQ(0xf0,0x96,0xb9,0xbf) /* 𖹿 */;
+ case 0x1e900 /* 𞤀 */: BSEQ(0xf0,0x9e,0xa4,0xa2) /* 𞤢 */;
+ case 0x1e901 /* 𞤁 */: BSEQ(0xf0,0x9e,0xa4,0xa3) /* 𞤣 */;
+ case 0x1e902 /* 𞤂 */: BSEQ(0xf0,0x9e,0xa4,0xa4) /* 𞤤 */;
+ case 0x1e903 /* 𞤃 */: BSEQ(0xf0,0x9e,0xa4,0xa5) /* 𞤥 */;
+ case 0x1e904 /* 𞤄 */: BSEQ(0xf0,0x9e,0xa4,0xa6) /* 𞤦 */;
+ case 0x1e905 /* 𞤅 */: BSEQ(0xf0,0x9e,0xa4,0xa7) /* 𞤧 */;
+ case 0x1e906 /* 𞤆 */: BSEQ(0xf0,0x9e,0xa4,0xa8) /* 𞤨 */;
+ case 0x1e907 /* 𞤇 */: BSEQ(0xf0,0x9e,0xa4,0xa9) /* 𞤩 */;
+ case 0x1e908 /* 𞤈 */: BSEQ(0xf0,0x9e,0xa4,0xaa) /* 𞤪 */;
+ case 0x1e909 /* 𞤉 */: BSEQ(0xf0,0x9e,0xa4,0xab) /* 𞤫 */;
+ case 0x1e90a /* 𞤊 */: BSEQ(0xf0,0x9e,0xa4,0xac) /* 𞤬 */;
+ case 0x1e90b /* 𞤋 */: BSEQ(0xf0,0x9e,0xa4,0xad) /* 𞤭 */;
+ case 0x1e90c /* 𞤌 */: BSEQ(0xf0,0x9e,0xa4,0xae) /* 𞤮 */;
+ case 0x1e90d /* 𞤍 */: BSEQ(0xf0,0x9e,0xa4,0xaf) /* 𞤯 */;
+ case 0x1e90e /* 𞤎 */: BSEQ(0xf0,0x9e,0xa4,0xb0) /* 𞤰 */;
+ case 0x1e90f /* 𞤏 */: BSEQ(0xf0,0x9e,0xa4,0xb1) /* 𞤱 */;
+ case 0x1e910 /* 𞤐 */: BSEQ(0xf0,0x9e,0xa4,0xb2) /* 𞤲 */;
+ case 0x1e911 /* 𞤑 */: BSEQ(0xf0,0x9e,0xa4,0xb3) /* 𞤳 */;
+ case 0x1e912 /* 𞤒 */: BSEQ(0xf0,0x9e,0xa4,0xb4) /* 𞤴 */;
+ case 0x1e913 /* 𞤓 */: BSEQ(0xf0,0x9e,0xa4,0xb5) /* 𞤵 */;
+ case 0x1e914 /* 𞤔 */: BSEQ(0xf0,0x9e,0xa4,0xb6) /* 𞤶 */;
+ case 0x1e915 /* 𞤕 */: BSEQ(0xf0,0x9e,0xa4,0xb7) /* 𞤷 */;
+ case 0x1e916 /* 𞤖 */: BSEQ(0xf0,0x9e,0xa4,0xb8) /* 𞤸 */;
+ case 0x1e917 /* 𞤗 */: BSEQ(0xf0,0x9e,0xa4,0xb9) /* 𞤹 */;
+ case 0x1e918 /* 𞤘 */: BSEQ(0xf0,0x9e,0xa4,0xba) /* 𞤺 */;
+ case 0x1e919 /* 𞤙 */: BSEQ(0xf0,0x9e,0xa4,0xbb) /* 𞤻 */;
+ case 0x1e91a /* 𞤚 */: BSEQ(0xf0,0x9e,0xa4,0xbc) /* 𞤼 */;
+ case 0x1e91b /* 𞤛 */: BSEQ(0xf0,0x9e,0xa4,0xbd) /* 𞤽 */;
+ case 0x1e91c /* 𞤜 */: BSEQ(0xf0,0x9e,0xa4,0xbe) /* 𞤾 */;
+ case 0x1e91d /* 𞤝 */: BSEQ(0xf0,0x9e,0xa4,0xbf) /* 𞤿 */;
+ case 0x1e91e /* 𞤞 */: BSEQ(0xf0,0x9e,0xa5,0x80) /* 𞥀 */;
+ case 0x1e91f /* 𞤟 */: BSEQ(0xf0,0x9e,0xa5,0x81) /* 𞥁 */;
+ case 0x1e920 /* 𞤠 */: BSEQ(0xf0,0x9e,0xa5,0x82) /* 𞥂 */;
+ case 0x1e921 /* 𞤡 */: BSEQ(0xf0,0x9e,0xa5,0x83) /* 𞥃 */;
+ default: return nullptr;
+ }
+}
+
+#endif
diff --git a/src/caseconvert.py b/src/caseconvert.py
new file mode 100644
index 0000000..ef7e403
--- /dev/null
+++ b/src/caseconvert.py
@@ -0,0 +1,59 @@
+# python3 script to generate caseconvert.h.
+# It uses difference in lower() and upper() on a character to make a mapping
+# that maps a given unicode point to either a lower or upper case UTF-8 character.
+# this also include multi-byte characters.
+
+import codecs
+
+toupper = {}
+tolower = {}
+
+def writeMapping(file,mapping):
+ for k,v in sorted(mapping.items()):
+ file.write(u" case %s /* %s */: BSEQ(%s) /* %s */;\n" %
+ (hex(ord(k[0])), k, ",".join(f"0x{b:02x}" for b in v.encode('utf-8')), v))
+
+# create mappings of characters whose upper and lower case differ
+for codeValue in range(0,0x1FFFF):
+ s = chr(codeValue)
+ sl = s.lower()
+ su = s.upper()
+ if ord(s[0])!=ord(sl[0]):
+ tolower[s]=sl
+ if ord(s[0])!=ord(su[0]):
+ toupper[s]=su
+
+file = codecs.open("caseconvert.h", "w", "utf-8")
+file.write(r'''/** This file is generated by python3 caseconvert.py. DO NOT EDIT! */
+
+#ifndef CASECONVERT_H
+#define CASECONVERT_H
+
+#include <cstdint>
+#include <string>
+
+#define BSEQ(...) { static unsigned char s[] = { __VA_ARGS__, 0x00 }; \
+ return reinterpret_cast<const char *>(s); }
+
+inline const char *convertUnicodeToUpper(uint32_t code)
+{
+ switch(code)
+ {
+''');
+writeMapping(file,toupper);
+file.write(r''' default: return nullptr;
+ }
+}
+
+inline const char *convertUnicodeToLower(uint32_t code)
+{
+ switch(code)
+ {
+''');
+writeMapping(file,tolower);
+file.write(r''' default: return nullptr;
+ }
+}
+
+#endif
+''');
diff --git a/src/cite.cpp b/src/cite.cpp
index ab090e0..79b45da 100644
--- a/src/cite.cpp
+++ b/src/cite.cpp
@@ -16,20 +16,18 @@
#include "cite.h"
#include "config.h"
-#include "ftextstream.h"
#include "language.h"
#include "message.h"
#include "portable.h"
#include "resourcemgr.h"
#include "util.h"
#include "debug.h"
-
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qdir.h>
+#include "fileinfo.h"
+#include "dir.h"
#include <map>
#include <string>
+#include <fstream>
const char *bibTmpFile = "bibTmpFile_";
const char *bibTmpDir = "bibTmpDir/";
@@ -37,13 +35,13 @@ const char *bibTmpDir = "bibTmpDir/";
class CiteInfoImpl : public CiteInfo
{
public:
- CiteInfoImpl(const char *label, const char *text=0)
+ CiteInfoImpl(const QCString &label, const QCString &text=QCString())
: m_label(label), m_text(text) { }
virtual QCString label() const { return m_label; }
virtual QCString text() const { return m_text; }
- void setText(const char *s) { m_text = s; }
+ void setText(const QCString &s) { m_text = s; }
private:
QCString m_label;
@@ -65,18 +63,18 @@ CitationManager::CitationManager() : p(new Private)
{
}
-void CitationManager::insert(const char *label)
+void CitationManager::insert(const QCString &label)
{
p->entries.insert(
std::make_pair(
- std::string(label),
+ label.str(),
std::make_unique<CiteInfoImpl>(label)
));
}
-const CiteInfo *CitationManager::find(const char *label) const
+const CiteInfo *CitationManager::find(const QCString &label) const
{
- auto it = p->entries.find(label);
+ auto it = p->entries.find(label.str());
if (it!=p->entries.end())
{
return it->second.get();
@@ -95,12 +93,12 @@ bool CitationManager::isEmpty() const
return (numFiles==0 || p->entries.empty());
}
-const char *CitationManager::fileName() const
+QCString CitationManager::fileName() const
{
return "citelist";
}
-const char *CitationManager::anchorPrefix() const
+QCString CitationManager::anchorPrefix() const
{
return "CITEREF_";
}
@@ -112,77 +110,46 @@ void CitationManager::insertCrossReferencesForBibFile(const QCString &bibFile)
{
return;
}
- QFileInfo fi(bibFile);
+ FileInfo fi(bibFile.str());
if (!fi.exists())
{
- err("bib file %s not found!\n",bibFile.data());
+ err("bib file %s not found!\n",qPrint(bibFile));
return;
}
- QFile f(bibFile);
- if (!f.open(IO_ReadOnly))
+ std::ifstream f(bibFile.str(), std::ifstream::in);
+ if (!f.is_open())
{
- err("could not open file %s for reading\n",bibFile.data());
+ err("could not open file %s for reading\n",qPrint(bibFile));
return;
}
- // convert file to string
- QCString doc;
- QCString input(fi.size()+1);
- f.readBlock(input.rawData(),fi.size());
- f.close();
- input.at(fi.size())='\0';
-
- int pos=0;
- int s;
-
- // helper lambda function to get the next line of input and update pos accordingly
- auto get_next_line = [&input,&pos,&s]()
- {
- uint prevPos = (uint)pos;
- pos=s+1;
- return input.mid(prevPos,(uint)(s-prevPos));
- };
-
- // helper lambda function to return if the end of the input has reached
- auto end_of_input = [&s]()
- {
- return s==-1;
- };
-
- // helper lambda function to proceed to the next line in the input, and update s
- // to point to the start of the line. Return true as long as there is a new line.
- auto has_next_line = [&input,&pos,&s]()
- {
- s=input.find('\n',pos);
- return s!=-1;
- };
-
// search for citation cross references
QCString citeName;
- while (has_next_line())
- {
- QCString line = get_next_line();
+ std::string lineStr;
+ while (getline(f,lineStr))
+ {
int i;
+ QCString line(lineStr);
if (line.stripWhiteSpace().startsWith("@"))
{
// assumption entry like: "@book { name," or "@book { name" (spaces optional)
int j = line.find('{');
// when no {, go hunting for it
- while (j==-1 && has_next_line())
+ while (j==-1 && getline(f,lineStr))
{
- line = get_next_line();
+ line = lineStr;
j = line.find('{');
}
// search for the name
citeName = "";
- if (!end_of_input() && j!=-1) // to prevent something like "@manual ," and no { found
+ if (!f.eof() && j!=-1) // to prevent something like "@manual ," and no { found
{
int k = line.find(',',j);
j++;
// found a line "@....{.....,...." or "@.....{....."
// ^=j ^=k ^=j k=-1
- while (!end_of_input() && citeName.isEmpty())
+ while (!f.eof() && citeName.isEmpty())
{
if (k!=-1)
{
@@ -194,14 +161,14 @@ void CitationManager::insertCrossReferencesForBibFile(const QCString &bibFile)
}
citeName = citeName.stripWhiteSpace();
j = 0;
- if (citeName.isEmpty() && has_next_line())
+ if (citeName.isEmpty() && getline(f,lineStr))
{
- line = get_next_line();
+ line = lineStr;
k = line.find(',');
}
}
}
- //printf("citeName = #%s#\n",citeName.data());
+ //printf("citeName = #%s#\n",qPrint(citeName));
}
else if ((i=line.find("crossref"))!=-1 && !citeName.isEmpty()) /* assumption cross reference is on one line and the only item */
{
@@ -212,8 +179,8 @@ void CitationManager::insertCrossReferencesForBibFile(const QCString &bibFile)
QCString crossrefName = line.mid((uint)(j+1),(uint)(k-j-1));
// check if the reference with the cross reference is used
// insert cross reference when cross reference has not yet been added.
- if ((p->entries.find(citeName.data())!=p->entries.end()) &&
- (p->entries.find(crossrefName.data())==p->entries.end())) // not found yet
+ if ((p->entries.find(citeName.str())!=p->entries.end()) &&
+ (p->entries.find(crossrefName.str())==p->entries.end())) // not found yet
{
insert(crossrefName);
}
@@ -232,7 +199,6 @@ void CitationManager::generatePage()
bool citeDebug = Debug::isFlagSet(Debug::Cite);
// 0. add cross references from the bib files to the cite dictionary
- QFile f;
const StringVector &citeDataList = Config_getList(CITE_BIB_FILES);
for (const auto &bibdata : citeDataList)
{
@@ -244,23 +210,24 @@ void CitationManager::generatePage()
// 1. generate file with markers and citations to OUTPUT_DIRECTORY
QCString outputDir = Config_getString(OUTPUT_DIRECTORY);
QCString citeListFile = outputDir+"/citelist.doc";
- f.setName(citeListFile);
- if (!f.open(IO_WriteOnly))
- {
- err("could not open file %s for writing\n",citeListFile.data());
- }
- FTextStream t(&f);
- t << "<!-- BEGIN CITATIONS -->" << endl;
- t << "<!--" << endl;
- for (const auto &it : p->entries)
{
- t << "\\citation{" << it.second->label() << "}" << endl;
+ std::ofstream t(citeListFile.str(),std::ofstream::out | std::ofstream::binary);
+ if (!t.is_open())
+ {
+ err("could not open file %s for writing\n",qPrint(citeListFile));
+ }
+ t << "<!-- BEGIN CITATIONS -->\n";
+ t << "<!--\n";
+ for (const auto &it : p->entries)
+ {
+ t << "\\citation{" << it.second->label() << "}\n";
+ }
+ t << "-->\n";
+ t << "<!-- END CITATIONS -->\n";
+ t << "<!-- BEGIN BIBLIOGRAPHY -->\n";
+ t << "<!-- END BIBLIOGRAPHY -->\n";
+ t.close();
}
- t << "-->" << endl;
- t << "<!-- END CITATIONS -->" << endl;
- t << "<!-- BEGIN BIBLIOGRAPHY -->" << endl;
- t << "<!-- END BIBLIOGRAPHY -->" << endl;
- f.close();
// 2. generate bib2xhtml
QCString bib2xhtmlFile = outputDir+"/bib2xhtml.pl";
@@ -276,10 +243,10 @@ void CitationManager::generatePage()
// Strictly not required when only latex is generated
QCString bibOutputDir = outputDir+"/"+bibTmpDir;
QCString bibOutputFiles = "";
- QDir thisDir;
- if (!thisDir.exists(bibOutputDir) && !thisDir.mkdir(bibOutputDir))
+ Dir thisDir;
+ if (!thisDir.exists(bibOutputDir.str()) && !thisDir.mkdir(bibOutputDir.str()))
{
- err("Failed to create temporary output directory '%s', skipping citations\n",bibOutputDir.data());
+ err("Failed to create temporary output directory '%s', skipping citations\n",qPrint(bibOutputDir));
return;
}
int i = 0;
@@ -287,7 +254,7 @@ void CitationManager::generatePage()
{
QCString bibFile = bibdata.c_str();
if (!bibFile.isEmpty() && bibFile.right(4)!=".bib") bibFile+=".bib";
- QFileInfo fi(bibFile);
+ FileInfo fi(bibFile.str());
if (fi.exists())
{
if (!bibFile.isEmpty())
@@ -299,73 +266,69 @@ void CitationManager::generatePage()
}
}
- QString oldDir = QDir::currentDirPath();
- QDir::setCurrent(outputDir);
+ std::string oldDir = Dir::currentDirPath();
+ Dir::setCurrent(outputDir.str());
// 5. run bib2xhtml perl script on the generated file which will insert the
// bibliography in citelist.doc
int exitCode;
Portable::sysTimerStop();
- if ((exitCode=Portable::system("perl","\""+bib2xhtmlFile+"\" "+bibOutputFiles+" \""+
- citeListFile+"\"" + (citeDebug ? " -d" : ""))) != 0)
+ QCString perlArgs = "\""+bib2xhtmlFile+"\" "+bibOutputFiles+" \""+ citeListFile+"\"";
+ if (citeDebug) perlArgs+=" -d";
+ if ((exitCode=Portable::system("perl",perlArgs)) != 0)
{
err("Problems running bibtex. Verify that the command 'perl --version' works from the command line. Exit code: %d\n",
exitCode);
}
Portable::sysTimerStop();
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
// 6. read back the file
- f.setName(citeListFile);
- if (!f.open(IO_ReadOnly))
- {
- err("could not open file %s for reading\n",citeListFile.data());
- }
-
QCString doc;
- QFileInfo fi(citeListFile);
- QCString input(fi.size()+1);
- f.readBlock(input.rawData(),fi.size());
- f.close();
- input.at(fi.size())='\0';
-
- bool insideBib=FALSE;
- int pos=0,s;
- //printf("input=[%s]\n",input.data());
- while ((s=input.find('\n',pos))!=-1)
{
- QCString line = input.mid((uint)pos,(uint)(s-pos));
- //printf("pos=%d s=%d line=[%s]\n",pos,s,line.data());
- pos=s+1;
-
- if (line.find("<!-- BEGIN BIBLIOGRAPHY")!=-1) insideBib=TRUE;
- else if (line.find("<!-- END BIBLIOGRAPH")!=-1) insideBib=FALSE;
- // determine text to use at the location of the @cite command
- if (insideBib && (i=line.find("name=\"CITEREF_"))!=-1)
+ std::ifstream f(citeListFile.str(),std::ifstream::in);
+ if (!f.is_open())
{
- int j=line.find("\">[");
- int k=line.find("]</a>");
- if (j!=-1 && k!=-1)
+ err("could not open file %s for reading\n",qPrint(citeListFile));
+ }
+
+ bool insideBib=FALSE;
+ //printf("input=[%s]\n",qPrint(input));
+ std::string lineStr;
+ while (getline(f,lineStr))
+ {
+ QCString line(lineStr);
+ //printf("pos=%d s=%d line=[%s]\n",pos,s,qPrint(line));
+
+ if (line.find("<!-- BEGIN BIBLIOGRAPHY")!=-1) insideBib=TRUE;
+ else if (line.find("<!-- END BIBLIOGRAPH")!=-1) insideBib=FALSE;
+ // determine text to use at the location of the @cite command
+ if (insideBib && (i=line.find("name=\"CITEREF_"))!=-1)
{
- uint ui=(uint)i;
- uint uj=(uint)j;
- uint uk=(uint)k;
- QCString label = line.mid(ui+14,uj-ui-14);
- QCString number = line.mid(uj+2,uk-uj-1);
- label = substitute(substitute(label,"&ndash;","--"),"&mdash;","---");
- line = line.left(ui+14) + label + line.right(line.length()-uj);
- auto it = p->entries.find(label.data());
- //printf("label='%s' number='%s' => %p\n",label.data(),number.data(),it->second.get());
- if (it!=p->entries.end())
+ int j=line.find("\">[");
+ int k=line.find("]</a>");
+ if (j!=-1 && k!=-1)
{
- it->second->setText(number);
+ uint ui=(uint)i;
+ uint uj=(uint)j;
+ uint uk=(uint)k;
+ QCString label = line.mid(ui+14,uj-ui-14);
+ QCString number = line.mid(uj+2,uk-uj-1);
+ label = substitute(substitute(label,"&ndash;","--"),"&mdash;","---");
+ line = line.left(ui+14) + label + line.right(line.length()-uj);
+ auto it = p->entries.find(label.str());
+ //printf("label='%s' number='%s' => %p\n",qPrint(label),qPrint(number),it->second.get());
+ if (it!=p->entries.end())
+ {
+ it->second->setText(number);
+ }
}
}
+ if (insideBib) doc+=line+"\n";
}
- if (insideBib) doc+=line+"\n";
+ //printf("doc=[%s]\n",qPrint(doc));
}
- //printf("doc=[%s]\n",doc.data());
// 7. add it as a page
addRelatedPage(fileName(),theTranslator->trCiteReferences(),doc,fileName(),1,1);
@@ -382,7 +345,7 @@ void CitationManager::generatePage()
QCString bibFile = bibdata.c_str();
// Note: file can now have multiple dots
if (!bibFile.isEmpty() && bibFile.right(4)!=".bib") bibFile+=".bib";
- fi.setFile(bibFile);
+ FileInfo fi(bibFile.str());
if (fi.exists())
{
if (!bibFile.isEmpty())
@@ -395,7 +358,7 @@ void CitationManager::generatePage()
}
else
{
- err("bib file %s not found!\n",bibFile.data());
+ err("bib file %s not found!\n",qPrint(bibFile));
}
}
}
@@ -403,17 +366,18 @@ void CitationManager::generatePage()
// 9. Remove temporary files
if (!citeDebug)
{
- thisDir.remove(citeListFile);
- thisDir.remove(doxygenBstFile);
- thisDir.remove(bib2xhtmlFile);
+ thisDir.remove(citeListFile.str());
+ thisDir.remove(doxygenBstFile.str());
+ thisDir.remove(bib2xhtmlFile.str());
// we might try to remove too many files as empty files didn't get a corresponding new file
// but the remove function does not emit an error for it and we don't catch the error return
// so no problem.
for (size_t j = 1; j <= citeDataList.size(); j++)
{
- thisDir.remove(bibOutputDir + bibTmpFile + QCString().setNum(static_cast<ulong>(j)) + ".bib");
+ QCString bibFile = bibOutputDir + bibTmpFile + QCString().setNum(static_cast<ulong>(j)) + ".bib";
+ thisDir.remove(bibFile.str());
}
- thisDir.rmdir(bibOutputDir);
+ thisDir.rmdir(bibOutputDir.str());
}
}
@@ -427,7 +391,7 @@ QCString CitationManager::latexBibFiles()
QCString bibFile = bibdata.c_str();
// Note: file can now have multiple dots
if (!bibFile.isEmpty() && bibFile.right(4)!=".bib") bibFile+=".bib";
- QFileInfo fi(bibFile);
+ FileInfo fi(bibFile.str());
if (fi.exists())
{
if (!bibFile.isEmpty())
diff --git a/src/cite.h b/src/cite.h
index adf0840..499000b 100644
--- a/src/cite.h
+++ b/src/cite.h
@@ -19,9 +19,7 @@
#include <memory>
-#include <qcstring.h>
-
-class FTextStream;
+#include "qcstring.h"
/// Citation-related data.
struct CiteInfo
@@ -42,12 +40,12 @@ class CitationManager
static CitationManager &instance();
/** Insert a citation identified by \a label into the database */
- void insert(const char *label);
+ void insert(const QCString &label);
/** Return the citation info for a given \a label.
* Ownership of the info stays with the manager.
*/
- const CiteInfo *find(const char *label) const;
+ const CiteInfo *find(const QCString &label) const;
/** Generate the citations page */
void generatePage();
@@ -63,8 +61,8 @@ class CitationManager
*/
QCString latexBibFiles();
- const char *fileName() const;
- const char *anchorPrefix() const;
+ QCString fileName() const;
+ QCString anchorPrefix() const;
private:
/** Create the database, with an expected maximum of \a size entries */
diff --git a/src/clangparser.cpp b/src/clangparser.cpp
index 045b0aa..6646adf 100644
--- a/src/clangparser.cpp
+++ b/src/clangparser.cpp
@@ -19,6 +19,7 @@
#include "membername.h"
#include "filename.h"
#include "tooltip.h"
+#include "utf8.h"
#endif
//--------------------------------------------------------------------------
@@ -73,18 +74,14 @@ static QCString detab(const QCString &s)
col++;
break;
default: // non-whitespace => update minIndent
- out.addChar(c);
- if (c<0 && i<size) // multibyte sequence
{
- out.addChar(data[i++]); // >= 2 bytes
- if (((uchar)c&0xE0)==0xE0 && i<size)
- {
- out.addChar(data[i++]); // 3 bytes
- }
- if (((uchar)c&0xF0)==0xF0 && i<size)
+ int bytes = getUTF8CharNumBytes(c);
+ for (int j=0;j<bytes-1 && c!=0; j++)
{
- out.addChar(data[i++]); // 4 byres
+ out.addChar(c);
+ c = data[i++];
}
+ out.addChar(c);
}
if (col<minIndent) minIndent=col;
col++;
@@ -95,7 +92,7 @@ static QCString detab(const QCString &s)
return out.get();
}
-static QCString keywordToType(const char *keyword)
+static const char * keywordToType(const char *keyword)
{
static const StringUnorderedSet flowKeywords({
"break", "case", "catch", "continue", "default", "do",
@@ -266,7 +263,7 @@ void ClangTUParser::parse()
// provide the input and and its dependencies as unsaved files so we can
// pass the filtered versions
- argv[argc++]=qstrdup(fileName);
+ argv[argc++]=qstrdup(fileName.data());
}
//printf("source %s ----------\n%s\n-------------\n\n",
// fileName,p->source.data());
@@ -275,7 +272,7 @@ void ClangTUParser::parse()
p->sources.resize(numUnsavedFiles);
p->ufs.resize(numUnsavedFiles);
p->sources[0] = detab(fileToString(fileName,filterSourceFiles,TRUE));
- p->ufs[0].Filename = qstrdup(fileName);
+ p->ufs[0].Filename = qstrdup(fileName.data());
p->ufs[0].Contents = p->sources[0].data();
p->ufs[0].Length = p->sources[0].length();
p->fileMapping.insert({fileName.data(),0});
@@ -358,7 +355,7 @@ void ClangTUParser::switchToFile(const FileDef *fd)
p->tokens = 0;
p->numTokens = 0;
- CXFile f = clang_getFile(p->tu, fd->absFilePath());
+ CXFile f = clang_getFile(p->tu, fd->absFilePath().data());
auto it = p->fileMapping.find(fd->absFilePath().data());
if (it!=p->fileMapping.end() && it->second < p->numFiles)
{
@@ -520,7 +517,7 @@ void ClangTUParser::writeLineNumber(CodeOutputInterface &ol,const FileDef *fd,ui
}
else // no link
{
- ol.writeLineNumber(0,0,0,line);
+ ol.writeLineNumber(QCString(),QCString(),QCString(),line);
}
// set search page target
@@ -637,7 +634,7 @@ void ClangTUParser::linkInclude(CodeOutputInterface &ol,const FileDef *fd,
}
if (ifd)
{
- ol.writeCodeLink(ifd->getReference(),ifd->getOutputFileBase(),0,text,ifd->briefDescriptionAsTooltip());
+ ol.writeCodeLink(ifd->getReference(),ifd->getOutputFileBase(),QCString(),text,ifd->briefDescriptionAsTooltip());
}
else
{
diff --git a/src/classdef.cpp b/src/classdef.cpp
index 198a1c9..152c316 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -18,8 +18,6 @@
#include <cstdio>
#include <algorithm>
-#include <qfile.h>
-#include <qfileinfo.h>
#include "classdef.h"
#include "classlist.h"
#include "entry.h"
@@ -50,6 +48,7 @@
#include "membergroup.h"
#include "definitionimpl.h"
#include "symbolresolver.h"
+#include "fileinfo.h"
//-----------------------------------------------------------------------------
@@ -58,7 +57,7 @@ static QCString makeQualifiedNameWithTemplateParameters(const ClassDef *cd,
{
//static bool optimizeOutputJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
bool hideScopeNames = Config_getBool(HIDE_SCOPE_NAMES);
- //printf("qualifiedNameWithTemplateParameters() localName=%s\n",localName().data());
+ //printf("qualifiedNameWithTemplateParameters() localName=%s\n",qPrint(localName()));
QCString scName;
const Definition *d=cd->getOuterScope();
if (d)
@@ -101,7 +100,7 @@ static QCString makeQualifiedNameWithTemplateParameters(const ClassDef *cd,
}
}
}
- //printf("qualifiedNameWithTemplateParameters: scope=%s qualifiedName=%s\n",name().data(),scName.data());
+ //printf("qualifiedNameWithTemplateParameters: scope=%s qualifiedName=%s\n",qPrint(name()),qPrint(scName));
return scName;
}
@@ -143,7 +142,7 @@ static QCString makeDisplayName(const ClassDef *cd,bool includeScope)
//{
// n = n.left(n.length()-2);
//}
- //printf("ClassDefImpl::displayName()=%s\n",n.data());
+ //printf("ClassDefImpl::displayName()=%s\n",qPrint(n));
return n;
}
@@ -155,9 +154,9 @@ static QCString makeDisplayName(const ClassDef *cd,bool includeScope)
class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
{
public:
- ClassDefImpl(const char *fileName,int startLine,int startColumn,
- const char *name,CompoundType ct,
- const char *ref=0,const char *fName=0,
+ ClassDefImpl(const QCString &fileName,int startLine,int startColumn,
+ const QCString &name,CompoundType ct,
+ const QCString &ref=QCString(),const QCString &fName=QCString(),
bool isSymbol=TRUE,bool isJavaEnum=FALSE);
/** Destroys a compound definition. */
~ClassDefImpl();
@@ -178,9 +177,9 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
virtual QCString displayName(bool includeScope=TRUE) const;
virtual CompoundType compoundType() const;
virtual QCString compoundTypeString() const;
- virtual BaseClassList baseClasses() const;
+ virtual const BaseClassList &baseClasses() const;
virtual void updateBaseClasses(const BaseClassList &bcd);
- virtual BaseClassList subClasses() const;
+ virtual const BaseClassList &subClasses() const;
virtual void updateSubClasses(const BaseClassList &bcd);
virtual const MemberNameInfoLinkedMap &memberNameInfoLinkedMap() const;
virtual Protection protection() const;
@@ -189,7 +188,6 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
virtual bool isVisibleInHierarchy() const;
virtual bool visibleInParentsDeclList() const;
virtual const ArgumentList &templateArguments() const;
- virtual NamespaceDef *getNamespaceDef() const;
virtual FileDef *getFileDef() const;
virtual const MemberDef *getMemberByName(const QCString &) const;
virtual bool isBaseClass(const ClassDef *bcd,bool followInstances,int level=0) const;
@@ -203,7 +201,7 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
virtual const UsesClassList &usedByImplementationClasses() const;
virtual const ConstraintClassList &templateTypeConstraints() const;
virtual bool isTemplateArgument() const;
- virtual const Definition *findInnerCompound(const char *name) const;
+ virtual const Definition *findInnerCompound(const QCString &name) const;
virtual ArgumentLists getTemplateParameterLists() const;
virtual QCString qualifiedNameWithTemplateParameters(
const ArgumentLists *actualParams=0,uint *actualParamIndex=0) const;
@@ -240,39 +238,40 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
virtual bool subGrouping() const;
virtual bool isSliceLocal() const;
virtual bool hasNonReferenceSuperClass() const;
+ virtual QCString requiresClause() const;
virtual ClassDef *insertTemplateInstance(const QCString &fileName,int startLine,int startColumn,
const QCString &templSpec,bool &freshInstance) const;
- virtual void insertBaseClass(ClassDef *,const char *name,Protection p,Specifier s,const char *t=0);
- virtual void insertSubClass(ClassDef *,Protection p,Specifier s,const char *t=0);
- virtual void setIncludeFile(FileDef *fd,const char *incName,bool local,bool force);
+ virtual void insertBaseClass(ClassDef *,const QCString &name,Protection p,Specifier s,const QCString &t=QCString());
+ virtual void insertSubClass(ClassDef *,Protection p,Specifier s,const QCString &t=QCString());
+ virtual void setIncludeFile(FileDef *fd,const QCString &incName,bool local,bool force);
virtual void insertMember(MemberDef *);
virtual void insertUsedFile(const FileDef *);
- virtual bool addExample(const char *anchor,const char *name, const char *file);
+ virtual bool addExample(const QCString &anchor,const QCString &name, const QCString &file);
virtual void mergeCategory(ClassDef *category);
- virtual void setNamespace(NamespaceDef *nd);
+ //virtual void setNamespace(NamespaceDef *nd);
virtual void setFileDef(FileDef *fd);
virtual void setSubGrouping(bool enabled);
virtual void setProtection(Protection p);
virtual void setGroupDefForAllMembers(GroupDef *g,Grouping::GroupPri_t pri,const QCString &fileName,int startLine,bool hasDocs);
virtual void addInnerCompound(const Definition *d);
- virtual void addUsedClass(ClassDef *cd,const char *accessName,Protection prot);
- virtual void addUsedByClass(ClassDef *cd,const char *accessName,Protection prot);
+ virtual void addUsedClass(ClassDef *cd,const QCString &accessName,Protection prot);
+ virtual void addUsedByClass(ClassDef *cd,const QCString &accessName,Protection prot);
virtual void setIsStatic(bool b);
virtual void setCompoundType(CompoundType t);
- virtual void setClassName(const char *name);
+ virtual void setClassName(const QCString &name);
virtual void setClassSpecifier(uint64 spec);
virtual void setTemplateArguments(const ArgumentList &al);
virtual void setTemplateBaseClassNames(const TemplateNameMap &templateNames);
virtual void setTemplateMaster(const ClassDef *tm);
virtual void setTypeConstraints(const ArgumentList &al);
- virtual void addMembersToTemplateInstance(const ClassDef *cd,const ArgumentList &templateArguments,const char *templSpec);
+ virtual void addMembersToTemplateInstance(const ClassDef *cd,const ArgumentList &templateArguments,const QCString &templSpec);
virtual void makeTemplateArgument(bool b=TRUE);
virtual void setCategoryOf(ClassDef *cd);
virtual void setUsedOnly(bool b);
virtual void setTagLessReference(const ClassDef *cd);
- virtual void setName(const char *name);
- virtual void setMetaData(const char *md);
+ virtual void setName(const QCString &name);
+ virtual void setMetaData(const QCString &md);
virtual void findSectionsInDocumentation();
virtual void addMembersToMemberGroup();
virtual void addListReferences();
@@ -286,13 +285,13 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
virtual void writeMemberPages(OutputList &ol) const;
virtual void writeMemberList(OutputList &ol) const;
virtual void writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup,
- const ClassDef *inheritedFrom,const char *inheritId) const;
+ const ClassDef *inheritedFrom,const QCString &inheritId) const;
virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *md) const;
virtual void writeSummaryLinks(OutputList &ol) const;
virtual void reclassifyMember(MemberDefMutable *md,MemberType t);
virtual void writeInlineDocumentation(OutputList &ol) const;
virtual void writeDeclarationLink(OutputList &ol,bool &found,
- const char *header,bool localNames) const;
+ const QCString &header,bool localNames) const;
virtual void removeMemberFromLists(MemberDef *md);
virtual void setAnonymousEnumType();
virtual void countMembers();
@@ -300,7 +299,7 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
virtual void addGroupedInheritedMembers(OutputList &ol,MemberListType lt,
const ClassDef *inheritedFrom,const QCString &inheritId) const;
- virtual void writeTagFile(FTextStream &);
+ virtual void writeTagFile(TextStream &);
virtual int countMembersIncludingGrouped(MemberListType lt,const ClassDef *inheritedFrom,bool additional) const;
virtual int countInheritanceNodes() const;
@@ -308,11 +307,13 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
int lt2,bool invert,bool showAlways,ClassDefSet &visitedClasses) const;
virtual void writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedClasses,
MemberListType lt,const QCString &title,
- const char *subTitle=0,bool showInline=FALSE,const ClassDef *inheritedFrom=0,
+ const QCString &subTitle=QCString(),
+ bool showInline=FALSE,const ClassDef *inheritedFrom=0,
int lt2=-1,bool invert=FALSE,bool showAlways=FALSE) const;
+ virtual void setRequiresClause(const QCString &req);
private:
- void addUsedInterfaceClasses(MemberDef *md,const char *typeStr);
+ void addUsedInterfaceClasses(MemberDef *md,const QCString &typeStr);
void showUsedFiles(OutputList &ol) const;
void writeDocumentationContents(OutputList &ol,const QCString &pageTitle) const;
@@ -324,7 +325,7 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
bool showAlways) const;
void writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title,bool showInline=FALSE) const;
void writeSimpleMemberDocumentation(OutputList &ol,MemberListType lt) const;
- void writePlainMemberDeclaration(OutputList &ol,MemberListType lt,bool inGroup,const ClassDef *inheritedFrom,const char *inheritId) const;
+ void writePlainMemberDeclaration(OutputList &ol,MemberListType lt,bool inGroup,const ClassDef *inheritedFrom,const QCString &inheritId) const;
void writeBriefDescription(OutputList &ol,bool exampleFlag) const;
void writeDetailedDescription(OutputList &ol,const QCString &pageType,bool exampleFlag,
const QCString &title,const QCString &anchor=QCString()) const;
@@ -354,6 +355,8 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
QCString &title,QCString &subtitle) const;
QCString includeStatement() const;
void addTypeConstraint(const QCString &typeConstraint,const QCString &type);
+ void writeTemplateSpec(OutputList &ol,const Definition *d,
+ const QCString &type,SrcLangExt lang) const;
// PIMPL idiom
class IMPL;
@@ -361,9 +364,9 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
};
ClassDefMutable *createClassDef(
- const char *fileName,int startLine,int startColumn,
- const char *name,ClassDef::CompoundType ct,
- const char *ref,const char *fName,
+ const QCString &fileName,int startLine,int startColumn,
+ const QCString &name,ClassDef::CompoundType ct,
+ const QCString &ref,const QCString &fName,
bool isSymbol,bool isJavaEnum)
{
return new ClassDefImpl(fileName,startLine,startColumn,name,ct,ref,fName,isSymbol,isJavaEnum);
@@ -409,9 +412,9 @@ class ClassDefAliasImpl : public DefinitionAliasMixin<ClassDef>
{ return getCdAlias()->compoundType(); }
virtual QCString compoundTypeString() const
{ return getCdAlias()->compoundTypeString(); }
- virtual BaseClassList baseClasses() const
+ virtual const BaseClassList &baseClasses() const
{ return getCdAlias()->baseClasses(); }
- virtual BaseClassList subClasses() const
+ virtual const BaseClassList &subClasses() const
{ return getCdAlias()->subClasses(); }
virtual const MemberNameInfoLinkedMap &memberNameInfoLinkedMap() const
{ return getCdAlias()->memberNameInfoLinkedMap(); }
@@ -427,8 +430,8 @@ class ClassDefAliasImpl : public DefinitionAliasMixin<ClassDef>
{ return getCdAlias()->visibleInParentsDeclList(); }
virtual const ArgumentList &templateArguments() const
{ return getCdAlias()->templateArguments(); }
- virtual NamespaceDef *getNamespaceDef() const
- { return getCdAlias()->getNamespaceDef(); }
+ //virtual NamespaceDef *getNamespaceDef() const
+ //{ return getCdAlias()->getNamespaceDef(); }
virtual FileDef *getFileDef() const
{ return getCdAlias()->getFileDef(); }
virtual const MemberDef *getMemberByName(const QCString &s) const
@@ -455,7 +458,7 @@ class ClassDefAliasImpl : public DefinitionAliasMixin<ClassDef>
{ return getCdAlias()->templateTypeConstraints(); }
virtual bool isTemplateArgument() const
{ return getCdAlias()->isTemplateArgument(); }
- virtual const Definition *findInnerCompound(const char *name) const
+ virtual const Definition *findInnerCompound(const QCString &name) const
{ return getCdAlias()->findInnerCompound(name); }
virtual ArgumentLists getTemplateParameterLists() const
{ return getCdAlias()->getTemplateParameterLists(); }
@@ -528,6 +531,8 @@ class ClassDefAliasImpl : public DefinitionAliasMixin<ClassDef>
{ return getCdAlias()->isSliceLocal(); }
virtual bool hasNonReferenceSuperClass() const
{ return getCdAlias()->hasNonReferenceSuperClass(); }
+ virtual QCString requiresClause() const
+ { return getCdAlias()->requiresClause(); }
virtual int countMembersIncludingGrouped(MemberListType lt,const ClassDef *inheritedFrom,bool additional) const
{ return getCdAlias()->countMembersIncludingGrouped(lt,inheritedFrom,additional); }
@@ -538,7 +543,7 @@ class ClassDefAliasImpl : public DefinitionAliasMixin<ClassDef>
{ return getCdAlias()->countMemberDeclarations(lt,inheritedFrom,lt2,invert,showAlways,visitedClasses); }
virtual void writeDeclarationLink(OutputList &ol,bool &found,
- const char *header,bool localNames) const
+ const QCString &header,bool localNames) const
{ getCdAlias()->writeDeclarationLink(ol,found,header,localNames); }
virtual ClassDef *insertTemplateInstance(const QCString &fileName,int startLine,int startColumn,
const QCString &templSpec,bool &freshInstance) const
@@ -548,14 +553,12 @@ class ClassDefAliasImpl : public DefinitionAliasMixin<ClassDef>
virtual void updateSubClasses(const BaseClassList &) {}
};
-
-
ClassDef *createClassDefAlias(const Definition *newScope,const ClassDef *cd)
{
ClassDef *acd = new ClassDefAliasImpl(newScope,cd);
//printf("cd name=%s localName=%s qualifiedName=%s qualifiedNameWith=%s displayName()=%s\n",
- // acd->name().data(),acd->localName().data(),acd->qualifiedName().data(),
- // acd->qualifiedNameWithTemplateParameters().data(),acd->displayName().data());
+ // qPrint(acd->name()),qPrint(acd->localName()),qPrint(acd->qualifiedName()),
+ // qPrint(acd->qualifiedNameWithTemplateParameters()),qPrint(acd->displayName()));
return acd;
}
@@ -567,8 +570,8 @@ class ClassDefImpl::IMPL
public:
IMPL();
~IMPL();
- void init(const char *defFileName, const char *name,
- const QCString &ctStr, const char *fName);
+ void init(const QCString &defFileName, const QCString &name,
+ const QCString &ctStr, const QCString &fName);
/*! file name that forms the base for the output file containing the
* class documentation. For compatibility with Qt (e.g. links via tag
@@ -602,7 +605,7 @@ class ClassDefImpl::IMPL
/*! Namespace this class is part of
* (this is the inner most namespace in case of nested namespaces)
*/
- NamespaceDef *nspace = 0;
+ //NamespaceDef *nspace = 0;
/*! File this class is defined in */
FileDef *fileDef = 0;
@@ -705,12 +708,15 @@ class ClassDefImpl::IMPL
uint64 spec = 0;
QCString metaData;
+
+ /** C++20 requires clause */
+ QCString requiresClause;
};
-void ClassDefImpl::IMPL::init(const char *defFileName, const char *name,
- const QCString &ctStr, const char *fName)
+void ClassDefImpl::IMPL::init(const QCString &defFileName, const QCString &name,
+ const QCString &ctStr, const QCString &fName)
{
- if (fName)
+ if (!fName.isEmpty())
{
fileName=stripExtension(fName);
}
@@ -719,7 +725,7 @@ void ClassDefImpl::IMPL::init(const char *defFileName, const char *name,
fileName=ctStr+name;
}
prot=Public;
- nspace=0;
+ //nspace=0;
fileDef=0;
subGrouping=Config_getBool(SUBGROUPING);
templateMaster =0;
@@ -735,7 +741,7 @@ void ClassDefImpl::IMPL::init(const char *defFileName, const char *name,
spec=0;
//QCString ns;
//extractNamespaceName(name,className,ns);
- //printf("m_name=%s m_className=%s ns=%s\n",m_name.data(),m_className.data(),ns.data());
+ //printf("m_name=%s m_className=%s ns=%s\n",qPrint(m_name),qPrint(m_className),qPrint(ns));
// we cannot use getLanguage at this point, as setLanguage has not been called.
SrcLangExt lang = getLanguageFromFileName(defFileName);
@@ -762,9 +768,9 @@ ClassDefImpl::IMPL::~IMPL()
// constructs a new class definition
ClassDefImpl::ClassDefImpl(
- const char *defFileName,int defLine,int defColumn,
- const char *nm,CompoundType ct,
- const char *lref,const char *fName,
+ const QCString &defFileName,int defLine,int defColumn,
+ const QCString &nm,CompoundType ct,
+ const QCString &lref,const QCString &fName,
bool isSymbol,bool isJavaEnum)
: DefinitionMixin(defFileName,defLine,defColumn,removeRedundantWhiteSpace(nm),0,0,isSymbol)
{
@@ -776,7 +782,7 @@ ClassDefImpl::ClassDefImpl(
m_impl->memberListFileName = convertNameToFile(compoundTypeString()+name()+"-members");
m_impl->collabFileName = convertNameToFile(m_impl->fileName+"_coll_graph");
m_impl->inheritFileName = convertNameToFile(m_impl->fileName+"_inherit_graph");
- if (!lref)
+ if (lref.isEmpty())
{
m_impl->fileName = convertNameToFile(m_impl->fileName);
}
@@ -799,22 +805,22 @@ QCString ClassDefImpl::displayName(bool includeScope) const
}
// inserts a base/super class in the inheritance list
-void ClassDefImpl::insertBaseClass(ClassDef *cd,const char *n,Protection p,
- Specifier s,const char *t)
+void ClassDefImpl::insertBaseClass(ClassDef *cd,const QCString &n,Protection p,
+ Specifier s,const QCString &t)
{
- //printf("*** insert base class %s into %s\n",cd->name().data(),name().data());
+ //printf("*** insert base class %s into %s\n",qPrint(cd->name()),qPrint(name()));
m_impl->inherits.push_back(BaseClassDef(cd,n,p,s,t));
m_impl->isSimple = FALSE;
}
// inserts a derived/sub class in the inherited-by list
void ClassDefImpl::insertSubClass(ClassDef *cd,Protection p,
- Specifier s,const char *t)
+ Specifier s,const QCString &t)
{
- //printf("*** insert sub class %s into %s\n",cd->name().data(),name().data());
+ //printf("*** insert sub class %s into %s\n",qPrint(cd->name()),qPrint(name()));
static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
if (!extractPrivate && cd->protection()==Private) return;
- m_impl->inheritedBy.push_back(BaseClassDef(cd,0,p,s,t));
+ m_impl->inheritedBy.push_back(BaseClassDef(cd,QCString(),p,s,t));
m_impl->isSimple = FALSE;
}
@@ -833,7 +839,7 @@ void ClassDefImpl::addMembersToMemberGroup()
{
if (mg->allMembersInSameSection() && m_impl->subGrouping)
{
- //printf("addToDeclarationSection(%s)\n",mg->header().data());
+ //printf("addToDeclarationSection(%s)\n",qPrint(mg->header()));
mg->addToDeclarationSection();
}
}
@@ -845,7 +851,7 @@ void ClassDefImpl::internalInsertMember(const MemberDef *md,
bool addToAllList
)
{
- //printf("insertInternalMember(%s) isHidden()=%d\n",md->name().data(),md->isHidden());
+ //printf("insertInternalMember(%s) isHidden()=%d\n",qPrint(md->name()),md->isHidden());
if (md->isHidden()) return;
if (getLanguage()==SrcLangExt_VHDL)
@@ -1015,7 +1021,7 @@ void ClassDefImpl::internalInsertMember(const MemberDef *md,
{
m_impl->isSimple = FALSE;
}
- //printf("adding %s simple=%d total_simple=%d\n",name().data(),isSimple,m_impl->isSimple);
+ //printf("adding %s simple=%d total_simple=%d\n",qPrint(name()),isSimple,m_impl->isSimple);
/*******************************************************/
/* insert member in the detailed documentation section */
@@ -1083,7 +1089,7 @@ void ClassDefImpl::internalInsertMember(const MemberDef *md,
break;
case MemberType_Define:
warn(md->getDefFileName(),md->getDefLine()-1,"A define (%s) cannot be made a member of %s",
- md->name().data(), this->name().data());
+ qPrint(md->name()), qPrint(this->name()));
break;
default:
err("Unexpected member type %d found!\n",md->memberType());
@@ -1120,7 +1126,7 @@ void ClassDefImpl::internalInsertMember(const MemberDef *md,
QCString(md->typeString())=="friend struct" ||
QCString(md->typeString())=="friend union")))
{
- //printf("=======> adding member %s to class %s\n",md->name().data(),name().data());
+ //printf("=======> adding member %s to class %s\n",qPrint(md->name()),qPrint(name()));
MemberNameInfo *mni = m_impl->allMemberNameInfoLinkedMap.add(md->name());
mni->push_back(std::make_unique<MemberInfo>(md,prot,md->virtualness(),FALSE));
@@ -1217,11 +1223,11 @@ static void writeInheritanceSpecifier(OutputList &ol,const BaseClassDef &bcd)
}
void ClassDefImpl::setIncludeFile(FileDef *fd,
- const char *includeName,bool local, bool force)
+ const QCString &includeName,bool local, bool force)
{
//printf("ClassDefImpl::setIncludeFile(%p,%s,%d,%d)\n",fd,includeName,local,force);
if (!m_impl->incInfo) m_impl->incInfo = std::make_unique<IncludeInfo>();
- if ((includeName && m_impl->incInfo->includeName.isEmpty()) ||
+ if ((!includeName.isEmpty() && m_impl->incInfo->includeName.isEmpty()) ||
(fd!=0 && m_impl->incInfo->fileDef==0)
)
{
@@ -1230,7 +1236,7 @@ void ClassDefImpl::setIncludeFile(FileDef *fd,
m_impl->incInfo->includeName = includeName;
m_impl->incInfo->local = local;
}
- if (force && includeName)
+ if (force && !includeName.isEmpty())
{
m_impl->incInfo->includeName = includeName;
m_impl->incInfo->local = local;
@@ -1290,15 +1296,15 @@ static void searchTemplateSpecs(/*in*/ const Definition *d,
}
}
-static void writeTemplateSpec(OutputList &ol,const Definition *d,
- const QCString &type,SrcLangExt lang)
+void ClassDefImpl::writeTemplateSpec(OutputList &ol,const Definition *d,
+ const QCString &type,SrcLangExt lang) const
{
ArgumentLists specs;
QCString name;
searchTemplateSpecs(d,specs,name,lang);
if (!specs.empty()) // class has template scope specifiers
{
- ol.startSubsubsection();
+ ol.startCompoundTemplateParams();
for (const ArgumentList &al : specs)
{
ol.docify("template<");
@@ -1306,7 +1312,13 @@ static void writeTemplateSpec(OutputList &ol,const Definition *d,
while (it!=al.end())
{
Argument a = *it;
- ol.docify(a.type);
+ linkifyText(TextGeneratorOLImpl(ol), // out
+ d, // scope
+ getFileDef(), // fileScope
+ this, // self
+ a.type, // text
+ FALSE // autoBreak
+ );
if (!a.name.isEmpty())
{
ol.docify(" ");
@@ -1323,9 +1335,20 @@ static void writeTemplateSpec(OutputList &ol,const Definition *d,
ol.docify(">");
ol.lineBreak();
}
+ if (!m_impl->requiresClause.isEmpty())
+ {
+ ol.docify("requires ");
+ linkifyText(TextGeneratorOLImpl(ol), // out
+ d, // scope
+ getFileDef(), // fileScope
+ this, // self
+ m_impl->requiresClause, // text
+ FALSE // autoBreak
+ );
+ ol.lineBreak();
+ }
ol.docify(type.lower()+" "+name);
- ol.endSubsubsection();
- ol.writeString("\n");
+ ol.endCompoundTemplateParams();
}
}
@@ -1339,7 +1362,7 @@ void ClassDefImpl::writeBriefDescription(OutputList &ol,bool exampleFlag) const
ol.writeString(" - ");
ol.popGeneratorState();
ol.generateDoc(briefFile(),briefLine(),this,0,
- briefDescription(),TRUE,FALSE,0,
+ briefDescription(),TRUE,FALSE,QCString(),
TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.pushGeneratorState();
ol.disable(OutputGenerator::RTF);
@@ -1372,7 +1395,7 @@ void ClassDefImpl::writeDetailedDocumentationBody(OutputList &ol) const
if (!briefDescription().isEmpty() && repeatBrief)
{
ol.generateDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
if (!briefDescription().isEmpty() && repeatBrief &&
!documentation().isEmpty())
@@ -1386,7 +1409,7 @@ void ClassDefImpl::writeDetailedDocumentationBody(OutputList &ol) const
if (!documentation().isEmpty())
{
ol.generateDoc(docFile(),docLine(),this,0,documentation(),TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
// write type constraints
writeTypeConstraints(ol,this,m_impl->typeConstraints);
@@ -1429,7 +1452,7 @@ void ClassDefImpl::writeDetailedDescription(OutputList &ol, const QCString &/*pa
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- ol.writeAnchor(0,anchor.isEmpty() ? QCString("details") : anchor);
+ ol.writeAnchor(QCString(),anchor.isEmpty() ? QCString("details") : anchor);
ol.popGeneratorState();
if (!anchor.isEmpty())
@@ -1529,12 +1552,11 @@ void ClassDefImpl::showUsedFiles(OutputList &ol) const
ol.disableAllBut(OutputGenerator::Html);
if (fd->generateSourceFile())
{
- ol.writeObjectLink(0,fd->getSourceFileBase(),0,fname);
+ ol.writeObjectLink(QCString(),fd->getSourceFileBase(),QCString(),fname);
}
else if (fd->isLinkable())
{
- ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,
- fname);
+ ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fname);
}
else
{
@@ -1547,8 +1569,7 @@ void ClassDefImpl::showUsedFiles(OutputList &ol) const
ol.disable(OutputGenerator::Html);
if (fd->isLinkable())
{
- ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,
- fname);
+ ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fname);
}
else
{
@@ -1593,7 +1614,7 @@ void ClassDefImpl::writeInheritanceGraph(OutputList &ol) const
if (inheritanceGraph.isTooBig())
{
warn_uncond("Inheritance graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
- name().data(), inheritanceGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
+ qPrint(name()), inheritanceGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
}
else if (!inheritanceGraph.isTrivial())
{
@@ -1738,10 +1759,10 @@ void ClassDefImpl::writeIncludeFilesForSlice(OutputList &ol) const
unsigned int length = 0;
for (const auto &s : paths)
{
- QFileInfo info(s.c_str());
+ FileInfo info(s);
if (info.exists())
{
- QCString prefix = info.absFilePath().utf8();
+ QCString prefix = info.absFilePath();
if (prefix.at(prefix.length() - 1) != '/')
{
prefix += '/';
@@ -1764,7 +1785,7 @@ void ClassDefImpl::writeIncludeFilesForSlice(OutputList &ol) const
if (nm.isEmpty())
{
- nm = m_impl->incInfo->includeName.data();
+ nm = m_impl->incInfo->includeName;
}
ol.startParagraph();
@@ -1773,7 +1794,7 @@ void ClassDefImpl::writeIncludeFilesForSlice(OutputList &ol) const
ol.docify("<");
if (m_impl->incInfo->fileDef)
{
- ol.writeObjectLink(0,m_impl->incInfo->fileDef->includeName(),0,nm);
+ ol.writeObjectLink(QCString(),m_impl->incInfo->fileDef->includeName(),QCString(),nm);
}
else
{
@@ -1873,9 +1894,9 @@ void ClassDefImpl::writeIncludeFiles(OutputList &ol) const
SrcLangExt lang = getLanguage();
QCString nm=m_impl->incInfo->includeName.isEmpty() ?
(m_impl->incInfo->fileDef ?
- m_impl->incInfo->fileDef->docName().data() : ""
+ m_impl->incInfo->fileDef->docName() : QCString()
) :
- m_impl->incInfo->includeName.data();
+ m_impl->incInfo->includeName;
if (!nm.isEmpty())
{
ol.startParagraph();
@@ -1893,7 +1914,7 @@ void ClassDefImpl::writeIncludeFiles(OutputList &ol) const
ol.enable(OutputGenerator::Html);
if (m_impl->incInfo->fileDef)
{
- ol.writeObjectLink(0,m_impl->incInfo->fileDef->includeName(),0,nm);
+ ol.writeObjectLink(QCString(),m_impl->incInfo->fileDef->includeName(),QCString(),nm);
}
else
{
@@ -1923,7 +1944,7 @@ void ClassDefImpl::writeMemberGroups(OutputList &ol,bool showInline) const
}
else // add this group to the corresponding member section
{
- //printf("addToDeclarationSection(%s)\n",mg->header().data());
+ //printf("addToDeclarationSection(%s)\n",qPrint(mg->header()));
//mg->addToDeclarationSection();
}
}
@@ -1942,7 +1963,7 @@ void ClassDefImpl::writeInlineClasses(OutputList &ol) const
void ClassDefImpl::startMemberDocumentation(OutputList &ol) const
{
- //printf("%s: ClassDefImpl::startMemberDocumentation()\n",name().data());
+ //printf("%s: ClassDefImpl::startMemberDocumentation()\n",qPrint(name()));
if (Config_getBool(SEPARATE_MEMBER_PAGES))
{
ol.disable(OutputGenerator::Html);
@@ -1952,7 +1973,7 @@ void ClassDefImpl::startMemberDocumentation(OutputList &ol) const
void ClassDefImpl::endMemberDocumentation(OutputList &ol) const
{
- //printf("%s: ClassDefImpl::endMemberDocumentation()\n",name().data());
+ //printf("%s: ClassDefImpl::endMemberDocumentation()\n",qPrint(name()));
if (Config_getBool(SEPARATE_MEMBER_PAGES))
{
ol.enable(OutputGenerator::Html);
@@ -1962,13 +1983,13 @@ void ClassDefImpl::endMemberDocumentation(OutputList &ol) const
void ClassDefImpl::startMemberDeclarations(OutputList &ol) const
{
- //printf("%s: ClassDefImpl::startMemberDeclarations()\n",name().data());
+ //printf("%s: ClassDefImpl::startMemberDeclarations()\n",qPrint(name()));
ol.startMemberSections();
}
void ClassDefImpl::endMemberDeclarations(OutputList &ol) const
{
- //printf("%s: ClassDefImpl::endMemberDeclarations()\n",name().data());
+ //printf("%s: ClassDefImpl::endMemberDeclarations()\n",qPrint(name()));
static bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
if (!inlineInheritedMembers && countAdditionalInheritedMembers()>0)
{
@@ -2009,7 +2030,7 @@ void ClassDefImpl::writeSummaryLinks(OutputList &ol) const
)
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
- ol.writeSummaryLink(0,"nested-classes",ls->title(lang),first);
+ ol.writeSummaryLink(QCString(),"nested-classes",ls->title(lang),first);
first=FALSE;
}
else if (lde->kind()==LayoutDocEntry::ClassAllMembersLink &&
@@ -2026,7 +2047,7 @@ void ClassDefImpl::writeSummaryLinks(OutputList &ol) const
MemberList * ml = getMemberList(lmd->type);
if (ml && ml->declVisible())
{
- ol.writeSummaryLink(0,MemberList::listTypeAsString(ml->listType()),lmd->title(lang),first);
+ ol.writeSummaryLink(QCString(),MemberList::listTypeAsString(ml->listType()),lmd->title(lang),first);
first=FALSE;
}
}
@@ -2036,7 +2057,7 @@ void ClassDefImpl::writeSummaryLinks(OutputList &ol) const
{
for (const auto &s : m_impl->vhdlSummaryTitles)
{
- ol.writeSummaryLink(0,convertToId(s.c_str()),s.c_str(),first);
+ ol.writeSummaryLink(QCString(),convertToId(QCString(s)),QCString(s),first);
first=FALSE;
}
}
@@ -2047,7 +2068,7 @@ void ClassDefImpl::writeSummaryLinks(OutputList &ol) const
ol.popGeneratorState();
}
-void ClassDefImpl::writeTagFile(FTextStream &tagFile)
+void ClassDefImpl::writeTagFile(TextStream &tagFile)
{
if (!isLinkableInProject() || isArtificial()) return;
tagFile << " <compound kind=\"";
@@ -2057,17 +2078,17 @@ void ClassDefImpl::writeTagFile(FTextStream &tagFile)
tagFile << compoundTypeString();
tagFile << "\"";
if (isObjectiveC()) { tagFile << " objc=\"yes\""; }
- tagFile << ">" << endl;
- tagFile << " <name>" << convertToXML(name()) << "</name>" << endl;
- tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>" << endl;
+ tagFile << ">\n";
+ tagFile << " <name>" << convertToXML(name()) << "</name>\n";
+ tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>\n";
if (!anchor().isEmpty())
{
- tagFile << " <anchor>" << convertToXML(anchor()) << "</anchor>" << endl;
+ tagFile << " <anchor>" << convertToXML(anchor()) << "</anchor>\n";
}
QCString idStr = id();
if (!idStr.isEmpty())
{
- tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>" << endl;
+ tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
}
for (const Argument &a : m_impl->tempArgs)
{
@@ -2076,7 +2097,7 @@ void ClassDefImpl::writeTagFile(FTextStream &tagFile)
{
tagFile << " " << convertToXML(a.name);
}
- tagFile << "</templarg>" << endl;
+ tagFile << "</templarg>\n";
}
for (const auto &ibcd : m_impl->inherits)
{
@@ -2098,7 +2119,7 @@ void ClassDefImpl::writeTagFile(FTextStream &tagFile)
{
tagFile << " virtualness=\"virtual\"";
}
- tagFile << ">" << convertToXML(cd->name()) << "</base>" << endl;
+ tagFile << ">" << convertToXML(cd->name()) << "</base>\n";
}
}
}
@@ -2116,7 +2137,7 @@ void ClassDefImpl::writeTagFile(FTextStream &tagFile)
)
{
tagFile << " <class kind=\"" << innerCd->compoundTypeString() <<
- "\">" << convertToXML(innerCd->name()) << "</class>" << endl;
+ "\">" << convertToXML(innerCd->name()) << "</class>\n";
}
}
}
@@ -2144,7 +2165,7 @@ void ClassDefImpl::writeTagFile(FTextStream &tagFile)
}
}
writeDocAnchorsToTagFile(tagFile);
- tagFile << " </compound>" << endl;
+ tagFile << " </compound>\n";
}
/** Write class documentation inside another container (i.e. a group) */
@@ -2152,8 +2173,8 @@ void ClassDefImpl::writeInlineDocumentation(OutputList &ol) const
{
bool isSimple = m_impl->isSimple;
- ol.addIndexItem(name(),0);
- //printf("ClassDefImpl::writeInlineDocumentation(%s)\n",name().data());
+ ol.addIndexItem(name(),QCString());
+ //printf("ClassDefImpl::writeInlineDocumentation(%s)\n",qPrint(name()));
// part 1: anchor and title
QCString s = compoundTypeString()+" "+name();
@@ -2162,8 +2183,8 @@ void ClassDefImpl::writeInlineDocumentation(OutputList &ol) const
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
{ // only HTML only
- ol.writeAnchor(0,anchor());
- ol.startMemberDoc(0,0,anchor(),name(),1,1,FALSE);
+ ol.writeAnchor(QCString(),anchor());
+ ol.startMemberDoc(QCString(),QCString(),anchor(),name(),1,1,FALSE);
ol.startMemberDocName(FALSE);
ol.parseText(s);
ol.endMemberDocName();
@@ -2319,7 +2340,7 @@ bool ClassDefImpl::visibleInParentsDeclList() const
);
}
-void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const char *header,bool localNames) const
+void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const QCString &header,bool localNames) const
{
//static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
//static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
@@ -2352,7 +2373,7 @@ void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const char *h
{
ol.startMemberHeader("nested-classes");
}
- if (header)
+ if (!header.isEmpty())
{
ol.parseText(header);
}
@@ -2412,7 +2433,7 @@ void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const char *h
{
DocRoot *rootNode = validatingParseDoc(briefFile(),briefLine(),this,0,
briefDescription(),FALSE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
if (rootNode && !rootNode->isEmpty())
{
ol.startMemberDescription(anchor());
@@ -2425,29 +2446,28 @@ void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const char *h
}
delete rootNode;
}
- ol.endMemberDeclaration(anchor(),0);
+ ol.endMemberDeclaration(anchor(),QCString());
}
}
void ClassDefImpl::addClassAttributes(OutputList &ol) const
{
- QStrList sl;
- if (isFinal()) sl.append("final");
- if (isSealed()) sl.append("sealed");
- if (isAbstract()) sl.append("abstract");
- if (getLanguage()==SrcLangExt_IDL && isPublished()) sl.append("published");
+ StringVector sl;
+ if (isFinal()) sl.push_back("final");
+ if (isSealed()) sl.push_back("sealed");
+ if (isAbstract()) sl.push_back("abstract");
+ if (getLanguage()==SrcLangExt_IDL && isPublished()) sl.push_back("published");
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- if (sl.count()>0)
+ if (!sl.empty())
{
ol.startLabels();
- const char *s=sl.first();
- while (s)
+ size_t i=0;
+ for (const auto &s : sl)
{
- const char *ns = sl.next();
- ol.writeLabel(s,ns==0);
- s=ns;
+ i++;
+ ol.writeLabel(s.c_str(),i==sl.size());
}
ol.endLabels();
}
@@ -2552,11 +2572,14 @@ void ClassDefImpl::writeDocumentationContents(OutputList &ol,const QCString & /*
case LayoutDocEntry::NamespaceNestedNamespaces:
case LayoutDocEntry::NamespaceNestedConstantGroups:
case LayoutDocEntry::NamespaceClasses:
+ case LayoutDocEntry::NamespaceConcepts:
case LayoutDocEntry::NamespaceInterfaces:
case LayoutDocEntry::NamespaceStructs:
case LayoutDocEntry::NamespaceExceptions:
case LayoutDocEntry::NamespaceInlineClasses:
+ case LayoutDocEntry::ConceptDefinition:
case LayoutDocEntry::FileClasses:
+ case LayoutDocEntry::FileConcepts:
case LayoutDocEntry::FileInterfaces:
case LayoutDocEntry::FileStructs:
case LayoutDocEntry::FileExceptions:
@@ -2568,6 +2591,7 @@ void ClassDefImpl::writeDocumentationContents(OutputList &ol,const QCString & /*
case LayoutDocEntry::FileSourceLink:
case LayoutDocEntry::FileInlineClasses:
case LayoutDocEntry::GroupClasses:
+ case LayoutDocEntry::GroupConcepts:
case LayoutDocEntry::GroupInlineClasses:
case LayoutDocEntry::GroupNamespaces:
case LayoutDocEntry::GroupDirs:
@@ -2829,9 +2853,9 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const
}
ol.endQuickIndices();
}
- startTitle(ol,0);
+ startTitle(ol,QCString());
ol.parseText(displayName()+" "+theTranslator->trMemberList());
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
ol.startParagraph();
ol.parseText(theTranslator->trThisIsTheListOfAllMembers());
@@ -2853,7 +2877,7 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const
Specifier virt=md->virtualness();
//printf("%s: Member %s of class %s md->protection()=%d mi->prot=%d prot=%d inherited=%d\n",
- // name().data(),md->name().data(),cd->name().data(),md->protection(),mi->prot,prot,mi->inherited);
+ // qPrint(name()),qPrint(md->name()),qPrint(cd->name()),md->protection(),mi->prot,prot,mi->inherited);
if (cd && !md->name().isEmpty() && !md->isAnonymous())
{
@@ -2899,7 +2923,7 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const
md->anchor(),name);
if ( md->isFunction() || md->isSignal() || md->isSlot() ||
- (md->isFriend() && md->argsString()))
+ (md->isFriend() && md->argsString().isEmpty()))
ol.docify(md->argsString());
else if (md->isEnumerate())
ol.parseText(" "+theTranslator->trEnumName());
@@ -2907,7 +2931,7 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const
ol.parseText(" "+theTranslator->trEnumValue());
else if (md->isTypedef())
ol.docify(" typedef");
- else if (md->isFriend() && !qstrcmp(md->typeString(),"friend class"))
+ else if (md->isFriend() && md->typeString()=="friend class")
ol.docify(" class");
//ol.writeString("\n");
}
@@ -3000,50 +3024,56 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const
)
&& memberWritten)
{
- ol.writeString("<span class=\"mlabel\">");
- QStrList sl;
+ StringVector sl;
if (lang==SrcLangExt_VHDL)
{
- sl.append(theTranslator->trVhdlType(md->getMemberSpecifiers(),TRUE)); //append vhdl type
+ sl.push_back(theTranslator->trVhdlType(md->getMemberSpecifiers(),TRUE).str()); //append vhdl type
}
- else if (md->isFriend()) sl.append("friend");
- else if (md->isRelated()) sl.append("related");
+ else if (md->isFriend()) sl.push_back("friend");
+ else if (md->isRelated()) sl.push_back("related");
else
{
if (Config_getBool(INLINE_INFO) && md->isInline())
- sl.append("inline");
- if (md->isExplicit()) sl.append("explicit");
- if (md->isMutable()) sl.append("mutable");
- if (prot==Protected) sl.append("protected");
- else if (prot==Private) sl.append("private");
- else if (prot==Package) sl.append("package");
+ sl.push_back("inline");
+ if (md->isExplicit()) sl.push_back("explicit");
+ if (md->isMutable()) sl.push_back("mutable");
+ if (prot==Protected) sl.push_back("protected");
+ else if (prot==Private) sl.push_back("private");
+ else if (prot==Package) sl.push_back("package");
if (virt==Virtual && getLanguage()!=SrcLangExt_ObjC)
- sl.append("virtual");
- else if (virt==Pure) sl.append("pure virtual");
- if (md->isStatic()) sl.append("static");
- if (md->isSignal()) sl.append("signal");
- if (md->isSlot()) sl.append("slot");
+ sl.push_back("virtual");
+ else if (virt==Pure) sl.push_back("pure virtual");
+ if (md->isStatic()) sl.push_back("static");
+ if (md->isSignal()) sl.push_back("signal");
+ if (md->isSlot()) sl.push_back("slot");
// this is the extra member page
- if (md->isOptional()) sl.append("optional");
- if (md->isAttribute()) sl.append("attribute");
- if (md->isUNOProperty()) sl.append("property");
- if (md->isReadonly()) sl.append("readonly");
- if (md->isBound()) sl.append("bound");
- if (md->isRemovable()) sl.append("removable");
- if (md->isConstrained()) sl.append("constrained");
- if (md->isTransient()) sl.append("transient");
- if (md->isMaybeVoid()) sl.append("maybevoid");
- if (md->isMaybeDefault()) sl.append("maybedefault");
- if (md->isMaybeAmbiguous())sl.append("maybeambiguous");
+ if (md->isOptional()) sl.push_back("optional");
+ if (md->isAttribute()) sl.push_back("attribute");
+ if (md->isUNOProperty()) sl.push_back("property");
+ if (md->isReadonly()) sl.push_back("readonly");
+ if (md->isBound()) sl.push_back("bound");
+ if (md->isRemovable()) sl.push_back("removable");
+ if (md->isConstrained()) sl.push_back("constrained");
+ if (md->isTransient()) sl.push_back("transient");
+ if (md->isMaybeVoid()) sl.push_back("maybevoid");
+ if (md->isMaybeDefault()) sl.push_back("maybedefault");
+ if (md->isMaybeAmbiguous())sl.push_back("maybeambiguous");
}
- const char *s=sl.first();
- while (s)
+ bool firstSpan=true;
+ for (const auto &s : sl)
{
- ol.docify(s);
- s=sl.next();
- if (s) ol.writeString("</span><span class=\"mlabel\">");
+ if (!firstSpan)
+ {
+ ol.writeString("</span><span class=\"mlabel\">");
+ }
+ else
+ {
+ ol.writeString("<span class=\"mlabel\">");
+ firstSpan=false;
+ }
+ ol.docify(s.c_str());
}
- ol.writeString("</span>");
+ if (!firstSpan) ol.writeString("</span>");
}
if (memberWritten)
{
@@ -3062,7 +3092,7 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const
}
// add a reference to an example
-bool ClassDefImpl::addExample(const char *anchor,const char *nameStr, const char *file)
+bool ClassDefImpl::addExample(const QCString &anchor,const QCString &nameStr, const QCString &file)
{
return m_impl->examples.inSort(Example(anchor,nameStr,file));
}
@@ -3075,7 +3105,7 @@ bool ClassDefImpl::hasExamples() const
void ClassDefImpl::addTypeConstraint(const QCString &typeConstraint,const QCString &type)
{
- //printf("addTypeConstraint(%s,%s)\n",type.data(),typeConstraint.data());
+ //printf("addTypeConstraint(%s,%s)\n",qPrint(type),qPrint(typeConstraint));
static bool hideUndocRelation = Config_getBool(HIDE_UNDOC_RELATIONS);
if (typeConstraint.isEmpty() || type.isEmpty()) return;
SymbolResolver resolver(getFileDef());
@@ -3095,7 +3125,7 @@ void ClassDefImpl::addTypeConstraint(const QCString &typeConstraint,const QCStri
cd->setUsedOnly(TRUE);
cd->setLanguage(getLanguage());
//printf("Adding undocumented constraint '%s' to class %s on type %s\n",
- // typeConstraint.data(),name().data(),type.data());
+ // qPrint(typeConstraint),qPrint(name()),qPrint(type));
}
}
if (cd)
@@ -3111,7 +3141,7 @@ void ClassDefImpl::addTypeConstraint(const QCString &typeConstraint,const QCStri
}
(*it).addAccessor(type);
//printf("Adding constraint '%s' to class %s on type %s\n",
- // typeConstraint.data(),name().data(),type.data());
+ // qPrint(typeConstraint),qPrint(name()),qPrint(type));
}
}
@@ -3180,13 +3210,23 @@ bool ClassDefImpl::hasNonReferenceSuperClass() const
return found;
}
+QCString ClassDefImpl::requiresClause() const
+{
+ return m_impl->requiresClause;
+}
+
+void ClassDefImpl::setRequiresClause(const QCString &req)
+{
+ m_impl->requiresClause = req;
+}
+
/*! called from MemberDef::writeDeclaration() to (recursively) write the
* definition of an anonymous struct, union or class.
*/
void ClassDefImpl::writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup,
- const ClassDef *inheritedFrom,const char *inheritId) const
+ const ClassDef *inheritedFrom,const QCString &inheritId) const
{
- //printf("ClassName='%s' inGroup=%d\n",name().data(),inGroup);
+ //printf("ClassName='%s' inGroup=%d\n",qPrint(name()),inGroup);
ol.docify(compoundTypeString());
QCString cn = displayName(FALSE);
@@ -3195,7 +3235,7 @@ void ClassDefImpl::writeDeclaration(OutputList &ol,const MemberDef *md,bool inGr
ol.docify(" ");
if (md && isLinkable())
{
- ol.writeObjectLink(0,0,md->anchor(),cn);
+ ol.writeObjectLink(QCString(),QCString(),md->anchor(),cn);
}
else
{
@@ -3296,7 +3336,7 @@ bool ClassDefImpl::hasDocumentation() const
bool ClassDefImpl::isBaseClass(const ClassDef *bcd, bool followInstances,int level) const
{
bool found=FALSE;
- //printf("isBaseClass(cd=%s) looking for %s\n",name().data(),bcd->name().data());
+ //printf("isBaseClass(cd=%s) looking for %s\n",qPrint(name()),qPrint(bcd->name()));
if (level>256)
{
err("Possible recursive class relation while inside %s and looking for base class %s\n",qPrint(name()),qPrint(bcd->name()));
@@ -3356,7 +3396,7 @@ void ClassDefImpl::mergeMembers()
uint sepLen = sep.length();
m_impl->membersMerged=TRUE;
- //printf(" mergeMembers for %s\n",name().data());
+ //printf(" mergeMembers for %s\n",qPrint(name()));
static bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
for (const auto &bcd : baseClasses())
@@ -3393,7 +3433,7 @@ void ClassDefImpl::mergeMembers()
if (srcMd!=dstMd) // different members
{
const ClassDef *dstCd = dstMd->getClassDef();
- //printf(" Is %s a base class of %s?\n",srcCd->name().data(),dstCd->name().data());
+ //printf(" Is %s a base class of %s?\n",qPrint(srcCd->name()),qPrint(dstCd->name()));
if (srcCd==dstCd || dstCd->isBaseClass(srcCd,TRUE))
// member is in the same or a base class
{
@@ -3405,8 +3445,8 @@ void ClassDefImpl::mergeMembers()
TRUE
);
//printf(" Yes, matching (%s<->%s): %d\n",
- // argListToString(srcMd->argumentList()).data(),
- // argListToString(dstMd->argumentList()).data(),
+ // qPrint(argListToString(srcMd->argumentList())),
+ // qPrint(argListToString(dstMd->argumentList())),
// found);
hidden = hidden || !found;
}
@@ -3414,9 +3454,9 @@ void ClassDefImpl::mergeMembers()
// using the same base class.
{
//printf("$$ Existing member %s %s add scope %s\n",
- // dstMi->ambiguityResolutionScope.data(),
- // dstMd->name().data(),
- // dstMi->scopePath.left(dstMi->scopePath.find("::")+2).data());
+ // qPrint(dstMi->ambiguityResolutionScope),
+ // qPrint(dstMd->name()),
+ // qPrint(dstMi->scopePath.left(dstMi->scopePath.find("::")+2));
QCString scope=dstMi->scopePath().left((uint)dstMi->scopePath().find(sep)+sepLen);
if (scope!=dstMi->ambiguityResolutionScope().left(scope.length()))
@@ -3443,9 +3483,9 @@ void ClassDefImpl::mergeMembers()
// inheritance tree
{
//printf("$$ Existing member %s %s add scope %s\n",
- // dstMi->ambiguityResolutionScope.data(),
- // dstMd->name().data(),
- // dstMi->scopePath.left(dstMi->scopePath.find("::")+2).data());
+ // qPrint(dstMi->ambiguityResolutionScope),
+ // qPrint(dstMd->name()),
+ // qPrint(dstMi->scopePath.left(dstMi->scopePath.find("::")+2));
QCString scope=dstMi->scopePath().left((uint)dstMi->scopePath().find(sep)+sepLen);
if (scope!=dstMi->ambiguityResolutionScope().left(scope.length()))
@@ -3458,7 +3498,7 @@ void ClassDefImpl::mergeMembers()
if (found) break;
}
//printf("member %s::%s hidden %d ambiguous %d srcMi->ambigClass=%p\n",
- // srcCd->name().data(),srcMd->name().data(),hidden,ambiguous,srcMi->ambigClass);
+ // qPrint(srcCd->name()),qPrint(srcMd->name()),hidden,ambiguous,srcMi->ambigClass);
// TODO: fix the case where a member is hidden by inheritance
// of a member with the same name but with another prototype,
@@ -3477,7 +3517,7 @@ void ClassDefImpl::mergeMembers()
{
if (!isStandardFunc(srcMd))
{
- //printf(" insertMember '%s'\n",srcMd->name().data());
+ //printf(" insertMember '%s'\n",qPrint(srcMd->name()));
internalInsertMember(srcMd,prot,FALSE);
}
}
@@ -3490,9 +3530,9 @@ void ClassDefImpl::mergeMembers()
if (ambiguous)
{
//printf("$$ New member %s %s add scope %s::\n",
- // srcMi->ambiguityResolutionScope.data(),
- // srcMd->name().data(),
- // bClass->name().data());
+ // qPrint(srcMi->ambiguityResolutionScope),
+ // qPrint(srcMd->name()),
+ // qPrint(bClass->name()));
QCString scope=bClass->name()+sep;
if (scope!=srcMi->ambiguityResolutionScope().left(scope.length()))
@@ -3538,7 +3578,7 @@ void ClassDefImpl::mergeMembers()
prot=Private;
}
//printf("%s::%s: prot=%d bcd.prot=%d result=%d\n",
- // name().data(),mi->memberDef->name().data(),mi->prot,
+ // qPrint(name()),qPrint(mi->memberDef->name()),mi->prot,
// bcd.prot,prot);
if (prot!=Private || extractPrivate)
@@ -3550,7 +3590,7 @@ void ClassDefImpl::mergeMembers()
{
if (!isStandardFunc(mi->memberDef()))
{
- //printf(" insertMember '%s'\n",mi->memberDef->name().data());
+ //printf(" insertMember '%s'\n",qPrint(mi->memberDef->name()));
internalInsertMember(mi->memberDef(),prot,FALSE);
}
}
@@ -3609,7 +3649,7 @@ void ClassDefImpl::mergeCategory(ClassDef *cat)
}
}
// make methods private for categories defined in the .m file
- //printf("%s::mergeCategory makePrivate=%d\n",name().data(),makePrivate);
+ //printf("%s::mergeCategory makePrivate=%d\n",qPrint(name()),makePrivate);
const MemberNameInfoLinkedMap &srcMnd = category->memberNameInfoLinkedMap();
MemberNameInfoLinkedMap &dstMnd = m_impl->allMemberNameInfoLinkedMap;
@@ -3644,13 +3684,13 @@ void ClassDefImpl::mergeCategory(ClassDef *cat)
// copy the member(s) from the category to this class
for (auto &mi : *srcMni)
{
- //printf("Adding '%s'\n",mi->memberDef->name().data());
+ //printf("Adding '%s'\n",qPrint(mi->memberDef->name()));
Protection prot = mi->prot();
//if (makePrivate) prot = Private;
std::unique_ptr<MemberDefMutable> newMd { toMemberDefMutable(mi->memberDef()->deepCopy()) };
if (newMd)
{
- //printf("Copying member %s\n",mi->memberDef->name().data());
+ //printf("Copying member %s\n",qPrint(mi->memberDef->name()));
newMd->moveTo(this);
std::unique_ptr<MemberInfo> newMi=std::make_unique<MemberInfo>(newMd.get(),prot,mi->virt(),mi->inherited());
@@ -3689,13 +3729,13 @@ void ClassDefImpl::mergeCategory(ClassDef *cat)
//----------------------------------------------------------------------------
-void ClassDefImpl::addUsedClass(ClassDef *cd,const char *accessName,
+void ClassDefImpl::addUsedClass(ClassDef *cd,const QCString &accessName,
Protection prot)
{
static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
static bool umlLook = Config_getBool(UML_LOOK);
if (prot==Private && !extractPrivate) return;
- //printf("%s::addUsedClass(%s,%s)\n",name().data(),cd->name().data(),accessName);
+ //printf("%s::addUsedClass(%s,%s)\n",qPrint(name()),qPrint(cd->name()),accessName);
auto it = std::find_if(m_impl->usesImplClassList.begin(),
m_impl->usesImplClassList.end(),
@@ -3704,7 +3744,7 @@ void ClassDefImpl::addUsedClass(ClassDef *cd,const char *accessName,
{
m_impl->usesImplClassList.emplace_back(cd);
//printf("Adding used class %s to class %s via accessor %s\n",
- // cd->name().data(),name().data(),accessName);
+ // qPrint(cd->name()),qPrint(name()),accessName);
it = m_impl->usesImplClassList.end()-1;
}
QCString acc = accessName;
@@ -3721,13 +3761,13 @@ void ClassDefImpl::addUsedClass(ClassDef *cd,const char *accessName,
(*it).addAccessor(acc);
}
-void ClassDefImpl::addUsedByClass(ClassDef *cd,const char *accessName,
+void ClassDefImpl::addUsedByClass(ClassDef *cd,const QCString &accessName,
Protection prot)
{
static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
static bool umlLook = Config_getBool(UML_LOOK);
if (prot==Private && !extractPrivate) return;
- //printf("%s::addUsedByClass(%s,%s)\n",name().data(),cd->name().data(),accessName);
+ //printf("%s::addUsedByClass(%s,%s)\n",qPrint(name()),qPrint(cd->name()),accessName);
//
auto it = std::find_if(m_impl->usedByImplClassList.begin(),
m_impl->usedByImplClassList.end(),
@@ -3736,7 +3776,7 @@ void ClassDefImpl::addUsedByClass(ClassDef *cd,const char *accessName,
{
m_impl->usedByImplClassList.emplace_back(cd);
//printf("Adding used by class %s to class %s\n",
- // cd->name().data(),name().data());
+ // qPrint(cd->name()),qPrint(name()));
it = m_impl->usedByImplClassList.end()-1;
}
QCString acc = accessName;
@@ -3845,7 +3885,7 @@ QCString ClassDefImpl::getSourceFileBase() const
void ClassDefImpl::setGroupDefForAllMembers(GroupDef *gd,Grouping::GroupPri_t pri,const QCString &fileName,int startLine,bool hasDocs)
{
gd->addClass(this);
- //printf("ClassDefImpl::setGroupDefForAllMembers(%s)\n",gd->name().data());
+ //printf("ClassDefImpl::setGroupDefForAllMembers(%s)\n",qPrint(gd->name()));
for (auto &mni : m_impl->allMemberNameInfoLinkedMap)
{
for (auto &mi : *mni)
@@ -3864,7 +3904,7 @@ void ClassDefImpl::setGroupDefForAllMembers(GroupDef *gd,Grouping::GroupPri_t pr
void ClassDefImpl::addInnerCompound(const Definition *d)
{
- //printf("**** %s::addInnerCompound(%s)\n",name().data(),d->name().data());
+ //printf("**** %s::addInnerCompound(%s)\n",qPrint(name()),qPrint(d->name()));
if (d->definitionType()==Definition::TypeClass) // only classes can be
// nested in classes.
{
@@ -3872,7 +3912,7 @@ void ClassDefImpl::addInnerCompound(const Definition *d)
}
}
-const Definition *ClassDefImpl::findInnerCompound(const char *name) const
+const Definition *ClassDefImpl::findInnerCompound(const QCString &name) const
{
return m_impl->innerClasses.find(name);
}
@@ -3945,9 +3985,9 @@ const TemplateNameMap &ClassDefImpl::getTemplateBaseClassNames() const
return m_impl->templBaseClassNames;
}
-void ClassDefImpl::addMembersToTemplateInstance(const ClassDef *cd,const ArgumentList &templateArguments,const char *templSpec)
+void ClassDefImpl::addMembersToTemplateInstance(const ClassDef *cd,const ArgumentList &templateArguments,const QCString &templSpec)
{
- //printf("%s::addMembersToTemplateInstance(%s,%s)\n",name().data(),cd->name().data(),templSpec);
+ //printf("%s::addMembersToTemplateInstance(%s,%s)\n",qPrint(name()),qPrint(cd->name()),templSpec);
for (const auto &mni : cd->memberNameInfoLinkedMap())
{
for (const auto &mi : *mni)
@@ -3956,7 +3996,7 @@ void ClassDefImpl::addMembersToTemplateInstance(const ClassDef *cd,const Argumen
const MemberDef *md = mi->memberDef();
std::unique_ptr<MemberDefMutable> imd { md->createTemplateInstanceMember(
templateArguments,actualArguments_p) };
- //printf("%s->setMemberClass(%p)\n",imd->name().data(),this);
+ //printf("%s->setMemberClass(%p)\n",qPrint(imd->name()),this);
imd->setMemberClass(this);
imd->setTemplateMaster(md);
imd->setDocumentation(md->documentation(),md->docFile(),md->docLine());
@@ -3966,10 +4006,10 @@ void ClassDefImpl::addMembersToTemplateInstance(const ClassDef *cd,const Argumen
imd->setMemberGroupId(md->getMemberGroupId());
insertMember(imd.get());
//printf("Adding member=%s %s%s to class %s templSpec %s\n",
- // imd->typeString(),imd->name().data(),imd->argsString(),
- // imd->getClassDef()->name().data(),templSpec);
+ // imd->typeString(),qPrint(imd->name()),imd->argsString(),
+ // qPrint(imd->getClassDef()->name()),templSpec);
// insert imd in the list of all members
- //printf("Adding member=%s class=%s\n",imd->name().data(),name().data());
+ //printf("Adding member=%s class=%s\n",qPrint(imd->name()),qPrint(name()));
MemberName *mn = Doxygen::memberNameLinkedMap->add(imd->name());
mn->push_back(std::move(imd));
}
@@ -4043,7 +4083,7 @@ QCString ClassDefImpl::className() const
}
}
-void ClassDefImpl::setClassName(const char *name)
+void ClassDefImpl::setClassName(const QCString &name)
{
m_impl->className = name;
}
@@ -4052,7 +4092,7 @@ void ClassDefImpl::addListReferences()
{
SrcLangExt lang = getLanguage();
if (!isLinkableInProject()) return;
- //printf("ClassDef(%s)::addListReferences()\n",name().data());
+ //printf("ClassDef(%s)::addListReferences()\n",qPrint(name()));
{
const RefItemVector &xrefItems = xrefListItems();
addRefItem(xrefItems,
@@ -4061,7 +4101,7 @@ void ClassDefImpl::addListReferences()
: theTranslator->trClass(TRUE,TRUE),
getOutputFileBase(),
displayName(),
- 0,
+ QCString(),
this
);
}
@@ -4091,7 +4131,7 @@ const MemberDef *ClassDefImpl::getMemberByName(const QCString &name) const
const ClassDef *mcd=mi->memberDef()->getClassDef();
int m=minClassDistance(this,mcd);
//printf("found member in %s linkable=%d m=%d\n",
- // mcd->name().data(),mcd->isLinkable(),m);
+ // qPrint(mcd->name()),mcd->isLinkable(),m);
if (m<mdist && mcd->isLinkable())
{
mdist=m;
@@ -4099,7 +4139,7 @@ const MemberDef *ClassDefImpl::getMemberByName(const QCString &name) const
}
}
}
- //printf("getMemberByName(%s)=%p\n",name.data(),xmd);
+ //printf("getMemberByName(%s)=%p\n",qPrint(name),xmd);
return xmd;
}
@@ -4158,7 +4198,7 @@ void ClassDefImpl::sortMemberLists()
int ClassDefImpl::countMemberDeclarations(MemberListType lt,const ClassDef *inheritedFrom,
int lt2,bool invert,bool showAlways,ClassDefSet &visitedClasses) const
{
- //printf("%s: countMemberDeclarations for %d and %d\n",name().data(),lt,lt2);
+ //printf("%s: countMemberDeclarations for %d and %d\n",qPrint(name()),lt,lt2);
int count=0;
MemberList * ml = getMemberList(lt);
MemberList * ml2 = getMemberList((MemberListType)lt2);
@@ -4238,7 +4278,7 @@ int ClassDefImpl::countInheritedDecMembers(MemberListType lt,
int count = countMembersIncludingGrouped(lt,inheritedFrom,FALSE);
bool process = count>0;
//printf("%s: countInheritedDecMembers: lt=%d process=%d count=%d invert=%d\n",
- // name().data(),lt,process,count,invert);
+ // qPrint(name()),lt,process,count,invert);
if ((process^invert) || showAlways)
{
for (const auto &ibcd : m_impl->inherits)
@@ -4249,7 +4289,7 @@ int ClassDefImpl::countInheritedDecMembers(MemberListType lt,
{
convertProtectionLevel(lt,ibcd.prot,&lt1,&lt2);
//printf("%s: convert %d->(%d,%d) prot=%d\n",
- // icd->name().data(),lt,lt1,lt2,ibcd->prot);
+ // qPrint(icd->name()),lt,lt1,lt2,ibcd->prot);
if (visitedClasses.find(icd)==visitedClasses.end())
{
visitedClasses.insert(icd); // guard for multiple virtual inheritance
@@ -4330,7 +4370,7 @@ int ClassDefImpl::countMembersIncludingGrouped(MemberListType lt,
{
count=ml->countInheritableMembers(inheritedFrom);
}
- //printf("%s:countMembersIncludingGrouped: count=%d\n",name().data(),count);
+ //printf("%s:countMembersIncludingGrouped: count=%d\n",qPrint(name()),count);
for (const auto &mg : m_impl->memberGroups)
{
bool hasOwnSection = !mg->allMembersInSameSection() ||
@@ -4341,7 +4381,7 @@ int ClassDefImpl::countMembersIncludingGrouped(MemberListType lt,
}
}
//printf("%s:countMembersIncludingGrouped(lt=%d,%s)=%d\n",
- // name().data(),lt,ml?ml->listTypeAsString(ml->listType()).data():"<none>",count);
+ // qPrint(name()),lt,ml?qPrint(ml->listTypeAsString(ml->listType())):"<none>",count);
return count;
}
@@ -4355,7 +4395,7 @@ void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol,ClassDefSet &
int count = countMembersIncludingGrouped(lt,inheritedFrom,FALSE);
bool process = count>0;
//printf("%s: writeInheritedMemberDec: lt=%d process=%d invert=%d always=%d\n",
- // name().data(),lt,process,invert,showAlways);
+ // qPrint(name()),lt,process,invert,showAlways);
if ((process^invert) || showAlways)
{
for (const auto &ibcd : m_impl->inherits)
@@ -4369,7 +4409,7 @@ void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol,ClassDefSet &
{
lt2=lt3;
}
- //printf("%s:convert %d->(%d,%d) prot=%d\n",icd->name().data(),lt,lt1,lt2,ibcd->prot);
+ //printf("%s:convert %d->(%d,%d) prot=%d\n",qPrint(icd->name()),lt,lt1,lt2,ibcd->prot);
if (visitedClasses.find(icd)==visitedClasses.end())
{
visitedClasses.insert(icd); // guard for multiple virtual inheritance
@@ -4381,7 +4421,7 @@ void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol,ClassDefSet &
}
else
{
- //printf("%s: class already visited!\n",icd->name().data());
+ //printf("%s: class already visited!\n",qPrint(icd->name()));
}
}
}
@@ -4391,10 +4431,10 @@ void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol,ClassDefSet &
void ClassDefImpl::writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedClasses,
MemberListType lt,const QCString &title,
- const char *subTitle,bool showInline,const ClassDef *inheritedFrom,int lt2,
+ const QCString &subTitle,bool showInline,const ClassDef *inheritedFrom,int lt2,
bool invert,bool showAlways) const
{
- //printf("%s: ClassDefImpl::writeMemberDeclarations lt=%d lt2=%d\n",name().data(),lt,lt2);
+ //printf("%s: ClassDefImpl::writeMemberDeclarations lt=%d lt2=%d\n",qPrint(name()),lt,lt2);
MemberList * ml = getMemberList(lt);
MemberList * ml2 = getMemberList((MemberListType)lt2);
if (getLanguage()==SrcLangExt_VHDL) // use specific declarations function
@@ -4412,7 +4452,7 @@ void ClassDefImpl::writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedCl
}
else
{
- //printf("%s::writeMemberDeclarations(%s) ml=%p ml2=%p\n",name().data(),title.data(),ml,ml2);
+ //printf("%s::writeMemberDeclarations(%s) ml=%p ml2=%p\n",qPrint(name()),qPrint(title),ml,ml2);
QCString tt = title, st = subTitle;
if (ml)
{
@@ -4439,7 +4479,7 @@ void ClassDefImpl::writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedCl
void ClassDefImpl::addGroupedInheritedMembers(OutputList &ol,MemberListType lt,
const ClassDef *inheritedFrom,const QCString &inheritId) const
{
- //printf("** %s::addGroupedInheritedMembers(%p) inheritId=%s\n",name().data(),m_impl->memberGroupSDict,inheritId.data());
+ //printf("** %s::addGroupedInheritedMembers(%p) inheritId=%s\n",qPrint(name()),m_impl->memberGroupSDict,qPrint(inheritId));
for (const auto &mg : m_impl->memberGroups)
{
if (!mg->allMembersInSameSection() || !m_impl->subGrouping) // group is in its own section
@@ -4451,23 +4491,23 @@ void ClassDefImpl::addGroupedInheritedMembers(OutputList &ol,MemberListType lt,
void ClassDefImpl::writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title,bool showInline) const
{
- //printf("%s: ClassDefImpl::writeMemberDocumentation()\n",name().data());
+ //printf("%s: ClassDefImpl::writeMemberDocumentation()\n",qPrint(name()));
MemberList * ml = getMemberList(lt);
if (ml) ml->writeDocumentation(ol,displayName(),this,title,FALSE,showInline);
}
void ClassDefImpl::writeSimpleMemberDocumentation(OutputList &ol,MemberListType lt) const
{
- //printf("%s: ClassDefImpl::writeSimpleMemberDocumentation()\n",name().data());
+ //printf("%s: ClassDefImpl::writeSimpleMemberDocumentation()\n",qPrint(name()));
MemberList * ml = getMemberList(lt);
if (ml) ml->writeSimpleDocumentation(ol,this);
}
void ClassDefImpl::writePlainMemberDeclaration(OutputList &ol,
MemberListType lt,bool inGroup,
- const ClassDef *inheritedFrom,const char *inheritId) const
+ const ClassDef *inheritedFrom,const QCString &inheritId) const
{
- //printf("%s: ClassDefImpl::writePlainMemberDeclaration()\n",name().data());
+ //printf("%s: ClassDefImpl::writePlainMemberDeclaration()\n",qPrint(name()));
MemberList * ml = getMemberList(lt);
if (ml)
{
@@ -4491,7 +4531,7 @@ ClassDefImpl::CompoundType ClassDefImpl::compoundType() const
return m_impl->compType;
}
-BaseClassList ClassDefImpl::baseClasses() const
+const BaseClassList &ClassDefImpl::baseClasses() const
{
return m_impl->inherits;
}
@@ -4501,7 +4541,7 @@ void ClassDefImpl::updateBaseClasses(const BaseClassList &bcd)
m_impl->inherits = bcd;
}
-BaseClassList ClassDefImpl::subClasses() const
+const BaseClassList &ClassDefImpl::subClasses() const
{
return m_impl->inheritedBy;
}
@@ -4536,10 +4576,10 @@ const ArgumentList &ClassDefImpl::templateArguments() const
return m_impl->tempArgs;
}
-NamespaceDef *ClassDefImpl::getNamespaceDef() const
-{
- return m_impl->nspace;
-}
+//NamespaceDef *ClassDefImpl::getNamespaceDef() const
+//{
+// return m_impl->nspace;
+//}
FileDef *ClassDefImpl::getFileDef() const
{
@@ -4646,11 +4686,6 @@ const MemberGroupList &ClassDefImpl::getMemberGroups() const
return m_impl->memberGroups;
}
-void ClassDefImpl::setNamespace(NamespaceDef *nd)
-{
- m_impl->nspace = nd;
-}
-
void ClassDefImpl::setFileDef(FileDef *fd)
{
m_impl->fileDef=fd;
@@ -4764,8 +4799,8 @@ bool ClassDefImpl::isEmbeddedInOuterScope() const
//printf("%s::isEmbeddedInOuterScope(): inlineGroupedClasses=%d "
// "inlineSimpleClasses=%d partOfGroups()=%p m_impl->isSimple=%d "
// "getOuterScope()=%s b1=%d b2=%d\n",
- // name().data(),inlineGroupedClasses,inlineSimpleClasses,
- // partOfGroups().pointer(),m_impl->isSimple,getOuterScope()?getOuterScope()->name().data():"<none>",b1,b2);
+ // qPrint(name()),inlineGroupedClasses,inlineSimpleClasses,
+ // partOfGroups().pointer(),m_impl->isSimple,getOuterScope()?qPrint(getOuterScope()->name()):"<none>",b1,b2);
return b1 || b2; // either reason will do
}
@@ -4831,12 +4866,12 @@ bool ClassDefImpl::isSliceLocal() const
return m_impl->spec&Entry::Local;
}
-void ClassDefImpl::setName(const char *name)
+void ClassDefImpl::setName(const QCString &name)
{
DefinitionMixin::setName(name);
}
-void ClassDefImpl::setMetaData(const char *md)
+void ClassDefImpl::setMetaData(const QCString &md)
{
m_impl->metaData = md;
}
diff --git a/src/classdef.h b/src/classdef.h
index ea14675..2c8f870 100644
--- a/src/classdef.h
+++ b/src/classdef.h
@@ -43,7 +43,6 @@ class PackageDef;
class GroupDef;
struct IncludeInfo;
class ClassDefImpl;
-class FTextStream;
class ClassDef;
class ClassDefMutable;
class UsesClassList;
@@ -54,7 +53,7 @@ class MemberGroupList;
*/
struct BaseClassDef
{
- BaseClassDef(ClassDef *cd,const char *n,Protection p, Specifier v,const char *t) :
+ BaseClassDef(ClassDef *cd,const QCString &n,Protection p, Specifier v,const QCString &t) :
classDef(cd), usedName(n), prot(p), virt(v), templSpecifiers(t) {}
/** Class definition that this relation inherits from. */
@@ -168,14 +167,14 @@ class ClassDef : public Definition
/** Returns the list of base classes from which this class directly
* inherits.
*/
- virtual BaseClassList baseClasses() const = 0;
+ virtual const BaseClassList &baseClasses() const = 0;
/** Update the list of base classes to the one passed */
virtual void updateBaseClasses(const BaseClassList &bcd) = 0;
/** Returns the list of sub classes that directly derive from this class
*/
- virtual BaseClassList subClasses() const = 0;
+ virtual const BaseClassList &subClasses() const = 0;
/** Update the list of sub classes to the one passed */
virtual void updateSubClasses(const BaseClassList &bcd) = 0;
@@ -212,7 +211,7 @@ class ClassDef : public Definition
/** Returns the namespace this compound is in, or 0 if it has a global
* scope.
*/
- virtual NamespaceDef *getNamespaceDef() const = 0;
+ //virtual NamespaceDef *getNamespaceDef() const = 0;
/** Returns the file in which this compound's definition can be found.
* Should not return 0 (but it might be a good idea to check anyway).
@@ -267,7 +266,7 @@ class ClassDef : public Definition
* available, or 0 otherwise.
* @param name The name of the nested compound
*/
- virtual const Definition *findInnerCompound(const char *name) const = 0;
+ virtual const Definition *findInnerCompound(const QCString &name) const = 0;
/** Returns the template parameter lists that form the template
* declaration of this class.
@@ -359,6 +358,8 @@ class ClassDef : public Definition
virtual bool isSliceLocal() const = 0;
virtual bool hasNonReferenceSuperClass() const = 0;
+ virtual QCString requiresClause() const = 0;
+
//-----------------------------------------------------------------------------------
// --- count members ----
//-----------------------------------------------------------------------------------
@@ -376,7 +377,7 @@ class ClassDef : public Definition
virtual ClassDef *insertTemplateInstance(const QCString &fileName,int startLine,int startColumn,
const QCString &templSpec,bool &freshInstance) const = 0;
virtual void writeDeclarationLink(OutputList &ol,bool &found,
- const char *header,bool localNames) const = 0;
+ const QCString &header,bool localNames) const = 0;
};
@@ -387,15 +388,14 @@ class ClassDefMutable : public DefinitionMutable, public ClassDef
// --- setters ----
//-----------------------------------------------------------------------------------
- virtual void setIncludeFile(FileDef *fd,const char *incName,bool local,bool force) = 0;
- virtual void setNamespace(NamespaceDef *nd) = 0;
+ virtual void setIncludeFile(FileDef *fd,const QCString &incName,bool local,bool force) = 0;
virtual void setFileDef(FileDef *fd) = 0;
virtual void setSubGrouping(bool enabled) = 0;
virtual void setProtection(Protection p) = 0;
virtual void setGroupDefForAllMembers(GroupDef *g,Grouping::GroupPri_t pri,const QCString &fileName,int startLine,bool hasDocs) = 0;
virtual void setIsStatic(bool b) = 0;
virtual void setCompoundType(CompoundType t) = 0;
- virtual void setClassName(const char *name) = 0;
+ virtual void setClassName(const QCString &name) = 0;
virtual void setClassSpecifier(uint64 spec) = 0;
virtual void setTemplateArguments(const ArgumentList &al) = 0;
virtual void setTemplateBaseClassNames(const TemplateNameMap &templateNames) = 0;
@@ -404,22 +404,23 @@ class ClassDefMutable : public DefinitionMutable, public ClassDef
virtual void setCategoryOf(ClassDef *cd) = 0;
virtual void setUsedOnly(bool b) = 0;
virtual void setTagLessReference(const ClassDef *cd) = 0;
- virtual void setName(const char *name) = 0;
- virtual void setMetaData(const char *md) = 0;
+ virtual void setName(const QCString &name) = 0;
+ virtual void setMetaData(const QCString &md) = 0;
+ virtual void setRequiresClause(const QCString &req) = 0;
//-----------------------------------------------------------------------------------
// --- actions ----
//-----------------------------------------------------------------------------------
- virtual void insertBaseClass(ClassDef *,const char *name,Protection p,Specifier s,const char *t=0) = 0;
- virtual void insertSubClass(ClassDef *,Protection p,Specifier s,const char *t=0) = 0;
+ virtual void insertBaseClass(ClassDef *,const QCString &name,Protection p,Specifier s,const QCString &t=QCString()) = 0;
+ virtual void insertSubClass(ClassDef *,Protection p,Specifier s,const QCString &t=QCString()) = 0;
virtual void insertMember(MemberDef *) = 0;
virtual void insertUsedFile(const FileDef *) = 0;
- virtual void addMembersToTemplateInstance(const ClassDef *cd,const ArgumentList &templateArguments,const char *templSpec) = 0;
+ virtual void addMembersToTemplateInstance(const ClassDef *cd,const ArgumentList &templateArguments,const QCString &templSpec) = 0;
virtual void addInnerCompound(const Definition *d) = 0;
- virtual bool addExample(const char *anchor,const char *name, const char *file) = 0;
- virtual void addUsedClass(ClassDef *cd,const char *accessName,Protection prot) = 0;
- virtual void addUsedByClass(ClassDef *cd,const char *accessName,Protection prot) = 0;
+ virtual bool addExample(const QCString &anchor,const QCString &name, const QCString &file) = 0;
+ virtual void addUsedClass(ClassDef *cd,const QCString &accessName,Protection prot) = 0;
+ virtual void addUsedByClass(ClassDef *cd,const QCString &accessName,Protection prot) = 0;
virtual void makeTemplateArgument(bool b=TRUE) = 0;
virtual void mergeCategory(ClassDef *category) = 0;
virtual void findSectionsInDocumentation() = 0;
@@ -445,14 +446,15 @@ class ClassDefMutable : public DefinitionMutable, public ClassDef
virtual void writeMemberPages(OutputList &ol) const = 0;
virtual void writeMemberList(OutputList &ol) const = 0;
virtual void writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup,
- const ClassDef *inheritedFrom,const char *inheritId) const = 0;
+ const ClassDef *inheritedFrom,const QCString &inheritId) const = 0;
virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *md) const = 0;
virtual void writeSummaryLinks(OutputList &ol) const = 0;
virtual void writeInlineDocumentation(OutputList &ol) const = 0;
- virtual void writeTagFile(FTextStream &) = 0;
+ virtual void writeTagFile(TextStream &) = 0;
virtual void writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedClasses,
MemberListType lt,const QCString &title,
- const char *subTitle=0,bool showInline=FALSE,const ClassDef *inheritedFrom=0,
+ const QCString &subTitle=QCString(),
+ bool showInline=FALSE,const ClassDef *inheritedFrom=0,
int lt2=-1,bool invert=FALSE,bool showAlways=FALSE) const = 0;
virtual void addGroupedInheritedMembers(OutputList &ol,MemberListType lt,
const ClassDef *inheritedFrom,const QCString &inheritId) const = 0;
@@ -462,9 +464,9 @@ class ClassDefMutable : public DefinitionMutable, public ClassDef
/** Factory method to create a new ClassDef object */
ClassDefMutable *createClassDef(
- const char *fileName,int startLine,int startColumn,
- const char *name,ClassDef::CompoundType ct,
- const char *ref=0,const char *fName=0,
+ const QCString &fileName,int startLine,int startColumn,
+ const QCString &name,ClassDef::CompoundType ct,
+ const QCString &ref=QCString(),const QCString &fName=QCString(),
bool isSymbol=TRUE,bool isJavaEnum=FALSE);
ClassDef *createClassDefAlias(const Definition *newScope,const ClassDef *cd);
@@ -489,11 +491,11 @@ struct UsesClassDef
~UsesClassDef()
{
}
- void addAccessor(const char *s)
+ void addAccessor(const QCString &s)
{
- if (accessors.find(s)==accessors.end())
+ if (accessors.find(s.str())==accessors.end())
{
- accessors.insert(s);
+ accessors.insert(s.str());
}
}
/** Class definition that this relation uses. */
@@ -526,11 +528,11 @@ struct ConstraintClassDef
~ConstraintClassDef()
{
}
- void addAccessor(const char *s)
+ void addAccessor(const QCString &s)
{
- if (accessors.find(s)==accessors.end())
+ if (accessors.find(s.str())==accessors.end())
{
- accessors.insert(s);
+ accessors.insert(s.str());
}
}
/** Class definition that this relation uses. */
diff --git a/src/classlist.cpp b/src/classlist.cpp
index af64478..b4c2412 100644
--- a/src/classlist.cpp
+++ b/src/classlist.cpp
@@ -51,7 +51,7 @@ bool ClassLinkedRefMap::declVisible(const ClassDef::CompoundType *filter) const
}
void ClassLinkedRefMap::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter,
- const char *header,bool localNames) const
+ const QCString &header,bool localNames) const
{
static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
bool found=FALSE;
diff --git a/src/classlist.h b/src/classlist.h
index 709412b..75bc713 100644
--- a/src/classlist.h
+++ b/src/classlist.h
@@ -31,7 +31,7 @@ class ClassLinkedRefMap : public LinkedRefMap<const ClassDef>
{
public:
bool declVisible(const ClassDef::CompoundType *filter=0) const;
- void writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter,const char *header,bool localNames) const;
+ void writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter,const QCString &header,bool localNames) const;
void writeDocumentation(OutputList &ol,const Definition * container=0) const;
};
diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp
index 264a74b..bc8719a 100644
--- a/src/cmdmapper.cpp
+++ b/src/cmdmapper.cpp
@@ -233,10 +233,10 @@ CommandMap htmlTagMap[] =
Mapper *Mappers::cmdMapper = new Mapper(cmdMap,true);
Mapper *Mappers::htmlTagMapper = new Mapper(htmlTagMap,false);
-int Mapper::map(const char *n)
+int Mapper::map(const QCString &n)
{
- QCString name=n;
- if (name.isEmpty()) return 0;
+ if (n.isEmpty()) return 0;
+ QCString name = n;
if (!m_cs) name=name.lower();
auto it = m_map.find(name.str());
return it!=m_map.end() ? it->second : 0;
diff --git a/src/cmdmapper.h b/src/cmdmapper.h
index 8cbf017..17e17e9 100644
--- a/src/cmdmapper.h
+++ b/src/cmdmapper.h
@@ -18,7 +18,7 @@
#include <map>
#include <string>
-#include <qcstring.h>
+#include "qcstring.h"
struct CommandMap;
@@ -218,7 +218,7 @@ enum HtmlTagType
class Mapper
{
public:
- int map(const char *n);
+ int map(const QCString &n);
QCString find(const int n);
Mapper(const CommandMap *cm,bool caseSensitive);
private:
diff --git a/src/code.h b/src/code.h
index ba24242..be50b27 100644
--- a/src/code.h
+++ b/src/code.h
@@ -1,12 +1,12 @@
/******************************************************************************
*
- *
+ *
*
* Copyright (C) 1997-2015 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
+ * 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.
*
@@ -31,11 +31,11 @@ class CCodeParser : public CodeParserInterface
CCodeParser();
virtual ~CCodeParser();
void parseCode(CodeOutputInterface &codeOutIntf,
- const char *scopeName,
+ const QCString &scopeName,
const QCString &input,
SrcLangExt lang,
bool isExampleBlock,
- const char *exampleName=0,
+ const QCString &exampleName=QCString(),
FileDef *fileDef=0,
int startLine=-1,
int endLine=-1,
diff --git a/src/code.l b/src/code.l
index be1f179..c8a1dba 100644
--- a/src/code.l
+++ b/src/code.l
@@ -34,11 +34,11 @@
#include <vector>
#include <string>
#include <mutex>
+#include <sstream>
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
-#include <qdir.h>
#include "code.h"
#include "entry.h"
@@ -58,6 +58,7 @@
#include "tooltip.h"
#include "scopedtypevariant.h"
#include "symbolresolver.h"
+#include "dir.h"
// Toggle for some debugging info
//#define DBG_CTX(x) fprintf x
@@ -77,7 +78,7 @@ struct ObjCCallCtx
int id;
QCString methodName;
QCString objectTypeOrName;
- QGString comment;
+ TextStream comment;
const ClassDef *objectType;
const MemberDef *objectVar;
const MemberDef *method;
@@ -92,7 +93,7 @@ struct codeYY_state
std::unordered_map< std::string, ScopedTypeVariant > codeClassMap;
QCString curClassName;
- QStrList curClassBases;
+ StringVector curClassBases;
QCString parmType;
QCString parmName;
@@ -182,7 +183,7 @@ struct codeYY_state
SymbolResolver symbolResolver;
};
-static bool isCastKeyword(const QCString &s);
+static bool isCastKeyword(const char *s);
//-------------------------------------------------------------------
#if USE_STATE2STRING
@@ -192,9 +193,10 @@ static const char *stateToString(yyscan_t yyscanner,int state);
static void saveObjCContext(yyscan_t yyscanner);
static void restoreObjCContext(yyscan_t yyscanner);
static void addUsingDirective(yyscan_t yyscanner,const char *name);
-static void pushScope(yyscan_t yyscanner,const char *s);
+static void pushScope(yyscan_t yyscanner,const QCString &s);
static void popScope(yyscan_t yyscanner);
static void setCurrentDoc(yyscan_t yyscanner,const QCString &anchor);
+static void addToSearchIndex(yyscan_t yyscanner,const QCString &text);
static void addToSearchIndex(yyscan_t yyscanner,const char *text);
static void setClassScope(yyscan_t yyscanner,const QCString &name);
static void startCodeLine(yyscan_t yyscanner);
@@ -202,37 +204,41 @@ static void endCodeLine(yyscan_t yyscanner);
static void nextCodeLine(yyscan_t yyscanner);
static void startFontClass(yyscan_t yyscanner,const char *s);
static void endFontClass(yyscan_t yyscanner);
+static void codifyLines(yyscan_t yyscanner,const QCString &text);
static void codifyLines(yyscan_t yyscanner,const char *text);
static void incrementFlowKeyWordCount(yyscan_t yyscanner);
static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
const Definition *d,
- const char *text);
+ const QCString &text);
static void addType(yyscan_t yyscanner);
static void addParmType(yyscan_t yyscanner);
static void addUsingDirective(yyscan_t yyscanner,const char *name);
static void setParameterList(yyscan_t yyscanner,const MemberDef *md);
-static const ClassDef *stripClassName(yyscan_t yyscanner,const char *s,const Definition *d);
+static const ClassDef *stripClassName(yyscan_t yyscanner,const QCString &s,const Definition *d);
static const MemberDef *setCallContextForVar(yyscan_t yyscanner,const QCString &name);
static void updateCallContextForSmartPointer(yyscan_t yyscanner);
static bool getLinkInScope(yyscan_t yyscanner,const QCString &c, // scope
const QCString &m, // member
- const char *memberText, // exact text
+ const QCString &memberText, // exact text
CodeOutputInterface &ol,
- const char *text,
+ const QCString &text,
bool varOnly=FALSE
);
-static bool getLink(yyscan_t yyscanner,const char *className,
- const char *memberName,
+static bool getLink(yyscan_t yyscanner,const QCString &className,
+ const QCString &memberName,
CodeOutputInterface &ol,
- const char *text=0,
+ const QCString &text=QCString(),
bool varOnly=FALSE);
+static void generateClassOrGlobalLink(yyscan_t yyscanner,CodeOutputInterface &ol,const QCString &clName,
+ bool typeOnly=FALSE,bool varOnly=FALSE);
static void generateClassOrGlobalLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *clName,
bool typeOnly=FALSE,bool varOnly=FALSE);
-static bool generateClassMemberLink(yyscan_t yyscanner,CodeOutputInterface &ol,const MemberDef *xmd,const char *memName);
-static bool generateClassMemberLink(yyscan_t yyscanner,CodeOutputInterface &ol,const Definition *def,const char *memName);
+static bool generateClassMemberLink(yyscan_t yyscanner,CodeOutputInterface &ol,const MemberDef *xmd,const QCString &memName);
+static bool generateClassMemberLink(yyscan_t yyscanner,CodeOutputInterface &ol,const Definition *def,const QCString &memName);
static void generateMemberLink(yyscan_t yyscanner,CodeOutputInterface &ol,const QCString &varName,
- const char *memName);
+ const QCString &memName);
static void generatePHPVariableLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *varName);
+static void generateFunctionLink(yyscan_t yyscanner,CodeOutputInterface &ol,const QCString &funcName);
static void generateFunctionLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *funcName);
static int countLines(yyscan_t yyscanner);
static void writeObjCMethodCall(yyscan_t yyscanner,ObjCCallCtx *ctx);
@@ -240,7 +246,7 @@ static QCString escapeName(yyscan_t yyscanner,const char *s);
static QCString escapeObject(yyscan_t yyscanner,const char *s);
static QCString escapeWord(yyscan_t yyscanner,const char *s);
static QCString escapeComment(yyscan_t yyscanner,const char *s);
-static bool skipLanguageSpecificKeyword(yyscan_t yyscanner,const QCString &kw);
+static bool skipLanguageSpecificKeyword(yyscan_t yyscanner,const char *kw);
static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
static void addVariable(yyscan_t yyscanner,QCString type,QCString name);
@@ -269,7 +275,7 @@ TEMPLIST "<"[^\"\}\{\(\)\/\n\>]*">"
SCOPETNAME (((({ID}{TEMPLIST}?){BN}*)?{SEP}{BN}*)*)((~{BN}*)?{ID})
SCOPEPREFIX ({ID}{TEMPLIST}?{BN}*{SEP}{BN}*)+
KEYWORD_OBJC ("@public"|"@private"|"@protected"|"@class"|"@implementation"|"@interface"|"@end"|"@selector"|"@protocol"|"@optional"|"@required"|"@throw"|"@synthesize"|"@property")
-KEYWORD ("asm"|"__assume"|"auto"|"class"|"const"|"delete"|"enum"|"explicit"|"extern"|"false"|"friend"|"gcnew"|"gcroot"|"set"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"null"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"sizeof"|"static"|"struct"|"__super"|"function"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|"alignas"|"alignof"|{KEYWORD_OBJC})
+KEYWORD ("asm"|"__assume"|"auto"|"class"|"const"|"delete"|"enum"|"explicit"|"extern"|"false"|"friend"|"gcnew"|"gcroot"|"set"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"null"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"sizeof"|"static"|"struct"|"__super"|"function"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|"alignas"|"alignof"|"concept"|"requires"|{KEYWORD_OBJC})
FLOWKW ("break"|"catch"|"continue"|"default"|"do"|"else"|"finally"|"return"|"switch"|"throw"|"throws"|"@catch"|"@finally")
FLOWCONDITION ("case"|"for"|"foreach"|"for each"|"goto"|"if"|"try"|"while"|"@try")
TYPEKW ("bool"|"byte"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string"|"nullptr")
@@ -361,6 +367,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
%x ObjCSkipStr
%x ObjCCallComment
%x OldStyleArgs
+%x ConceptName
%x UsingName
%x RawString
%x InlineInit
@@ -491,13 +498,13 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
bool found=FALSE;
const FileDef *fd=findFileDef(Doxygen::inputNameLinkedMap,yytext,ambig);
- //printf("looking for include %s -> %s fd=%p\n",yytext,absPath.data(),fd);
+ //printf("looking for include %s -> %s fd=%p\n",yytext,qPrint(absPath),fd);
if (fd && fd->isLinkable())
{
if (ambig) // multiple input files match the name
{
DBG_CTX((stderr,"===== yes %s is ambiguous\n",yytext));
- QCString name = QDir::cleanDirPath(yytext).utf8();
+ QCString name(Dir::cleanDirPath(yytext));
if (!name.isEmpty() && yyextra->sourceFileDef)
{
const FileName *fn = Doxygen::inputNameLinkedMap->find(name);
@@ -518,7 +525,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
found = TRUE;
}
}
- DBG_CTX((stderr," include file %s found=%d\n",fd ? fd->absFilePath().data() : "<none>",found));
+ DBG_CTX((stderr," include file %s found=%d\n",fd ? qPrint(fd->absFilePath()) : "<none>",found));
if (found)
{
writeMultiLineCodeLink(yyscanner,*yyextra->code,fd,yytext);
@@ -606,7 +613,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
BEGIN(Body);
}
<Body,ClassVar>"@end" {
- DBG_CTX((stderr,"End of objc scope fd=%s\n",yyextra->sourceFileDef->name().data()));
+ DBG_CTX((stderr,"End of objc scope fd=%s\n",qPrint(yyextra->sourceFileDef->name())));
if (yyextra->sourceFileDef)
{
const FileDef *fd=yyextra->sourceFileDef;
@@ -650,7 +657,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
BEGIN( Body );
}
<ClassName,ClassVar>[*&^%]+ {
- yyextra->type=yyextra->curClassName.copy();
+ yyextra->type=yyextra->curClassName;
yyextra->name.resize(0);
yyextra->code->codify(yytext);
BEGIN( Body ); // variable of type struct *
@@ -721,7 +728,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
}
<PackageName>{ID}("."{ID})* {
yyextra->curClassName=substitute(yytext,".","::");
- DBG_CTX((stderr,"found package: %s\n",yyextra->curClassName.data()));
+ DBG_CTX((stderr,"found package: %s\n",qPrint(yyextra->curClassName)));
addType(yyscanner);
codifyLines(yyscanner,yytext);
}
@@ -737,14 +744,14 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
BEGIN( Bases );
}
<ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
- DBG_CTX((stderr,"***** C++/CLI modifier %s on yyextra->curClassName=%s\n",yytext,yyextra->curClassName.data()));
+ DBG_CTX((stderr,"***** C++/CLI modifier %s on yyextra->curClassName=%s\n",yytext,qPrint(yyextra->curClassName)));
startFontClass(yyscanner,"keyword");
codifyLines(yyscanner,yytext);
endFontClass(yyscanner);
BEGIN( CppCliTypeModifierFollowup );
}
<ClassVar>{ID} {
- yyextra->type = yyextra->curClassName.copy();
+ yyextra->type = yyextra->curClassName;
yyextra->name = yytext;
if (yyextra->insideBody)
{
@@ -764,7 +771,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
yyextra->code->codify(yytext);
if (YY_START==ClassVar && yyextra->curClassName.isEmpty())
{
- yyextra->curClassName = yyextra->name.copy();
+ yyextra->curClassName = yyextra->name;
}
if (yyextra->searchingForBody)
{
@@ -777,14 +784,13 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
DBG_CTX((stderr,"** scope stack push CLASSBLOCK\n"));
yyextra->scopeStack.push(CLASSBLOCK);
pushScope(yyscanner,yyextra->curClassName);
- DBG_CTX((stderr,"***** yyextra->curClassName=%s\n",yyextra->curClassName.data()));
+ DBG_CTX((stderr,"***** yyextra->curClassName=%s\n",qPrint(yyextra->curClassName)));
if (yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,yyextra->curClassName)==0)
{
- DBG_CTX((stderr,"Adding new class %s\n",yyextra->curClassName.data()));
+ DBG_CTX((stderr,"Adding new class %s\n",qPrint(yyextra->curClassName)));
ScopedTypeVariant var(yyextra->curClassName);
// insert base classes.
- char *s=yyextra->curClassBases.first();
- while (s)
+ for (const auto &s : yyextra->curClassBases)
{
const ClassDef *bcd=0;
auto it = yyextra->codeClassMap.find(s);
@@ -792,12 +798,11 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
{
bcd = toClassDef(it->second.globalDef());
}
- if (bcd==0) bcd=yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,s);
+ if (bcd==0) bcd=yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,QCString(s));
if (bcd && bcd->name()!=yyextra->curClassName)
{
var.localDef()->insertBaseClass(bcd->name());
}
- s=yyextra->curClassBases.next();
}
yyextra->codeClassMap.emplace(std::make_pair(yyextra->curClassName.str(),std::move(var)));
}
@@ -818,8 +823,8 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
endFontClass(yyscanner);
}
<Bases>{SEP}?({ID}{SEP})*{ID} {
- DBG_CTX((stderr,"%s:addBase(%s)\n",yyextra->curClassName.data(),yytext));
- yyextra->curClassBases.inSort(yytext);
+ DBG_CTX((stderr,"%s:addBase(%s)\n",qPrint(yyextra->curClassName),yytext));
+ yyextra->curClassBases.push_back(yytext);
generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
}
<Bases>"<" {
@@ -909,12 +914,23 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
yyextra->insideTemplate=TRUE;
yyextra->sharpCount=0;
}
+<Body>"concept"{BN}+ {
+ startFontClass(yyscanner,"keyword");
+ codifyLines(yyscanner,yytext);
+ endFontClass(yyscanner);
+ BEGIN(ConceptName);
+ }
<Body>"using"{BN}+"namespace"{BN}+ {
startFontClass(yyscanner,"keyword");
codifyLines(yyscanner,yytext);
endFontClass(yyscanner);
BEGIN(UsingName);
}
+<ConceptName>{ID}("::"{ID})* {
+ addUsingDirective(yyscanner,yytext);
+ generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
+ }
+<ConceptName>"=" { codifyLines(yyscanner,yytext); BEGIN(Body); }
<UsingName>{ID}("::"{ID})* {
addUsingDirective(yyscanner,yytext);
generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
@@ -1121,7 +1137,6 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
<Body>{SCOPENAME}/{BN}*[:;,)\]] { // "int var;" or "var, var2" or "debug(f) macro" , or int var : 5;
addType(yyscanner);
// changed this to generateFunctionLink, see bug 624514
- //generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext,FALSE,TRUE);
generateFunctionLink(yyscanner,*yyextra->code,yytext);
yyextra->name+=yytext;
}
@@ -1152,11 +1167,11 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
BEGIN( FuncCall );
}
<FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>{RAWBEGIN} {
- QCString text=yytext;
+ QCString text(yytext);
uint i=(uint)text.find('R');
yyextra->code->codify(text.left(i+1));
startFontClass(yyscanner,"stringliteral");
- yyextra->code->codify(yytext+i+1);
+ yyextra->code->codify(QCString(yytext+i+1));
yyextra->lastStringContext=YY_START;
yyextra->inForEachExpression = FALSE;
yyextra->delimiter = yytext+i+2;
@@ -1205,7 +1220,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
}
<RawString>{RAWEND} {
yyextra->code->codify(yytext);
- QCString delimiter = yytext+1;
+ QCString delimiter(yytext+1);
delimiter=delimiter.left(delimiter.length()-1);
if (delimiter==yyextra->delimiter)
{
@@ -1296,7 +1311,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
<MemberCall>{SCOPENAME}/{B}* {
if (yyextra->theCallContext.getScope().globalDef())
{
- DBG_CTX((stderr,"yyextra->theCallContext.getClass()=%p\n",yyextra->theCallContext.getScope().globalDef()));
+ DBG_CTX((stderr,"yyextra->theCallContext.getClass()=%p\n",(void*)yyextra->theCallContext.getScope().globalDef()));
if (!generateClassMemberLink(yyscanner,*yyextra->code,yyextra->theCallContext.getScope().globalDef(),yytext))
{
yyextra->code->codify(yytext);
@@ -1335,15 +1350,15 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
else
{
yyextra->code->codify(yytext);
- yyextra->saveName = yyextra->name.copy();
- yyextra->saveType = yyextra->type.copy();
+ yyextra->saveName = yyextra->name;
+ yyextra->saveType = yyextra->type;
if (*yytext!='[' && !yyextra->type.isEmpty())
{
//printf("yyextra->scopeStack.bottom()=%p\n",yyextra->scopeStack.bottom());
//if (yyextra->scopeStack.top()!=CLASSBLOCK) // commented out for bug731363
{
//printf("AddVariable: '%s' '%s' context=%d\n",
- // yyextra->type.data(),yyextra->name.data(),yyextra->theVarContext.count());
+ // qPrint(yyextra->type),qPrint(yyextra->name),yyextra->theVarContext.count());
addVariable(yyscanner,yyextra->type,yyextra->name);
}
yyextra->name.resize(0);
@@ -1362,52 +1377,6 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
yyextra->parmName.resize(0);
}
}
- /*
-<ObjCMemberCall>{ID} {
- if (qstrcmp(yytext,"self")==0 || qstrcmp(yytext,"super")==0)
- {
- // TODO: get proper base class for "super"
- yyextra->theCallContext.setClass(getClass(yyextra->curClassName));
- startFontClass(yyscanner,"keyword");
- yyextra->code->codify(yytext);
- endFontClass(yyscanner);
- }
- else
- {
- generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
- }
- yyextra->name.resize(0);
- BEGIN(ObjCMemberCall2);
- }
-<ObjCMemberCall>"[" {
- yyextra->code->codify(yytext);
- yyextra->theCallContext.pushScope(yyscanner,yyextra->name, yyextra->type);
- }
-<ObjCMemberCall2>{ID}":"? {
- yyextra->name+=yytext;
- if (yyextra->theCallContext.getClass())
- {
- DBG_CTX((stderr,"Calling method %s\n",yyextra->name.data()));
- if (!generateClassMemberLink(yyscanner,*yyextra->code,yyextra->theCallContext.getClass(),yyextra->name))
- {
- yyextra->code->codify(yytext);
- addToSearchIndex(yyscanner,yyextra->name);
- }
- }
- else
- {
- yyextra->code->codify(yytext);
- addToSearchIndex(yyscanner,yyextra->name);
- }
- yyextra->name.resize(0);
- BEGIN(ObjCMemberCall3);
- }
-<ObjCMemberCall2,ObjCMemberCall3>"]" {
- yyextra->theCallContext.popScope(yyextra->name, yyextra->type);
- yyextra->code->codify(yytext);
- BEGIN(Body);
- }
- */
<ObjCCall,ObjCMName>"["|"{" {
saveObjCContext(yyscanner);
yyextra->currentCtx->format+=*yytext;
@@ -1437,24 +1406,25 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
}
<ObjCCall,ObjCMName>{CCS} {
yyextra->lastObjCCallContext = YY_START;
- yyextra->currentCtx->comment=yytext;
+ yyextra->currentCtx->comment.str(yytext);
BEGIN(ObjCCallComment);
}
<ObjCCallComment>{CCE} {
- yyextra->currentCtx->comment+=yytext;
- yyextra->currentCtx->format+=escapeComment(yyscanner,yyextra->currentCtx->comment);
+ yyextra->currentCtx->comment << yytext;
+ std::string commentStr = yyextra->currentCtx->comment.str();
+ yyextra->currentCtx->format+=escapeComment(yyscanner,commentStr.c_str());
BEGIN(yyextra->lastObjCCallContext);
}
-<ObjCCallComment>[^*\n]+ { yyextra->currentCtx->comment+=yytext; }
-<ObjCCallComment>{CPPC}|{CCS} { yyextra->currentCtx->comment+=yytext; }
-<ObjCCallComment>\n { yyextra->currentCtx->comment+=*yytext; }
-<ObjCCallComment>. { yyextra->currentCtx->comment+=*yytext; }
+<ObjCCallComment>[^*\n]+ { yyextra->currentCtx->comment << yytext; }
+<ObjCCallComment>{CPPC}|{CCS} { yyextra->currentCtx->comment << yytext; }
+<ObjCCallComment>\n { yyextra->currentCtx->comment << *yytext; }
+<ObjCCallComment>. { yyextra->currentCtx->comment << *yytext; }
<ObjCCall>{ID} {
yyextra->currentCtx->format+=escapeObject(yyscanner,yytext);
if (yyextra->braceCount==0)
{
yyextra->currentCtx->objectTypeOrName=yytext;
- DBG_CTX((stderr,"new type=%s\n",yyextra->currentCtx->objectTypeOrName.data()));
+ DBG_CTX((stderr,"new type=%s\n",qPrint(yyextra->currentCtx->objectTypeOrName)));
BEGIN(ObjCMName);
}
}
@@ -1502,8 +1472,8 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
yyextra->theCallContext.popScope(yyextra->name, yyextra->type);
yyextra->code->codify(yytext);
// TODO: nested arrays like: a[b[0]->func()]->func()
- yyextra->name = yyextra->saveName.copy();
- yyextra->type = yyextra->saveType.copy();
+ yyextra->name = yyextra->saveName;
+ yyextra->type = yyextra->saveType;
}
<Body>[0-9]+ {
yyextra->code->codify(yytext);
@@ -1627,7 +1597,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
<MemberCall,MemberCall2,FuncCall>("*"{B}*)?")" {
if (yytext[0]==')') // no a pointer cast
{
- DBG_CTX((stderr,"addVariable(%s,%s)\n",yyextra->parmType.data(),yyextra->parmName.data()));
+ DBG_CTX((stderr,"addVariable(%s,%s)\n",qPrint(yyextra->parmType),qPrint(yyextra->parmName)));
if (yyextra->parmType.isEmpty())
{
yyextra->parmType=yyextra->parmName;
@@ -1667,7 +1637,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
if (*yytext==';') yyextra->searchingForBody=FALSE;
if (!yyextra->type.isEmpty())
{
- DBG_CTX((stderr,"add variable yyextra->type=%s yyextra->name=%s)\n",yyextra->type.data(),yyextra->name.data()));
+ DBG_CTX((stderr,"add variable yyextra->type=%s yyextra->name=%s)\n",qPrint(yyextra->type),qPrint(yyextra->name)));
addVariable(yyscanner,yyextra->type,yyextra->name);
}
yyextra->parmType.resize(0);yyextra->parmName.resize(0);
@@ -1701,11 +1671,11 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
//yyextra->theCallContext.popScope(yyextra->name, yyextra->type);
yyextra->parmType.resize(0);yyextra->parmName.resize(0);
int index = yyextra->name.findRev("::");
- DBG_CTX((stderr,"yyextra->name=%s\n",yyextra->name.data()));
+ DBG_CTX((stderr,"yyextra->name=%s\n",qPrint(yyextra->name)));
if (index!=-1)
{
QCString scope = yyextra->name.left((uint)index);
- if (!yyextra->classScope.isEmpty()) scope.prepend(yyextra->classScope+"::");
+ if (!yyextra->classScope.isEmpty()) scope.prepend((yyextra->classScope+"::"));
const ClassDef *cd=yyextra->symbolResolver.resolveClass(Doxygen::globalScope,scope);
if (cd)
{
@@ -1753,6 +1723,11 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
endFontClass(yyscanner);
yyextra->inFunctionTryBlock=TRUE;
}
+<CallEnd>"requires" { // function-try-block
+ startFontClass(yyscanner,"keyword");
+ yyextra->code->codify(yytext);
+ endFontClass(yyscanner);
+ }
<CallEnd>{ID} {
if (yyextra->insideBody || !yyextra->parmType.isEmpty())
{
@@ -1819,12 +1794,12 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
BEGIN( Body );
}
<SkipInits>{ID}{B}*"{" {
- QCString text = yytext;
+ QCString text(yytext);
int bracketPos = text.find('{');
int spacePos = text.find(' ');
int len = spacePos==-1 ? bracketPos : spacePos;
generateClassOrGlobalLink(yyscanner,*yyextra->code,text.left(len));
- yyextra->code->codify(yytext+len);
+ yyextra->code->codify(QCString(yytext+len));
}
<SkipInits>{ID} {
generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
@@ -2196,7 +2171,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
static void addVariable(yyscan_t yyscanner,QCString type,QCString name)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- DBG_CTX((stderr,"VariableContext::addVariable(%s,%s)\n",type.data(),name.data()));
+ DBG_CTX((stderr,"VariableContext::addVariable(%s,%s)\n",qPrint(type),qPrint(name)));
QCString ltype = type.simplifyWhiteSpace();
QCString lname = name.simplifyWhiteSpace();
if (ltype.left(7)=="struct ")
@@ -2209,11 +2184,11 @@ static void addVariable(yyscan_t yyscanner,QCString type,QCString name)
}
if (ltype.isEmpty() || lname.isEmpty()) return;
DBG_CTX((stderr,"** addVariable trying: type='%s' name='%s' currentDefinition=%s\n",
- ltype.data(),lname.data(),yyextra->currentDefinition?yyextra->currentDefinition->name().data():"<none>"));
+ qPrint(ltype),qPrint(lname),yyextra->currentDefinition?qPrint(yyextra->currentDefinition->name()):"<none>"));
auto it = yyextra->codeClassMap.find(ltype.str());
if (it!=yyextra->codeClassMap.end()) // look for class definitions inside the code block
{
- DBG_CTX((stderr,"** addVariable type='%s' name='%s'\n",ltype.data(),lname.data()));
+ DBG_CTX((stderr,"** addVariable type='%s' name='%s'\n",qPrint(ltype),qPrint(lname)));
yyextra->theVarContext.addVariable(lname,std::move(it->second)); // add it to a list
}
else
@@ -2222,7 +2197,7 @@ static void addVariable(yyscan_t yyscanner,QCString type,QCString name)
int i=0;
if (varDef)
{
- DBG_CTX((stderr,"** addVariable type='%s' name='%s'\n",ltype.data(),lname.data()));
+ DBG_CTX((stderr,"** addVariable type='%s' name='%s'\n",qPrint(ltype),qPrint(lname)));
yyextra->theVarContext.addVariable(lname,ScopedTypeVariant(varDef)); // add it to a list
}
else if ((i=ltype.find('<'))!=-1)
@@ -2237,7 +2212,7 @@ static void addVariable(yyscan_t yyscanner,QCString type,QCString name)
// is hidden to avoid false links to global variables with the same name
// TODO: make this work for namespaces as well!
{
- DBG_CTX((stderr,"** addVariable: dummy context for '%s'\n",lname.data()));
+ DBG_CTX((stderr,"** addVariable: dummy context for '%s'\n",qPrint(lname)));
yyextra->theVarContext.addVariable(lname,ScopedTypeVariant());
}
else
@@ -2251,7 +2226,7 @@ static void addVariable(yyscan_t yyscanner,QCString type,QCString name)
//-------------------------------------------------------------------
/*! add class/namespace name s to the scope */
-static void pushScope(yyscan_t yyscanner,const char *s)
+static void pushScope(yyscan_t yyscanner,const QCString &s)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->classScopeLengthStack.push(int(yyextra->classScope.length()));
@@ -2264,7 +2239,7 @@ static void pushScope(yyscan_t yyscanner,const char *s)
yyextra->classScope += "::";
yyextra->classScope += s;
}
- DBG_CTX((stderr,"pushScope(%s) result: '%s'\n",s,yyextra->classScope.data()));
+ DBG_CTX((stderr,"pushScope(%s) result: '%s'\n",qPrint(s),qPrint(yyextra->classScope)));
}
@@ -2282,7 +2257,7 @@ static void popScope(yyscan_t yyscanner)
{
//err("Too many end of scopes found!\n");
}
- DBG_CTX((stderr,"popScope() result: '%s'\n",yyextra->classScope.data()));
+ DBG_CTX((stderr,"popScope() result: '%s'\n",qPrint(yyextra->classScope)));
}
static void setCurrentDoc(yyscan_t yyscanner,const QCString &anchor)
@@ -2302,7 +2277,7 @@ static void setCurrentDoc(yyscan_t yyscanner,const QCString &anchor)
}
}
-static void addToSearchIndex(yyscan_t yyscanner,const char *text)
+static void addToSearchIndex(yyscan_t yyscanner,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (Doxygen::searchIndex)
@@ -2312,10 +2287,16 @@ static void addToSearchIndex(yyscan_t yyscanner,const char *text)
}
}
+static void addToSearchIndex(yyscan_t yyscanner,const char *text)
+{
+ addToSearchIndex(yyscanner,QCString(text));
+}
+
+
static void setClassScope(yyscan_t yyscanner,const QCString &name)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- DBG_CTX((stderr,"setClassScope(%s)\n",name.data()));
+ DBG_CTX((stderr,"setClassScope(%s)\n",qPrint(name)));
QCString n=name;
n=n.simplifyWhiteSpace();
int ts=n.find('<'); // start of template
@@ -2338,7 +2319,7 @@ static void setClassScope(yyscan_t yyscanner,const QCString &name)
n = n.mid(i+2);
}
pushScope(yyscanner,n);
- DBG_CTX((stderr,"--->New class scope '%s'\n",yyextra->classScope.data()));
+ DBG_CTX((stderr,"--->New class scope '%s'\n",qPrint(yyextra->classScope)));
}
/*! start a new line of code, inserting a line number if yyextra->sourceFileDef
@@ -2356,7 +2337,7 @@ static void startCodeLine(yyscan_t yyscanner)
//lineAnchor.sprintf("l%05d",yyextra->yyLineNr);
const Definition *d = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
- DBG_CTX((stderr,"%s:startCodeLine(%d)=%p\n",yyextra->sourceFileDef->name().data(),yyextra->yyLineNr,d));
+ DBG_CTX((stderr,"%s:startCodeLine(%d)=%p\n",qPrint(yyextra->sourceFileDef->name()),yyextra->yyLineNr,(void*)d));
if (!yyextra->includeCodeFragment && d)
{
yyextra->currentDefinition = d;
@@ -2370,7 +2351,7 @@ static void startCodeLine(yyscan_t yyscanner)
yyextra->args.resize(0);
yyextra->parmType.resize(0);
yyextra->parmName.resize(0);
- DBG_CTX((stderr,"Real scope: '%s'\n",yyextra->realScope.data()));
+ DBG_CTX((stderr,"Real scope: '%s'\n",qPrint(yyextra->realScope)));
yyextra->bodyCurlyCount = 0;
QCString lineAnchor;
lineAnchor.sprintf("l%05d",yyextra->yyLineNr);
@@ -2378,27 +2359,28 @@ static void startCodeLine(yyscan_t yyscanner)
{
yyextra->code->writeLineNumber(yyextra->currentMemberDef->getReference(),
yyextra->currentMemberDef->getOutputFileBase(),
- yyextra->currentMemberDef->anchor(),yyextra->yyLineNr);
+ yyextra->currentMemberDef->anchor(),
+ yyextra->yyLineNr);
setCurrentDoc(yyscanner,lineAnchor);
}
else if (d->isLinkableInProject())
{
yyextra->code->writeLineNumber(d->getReference(),
d->getOutputFileBase(),
- 0,yyextra->yyLineNr);
+ QCString(),yyextra->yyLineNr);
setCurrentDoc(yyscanner,lineAnchor);
}
}
else
{
- yyextra->code->writeLineNumber(0,0,0,yyextra->yyLineNr);
+ yyextra->code->writeLineNumber(QCString(),QCString(),QCString(),yyextra->yyLineNr);
}
}
DBG_CTX((stderr,"startCodeLine(%d)\n",yyextra->yyLineNr));
yyextra->code->startCodeLine(yyextra->sourceFileDef && yyextra->lineNumbers);
if (yyextra->currentFontClass)
{
- yyextra->code->startFontClass(yyextra->currentFontClass);
+ yyextra->code->startFontClass(QCString(yyextra->currentFontClass));
}
}
@@ -2427,11 +2409,12 @@ static void nextCodeLine(yyscan_t yyscanner)
/*! write a code fragment 'text' that may span multiple lines, inserting
* line numbers for each line.
*/
-static void codifyLines(yyscan_t yyscanner,const char *text)
+static void codifyLines(yyscan_t yyscanner,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- DBG_CTX((stderr,"codifyLines(%d,\"%s\")\n",yyextra->yyLineNr,text));
- const char *p=text,*sp=p;
+ DBG_CTX((stderr,"codifyLines(%d,\"%s\")\n",yyextra->yyLineNr,qPrint(text)));
+ if (text.isEmpty()) return;
+ const char *p=text.data(),*sp=p;
char c;
bool done=FALSE;
while (!done)
@@ -2446,18 +2429,23 @@ static void codifyLines(yyscan_t yyscanner,const char *text)
char *tmp = (char*)malloc(l+1);
memcpy(tmp,sp,l);
tmp[l]='\0';
- yyextra->code->codify(tmp);
+ yyextra->code->codify(QCString(tmp));
free(tmp);
nextCodeLine(yyscanner);
}
else
{
- yyextra->code->codify(sp);
+ yyextra->code->codify(QCString(sp));
done=TRUE;
}
}
}
+static void codifyLines(yyscan_t yyscanner,const char *text)
+{
+ codifyLines(yyscanner,QCString(text));
+}
+
static void incrementFlowKeyWordCount(yyscan_t yyscanner)
{
std::lock_guard<std::mutex> lock(g_countFlowKeywordsMutex);
@@ -2478,7 +2466,7 @@ static void incrementFlowKeyWordCount(yyscan_t yyscanner)
*/
static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
const Definition *d,
- const char *text)
+ const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool sourceTooltips = Config_getBool(SOURCE_TOOLTIPS);
@@ -2492,7 +2480,7 @@ static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
tooltip = d->briefDescriptionAsTooltip();
}
bool done=FALSE;
- char *p=(char *)text;
+ char *p=text.rawData();
while (!done)
{
char *sp=p;
@@ -2502,14 +2490,14 @@ static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
{
yyextra->yyLineNr++;
*(p-1)='\0';
- DBG_CTX((stderr,"writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp));
- ol.writeCodeLink(ref,file,anchor,sp,tooltip);
+ DBG_CTX((stderr,"writeCodeLink(%s,%s,%s,%s)\n",qPrint(ref),qPrint(file),qPrint(anchor),sp));
+ ol.writeCodeLink(ref,file,anchor,QCString(sp),tooltip);
nextCodeLine(yyscanner);
}
else
{
- DBG_CTX((stderr,"writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp));
- ol.writeCodeLink(ref,file,anchor,sp,tooltip);
+ DBG_CTX((stderr,"writeCodeLink(%s,%s,%s,%s)\n",qPrint(ref),qPrint(file),qPrint(anchor),sp));
+ ol.writeCodeLink(ref,file,anchor,QCString(sp),tooltip);
done=TRUE;
}
}
@@ -2552,7 +2540,7 @@ static void addUsingDirective(yyscan_t yyscanner,const char *name)
static void setParameterList(yyscan_t yyscanner,const MemberDef *md)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- yyextra->classScope = md->getClassDef() ? md->getClassDef()->name().data() : "";
+ yyextra->classScope = md->getClassDef() ? md->getClassDef()->name() : QCString();
for (const Argument &a : md->argumentList())
{
yyextra->parmName = a.name;
@@ -2567,7 +2555,7 @@ static void setParameterList(yyscan_t yyscanner,const MemberDef *md)
}
}
-static const ClassDef *stripClassName(yyscan_t yyscanner,const char *s,const Definition *d)
+static const ClassDef *stripClassName(yyscan_t yyscanner,const QCString &s,const Definition *d)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
int pos=0;
@@ -2586,7 +2574,7 @@ static const ClassDef *stripClassName(yyscan_t yyscanner,const char *s,const Def
{
cd=yyextra->symbolResolver.resolveClass(d,clName);
}
- DBG_CTX((stderr,"stripClass trying '%s' = %p\n",clName.data(),cd));
+ DBG_CTX((stderr,"stripClass trying '%s' = %p\n",qPrint(clName),(void*)cd));
if (cd)
{
return cd;
@@ -2600,21 +2588,21 @@ static const MemberDef *setCallContextForVar(yyscan_t yyscanner,const QCString &
{
if (name.isEmpty()) return 0;
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- DBG_CTX((stderr,"setCallContextForVar(%s) yyextra->classScope=%s\n",name.data(),yyextra->classScope.data()));
+ DBG_CTX((stderr,"setCallContextForVar(%s) yyextra->classScope=%s\n",qPrint(name),qPrint(yyextra->classScope)));
int scopeEnd = name.findRev("::");
if (scopeEnd!=-1) // name with explicit scope
{
QCString scope = name.left(scopeEnd);
QCString locName = name.right(name.length()-scopeEnd-2);
- DBG_CTX((stderr,"explicit scope: name=%s scope=%s\n",locName.data(),scope.data()));
+ DBG_CTX((stderr,"explicit scope: name=%s scope=%s\n",qPrint(locName),qPrint(scope)));
const ClassDef *mcd = getClass(scope);
if (mcd && !locName.isEmpty())
{
const MemberDef *md=mcd->getMemberByName(locName);
if (md)
{
- DBG_CTX((stderr,"name=%s scope=%s\n",locName.data(),scope.data()));
+ DBG_CTX((stderr,"name=%s scope=%s\n",qPrint(locName),qPrint(scope)));
yyextra->theCallContext.setScope(ScopedTypeVariant(stripClassName(yyscanner,md->typeString(),md->getOuterScope())));
return md;
}
@@ -2627,7 +2615,7 @@ static const MemberDef *setCallContextForVar(yyscan_t yyscanner,const QCString &
const MemberDef *md=mnd->getMemberByName(locName);
if (md)
{
- DBG_CTX((stderr,"name=%s scope=%s\n",locName.data(),scope.data()));
+ DBG_CTX((stderr,"name=%s scope=%s\n",qPrint(locName),qPrint(scope)));
yyextra->theCallContext.setScope(ScopedTypeVariant(stripClassName(yyscanner,md->typeString(),md->getOuterScope())));
return md;
}
@@ -2642,25 +2630,25 @@ static const MemberDef *setCallContextForVar(yyscan_t yyscanner,const QCString &
DBG_CTX((stderr,"local variable?\n"));
if (mcv->type()!=ScopedTypeVariant::Dummy) // locally found variable
{
- DBG_CTX((stderr,"local var '%s' mcd=%s\n",name.data(),mcv->name().data()));
+ DBG_CTX((stderr,"local var '%s' mcd=%s\n",qPrint(name),qPrint(mcv->name())));
yyextra->theCallContext.setScope(*mcv);
}
}
else
{
- DBG_CTX((stderr,"class member? scope=%s\n",yyextra->classScope.data()));
+ DBG_CTX((stderr,"class member? scope=%s\n",qPrint(yyextra->classScope)));
// look for a class member
const ClassDef *mcd = getClass(yyextra->classScope);
if (mcd)
{
- DBG_CTX((stderr,"Inside class %s\n",mcd->name().data()));
+ DBG_CTX((stderr,"Inside class %s\n",qPrint(mcd->name())));
const MemberDef *md=mcd->getMemberByName(name);
if (md)
{
- DBG_CTX((stderr,"Found member %s\n",md->name().data()));
+ DBG_CTX((stderr,"Found member %s\n",qPrint(md->name())));
if (yyextra->scopeStack.empty() || yyextra->scopeStack.top()!=CLASSBLOCK)
{
- DBG_CTX((stderr,"class member '%s' mcd=%s\n",name.data(),mcd->name().data()));
+ DBG_CTX((stderr,"class member '%s' mcd=%s\n",qPrint(name),qPrint(mcd->name())));
yyextra->theCallContext.setScope(ScopedTypeVariant(stripClassName(yyscanner,md->typeString(),md->getOuterScope())));
}
return md;
@@ -2671,7 +2659,7 @@ static const MemberDef *setCallContextForVar(yyscan_t yyscanner,const QCString &
// look for a global member
if ((mn=Doxygen::functionNameLinkedMap->find(name)))
{
- DBG_CTX((stderr,"global var '%s'\n",name.data()));
+ DBG_CTX((stderr,"global var '%s'\n",qPrint(name)));
if (mn->size()==1) // global defined only once
{
const std::unique_ptr<MemberDef> &md=mn->front();
@@ -2696,7 +2684,7 @@ static const MemberDef *setCallContextForVar(yyscan_t yyscanner,const QCString &
if (!md->isStatic() || md->getBodyDef()==yyextra->sourceFileDef)
{
yyextra->theCallContext.setScope(ScopedTypeVariant(stripClassName(yyscanner,md->typeString(),md->getOuterScope())));
- DBG_CTX((stderr,"returning member %s in source file %s\n",md->name().data(),yyextra->sourceFileDef->name().data()));
+ DBG_CTX((stderr,"returning member %s in source file %s\n",qPrint(md->name()),qPrint(yyextra->sourceFileDef->name())));
return md.get();
}
}
@@ -2710,7 +2698,7 @@ static void updateCallContextForSmartPointer(yyscan_t yyscanner)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
const Definition *d = yyextra->theCallContext.getScope().globalDef();
- //printf("updateCallContextForSmartPointer() cd=%s\n",cd ? d->name().data() : "<none>");
+ //printf("updateCallContextForSmartPointer() cd=%s\n",cd ? qPrint(d->name()) : "<none>");
const MemberDef *md;
if (d && d->definitionType()==Definition::TypeClass && (md=(toClassDef(d))->isSmartPointer()))
{
@@ -2718,7 +2706,7 @@ static void updateCallContextForSmartPointer(yyscan_t yyscanner)
if (ncd)
{
yyextra->theCallContext.setScope(ScopedTypeVariant(ncd));
- //printf("Found smart pointer call %s->%s!\n",cd->name().data(),ncd->name().data());
+ //printf("Found smart pointer call %s->%s!\n",qPrint(cd->name()),qPrint(ncd->name()));
}
}
}
@@ -2726,9 +2714,9 @@ static void updateCallContextForSmartPointer(yyscan_t yyscanner)
static bool getLinkInScope(yyscan_t yyscanner,
const QCString &c, // scope
const QCString &m, // member
- const char *memberText, // exact text
+ const QCString &memberText, // exact text
CodeOutputInterface &ol,
- const char *text,
+ const QCString &text,
bool varOnly
)
{
@@ -2738,20 +2726,20 @@ static bool getLinkInScope(yyscan_t yyscanner,
const FileDef *fd = 0;
const NamespaceDef *nd = 0;
const GroupDef *gd = 0;
- DBG_CTX((stderr,"getLinkInScope: trying '%s'::'%s' varOnly=%d\n",c.data(),m.data(),varOnly));
+ DBG_CTX((stderr,"getLinkInScope: trying '%s'::'%s' varOnly=%d\n",qPrint(c),qPrint(m),varOnly));
if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,yyextra->sourceFileDef,FALSE) &&
(!varOnly || md->isVariable()))
{
if (md->isLinkable())
{
- DBG_CTX((stderr,"found it %s!\n",md->qualifiedName().data()));
+ DBG_CTX((stderr,"found it %s!\n",qPrint(md->qualifiedName())));
if (yyextra->exampleBlock)
{
std::lock_guard<std::mutex> lock(g_addExampleMutex);
QCString anchor;
anchor.sprintf("a%d",yyextra->anchorCount);
- DBG_CTX((stderr,"addExampleFile(%s,%s,%s)\n",anchor.data(),yyextra->exampleName.data(),
- yyextra->exampleFile.data()));
+ DBG_CTX((stderr,"addExampleFile(%s,%s,%s)\n",qPrint(anchor),qPrint(yyextra->exampleName),
+ qPrint(yyextra->exampleFile)));
MemberDefMutable *mdm = toMemberDefMutable(md);
if (mdm && mdm->addExample(anchor,yyextra->exampleName,yyextra->exampleFile))
{
@@ -2767,7 +2755,7 @@ static bool getLinkInScope(yyscan_t yyscanner,
{
yyextra->theCallContext.setScope(ScopedTypeVariant(stripClassName(yyscanner,md->typeString(),md->getOuterScope())));
DBG_CTX((stderr,"yyextra->currentDefinition=%p yyextra->currentMemberDef=%p yyextra->insideBody=%d\n",
- yyextra->currentDefinition,yyextra->currentMemberDef,yyextra->insideBody));
+ (void*)yyextra->currentDefinition,(void*)yyextra->currentMemberDef,yyextra->insideBody));
if (yyextra->currentDefinition && yyextra->currentMemberDef &&
md!=yyextra->currentMemberDef && yyextra->insideBody && yyextra->collectXRefs)
@@ -2775,17 +2763,17 @@ static bool getLinkInScope(yyscan_t yyscanner,
std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(md));
}
- DBG_CTX((stderr,"d->getReference()='%s' d->getOutputBase()='%s' name='%s' member name='%s'\n",d->getReference().data(),d->getOutputFileBase().data(),d->name().data(),md->name().data()));
+ DBG_CTX((stderr,"d->getReference()='%s' d->getOutputBase()='%s' name='%s' member name='%s'\n",qPrint(d->getReference()),qPrint(d->getOutputFileBase()),qPrint(d->name()),qPrint(md->name())));
- writeMultiLineCodeLink(yyscanner,ol,md, text ? text : memberText);
- addToSearchIndex(yyscanner,text ? text : memberText);
+ writeMultiLineCodeLink(yyscanner,ol,md, !text.isEmpty() ? text : memberText);
+ addToSearchIndex(yyscanner,!text.isEmpty() ? text : memberText);
return TRUE;
}
}
else // found member, but it is not linkable, so make sure content inside is not assigned
// to the previous member, see bug762760
{
- DBG_CTX((stderr,"unlinkable member %s\n",md->name().data()));
+ DBG_CTX((stderr,"unlinkable member %s\n",qPrint(md->name())));
yyextra->currentMemberDef = 0;
}
}
@@ -2793,14 +2781,15 @@ static bool getLinkInScope(yyscan_t yyscanner,
}
static bool getLink(yyscan_t yyscanner,
- const char *className,
- const char *memberName,
+ const QCString &className,
+ const QCString &memberName,
CodeOutputInterface &ol,
- const char *text,
+ const QCString &text,
bool varOnly)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- DBG_CTX((stderr,"getLink(%s,%s) yyextra->curClassName=%s\n",className,memberName,yyextra->curClassName.data()));
+ DBG_CTX((stderr,"getLink(%s,%s) yyextra->curClassName=%s\n",
+ qPrint(className),qPrint(memberName),qPrint(yyextra->curClassName)));
QCString m=removeRedundantWhiteSpace(memberName);
QCString c=className;
if (!getLinkInScope(yyscanner,c,m,memberName,ol,text,varOnly))
@@ -2818,18 +2807,18 @@ static bool getLink(yyscan_t yyscanner,
static void generateClassOrGlobalLink(yyscan_t yyscanner,
CodeOutputInterface &ol,
- const char *clName,
+ const QCString &clName,
bool typeOnly,
bool varOnly)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
int i=0;
- if (*clName=='~') // correct for matching negated values i.s.o. destructors.
+ QCString className=clName;
+ if (!className.isEmpty() && className[0]=='~') // correct for matching negated values i.s.o. destructors.
{
yyextra->code->codify("~");
- clName++;
+ className=className.mid(1);
}
- QCString className=clName;
if (className.isEmpty()) return;
if (yyextra->insideProtocolList) // for Obj-C
{
@@ -2848,20 +2837,22 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
const MemberDef *md=0;
bool isLocal=FALSE;
- DBG_CTX((stderr,"generateClassOrGlobalLink(className=%s)\n",className.data()));
+ DBG_CTX((stderr,"generateClassOrGlobalLink(className=%s)\n",qPrint(className)));
if (!yyextra->isPrefixedWithThis || (lcd=yyextra->theVarContext.findVariable(className))==0) // not a local variable
{
const Definition *d = yyextra->currentDefinition;
- DBG_CTX((stderr,"d=%s yyextra->sourceFileDef=%s\n",d?d->name().data():"<none>",yyextra->sourceFileDef?yyextra->sourceFileDef->name().data():"<none>"));
+ DBG_CTX((stderr,"d=%s yyextra->sourceFileDef=%s\n",d?qPrint(d->name()):"<none>",yyextra->sourceFileDef?qPrint(yyextra->sourceFileDef->name()):"<none>"));
cd = yyextra->symbolResolver.resolveClass(d,className);
md = yyextra->symbolResolver.getTypedef();
DBG_CTX((stderr,"non-local variable name=%s cd=%s md=%s!\n",
- className.data(),cd?cd->name().data():"<none>",
- md?md->name().data():"<none>"));
- if (cd==0 && md==0 && (i=className.find('<'))!=-1)
+ qPrint(className),cd?qPrint(cd->name()):"<none>",
+ md?qPrint(md->name()):"<none>"));
+ i=className.find('<');
+ QCString bareName = className;
+ if (i!=-1) bareName = bareName.left(i);
+ if (cd==0 && md==0 && i!=-1)
{
- QCString bareName = className.left(i); //stripTemplateSpecifiersFromScope(className);
- DBG_CTX((stderr,"bareName=%s\n",bareName.data()));
+ DBG_CTX((stderr,"bareName=%s\n",qPrint(bareName)));
if (bareName!=className)
{
cd = yyextra->symbolResolver.resolveClass(d,bareName); // try unspecialized version
@@ -2876,10 +2867,18 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
writeMultiLineCodeLink(yyscanner,*yyextra->code,nd,clName);
return;
}
- DBG_CTX((stderr,"md=%s\n",md?md->name().data():"<none>"));
+ const ConceptDef *conceptDef = getResolvedConcept(d,bareName);
+ if (conceptDef && conceptDef->isLinkable())
+ {
+ yyextra->theCallContext.setScope(ScopedTypeVariant(conceptDef));
+ addToSearchIndex(yyscanner,className);
+ writeMultiLineCodeLink(yyscanner,*yyextra->code,conceptDef,clName);
+ return;
+ }
+ DBG_CTX((stderr,"md=%s\n",md?qPrint(md->name()):"<none>"));
DBG_CTX((stderr,"is found as a type cd=%s nd=%s\n",
- cd?cd->name().data():"<null>",
- nd?nd->name().data():"<null>"));
+ cd?qPrint(cd->name()):"<null>",
+ nd?qPrint(nd->name()):"<null>"));
if (cd==0 && md==0) // also see if it is variable or enum or enum value
{
if (getLink(yyscanner,yyextra->classScope,clName,ol,clName,varOnly))
@@ -2893,7 +2892,7 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
DBG_CTX((stderr,"local variable!\n"));
if (lcd->type()!=ScopedTypeVariant::Dummy)
{
- DBG_CTX((stderr,"non-dummy context lcd=%s!\n",lcd->name().data()));
+ DBG_CTX((stderr,"non-dummy context lcd=%s!\n",qPrint(lcd->name())));
yyextra->theCallContext.setScope(*lcd);
// to following is needed for links to a global variable, but is
@@ -2905,20 +2904,20 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
//}
}
isLocal=TRUE;
- DBG_CTX((stderr,"is a local variable cd=%p!\n",cd));
+ DBG_CTX((stderr,"is a local variable cd=%p!\n",(void*)cd));
}
yyextra->isPrefixedWithThis = FALSE; // discard the "this" prefix for the next calls
if (cd && cd->isLinkable()) // is it a linkable class
{
- DBG_CTX((stderr,"is linkable class %s\n",clName));
+ DBG_CTX((stderr,"is linkable class %s\n",qPrint(clName)));
if (yyextra->exampleBlock)
{
std::lock_guard<std::mutex> lock(g_addExampleMutex);
QCString anchor;
anchor.sprintf("_a%d",yyextra->anchorCount);
- DBG_CTX((stderr,"addExampleClass(%s,%s,%s)\n",anchor.data(),yyextra->exampleName.data(),
- yyextra->exampleFile.data()));
+ DBG_CTX((stderr,"addExampleClass(%s,%s,%s)\n",qPrint(anchor),qPrint(yyextra->exampleName),
+ qPrint(yyextra->exampleFile)));
ClassDefMutable *cdm = toClassDefMutable(const_cast<ClassDef*>(cd));
if (cdm && cdm->addExample(anchor,yyextra->exampleName,yyextra->exampleFile))
{
@@ -2944,19 +2943,19 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
}
else // not a class, maybe a global member
{
- DBG_CTX((stderr,"class %s not linkable! cd=%p md=%p typeOnly=%d\n",clName,cd,md,typeOnly));
+ DBG_CTX((stderr,"class %s not linkable! cd=%p md=%p typeOnly=%d\n",qPrint(clName),(void*)cd,(void*)md,typeOnly));
if (!isLocal && (md!=0 || (cd==0 && !typeOnly))) // not a class, see if it is a global enum/variable/typedef.
{
if (md==0) // not found as a typedef
{
md = setCallContextForVar(yyscanner,clName);
- DBG_CTX((stderr,"setCallContextForVar(%s) md=%p yyextra->currentDefinition=%p\n",clName,md,yyextra->currentDefinition));
+ DBG_CTX((stderr,"setCallContextForVar(%s) md=%p yyextra->currentDefinition=%p\n",qPrint(clName),(void*)md,(void*)yyextra->currentDefinition));
if (md && yyextra->currentDefinition)
{
DBG_CTX((stderr,"%s accessible from %s? %d md->getOuterScope=%s\n",
- md->name().data(),yyextra->currentDefinition->name().data(),
+ qPrint(md->name()),qPrint(yyextra->currentDefinition->name()),
yyextra->symbolResolver.isAccessibleFrom(yyextra->currentDefinition,md),
- md->getOuterScope()->name().data()));
+ qPrint(md->getOuterScope()->name())));
}
if (md && yyextra->currentDefinition &&
@@ -2967,7 +2966,7 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
}
if (md && (!varOnly || md->isVariable()))
{
- DBG_CTX((stderr,"is a global md=%p yyextra->currentDefinition=%s linkable=%d\n",md,yyextra->currentDefinition?yyextra->currentDefinition->name().data():"<none>",md->isLinkable()));
+ DBG_CTX((stderr,"is a global md=%p yyextra->currentDefinition=%s linkable=%d\n",(void*)md,yyextra->currentDefinition?qPrint(yyextra->currentDefinition->name()):"<none>",md->isLinkable()));
if (md->isLinkable())
{
QCString text=clName;
@@ -2990,26 +2989,32 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
}
}
+static void generateClassOrGlobalLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *clName,
+ bool typeOnly,bool varOnly)
+{
+ generateClassOrGlobalLink(yyscanner,ol,QCString(clName),typeOnly,varOnly);
+}
+
static bool generateClassMemberLink(yyscan_t yyscanner,
CodeOutputInterface &ol,
const MemberDef *xmd,
- const char *memName)
+ const QCString &memName)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
// extract class definition of the return type in order to resolve
// a->b()->c() like call chains
DBG_CTX((stderr,"type='%s' args='%s' class=%s\n",
- xmd->typeString(),xmd->argsString(),
- xmd->getClassDef()->name().data()));
+ qPrint(xmd->typeString()),qPrint(xmd->argsString()),
+ qPrint(xmd->getClassDef()->name())));
if (yyextra->exampleBlock)
{
std::lock_guard<std::mutex> lock(g_addExampleMutex);
QCString anchor;
anchor.sprintf("a%d",yyextra->anchorCount);
- DBG_CTX((stderr,"addExampleFile(%s,%s,%s)\n",anchor.data(),yyextra->exampleName.data(),
- yyextra->exampleFile.data()));
+ DBG_CTX((stderr,"addExampleFile(%s,%s,%s)\n",qPrint(anchor),qPrint(yyextra->exampleName),
+ qPrint(yyextra->exampleFile)));
MemberDefMutable *mdm = toMemberDefMutable(xmd);
if (mdm && mdm->addExample(anchor,yyextra->exampleName,yyextra->exampleFile))
{
@@ -3019,7 +3024,7 @@ static bool generateClassMemberLink(yyscan_t yyscanner,
}
const ClassDef *typeClass = stripClassName(yyscanner,removeAnonymousScopes(xmd->typeString()),xmd->getOuterScope());
- DBG_CTX((stderr,"%s -> typeName=%p\n",xmd->typeString(),typeClass));
+ DBG_CTX((stderr,"%s -> typeName=%p\n",qPrint(xmd->typeString()),(void*)typeClass));
yyextra->theCallContext.setScope(ScopedTypeVariant(typeClass));
const Definition *xd = xmd->getOuterScope()==Doxygen::globalScope ?
@@ -3028,7 +3033,8 @@ static bool generateClassMemberLink(yyscan_t yyscanner,
if (xd && xd->isLinkable())
{
- DBG_CTX((stderr,"yyextra->currentDefinition=%p yyextra->currentMemberDef=%p xmd=%p yyextra->insideBody=%d\n",yyextra->currentDefinition,yyextra->currentMemberDef,xmd,yyextra->insideBody));
+ DBG_CTX((stderr,"yyextra->currentDefinition=%p yyextra->currentMemberDef=%p xmd=%p yyextra->insideBody=%d\n",
+ (void*)yyextra->currentDefinition,(void*)yyextra->currentMemberDef,(void*)xmd,yyextra->insideBody));
if (xmd->templateMaster()) xmd = xmd->templateMaster();
@@ -3055,14 +3061,14 @@ static bool generateClassMemberLink(yyscan_t yyscanner,
static bool generateClassMemberLink(yyscan_t yyscanner,
CodeOutputInterface &ol,
const Definition *def,
- const char *memName)
+ const QCString &memName)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (def && def->definitionType()==Definition::TypeClass)
{
const ClassDef *cd = toClassDef(def);
const MemberDef *xmd = cd->getMemberByName(memName);
- DBG_CTX((stderr,"generateClassMemberLink(class=%s,member=%s)=%p\n",def->name().data(),memName,xmd));
+ DBG_CTX((stderr,"generateClassMemberLink(class=%s,member=%s)=%p\n",qPrint(def->name()),qPrint(memName),(void*)xmd));
if (xmd)
{
return generateClassMemberLink(yyscanner,ol,xmd,memName);
@@ -3082,7 +3088,7 @@ static bool generateClassMemberLink(yyscan_t yyscanner,
else if (def && def->definitionType()==Definition::TypeNamespace)
{
const NamespaceDef *nd = toNamespaceDef(def);
- DBG_CTX((stderr,"Looking for %s inside namespace %s\n",memName,nd->name().data()));
+ DBG_CTX((stderr,"Looking for %s inside namespace %s\n",qPrint(memName),qPrint(nd->name())));
const Definition *innerDef = nd->findInnerCompound(memName);
if (innerDef)
{
@@ -3098,11 +3104,11 @@ static bool generateClassMemberLink(yyscan_t yyscanner,
static void generateMemberLink(yyscan_t yyscanner,
CodeOutputInterface &ol,
const QCString &varName,
- const char *memName)
+ const QCString &memName)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
DBG_CTX((stderr,"generateMemberLink(object=%s,mem=%s) classScope=%s\n",
- varName.data(),memName,yyextra->classScope.data()));
+ qPrint(varName),qPrint(memName),qPrint(yyextra->classScope)));
if (varName.isEmpty()) return;
@@ -3136,7 +3142,7 @@ static void generateMemberLink(yyscan_t yyscanner,
const ClassDef *vcd = yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,yyextra->classScope);
if (vcd && vcd->isLinkable())
{
- DBG_CTX((stderr,"Found class %s for variable '%s'\n",yyextra->classScope.data(),varName.data()));
+ DBG_CTX((stderr,"Found class %s for variable '%s'\n",qPrint(yyextra->classScope),qPrint(varName)));
MemberName *vmn=Doxygen::memberNameLinkedMap->find(varName);
if (vmn==0)
{
@@ -3147,14 +3153,14 @@ static void generateMemberLink(yyscan_t yyscanner,
const ClassDef *jcd = getClass(vn.left(vi));
vn=vn.right(vn.length()-vi-2);
vmn=Doxygen::memberNameLinkedMap->find(vn);
- //printf("Trying name '%s' scope=%s\n",vn.data(),scope.data());
+ //printf("Trying name '%s' scope=%s\n",qPrint(vn),qPrint(scope));
if (vmn)
{
for (const auto &vmd : *vmn)
{
if (vmd->getClassDef()==jcd)
{
- DBG_CTX((stderr,"Found variable type=%s\n",vmd->typeString()));
+ DBG_CTX((stderr,"Found variable type=%s\n",qPrint(vmd->typeString())));
const ClassDef *mcd=stripClassName(yyscanner,vmd->typeString(),vmd->getOuterScope());
if (mcd && mcd->isLinkable())
{
@@ -3167,12 +3173,12 @@ static void generateMemberLink(yyscan_t yyscanner,
}
if (vmn)
{
- DBG_CTX((stderr,"There is a variable with name '%s'\n",varName));
+ DBG_CTX((stderr,"There is a variable with name '%s'\n",qPrint(varName)));
for (const auto &vmd : *vmn)
{
if (vmd->getClassDef()==vcd)
{
- DBG_CTX((stderr,"Found variable type=%s\n",vmd->typeString()));
+ DBG_CTX((stderr,"Found variable type=%s\n",qPrint(vmd->typeString())));
const ClassDef *mcd=stripClassName(yyscanner,vmd->typeString(),vmd->getOuterScope());
if (mcd && mcd->isLinkable())
{
@@ -3192,16 +3198,16 @@ static void generateMemberLink(yyscan_t yyscanner,
static void generatePHPVariableLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *varName)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- QCString name = varName+7; // strip $this->
+ QCString name(varName+7); // strip $this->
name.prepend("$");
- DBG_CTX((stderr,"generatePHPVariableLink(%s) name=%s scope=%s\n",varName,name.data(),yyextra->classScope.data()));
- if (!getLink(yyscanner,yyextra->classScope,name,ol,varName))
+ DBG_CTX((stderr,"generatePHPVariableLink(%s) name=%s scope=%s\n",varName,qPrint(name),qPrint(yyextra->classScope)));
+ if (!getLink(yyscanner,yyextra->classScope,name,ol,QCString(varName)))
{
codifyLines(yyscanner,varName);
}
}
-static void generateFunctionLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *funcName)
+static void generateFunctionLink(yyscan_t yyscanner,CodeOutputInterface &ol,const QCString &funcName)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
//CodeClassDef *ccd=0;
@@ -3212,7 +3218,7 @@ static void generateFunctionLink(yyscan_t yyscanner,CodeOutputInterface &ol,cons
QCString funcWithScope=locFunc;
QCString funcWithFullScope=locFunc;
QCString fullScope=locScope;
- DBG_CTX((stdout,"*** locScope=%s locFunc=%s\n",locScope.data(),locFunc.data()));
+ DBG_CTX((stdout,"*** locScope=%s locFunc=%s\n",qPrint(locScope),qPrint(locFunc)));
int len=2;
int i=locFunc.findRev("::");
if (yyextra->currentMemberDef && yyextra->currentMemberDef->resolveAlias()->getClassDef() &&
@@ -3310,6 +3316,11 @@ exit:
return;
}
+static void generateFunctionLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *funcName)
+{
+ generateFunctionLink(yyscanner,ol,QCString(funcName));
+}
+
/*! counts the number of lines in the input */
static int countLines(yyscan_t yyscanner)
{
@@ -3345,7 +3356,7 @@ static void startFontClass(yyscan_t yyscanner,const char *s)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
endFontClass(yyscanner);
- yyextra->code->startFontClass(s);
+ yyextra->code->startFontClass(QCString(s));
yyextra->currentFontClass=s;
}
@@ -3357,15 +3368,14 @@ static void writeObjCMethodCall(yyscan_t yyscanner,ObjCCallCtx *ctx)
if (ctx==0) return;
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
char c;
- const char *p = ctx->format.data();
if (!ctx->methodName.isEmpty())
{
DBG_CTX((stderr,"writeObjCMethodCall(%s) obj=%s method=%s\n",
- ctx->format.data(),ctx->objectTypeOrName.data(),ctx->methodName.data()));
+ qPrint(ctx->format),qPrint(ctx->objectTypeOrName),qPrint(ctx->methodName)));
if (!ctx->objectTypeOrName.isEmpty() && ctx->objectTypeOrName.at(0)!='$')
{
- DBG_CTX((stderr,"Looking for object=%s method=%s\n",ctx->objectTypeOrName.data(),
- ctx->methodName.data()));
+ DBG_CTX((stderr,"Looking for object=%s method=%s\n",qPrint(ctx->objectTypeOrName),
+ qPrint(ctx->methodName)));
const ScopedTypeVariant *stv = yyextra->theVarContext.findVariable(ctx->objectTypeOrName);
if (stv==0) // not a local variable
{
@@ -3382,29 +3392,29 @@ static void writeObjCMethodCall(yyscan_t yyscanner,ObjCCallCtx *ctx)
ctx->objectType = yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,ctx->objectTypeOrName);
ctx->method = yyextra->symbolResolver.getTypedef();
}
- DBG_CTX((stderr," object is class? %p\n",ctx->objectType));
+ DBG_CTX((stderr," object is class? %p\n",(void*)ctx->objectType));
if (ctx->objectType) // found class
{
ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
- DBG_CTX((stderr," yes->method=%s\n",ctx->method?ctx->method->name().data():"<none>"));
+ DBG_CTX((stderr," yes->method=%s\n",ctx->method?qPrint(ctx->method->name()):"<none>"));
}
else if (ctx->method==0) // search for class variable with the same name
{
DBG_CTX((stderr," no\n"));
- DBG_CTX((stderr,"yyextra->currentDefinition=%p\n",yyextra->currentDefinition));
+ DBG_CTX((stderr,"yyextra->currentDefinition=%p\n",(void*)yyextra->currentDefinition));
if (yyextra->currentDefinition &&
yyextra->currentDefinition->definitionType()==Definition::TypeClass)
{
ctx->objectVar = (toClassDef(yyextra->currentDefinition))->getMemberByName(ctx->objectTypeOrName);
- DBG_CTX((stderr," ctx->objectVar=%p\n",ctx->objectVar));
+ DBG_CTX((stderr," ctx->objectVar=%p\n",(void*)ctx->objectVar));
if (ctx->objectVar)
{
ctx->objectType = stripClassName(yyscanner,ctx->objectVar->typeString(),yyextra->currentDefinition);
- DBG_CTX((stderr," ctx->objectType=%p\n",ctx->objectType));
+ DBG_CTX((stderr," ctx->objectType=%p\n",(void*)ctx->objectType));
if (ctx->objectType && !ctx->methodName.isEmpty())
{
ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
- DBG_CTX((stderr," ctx->method=%p\n",ctx->method));
+ DBG_CTX((stderr," ctx->method=%p\n",(void*)ctx->method));
}
}
}
@@ -3420,236 +3430,240 @@ static void writeObjCMethodCall(yyscan_t yyscanner,ObjCCallCtx *ctx)
{
ctx->method = cd->getMemberByName(ctx->methodName);
}
- DBG_CTX((stderr," class=%p method=%p\n",cd,ctx->method));
+ DBG_CTX((stderr," class=%p method=%p\n",(void*)cd,(void*)ctx->method));
}
}
}
}
DBG_CTX((stderr,"["));
- while ((c=*p++)) // for each character in ctx->format
+ if (!ctx->format.isEmpty())
{
- if (c=='$')
+ const char *p = ctx->format.data();
+ while ((c=*p++)) // for each character in ctx->format
{
- char nc=*p++;
- if (nc=='$') // escaped $
- {
- yyextra->code->codify("$");
- }
- else // name fragment or reference to a nested call
+ if (c=='$')
{
- if (nc=='n') // name fragment
+ char nc=*p++;
+ if (nc=='$') // escaped $
+ {
+ yyextra->code->codify("$");
+ }
+ else // name fragment or reference to a nested call
{
- nc=*p++;
- QCString refIdStr;
- while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
- p--;
- int refId=refIdStr.toInt();
- auto it = yyextra->nameMap.find(refId);
- if (it!=yyextra->nameMap.end())
+ if (nc=='n') // name fragment
{
- QCString name = it->second;
- if (ctx->method && ctx->method->isLinkable())
+ nc=*p++;
+ QCString refIdStr;
+ while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
+ p--;
+ int refId=refIdStr.toInt();
+ auto it = yyextra->nameMap.find(refId);
+ if (it!=yyextra->nameMap.end())
{
- writeMultiLineCodeLink(yyscanner,*yyextra->code,ctx->method,name);
- if (yyextra->currentMemberDef && yyextra->collectXRefs)
+ QCString name = it->second;
+ if (ctx->method && ctx->method->isLinkable())
{
- std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
- addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(ctx->method));
+ writeMultiLineCodeLink(yyscanner,*yyextra->code,ctx->method,name);
+ if (yyextra->currentMemberDef && yyextra->collectXRefs)
+ {
+ std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
+ addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(ctx->method));
+ }
+ }
+ else
+ {
+ codifyLines(yyscanner,name);
}
}
else
{
- codifyLines(yyscanner,name);
+ DBG_CTX((stderr,"Invalid name: id=%d\n",refId));
}
}
- else
- {
- DBG_CTX((stderr,"Invalid name: id=%d\n",refId));
- }
- }
- else if (nc=='o') // reference to potential object name
- {
- nc=*p++;
- QCString refIdStr;
- while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
- p--;
- int refId=refIdStr.toInt();
- auto it = yyextra->objectMap.find(refId);
- if (it!=yyextra->objectMap.end())
+ else if (nc=='o') // reference to potential object name
{
- QCString object = it->second;
- if (object=="self")
+ nc=*p++;
+ QCString refIdStr;
+ while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
+ p--;
+ int refId=refIdStr.toInt();
+ auto it = yyextra->objectMap.find(refId);
+ if (it!=yyextra->objectMap.end())
{
- if (yyextra->currentDefinition &&
- yyextra->currentDefinition->definitionType()==Definition::TypeClass)
+ QCString object = it->second;
+ if (object=="self")
{
- ctx->objectType = toClassDef(yyextra->currentDefinition);
- if (ctx->objectType->categoryOf())
- {
- ctx->objectType = ctx->objectType->categoryOf();
- }
- if (ctx->objectType && !ctx->methodName.isEmpty())
+ if (yyextra->currentDefinition &&
+ yyextra->currentDefinition->definitionType()==Definition::TypeClass)
{
- ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
+ ctx->objectType = toClassDef(yyextra->currentDefinition);
+ if (ctx->objectType->categoryOf())
+ {
+ ctx->objectType = ctx->objectType->categoryOf();
+ }
+ if (ctx->objectType && !ctx->methodName.isEmpty())
+ {
+ ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
+ }
}
+ startFontClass(yyscanner,"keyword");
+ codifyLines(yyscanner,object);
+ endFontClass(yyscanner);
}
- startFontClass(yyscanner,"keyword");
- codifyLines(yyscanner,object);
- endFontClass(yyscanner);
- }
- else if (object=="super")
- {
- if (yyextra->currentDefinition &&
- yyextra->currentDefinition->definitionType()==Definition::TypeClass)
+ else if (object=="super")
{
- const ClassDef *cd = toClassDef(yyextra->currentDefinition);
- if (cd->categoryOf())
+ if (yyextra->currentDefinition &&
+ yyextra->currentDefinition->definitionType()==Definition::TypeClass)
{
- cd = cd->categoryOf();
- }
- for (const auto &bclass : cd->baseClasses())
- {
- if (bclass.classDef->compoundType()!=ClassDef::Protocol)
+ const ClassDef *cd = toClassDef(yyextra->currentDefinition);
+ if (cd->categoryOf())
{
- ctx->objectType = bclass.classDef;
- if (ctx->objectType && !ctx->methodName.isEmpty())
+ cd = cd->categoryOf();
+ }
+ for (const auto &bclass : cd->baseClasses())
+ {
+ if (bclass.classDef->compoundType()!=ClassDef::Protocol)
{
- ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
+ ctx->objectType = bclass.classDef;
+ if (ctx->objectType && !ctx->methodName.isEmpty())
+ {
+ ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
+ }
}
}
}
+ startFontClass(yyscanner,"keyword");
+ codifyLines(yyscanner,object);
+ endFontClass(yyscanner);
}
- startFontClass(yyscanner,"keyword");
- codifyLines(yyscanner,object);
- endFontClass(yyscanner);
- }
- else if (ctx->objectVar && ctx->objectVar->isLinkable()) // object is class variable
- {
- writeMultiLineCodeLink(yyscanner,*yyextra->code,ctx->objectVar,object);
- if (yyextra->currentMemberDef && yyextra->collectXRefs)
+ else if (ctx->objectVar && ctx->objectVar->isLinkable()) // object is class variable
{
- std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
- addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(ctx->objectVar));
+ writeMultiLineCodeLink(yyscanner,*yyextra->code,ctx->objectVar,object);
+ if (yyextra->currentMemberDef && yyextra->collectXRefs)
+ {
+ std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
+ addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(ctx->objectVar));
+ }
}
- }
- else if (ctx->objectType &&
- ctx->objectType->isLinkable()
- ) // object is class name
- {
- const ClassDef *cd = ctx->objectType;
- writeMultiLineCodeLink(yyscanner,*yyextra->code,cd,object);
- }
- else // object still needs to be resolved
- {
- const ClassDef *cd = yyextra->symbolResolver.resolveClass(yyextra->currentDefinition, object);
- if (cd && cd->isLinkable())
+ else if (ctx->objectType &&
+ ctx->objectType->isLinkable()
+ ) // object is class name
{
- if (ctx->objectType==0) ctx->objectType=cd;
+ const ClassDef *cd = ctx->objectType;
writeMultiLineCodeLink(yyscanner,*yyextra->code,cd,object);
}
- else
+ else // object still needs to be resolved
{
- codifyLines(yyscanner,object);
+ const ClassDef *cd = yyextra->symbolResolver.resolveClass(yyextra->currentDefinition, object);
+ if (cd && cd->isLinkable())
+ {
+ if (ctx->objectType==0) ctx->objectType=cd;
+ writeMultiLineCodeLink(yyscanner,*yyextra->code,cd,object);
+ }
+ else
+ {
+ codifyLines(yyscanner,object);
+ }
}
}
+ else
+ {
+ DBG_CTX((stderr,"Invalid object: id=%d\n",refId));
+ }
}
- else
- {
- DBG_CTX((stderr,"Invalid object: id=%d\n",refId));
- }
- }
- else if (nc=='c') // reference to nested call
- {
- nc=*p++;
- QCString refIdStr;
- while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
- p--;
- int refId=refIdStr.toInt();
- auto it = yyextra->contextMap.find(refId);
- if (it!=yyextra->contextMap.end()) // recurse into nested call
+ else if (nc=='c') // reference to nested call
{
- ObjCCallCtx *ictx = it->second.get();
- writeObjCMethodCall(yyscanner,ictx);
- if (ictx->method) // link to nested call successfully
+ nc=*p++;
+ QCString refIdStr;
+ while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
+ p--;
+ int refId=refIdStr.toInt();
+ auto it = yyextra->contextMap.find(refId);
+ if (it!=yyextra->contextMap.end()) // recurse into nested call
{
- // get the ClassDef representing the method's return type
- if (QCString(ictx->method->typeString())=="id")
+ ObjCCallCtx *ictx = it->second.get();
+ writeObjCMethodCall(yyscanner,ictx);
+ if (ictx->method) // link to nested call successfully
{
- // see if the method name is unique, if so we link to it
- MemberName *mn=Doxygen::memberNameLinkedMap->find(ctx->methodName);
- //printf("mn->count=%d ictx->method=%s ctx->methodName=%s\n",
- // mn==0?-1:(int)mn->count(),
- // ictx->method->name().data(),
- // ctx->methodName.data());
- if (mn && mn->size()==1) // member name unique
+ // get the ClassDef representing the method's return type
+ if (QCString(ictx->method->typeString())=="id")
{
- ctx->method = mn->front().get();
+ // see if the method name is unique, if so we link to it
+ MemberName *mn=Doxygen::memberNameLinkedMap->find(ctx->methodName);
+ //printf("mn->count=%d ictx->method=%s ctx->methodName=%s\n",
+ // mn==0?-1:(int)mn->count(),
+ // qPrint(ictx->method->name()),
+ // qPrint(ctx->methodName));
+ if (mn && mn->size()==1) // member name unique
+ {
+ ctx->method = mn->front().get();
+ }
}
- }
- else
- {
- ctx->objectType = stripClassName(yyscanner,ictx->method->typeString(),yyextra->currentDefinition);
- if (ctx->objectType && !ctx->methodName.isEmpty())
+ else
{
- ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
+ ctx->objectType = stripClassName(yyscanner,ictx->method->typeString(),yyextra->currentDefinition);
+ if (ctx->objectType && !ctx->methodName.isEmpty())
+ {
+ ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
+ }
}
+ DBG_CTX((stderr," ***** method=%s -> object=%p\n",qPrint(ictx->method->name()),(void*)ctx->objectType));
}
- DBG_CTX((stderr," ***** method=%s -> object=%p\n",ictx->method->name().data(),ctx->objectType));
+ }
+ else
+ {
+ DBG_CTX((stderr,"Invalid context: id=%d\n",refId));
}
}
- else
+ else if (nc=='w') // some word
{
- DBG_CTX((stderr,"Invalid context: id=%d\n",refId));
+ nc=*p++;
+ QCString refIdStr;
+ while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
+ p--;
+ int refId=refIdStr.toInt();
+ auto it = yyextra->wordMap.find(refId);
+ if (it!=yyextra->wordMap.end())
+ {
+ QCString word = it->second;
+ codifyLines(yyscanner,word);
+ }
}
- }
- else if (nc=='w') // some word
- {
- nc=*p++;
- QCString refIdStr;
- while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
- p--;
- int refId=refIdStr.toInt();
- auto it = yyextra->wordMap.find(refId);
- if (it!=yyextra->wordMap.end())
+ else if (nc=='d') // comment block
{
- QCString word = it->second;
- codifyLines(yyscanner,word);
+ nc=*p++;
+ QCString refIdStr;
+ while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
+ p--;
+ int refId=refIdStr.toInt();
+ auto it = yyextra->commentMap.find(refId);
+ if (it!=yyextra->commentMap.end())
+ {
+ QCString comment = it->second;
+ startFontClass(yyscanner,"comment");
+ codifyLines(yyscanner,comment);
+ endFontClass(yyscanner);
+ }
}
- }
- else if (nc=='d') // comment block
- {
- nc=*p++;
- QCString refIdStr;
- while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
- p--;
- int refId=refIdStr.toInt();
- auto it = yyextra->commentMap.find(refId);
- if (it!=yyextra->commentMap.end())
+ else // illegal marker
{
- QCString comment = it->second;
- startFontClass(yyscanner,"comment");
- codifyLines(yyscanner,comment);
- endFontClass(yyscanner);
+ ASSERT("invalid escape sequence"==0);
}
}
- else // illegal marker
- {
- ASSERT("invalid escape sequence"==0);
- }
}
- }
- else // normal non-marker character
- {
- char s[2];
- s[0]=c;s[1]=0;
- codifyLines(yyscanner,s);
+ else // normal non-marker character
+ {
+ char s[2];
+ s[0]=c;s[1]=0;
+ codifyLines(yyscanner,s);
+ }
}
}
- DBG_CTX((stderr,"%s %s]\n",ctx->objectTypeOrName.data(),ctx->methodName.data()));
+ DBG_CTX((stderr,"%s %s]\n",qPrint(ctx->objectTypeOrName),qPrint(ctx->methodName)));
DBG_CTX((stderr,"}=(type='%s',name='%s')",
- ctx->objectTypeOrName.data(),
- ctx->methodName.data()));
+ qPrint(ctx->objectTypeOrName),
+ qPrint(ctx->methodName)));
}
// Replaces an Objective-C method name fragment s by a marker of the form
@@ -3695,14 +3709,16 @@ static QCString escapeComment(yyscan_t yyscanner,const char *s)
return result;
}
-static bool skipLanguageSpecificKeyword(yyscan_t yyscanner,const QCString &kw)
+static bool skipLanguageSpecificKeyword(yyscan_t yyscanner,const char *keyword)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ QCString kw(keyword);
return yyextra->lang==SrcLangExt_Cpp && (kw == "remove" || kw == "set" || kw == "get");
}
-static bool isCastKeyword(const QCString &s)
+static bool isCastKeyword(const char *keyword)
{
+ QCString s(keyword);
int i=s.find('<');
if (i==-1) return FALSE;
QCString kw = s.left(i).stripWhiteSpace();
@@ -3734,7 +3750,7 @@ static void saveObjCContext(yyscan_t yyscanner)
if (yyextra->braceCount==0 && YY_START==ObjCCall)
{
yyextra->currentCtx->objectTypeOrName=yyextra->currentCtx->format.mid(1);
- DBG_CTX((stderr,"new type=%s\n",yyextra->currentCtx->objectTypeOrName.data()));
+ DBG_CTX((stderr,"new type=%s\n",qPrint(yyextra->currentCtx->objectTypeOrName)));
}
yyextra->contextStack.push(yyextra->currentCtx);
}
@@ -3811,8 +3827,8 @@ void CCodeParser::setStartCodeLine(const bool inp)
yyextra->beginCodeLine = inp;
}
-void CCodeParser::parseCode(CodeOutputInterface &od,const char *className,const QCString &s,
- SrcLangExt lang,bool exBlock, const char *exName,FileDef *fd,
+void CCodeParser::parseCode(CodeOutputInterface &od,const QCString &className,const QCString &s,
+ SrcLangExt lang,bool exBlock, const QCString &exName,FileDef *fd,
int startLine,int endLine,bool inlineFragment,
const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx,
bool collectXRefs)
@@ -3820,14 +3836,14 @@ void CCodeParser::parseCode(CodeOutputInterface &od,const char *className,const
yyscan_t yyscanner = p->yyscanner;
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
DBG_CTX((stderr,"***parseCode() exBlock=%d exName=%s fd=%p className=%s searchCtx=%s\n",
- exBlock,exName,fd,className,searchCtx?searchCtx->name().data():"<none>"));
+ exBlock,qPrint(exName),(void*)fd,qPrint(className),searchCtx?qPrint(searchCtx->name()):"<none>"));
if (s.isEmpty()) return;
- printlex(yy_flex_debug, TRUE, __FILE__, fd ? fd->fileName().data(): NULL);
+ printlex(yy_flex_debug, TRUE, __FILE__, fd ? qPrint(fd->fileName()): NULL);
yyextra->code = &od;
- yyextra->inputString = s;
+ yyextra->inputString = s.data();
yyextra->inputPosition = 0;
codeYYrestart(0,yyscanner);
yyextra->currentFontClass = 0;
@@ -3855,7 +3871,7 @@ void CCodeParser::parseCode(CodeOutputInterface &od,const char *className,const
yyextra->theCallContext.clear();
while (!yyextra->scopeStack.empty()) yyextra->scopeStack.pop();
yyextra->classScope = className;
- DBG_CTX((stderr,"parseCCode %s\n",className));
+ DBG_CTX((stderr,"parseCCode %s\n",qPrint(className)));
yyextra->exampleBlock = exBlock;
yyextra->exampleName = exName;
yyextra->sourceFileDef = fd;
@@ -3864,7 +3880,7 @@ void CCodeParser::parseCode(CodeOutputInterface &od,const char *className,const
if (fd==0)
{
// create a dummy filedef for the example
- yyextra->sourceFileDef = createFileDef("",(exName?exName:"generated"));
+ yyextra->sourceFileDef = createFileDef(QCString(),(!exName.isEmpty()?exName:"generated"));
cleanupSourceDef = TRUE;
}
yyextra->lang = lang;
@@ -3873,7 +3889,7 @@ void CCodeParser::parseCode(CodeOutputInterface &od,const char *className,const
{
setCurrentDoc(yyscanner,"l00001");
}
- yyextra->currentDefinition = 0;
+ yyextra->currentDefinition = getResolvedNamespace(className);
yyextra->currentMemberDef = 0;
yyextra->searchingForBody = exBlock;
yyextra->insideBody = FALSE;
@@ -3881,10 +3897,10 @@ void CCodeParser::parseCode(CodeOutputInterface &od,const char *className,const
if (!yyextra->exampleName.isEmpty())
{
yyextra->exampleFile = convertNameToFile(yyextra->exampleName+"-example",FALSE,TRUE);
- DBG_CTX((stderr,"yyextra->exampleFile=%s\n",yyextra->exampleFile.data()));
+ DBG_CTX((stderr,"yyextra->exampleFile=%s\n",qPrint(yyextra->exampleFile)));
}
yyextra->includeCodeFragment = inlineFragment;
- DBG_CTX((stderr,"** exBlock=%d exName=%s include=%d\n",exBlock,exName,inlineFragment));
+ DBG_CTX((stderr,"** exBlock=%d exName=%s include=%d\n",exBlock,qPrint(exName),inlineFragment));
if (yyextra->beginCodeLine) startCodeLine(yyscanner);
yyextra->type.resize(0);
yyextra->name.resize(0);
@@ -3910,7 +3926,7 @@ void CCodeParser::parseCode(CodeOutputInterface &od,const char *className,const
// write the tooltips
TooltipManager::instance().writeTooltips(od);
- printlex(yy_flex_debug, FALSE, __FILE__, fd ? fd->fileName().data(): NULL);
+ printlex(yy_flex_debug, FALSE, __FILE__, fd ? qPrint(fd->fileName()): NULL);
return;
}
diff --git a/src/commentcnv.h b/src/commentcnv.h
index a45d29c..973a602 100644
--- a/src/commentcnv.h
+++ b/src/commentcnv.h
@@ -1,12 +1,12 @@
/*****************************************************************************
*
- *
+ *
*
* Copyright (C) 1997-2015 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
+ * 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.
*
@@ -19,9 +19,10 @@
#define _COMMENTCNV_H
class BufStr;
+class QCString;
extern void convertCppComments(BufStr *inBuf,BufStr *outBuf,
- const char *fileName);
+ const QCString &fileName);
#endif
diff --git a/src/commentcnv.l b/src/commentcnv.l
index 09583d3..23611a9 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stack>
+#include <algorithm>
#include "bufstr.h"
#include "debug.h"
@@ -107,10 +108,10 @@ static inline int computeIndent(const char *s);
static void replaceCommentMarker(yyscan_t yyscanner,const char *s,int len);
static inline void copyToOutput(yyscan_t yyscanner,const char *s,int len);
-static void startCondSection(yyscan_t yyscanner,const char *sectId);
+static void startCondSection(yyscan_t yyscanner,const QCString &sectId);
static void endCondSection(yyscan_t yyscanner);
static void handleCondSectionId(yyscan_t yyscanner,const char *expression);
-static void replaceAliases(yyscan_t yyscanner,const char *s);
+static void replaceAliases(yyscan_t yyscanner,const QCString &s);
static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
static void replaceComment(yyscan_t yyscanner,int offset);
static void clearCommentStack(yyscan_t yyscanner);
@@ -305,7 +306,7 @@ SLASHopt [/]*
}
yyextra->blockHeadCol=yyextra->col;
copyToOutput(yyscanner,"/**",3);
- replaceAliases(yyscanner,yytext+i);
+ replaceAliases(yyscanner,QCString(yytext+i));
yyextra->inSpecialComment=TRUE;
//BEGIN(SComment);
yyextra->readLineCtx=SComment;
@@ -317,7 +318,7 @@ SLASHopt [/]*
int i=17; //=strlen("//##Documentation");
yyextra->blockHeadCol=yyextra->col;
copyToOutput(yyscanner,"/**",3);
- replaceAliases(yyscanner,yytext+i);
+ replaceAliases(yyscanner,QCString(yytext+i));
yyextra->inRoseComment=TRUE;
BEGIN(SComment);
}
@@ -872,7 +873,7 @@ SLASHopt [/]*
if (*yytext=='\n') yyextra->lineNr++;
}
<CComment,ReadLine>[\\@][a-z_A-Z][a-z_A-Z0-9]* { // expand alias without arguments
- replaceAliases(yyscanner,yytext);
+ replaceAliases(yyscanner,QCString(yytext));
}
<CComment,ReadLine>[\\@][a-z_A-Z][a-z_A-Z0-9]*"{" { // expand alias with arguments
yyextra->lastBlockContext=YY_START;
@@ -890,7 +891,7 @@ SLASHopt [/]*
}
else // abort the alias, restart scanning
{
- copyToOutput(yyscanner,yyextra->aliasString,yyextra->aliasString.length());
+ copyToOutput(yyscanner,yyextra->aliasString.data(),yyextra->aliasString.length());
copyToOutput(yyscanner,yytext,(int)yyleng);
BEGIN(Scan);
}
@@ -1042,7 +1043,7 @@ static void clearCommentStack(yyscan_t yyscanner)
while (!yyextra->commentStack.empty()) yyextra->commentStack.pop();
}
-static void startCondSection(yyscan_t yyscanner,const char *sectId)
+static void startCondSection(yyscan_t yyscanner,const QCString &sectId)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
//printf("startCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
@@ -1076,7 +1077,7 @@ static void handleCondSectionId(yyscan_t yyscanner,const char *expression)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool oldSkip=yyextra->skip;
- startCondSection(yyscanner,expression);
+ startCondSection(yyscanner,QCString(expression));
if ((yyextra->condCtx==CComment || yyextra->readLineCtx==SComment) &&
!oldSkip && yyextra->skip)
{
@@ -1102,11 +1103,11 @@ static void handleCondSectionId(yyscan_t yyscanner,const char *expression)
/** copies string \a s with length \a len to the output, while
* replacing any alias commands found in the string.
*/
-static void replaceAliases(yyscan_t yyscanner,const char *s)
+static void replaceAliases(yyscan_t yyscanner,const QCString &s)
{
QCString result = resolveAliasCmd(s);
//printf("replaceAliases(%s)->'%s'\n",s,result.data());
- copyToOutput(yyscanner,result,result.length());
+ copyToOutput(yyscanner,result.data(),result.length());
}
@@ -1114,7 +1115,7 @@ static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yy_size_t bytesInBuf = yyextra->inBuf->curPos()-yyextra->inBufPos;
- yy_size_t bytesToCopy = QMIN(max_size,bytesInBuf);
+ yy_size_t bytesToCopy = std::min(max_size,bytesInBuf);
memcpy(buf,yyextra->inBuf->data()+yyextra->inBufPos,bytesToCopy);
yyextra->inBufPos+=bytesToCopy;
return bytesToCopy;
@@ -1151,7 +1152,7 @@ static void replaceComment(yyscan_t yyscanner,int offset)
* -# It replaces aliases with their definition (see ALIASES)
* -# It handles conditional sections (cond...endcond blocks)
*/
-void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
+void convertCppComments(BufStr *inBuf,BufStr *outBuf,const QCString &fileName)
{
yyscan_t yyscanner;
commentcnvYY_state extra;
@@ -1175,12 +1176,12 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
clearCommentStack(yyscanner);
yyextra->vhdl = FALSE;
- printlex(yy_flex_debug, TRUE, __FILE__, fileName);
+ printlex(yy_flex_debug, TRUE, __FILE__, qPrint(fileName));
yyextra->isFixedForm = FALSE;
if (yyextra->lang==SrcLangExt_Fortran)
{
FortranFormat fmt = convertFileNameFortranParserCode(fileName);
- yyextra->isFixedForm = recognizeFixedForm(inBuf->data(),fmt);
+ yyextra->isFixedForm = recognizeFixedForm(QCString(inBuf->data()),fmt);
}
if (yyextra->lang==SrcLangExt_Markdown)
@@ -1197,7 +1198,7 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
while (!yyextra->condStack.empty())
{
const CondCtx &ctx = yyextra->condStack.top();
- QCString sectionInfo = " ";
+ QCString sectionInfo(" ");
if (ctx.sectionId!=" ") sectionInfo.sprintf(" with label '%s' ",ctx.sectionId.stripWhiteSpace().data());
warn(yyextra->fileName,ctx.lineNr,"Conditional section%sdoes not have "
"a corresponding \\endcond command within this file.",sectionInfo.data());
@@ -1205,7 +1206,7 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
}
if (yyextra->nestingCount>0 && yyextra->lang!=SrcLangExt_Markdown && yyextra->lang!=SrcLangExt_Fortran)
{
- QCString tmp= "(probable line reference: ";
+ QCString tmp("(probable line reference: ");
bool first = TRUE;
while (!yyextra->commentStack.empty())
{
@@ -1224,10 +1225,10 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
{
yyextra->outBuf->at(yyextra->outBuf->curPos())='\0';
Debug::print(Debug::CommentCnv,0,"-----------\nCommentCnv: %s\n"
- "output=[\n%s]\n-----------\n",fileName,yyextra->outBuf->data()
+ "output=[\n%s]\n-----------\n",qPrint(fileName),yyextra->outBuf->data()
);
}
- printlex(yy_flex_debug, FALSE, __FILE__, fileName);
+ printlex(yy_flex_debug, FALSE, __FILE__, qPrint(fileName));
commentcnvYYlex_destroy(yyscanner);
}
diff --git a/src/commentscan.h b/src/commentscan.h
index a111352..d9910d7 100644
--- a/src/commentscan.h
+++ b/src/commentscan.h
@@ -81,12 +81,12 @@ class CommentScanner
bool markdownEnabled
);
void initGroupInfo(Entry *entry);
- void enterFile(const char *fileName,int lineNr);
- void leaveFile(const char *fileName,int lineNr);
- void enterCompound(const char *fileName,int line,const char *name);
- void leaveCompound(const char *fileName,int line,const char *name);
- void open(Entry *e,const char *fileName,int line,bool implicit=false);
- void close(Entry *e,const char *fileName,int line,bool foundInline,bool implicit=false);
+ void enterFile(const QCString &fileName,int lineNr);
+ void leaveFile(const QCString &fileName,int lineNr);
+ void enterCompound(const QCString &fileName,int line,const QCString &name);
+ void leaveCompound(const QCString &fileName,int line,const QCString &name);
+ void open(Entry *e,const QCString &fileName,int line,bool implicit=false);
+ void close(Entry *e,const QCString &fileName,int line,bool foundInline,bool implicit=false);
private:
struct Private;
std::unique_ptr<Private> p;
diff --git a/src/commentscan.l b/src/commentscan.l
index 89b8052..399f5fb 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -37,9 +37,7 @@
#include <assert.h>
#include <ctype.h>
-#include <qcstring.h>
-#include <qcstringlist.h>
-
+#include "qcstring.h"
#include "cite.h"
#include "commentscan.h"
#include "condparser.h"
@@ -60,89 +58,90 @@
#define USE_STATE2STRING 0
// forward declarations
-static bool handleBrief(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleFn(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleDef(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleOverload(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleEnum(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleDefGroup(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleAddToGroup(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleWeakGroup(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleNamespace(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handlePackage(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleClass(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleHeaderFile(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleProtocol(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleCategory(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleUnion(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleStruct(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleInterface(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleIdlException(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handlePage(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleMainpage(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleFile(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleDir(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleExample(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleDetails(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleNoop(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleName(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleTodo(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleTest(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleBug(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleSubpage(yyscan_t yyscanner,const QCString &s, const QCStringList &);
-static bool handleDeprecated(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleXRefItem(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleRelated(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleRelatedAlso(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleMemberOf(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleRefItem(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleSection(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleAnchor(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleCite(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleFormatBlock(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleAddIndex(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleIf(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleIfNot(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleElseIf(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleElse(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleEndIf(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleIngroup(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleNoSubGrouping(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleShowInitializer(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleHideInitializer(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleCallgraph(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleHideCallgraph(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleCallergraph(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleHideCallergraph(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleReferencedByRelation(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleHideReferencedByRelation(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleReferencesRelation(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleHideReferencesRelation(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleInternal(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleStatic(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handlePure(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handlePrivate(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handlePrivateSection(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleProtected(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleProtectedSection(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handlePublic(yyscan_t yyscanner,const QCString &s, const QCStringList &);
-static bool handlePublicSection(yyscan_t yyscanner,const QCString &s, const QCStringList &);
-static bool handleToc(yyscan_t yyscanner,const QCString &s, const QCStringList &);
-static bool handleInherit(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleExtends(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleCopyDoc(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleCopyBrief(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleCopyDetails(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleParBlock(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleEndParBlock(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleParam(yyscan_t yyscanner,const QCString &, const QCStringList &);
-static bool handleRetval(yyscan_t yyscanner,const QCString &, const QCStringList &);
+static bool handleBrief(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleFn(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleDef(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleOverload(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleEnum(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleDefGroup(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleAddToGroup(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleWeakGroup(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleNamespace(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handlePackage(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleConcept(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleClass(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleHeaderFile(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleProtocol(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleCategory(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleUnion(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleStruct(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleInterface(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleIdlException(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handlePage(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleMainpage(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleFile(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleDir(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleExample(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleDetails(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleNoop(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleName(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleTodo(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleTest(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleBug(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleSubpage(yyscan_t yyscanner,const QCString &s, const StringVector &);
+static bool handleDeprecated(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleXRefItem(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleRelated(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleRelatedAlso(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleMemberOf(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleRefItem(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleSection(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleAnchor(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleCite(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleFormatBlock(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleAddIndex(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleIf(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleIfNot(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleElseIf(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleElse(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleEndIf(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleIngroup(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleNoSubGrouping(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleShowInitializer(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleHideInitializer(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleCallgraph(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleHideCallgraph(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleCallergraph(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleHideCallergraph(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleReferencedByRelation(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleHideReferencedByRelation(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleReferencesRelation(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleHideReferencesRelation(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleInternal(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleStatic(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handlePure(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handlePrivate(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handlePrivateSection(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleProtected(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleProtectedSection(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handlePublic(yyscan_t yyscanner,const QCString &s, const StringVector &);
+static bool handlePublicSection(yyscan_t yyscanner,const QCString &s, const StringVector &);
+static bool handleToc(yyscan_t yyscanner,const QCString &s, const StringVector &);
+static bool handleInherit(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleExtends(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleCopyDoc(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleCopyBrief(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleCopyDetails(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleParBlock(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleEndParBlock(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleParam(yyscan_t yyscanner,const QCString &, const StringVector &);
+static bool handleRetval(yyscan_t yyscanner,const QCString &, const StringVector &);
#if USE_STATE2STRING
static const char *stateToString(int state);
#endif
-typedef bool (*DocCmdFunc)(yyscan_t yyscanner,const QCString &name, const QCStringList &optList);
+typedef bool (*DocCmdFunc)(yyscan_t yyscanner,const QCString &name, const StringVector &optList);
enum class CommandSpacing
{
@@ -178,6 +177,7 @@ static const std::map< std::string, DocCmdMap > docCmdMap =
{ "cite", { &handleCite, CommandSpacing::Inline }},
{ "class", { &handleClass, CommandSpacing::Invisible }},
{ "code", { &handleFormatBlock, CommandSpacing::Block }},
+ { "concept", { &handleConcept, CommandSpacing::Invisible }},
{ "copybrief", { &handleCopyBrief, CommandSpacing::Invisible }},
{ "copydetails", { &handleCopyDetails, CommandSpacing::Block }},
{ "copydoc", { &handleCopyDoc, CommandSpacing::Block }},
@@ -425,14 +425,15 @@ static void initParser(yyscan_t yyscanner);
static bool makeStructuralIndicator(yyscan_t yyscanner,Entry::Sections s);
static void lineCount(yyscan_t yyscanner);
static void addXRefItem(yyscan_t yyscanner,
- const char *listName,const char *itemTitle,
- const char *listTitle,bool append);
+ const QCString &listName,const QCString &itemTitle,
+ const QCString &listTitle,bool append);
static QCString addFormula(yyscan_t yyscanner);
static void checkFormula(yyscan_t yyscanner);
static void addSection(yyscan_t yyscanner);
static inline void setOutput(yyscan_t yyscanner,OutputContext ctx);
-static void addAnchor(yyscan_t yyscanner,const char *anchor);
+static void addAnchor(yyscan_t yyscanner,const QCString &anchor);
static inline void addOutput(yyscan_t yyscanner,const char *s);
+static inline void addOutput(yyscan_t yyscanner,const QCString &s);
static inline void addOutput(yyscan_t yyscanner,char c);
static void endBrief(yyscan_t yyscanner,bool addToOutput=TRUE);
static void handleGuard(yyscan_t yyscanner,const QCString &expr);
@@ -520,6 +521,7 @@ STopt [^\n@\\]*
%x EnumDocArg1
%x NameSpaceDocArg1
%x PackageDocArg1
+%x ConceptDocArg1
%x GroupDocArg1
%x GroupDocArg2
%x SectionLabel
@@ -613,7 +615,7 @@ STopt [^\n@\\]*
addOutput(yyscanner,yytext);
}
<Comment>"<"{CAPTION}{ATTR}">" {
- QCString tag=yytext;
+ QCString tag(yytext);
int s=tag.find("id=");
if (s!=-1) // command has id attribute
{
@@ -668,19 +670,19 @@ STopt [^\n@\\]*
if ((idx > 1) && (yytext[idx-1] == 'f') && (yytext[idx-2] == '\\' || yytext[idx-2] =='@')) REJECT;
int idxEnd = fullMatch.find("}",idx+1);
QCString cmdName;
- QCStringList optList;
+ StringVector optList;
if (idx == -1) // no options
{
- cmdName = QCString(yytext).stripWhiteSpace().data()+1; // to remove {CMD}
+ cmdName = QCString(yytext).stripWhiteSpace().mid(1); // to remove {CMD}
}
else // options present
{
- cmdName = fullMatch.left(idx).stripWhiteSpace().data()+1; // to remove {CMD}
+ cmdName = fullMatch.left(idx).stripWhiteSpace().mid(1); // to remove {CMD}
QCString optStr = fullMatch.mid(idx+1,idxEnd-idx-1).stripWhiteSpace();
- optList = QCStringList::split(',',optStr);
+ optList = split(optStr.str(),",");
}
- auto it = docCmdMap.find(cmdName.data());
- //printf("lookup command '%s' found=%d\n",cmdName.data(),it!=docCmdMap.end());
+ auto it = docCmdMap.find(cmdName.str());
+ //printf("lookup command '%s' found=%d\n",qPrint(cmdName),it!=docCmdMap.end());
if (it!=docCmdMap.end()) // special action is required
{
int i=0;
@@ -727,9 +729,9 @@ STopt [^\n@\\]*
addOutput(yyscanner,yytext);
}
<Comment>{B}*{CMD}"~"[a-z_A-Z-]* { // language switch command
- QCString langId = QCString(yytext).stripWhiteSpace().data()+2;
+ QCString langId = QCString(yytext).stripWhiteSpace().mid(2);
if (!langId.isEmpty() &&
- qstricmp(Config_getEnum(OUTPUT_LANGUAGE),langId)!=0)
+ qstricmp(Config_getEnum(OUTPUT_LANGUAGE).data(),langId.data())!=0)
{ // enable language specific section
BEGIN(SkipLang);
}
@@ -737,7 +739,7 @@ STopt [^\n@\\]*
<Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?) { // start of a formula with custom environment
setOutput(yyscanner,OutputDoc);
yyextra->formulaText="\\begin";
- yyextra->formulaEnv=QCString(yytext).stripWhiteSpace().data()+2;
+ yyextra->formulaEnv=QCString(yytext).stripWhiteSpace().mid(2);
if (yyextra->formulaEnv.at(yyextra->formulaEnv.length()-1)=='{')
{
// remove trailing open brace
@@ -983,7 +985,7 @@ STopt [^\n@\\]*
/* ------------ handle argument of namespace command --------------- */
<NameSpaceDocArg1>{SCOPENAME} { // handle argument
- yyextra->current->name = substitute(yytext,".","::");
+ yyextra->current->name = substitute(QCString(yytext),QCString("."),QCString("::"));
BEGIN( Comment );
}
<NameSpaceDocArg1>{LC} { // line continuation
@@ -1026,14 +1028,36 @@ STopt [^\n@\\]*
<PackageDocArg1>. { // ignore other stuff
}
+ /* ------------ handle argument of concept command --------------- */
+
+<ConceptDocArg1>{SCOPEID} { // handle argument
+ yyextra->current->name = yytext;
+ BEGIN( Comment );
+ }
+<ConceptDocArg1>{LC} { // line continuation
+ yyextra->lineNr++;
+ addOutput(yyscanner,'\n');
+ }
+<ConceptDocArg1>{DOCNL} { // missing argument
+ warn(yyextra->fileName,yyextra->lineNr,
+ "missing argument after "
+ "\\concept."
+ );
+ unput_string(yytext,yyleng);
+ BEGIN( Comment );
+ }
+<ConceptDocArg1>. { // ignore other stuff
+ }
+
+
/* ------ handle argument of class/struct/union command --------------- */
<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
- yyextra->current->name = substitute(removeRedundantWhiteSpace(yytext),".","::");
+ yyextra->current->name = substitute(removeRedundantWhiteSpace(QCString(yytext)),".","::");
BEGIN( ClassDocArg2 );
}
<ClassDocArg1>{SCOPENAME} { // first argument
- yyextra->current->name = substitute(yytext,".","::");
+ yyextra->current->name = substitute(QCString(yytext),".","::");
if (yyextra->current->section==Entry::PROTOCOLDOC_SEC)
{
yyextra->current->name+="-p";
@@ -1042,7 +1066,7 @@ STopt [^\n@\\]*
BEGIN( ClassDocArg2 );
}
<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
- yyextra->current->name = substitute(yytext,".","::");
+ yyextra->current->name = substitute(QCString(yytext),".","::");
BEGIN( ClassDocArg2 );
}
<ClassDocArg1,CategoryDocArg1>{LC} { // line continuation
@@ -1052,7 +1076,7 @@ STopt [^\n@\\]*
<ClassDocArg1,CategoryDocArg1>{DOCNL} {
warn(yyextra->fileName,yyextra->lineNr,
"missing argument after "
- "'\\%s'.",yyextra->currentCmd.data()
+ "'\\%s'.",qPrint(yyextra->currentCmd)
);
//addOutput(yyscanner,'\n');
//if (*yytext=='\n') yyextra->lineNr++;
@@ -1140,7 +1164,7 @@ STopt [^\n@\\]*
{
warn(yyextra->fileName,yyextra->lineNr,
"missing title after "
- "\\defgroup %s", yyextra->current->name.data()
+ "\\defgroup %s", qPrint(yyextra->current->name)
);
}
unput_string(yytext,yyleng);
@@ -1183,7 +1207,7 @@ STopt [^\n@\\]*
}
<PageDocArg2>{CMD}[<>] {
// bug 748927
- QCString tmp = yytext;
+ QCString tmp(yytext);
tmp = substitute(substitute(tmp,"@<","&lt;"),"@>","&gt;");
tmp = substitute(substitute(tmp,"\\<","&lt;"),"\\>","&gt;");
yyextra->current->args += tmp;
@@ -1198,6 +1222,10 @@ STopt [^\n@\\]*
<ParamArg1>"," {
addOutput(yyscanner," , ");
}
+<ParamArg1>{DOCNL} {
+ if (*yytext=='\n') yyextra->lineNr++;
+ addOutput(yyscanner," ");
+ }
<ParamArg1>{ID} {
addOutput(yyscanner,yytext);
BEGIN( Comment );
@@ -1306,7 +1334,7 @@ STopt [^\n@\\]*
}
<RelatesParam1>{DOCNL} { // missing argument
warn(yyextra->fileName,yyextra->lineNr,
- "Missing argument of '\\%s' command",yyextra->currentCmd.data()
+ "Missing argument of '\\%s' command",qPrint(yyextra->currentCmd)
);
unput_string(yytext,yyleng);
//if (*yytext=='\n') yyextra->lineNr++;
@@ -1392,7 +1420,7 @@ STopt [^\n@\\]*
addOutput(yyscanner,yytext);
// we add subpage labels as a kind of "inheritance" relation to prevent
// needing to add another list to the Entry class.
- yyextra->current->extends.push_back(BaseInfo(yytext,Public,Normal));
+ yyextra->current->extends.push_back(BaseInfo(QCString(yytext),Public,Normal));
BEGIN(SubpageTitle);
}
<SubpageLabel>{DOCNL} { // missing argument
@@ -1419,7 +1447,7 @@ STopt [^\n@\\]*
/* ----- handle arguments of the anchor command ------- */
<AnchorLabel>{LABELID} { // found argument
- addAnchor(yyscanner,yytext);
+ addAnchor(yyscanner,QCString(yytext));
addOutput(yyscanner,yytext);
BEGIN( Comment );
}
@@ -1474,7 +1502,7 @@ STopt [^\n@\\]*
if (yyextra->commentCount<0)
{
warn(yyextra->fileName,yyextra->lineNr,
- "found */ without matching /* while inside a \\%s block! Perhaps a missing \\end%s?\n",yyextra->blockName.data(),yyextra->blockName.data());
+ "found */ without matching /* while inside a \\%s block! Perhaps a missing \\end%s?\n",qPrint(yyextra->blockName),qPrint(yyextra->blockName));
}
}
}
@@ -1486,7 +1514,7 @@ STopt [^\n@\\]*
if (yyextra->blockName=="startuml") endTag="enduml";
warn(yyextra->fileName,yyextra->lineNr,
"reached end of comment while inside a \\%s block; check for missing \\%s tag!",
- yyextra->blockName.data(),endTag.data()
+ qPrint(yyextra->blockName),qPrint(endTag)
);
yyterminate();
}
@@ -1515,12 +1543,12 @@ STopt [^\n@\\]*
}
<GuardExpr>\n {
warn(yyextra->fileName,yyextra->lineNr,
- "invalid expression '%s' for yyextra->guards",yyextra->guardExpr.data());
+ "invalid expression '%s' for yyextra->guards",qPrint(yyextra->guardExpr));
unput(*yytext);
BEGIN(GuardParam);
}
<GuardParam>{B}*[a-z_A-Z0-9.\-]+ { // parameter of if/ifnot yyextra->guards
- handleGuard(yyscanner,yytext);
+ handleGuard(yyscanner,QCString(yytext));
}
<GuardParam>{DOCNL} { // end of argument
if (*yytext=='\n') yyextra->lineNr++;
@@ -1711,7 +1739,7 @@ STopt [^\n@\\]*
<InGroupParam>{LABELID} { // group id
yyextra->current->groups.push_back(
- Grouping(yytext, Grouping::GROUPING_INGROUP)
+ Grouping(QCString(yytext), Grouping::GROUPING_INGROUP)
);
yyextra->inGroupParamFound=TRUE;
}
@@ -1796,7 +1824,7 @@ STopt [^\n@\\]*
<InheritParam>({ID}("::"|"."))*{ID} { // found argument
yyextra->current->extends.push_back(
- BaseInfo(removeRedundantWhiteSpace(yytext),Public,Normal)
+ BaseInfo(removeRedundantWhiteSpace(QCString(yytext)),Public,Normal)
);
BEGIN( Comment );
}
@@ -1819,13 +1847,13 @@ STopt [^\n@\\]*
<ExtendsParam>({ID}("::"|"."))*{ID} { // found argument
yyextra->current->extends.push_back(
- BaseInfo(removeRedundantWhiteSpace(yytext),Public,Normal)
+ BaseInfo(removeRedundantWhiteSpace(QCString(yytext)),Public,Normal)
);
BEGIN( Comment );
}
<ExtendsParam>{DOCNL} { // missing argument
warn(yyextra->fileName,yyextra->lineNr,
- "'\\%s' command has no argument",yyextra->currentCmd.data()
+ "'\\%s' command has no argument",qPrint(yyextra->currentCmd)
);
//if (*yytext=='\n') yyextra->lineNr++;
//addOutput(yyscanner,'\n');
@@ -1838,9 +1866,9 @@ STopt [^\n@\\]*
/* ----- handle language specific sections ------- */
<SkipLang>[\\@]"~"[a-zA-Z-]* { /* language switch */
- QCString langId = &yytext[2];
+ QCString langId(&yytext[2]);
if (langId.isEmpty() ||
- qstricmp(Config_getEnum(OUTPUT_LANGUAGE),langId)==0)
+ qstricmp(Config_getEnum(OUTPUT_LANGUAGE).data(),langId.data())==0)
{ // enable language specific section
BEGIN(Comment);
}
@@ -1897,19 +1925,23 @@ STopt [^\n@\\]*
addOutput(yyscanner,yytext);
}
+ /*
+<*>. { fprintf(stderr,"Lex scanner %s %sdefault rule for state %s: #%s#\n", __FILE__,yyextra->fileName ? ("(" + yyextra->fileName +") ").data(): "",stateToString(YY_START),yytext);}
+<*>\n { fprintf(stderr,"Lex scanner %s %sdefault rule newline for state %s.\n", __FILE__, yyextra->fileName ? ("(" + yyextra->fileName +") ").data(): "",stateToString(YY_START));}
+ */
%%
//----------------------------------------------------------------------------
-static bool handleBrief(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleBrief(yyscan_t yyscanner,const QCString &, const StringVector &)
{
//printf("handleBrief\n");
setOutput(yyscanner,OutputBrief);
return FALSE;
}
-static bool handleFn(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleFn(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::MEMBERDOC_SEC);
@@ -1919,7 +1951,7 @@ static bool handleFn(yyscan_t yyscanner,const QCString &, const QCStringList &)
return stop;
}
-static bool handleDef(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleDef(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::DEFINEDOC_SEC);
@@ -1928,7 +1960,7 @@ static bool handleDef(yyscan_t yyscanner,const QCString &, const QCStringList &)
return stop;
}
-static bool handleOverload(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleOverload(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->functionProto.resize(0);
@@ -1936,7 +1968,7 @@ static bool handleOverload(yyscan_t yyscanner,const QCString &, const QCStringLi
return FALSE;
}
-static bool handleEnum(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleEnum(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::ENUMDOC_SEC);
@@ -1944,7 +1976,7 @@ static bool handleEnum(yyscan_t yyscanner,const QCString &, const QCStringList &
return stop;
}
-static bool handleDefGroup(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleDefGroup(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::GROUPDOC_SEC);
@@ -1953,7 +1985,7 @@ static bool handleDefGroup(yyscan_t yyscanner,const QCString &, const QCStringLi
return stop;
}
-static bool handleAddToGroup(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleAddToGroup(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::GROUPDOC_SEC);
@@ -1962,7 +1994,7 @@ static bool handleAddToGroup(yyscan_t yyscanner,const QCString &, const QCString
return stop;
}
-static bool handleWeakGroup(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleWeakGroup(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::GROUPDOC_SEC);
@@ -1971,7 +2003,7 @@ static bool handleWeakGroup(yyscan_t yyscanner,const QCString &, const QCStringL
return stop;
}
-static bool handleNamespace(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleNamespace(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::NAMESPACEDOC_SEC);
@@ -1979,7 +2011,7 @@ static bool handleNamespace(yyscan_t yyscanner,const QCString &, const QCStringL
return stop;
}
-static bool handlePackage(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handlePackage(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::PACKAGEDOC_SEC);
@@ -1987,7 +2019,7 @@ static bool handlePackage(yyscan_t yyscanner,const QCString &, const QCStringLis
return stop;
}
-static bool handleClass(yyscan_t yyscanner,const QCString &cmd, const QCStringList &)
+static bool handleClass(yyscan_t yyscanner,const QCString &cmd, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::CLASSDOC_SEC);
@@ -1996,14 +2028,23 @@ static bool handleClass(yyscan_t yyscanner,const QCString &cmd, const QCStringLi
return stop;
}
-static bool handleHeaderFile(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleConcept(yyscan_t yyscanner,const QCString &cmd, const StringVector &)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ bool stop=makeStructuralIndicator(yyscanner,Entry::CONCEPTDOC_SEC);
+ yyextra->currentCmd = cmd;
+ BEGIN( ConceptDocArg1 );
+ return stop;
+}
+
+static bool handleHeaderFile(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
BEGIN( ClassDocArg2 );
return FALSE;
}
-static bool handleProtocol(yyscan_t yyscanner,const QCString &cmd, const QCStringList &)
+static bool handleProtocol(yyscan_t yyscanner,const QCString &cmd, const StringVector &)
{ // Obj-C protocol
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::PROTOCOLDOC_SEC);
@@ -2012,7 +2053,7 @@ static bool handleProtocol(yyscan_t yyscanner,const QCString &cmd, const QCStrin
return stop;
}
-static bool handleCategory(yyscan_t yyscanner,const QCString &cmd, const QCStringList &)
+static bool handleCategory(yyscan_t yyscanner,const QCString &cmd, const StringVector &)
{ // Obj-C category
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::CATEGORYDOC_SEC);
@@ -2021,7 +2062,7 @@ static bool handleCategory(yyscan_t yyscanner,const QCString &cmd, const QCStrin
return stop;
}
-static bool handleUnion(yyscan_t yyscanner,const QCString &cmd, const QCStringList &)
+static bool handleUnion(yyscan_t yyscanner,const QCString &cmd, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::UNIONDOC_SEC);
@@ -2030,7 +2071,7 @@ static bool handleUnion(yyscan_t yyscanner,const QCString &cmd, const QCStringLi
return stop;
}
-static bool handleStruct(yyscan_t yyscanner,const QCString &cmd, const QCStringList &)
+static bool handleStruct(yyscan_t yyscanner,const QCString &cmd, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::STRUCTDOC_SEC);
@@ -2039,7 +2080,7 @@ static bool handleStruct(yyscan_t yyscanner,const QCString &cmd, const QCStringL
return stop;
}
-static bool handleInterface(yyscan_t yyscanner,const QCString &cmd, const QCStringList &)
+static bool handleInterface(yyscan_t yyscanner,const QCString &cmd, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::INTERFACEDOC_SEC);
@@ -2048,7 +2089,7 @@ static bool handleInterface(yyscan_t yyscanner,const QCString &cmd, const QCStri
return stop;
}
-static bool handleIdlException(yyscan_t yyscanner,const QCString &cmd, const QCStringList &)
+static bool handleIdlException(yyscan_t yyscanner,const QCString &cmd, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::EXCEPTIONDOC_SEC);
@@ -2057,7 +2098,7 @@ static bool handleIdlException(yyscan_t yyscanner,const QCString &cmd, const QCS
return stop;
}
-static bool handlePage(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handlePage(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::PAGEDOC_SEC);
@@ -2065,7 +2106,7 @@ static bool handlePage(yyscan_t yyscanner,const QCString &, const QCStringList &
return stop;
}
-static bool handleMainpage(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleMainpage(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::MAINPAGEDOC_SEC);
@@ -2078,7 +2119,7 @@ static bool handleMainpage(yyscan_t yyscanner,const QCString &, const QCStringLi
return stop;
}
-static bool handleFile(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleFile(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::FILEDOC_SEC);
@@ -2090,7 +2131,7 @@ static bool handleFile(yyscan_t yyscanner,const QCString &, const QCStringList &
return stop;
}
-static bool handleParam(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleParam(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
// we need process param and retval arguments to escape leading underscores in case of
@@ -2100,7 +2141,7 @@ static bool handleParam(yyscan_t yyscanner,const QCString &, const QCStringList
return FALSE;
}
-static bool handleRetval(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleRetval(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
addOutput(yyscanner,"@retval ");
@@ -2108,7 +2149,7 @@ static bool handleRetval(yyscan_t yyscanner,const QCString &, const QCStringList
return FALSE;
}
-static bool handleDir(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleDir(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::DIRDOC_SEC);
@@ -2117,14 +2158,12 @@ static bool handleDir(yyscan_t yyscanner,const QCString &, const QCStringList &)
return stop;
}
-static bool handleExample(yyscan_t yyscanner,const QCString &cmd, const QCStringList &optList)
+static bool handleExample(yyscan_t yyscanner,const QCString &cmd, const StringVector &optList)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
Entry::Sections section=Entry::EXAMPLE_SEC;
- QCStringList::ConstIterator it;
- for ( it = optList.begin(); it != optList.end(); ++it )
+ for (const auto &opt : optList)
{
- QCString opt = (*it).stripWhiteSpace().lower();
if (opt=="lineno")
{
section=Entry::EXAMPLE_LINENO_SEC;
@@ -2132,7 +2171,7 @@ static bool handleExample(yyscan_t yyscanner,const QCString &cmd, const QCString
else
{
warn(yyextra->fileName,yyextra->lineNr,
- "unsupported option '%s' for command '\\%s'",qPrint(opt),qPrint(cmd));
+ "unsupported option '%s' for command '\\%s'",opt.c_str(),qPrint(cmd));
}
}
bool stop=makeStructuralIndicator(yyscanner,section);
@@ -2141,7 +2180,7 @@ static bool handleExample(yyscan_t yyscanner,const QCString &cmd, const QCString
return stop;
}
-static bool handleDetails(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleDetails(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (yyextra->inContext!=OutputBrief)
@@ -2153,14 +2192,14 @@ static bool handleDetails(yyscan_t yyscanner,const QCString &, const QCStringLis
return FALSE;
}
-static bool handleNoop(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleNoop(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
BEGIN( Noop );
return FALSE;
}
-static bool handleName(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleName(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool stop=makeStructuralIndicator(yyscanner,Entry::MEMBERGRP_SEC);
@@ -2176,7 +2215,7 @@ static bool handleName(yyscan_t yyscanner,const QCString &, const QCStringList &
return stop;
}
-static bool handleTodo(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleTodo(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->newXRefKind = XRef_Todo;
@@ -2185,7 +2224,7 @@ static bool handleTodo(yyscan_t yyscanner,const QCString &, const QCStringList &
return FALSE;
}
-static bool handleTest(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleTest(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->newXRefKind = XRef_Test;
@@ -2194,7 +2233,7 @@ static bool handleTest(yyscan_t yyscanner,const QCString &, const QCStringList &
return FALSE;
}
-static bool handleBug(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleBug(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->newXRefKind = XRef_Bug;
@@ -2203,7 +2242,7 @@ static bool handleBug(yyscan_t yyscanner,const QCString &, const QCStringList &)
return FALSE;
}
-static bool handleDeprecated(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleDeprecated(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->newXRefKind = XRef_Deprecated;
@@ -2212,7 +2251,7 @@ static bool handleDeprecated(yyscan_t yyscanner,const QCString &, const QCString
return FALSE;
}
-static bool handleXRefItem(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleXRefItem(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->newXRefKind = XRef_Item;
@@ -2220,7 +2259,7 @@ static bool handleXRefItem(yyscan_t yyscanner,const QCString &, const QCStringLi
return FALSE;
}
-static bool handleParBlock(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleParBlock(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (yyextra->insideParBlock)
@@ -2238,7 +2277,7 @@ static bool handleParBlock(yyscan_t yyscanner,const QCString &, const QCStringLi
return FALSE;
}
-static bool handleEndParBlock(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleEndParBlock(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (!yyextra->insideParBlock)
@@ -2252,7 +2291,7 @@ static bool handleEndParBlock(yyscan_t yyscanner,const QCString &, const QCStrin
return FALSE;
}
-static bool handleRelated(yyscan_t yyscanner,const QCString &cmd, const QCStringList &)
+static bool handleRelated(yyscan_t yyscanner,const QCString &cmd, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (!yyextra->current->relates.isEmpty())
@@ -2265,7 +2304,7 @@ static bool handleRelated(yyscan_t yyscanner,const QCString &cmd, const QCString
return FALSE;
}
-static bool handleRelatedAlso(yyscan_t yyscanner,const QCString &cmd, const QCStringList &)
+static bool handleRelatedAlso(yyscan_t yyscanner,const QCString &cmd, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (!yyextra->current->relates.isEmpty())
@@ -2279,7 +2318,7 @@ static bool handleRelatedAlso(yyscan_t yyscanner,const QCString &cmd, const QCSt
return FALSE;
}
-static bool handleMemberOf(yyscan_t yyscanner,const QCString &cmd, const QCStringList &)
+static bool handleMemberOf(yyscan_t yyscanner,const QCString &cmd, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (!yyextra->current->relates.isEmpty())
@@ -2293,7 +2332,7 @@ static bool handleMemberOf(yyscan_t yyscanner,const QCString &cmd, const QCStrin
return FALSE;
}
-static bool handleRefItem(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleRefItem(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
addOutput(yyscanner,"@refitem ");
@@ -2301,7 +2340,7 @@ static bool handleRefItem(yyscan_t yyscanner,const QCString &, const QCStringLis
return FALSE;
}
-static bool handleSection(yyscan_t yyscanner,const QCString &s, const QCStringList &)
+static bool handleSection(yyscan_t yyscanner,const QCString &s, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
setOutput(yyscanner,OutputDoc);
@@ -2314,7 +2353,7 @@ static bool handleSection(yyscan_t yyscanner,const QCString &s, const QCStringLi
return FALSE;
}
-static bool handleSubpage(yyscan_t yyscanner,const QCString &s, const QCStringList &)
+static bool handleSubpage(yyscan_t yyscanner,const QCString &s, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (yyextra->current->section!=Entry::EMPTY_SEC &&
@@ -2335,7 +2374,7 @@ static bool handleSubpage(yyscan_t yyscanner,const QCString &s, const QCStringLi
return FALSE;
}
-static bool handleAnchor(yyscan_t yyscanner,const QCString &s, const QCStringList &)
+static bool handleAnchor(yyscan_t yyscanner,const QCString &s, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
addOutput(yyscanner,"@"+s+" ");
@@ -2343,7 +2382,7 @@ static bool handleAnchor(yyscan_t yyscanner,const QCString &s, const QCStringLis
return FALSE;
}
-static bool handleCite(yyscan_t yyscanner,const QCString &s, const QCStringList &)
+static bool handleCite(yyscan_t yyscanner,const QCString &s, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (!yyextra->spaceBeforeCmd.isEmpty())
@@ -2356,25 +2395,25 @@ static bool handleCite(yyscan_t yyscanner,const QCString &s, const QCStringList
return FALSE;
}
-static bool handleFormatBlock(yyscan_t yyscanner,const QCString &s, const QCStringList &optList)
+static bool handleFormatBlock(yyscan_t yyscanner,const QCString &s, const StringVector &optList)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- if (optList.isEmpty())
+ if (optList.empty())
{
addOutput(yyscanner,"@"+s+" ");
}
else
{
- addOutput(yyscanner,"@"+s+"{"+optList.join(",")+"} ");
+ addOutput(yyscanner,"@"+s+"{"+QCString(join(optList,","))+"} ");
}
- //printf("handleFormatBlock(%s) with option(%s)\n",s.data(),opt.data());
+ //printf("handleFormatBlock(%s) with option(%s)\n",qPrint(s),qPrint(opt));
yyextra->blockName=s;
yyextra->commentCount=0;
BEGIN(FormatBlock);
return FALSE;
}
-static bool handleAddIndex(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleAddIndex(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
addOutput(yyscanner,"@addindex ");
@@ -2382,7 +2421,7 @@ static bool handleAddIndex(yyscan_t yyscanner,const QCString &, const QCStringLi
return FALSE;
}
-static bool handleIf(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleIf(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->enabledSectionFound=FALSE;
@@ -2392,7 +2431,7 @@ static bool handleIf(yyscan_t yyscanner,const QCString &, const QCStringList &)
return FALSE;
}
-static bool handleIfNot(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleIfNot(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->enabledSectionFound=FALSE;
@@ -2402,7 +2441,7 @@ static bool handleIfNot(yyscan_t yyscanner,const QCString &, const QCStringList
return FALSE;
}
-static bool handleElseIf(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleElseIf(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (yyextra->guards.empty())
@@ -2419,7 +2458,7 @@ static bool handleElseIf(yyscan_t yyscanner,const QCString &, const QCStringList
return FALSE;
}
-static bool handleElse(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleElse(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (yyextra->guards.empty())
@@ -2435,7 +2474,7 @@ static bool handleElse(yyscan_t yyscanner,const QCString &, const QCStringList &
return FALSE;
}
-static bool handleEndIf(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleEndIf(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (yyextra->guards.empty())
@@ -2457,7 +2496,7 @@ static bool handleEndIf(yyscan_t yyscanner,const QCString &, const QCStringList
return FALSE;
}
-static bool handleIngroup(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleIngroup(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->inGroupParamFound=FALSE;
@@ -2465,84 +2504,84 @@ static bool handleIngroup(yyscan_t yyscanner,const QCString &, const QCStringLis
return FALSE;
}
-static bool handleNoSubGrouping(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleNoSubGrouping(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->subGrouping = FALSE;
return FALSE;
}
-static bool handleShowInitializer(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleShowInitializer(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->initLines = 100000; // ON
return FALSE;
}
-static bool handleHideInitializer(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleHideInitializer(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->initLines = 0; // OFF
return FALSE;
}
-static bool handleCallgraph(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleCallgraph(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->callGraph = TRUE; // ON
return FALSE;
}
-static bool handleHideCallgraph(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleHideCallgraph(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->callGraph = FALSE; // OFF
return FALSE;
}
-static bool handleCallergraph(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleCallergraph(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->callerGraph = TRUE; // ON
return FALSE;
}
-static bool handleHideCallergraph(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleHideCallergraph(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->callerGraph = FALSE; // OFF
return FALSE;
}
-static bool handleReferencedByRelation(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleReferencedByRelation(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->referencedByRelation = TRUE; // ON
return FALSE;
}
-static bool handleHideReferencedByRelation(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleHideReferencedByRelation(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->referencedByRelation = FALSE; // OFF
return FALSE;
}
-static bool handleReferencesRelation(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleReferencesRelation(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->referencesRelation = TRUE; // ON
return FALSE;
}
-static bool handleHideReferencesRelation(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleHideReferencesRelation(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->referencesRelation = FALSE; // OFF
return FALSE;
}
-static bool handleInternal(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleInternal(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (!Config_getBool(INTERNAL_DOCS))
@@ -2565,72 +2604,71 @@ static bool handleInternal(yyscan_t yyscanner,const QCString &, const QCStringLi
return FALSE;
}
-static bool handleStatic(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleStatic(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->stat = TRUE;
return FALSE;
}
-static bool handlePure(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handlePure(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->virt = Pure;
return FALSE;
}
-static bool handlePrivate(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handlePrivate(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->protection = Private;
return FALSE;
}
-static bool handlePrivateSection(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handlePrivateSection(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->protection = yyextra->protection = Private;
return FALSE;
}
-static bool handleProtected(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleProtected(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->protection = Protected;
return FALSE;
}
-static bool handleProtectedSection(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleProtectedSection(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->protection = yyextra->protection = Protected ;
return FALSE;
}
-static bool handlePublic(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handlePublic(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->protection = Public;
return FALSE;
}
-static bool handlePublicSection(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handlePublicSection(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->current->protection = yyextra->protection = Public;
return FALSE;
}
-static bool handleToc(yyscan_t yyscanner,const QCString &, const QCStringList &optList)
+static bool handleToc(yyscan_t yyscanner,const QCString &, const StringVector &optList)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (yyextra->current->section==Entry::PAGEDOC_SEC ||
yyextra->current->section==Entry::MAINPAGEDOC_SEC)
{
- QCStringList::ConstIterator it;
- for ( it = optList.begin(); it != optList.end(); ++it )
+ for (const auto &opt_ : optList)
{
- QCString opt = (*it).stripWhiteSpace().lower();
+ QCString opt = QCString(opt_).stripWhiteSpace().lower();
char dum;
int level = 5;
int i = opt.find(':');
@@ -2638,7 +2676,7 @@ static bool handleToc(yyscan_t yyscanner,const QCString &, const QCStringList &o
{
if (sscanf(opt.right(opt.length() - i - 1).data(),"%d%c",&level,&dum) != 1)
{
- warn(yyextra->fileName,yyextra->lineNr,"Unknown option:level specified with \\tableofcontents: '%s'", (*it).stripWhiteSpace().data());
+ warn(yyextra->fileName,yyextra->lineNr,"Unknown option:level specified with \\tableofcontents: '%s'", qPrint(QCString(opt_).stripWhiteSpace()));
opt = "";
}
else
@@ -2668,7 +2706,7 @@ static bool handleToc(yyscan_t yyscanner,const QCString &, const QCStringList &o
}
else
{
- warn(yyextra->fileName,yyextra->lineNr,"Unknown option specified with \\tableofcontents: '%s'", (*it).stripWhiteSpace().data());
+ warn(yyextra->fileName,yyextra->lineNr,"Unknown option specified with \\tableofcontents: '%s'", qPrint(QCString(opt_).stripWhiteSpace()));
}
}
}
@@ -2682,14 +2720,14 @@ static bool handleToc(yyscan_t yyscanner,const QCString &, const QCStringList &o
return FALSE;
}
-static bool handleInherit(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleInherit(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
BEGIN(InheritParam);
return FALSE;
}
-static bool handleExtends(yyscan_t yyscanner,const QCString &cmd, const QCStringList &)
+static bool handleExtends(yyscan_t yyscanner,const QCString &cmd, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->currentCmd = cmd;
@@ -2697,7 +2735,7 @@ static bool handleExtends(yyscan_t yyscanner,const QCString &cmd, const QCString
return FALSE;
}
-static bool handleCopyBrief(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleCopyBrief(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (yyextra->current->brief.isEmpty() && yyextra->current->doc.isEmpty())
@@ -2715,7 +2753,7 @@ static bool handleCopyBrief(yyscan_t yyscanner,const QCString &, const QCStringL
return FALSE;
}
-static bool handleCopyDetails(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleCopyDetails(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
setOutput(yyscanner,OutputDoc);
@@ -2728,7 +2766,7 @@ static bool handleCopyDetails(yyscan_t yyscanner,const QCString &, const QCStrin
return FALSE;
}
-static bool handleCopyDoc(yyscan_t yyscanner,const QCString &, const QCStringList &)
+static bool handleCopyDoc(yyscan_t yyscanner,const QCString &, const StringVector &)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
setOutput(yyscanner,OutputBrief);
@@ -2779,6 +2817,7 @@ static bool getDocSectionName(int s)
case Entry::DIRDOC_SEC:
case Entry::EXAMPLE_SEC:
case Entry::MEMBERGRP_SEC:
+ case Entry::CONCEPTDOC_SEC:
return TRUE;
default:
return FALSE;
@@ -2832,11 +2871,11 @@ static QCString stripQuotes(const char *s)
//-----------------------------------------------------------------
static void addXRefItem(yyscan_t yyscanner,
- const char *listName,const char *itemTitle,
- const char *listTitle,bool append)
+ const QCString &listName,const QCString &itemTitle,
+ const QCString &listTitle,bool append)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- if (listName==0) return;
+ if (listName.isEmpty()) return;
//printf("addXRefItem(%s,%s,%s,%d)\n",listName,itemTitle,listTitle,append);
std::unique_lock<std::mutex> lock(g_sectionMutex);
@@ -2846,9 +2885,9 @@ static void addXRefItem(yyscan_t yyscanner,
for (auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it)
{
RefItem *i = *it;
- if (i && qstrcmp(i->list()->listName(),listName)==0)
+ if (i && i->list()->listName()==listName)
{
- //printf("found %s lii->type=%s\n",listName,i->list()->listName().data());
+ //printf("found %s lii->type=%s\n",listName,qPrint(i->list()->listName()));
item = i;
break;
}
@@ -2857,7 +2896,7 @@ static void addXRefItem(yyscan_t yyscanner,
{
//printf("listName=%s item id = %d existing\n",listName,item->id());
item->setText(item->text() + " <p>" + yyextra->outputXRef);
- //printf("%s: text +=%s\n",listName,item->text.data());
+ //printf("%s: text +=%s\n",listName,qPrint(item->text));
}
else // new item
{
@@ -2867,12 +2906,12 @@ static void addXRefItem(yyscan_t yyscanner,
item = refList->add();
//printf("listName=%s item id = %d new yyextra->current=%p\n",listName,item->id(),yyextra->current);
QCString anchorLabel;
- anchorLabel.sprintf("_%s%06d",listName,item->id());
+ anchorLabel.sprintf("_%s%06d",listName.data(),item->id());
item->setText(yyextra->outputXRef);
item->setAnchor(anchorLabel);
yyextra->current->sli.push_back(item);
QCString cmdString;
- cmdString.sprintf(" \\xrefitem %s %d.",listName,item->id());
+ cmdString.sprintf(" \\xrefitem %s %d.",qPrint(listName),item->id());
if (yyextra->inBody)
{
yyextra->current->inbodyDocs += cmdString;
@@ -2889,11 +2928,11 @@ static void addXRefItem(yyscan_t yyscanner,
{
if (si->lineNr() != -1)
{
- warn(listName,yyextra->lineNr,"multiple use of section label '%s', (first occurrence: %s, line %d)",anchorLabel.data(),si->fileName().data(),si->lineNr());
+ warn(listName,yyextra->lineNr,"multiple use of section label '%s', (first occurrence: %s, line %d)",qPrint(anchorLabel),qPrint(si->fileName()),si->lineNr());
}
else
{
- warn(listName,yyextra->lineNr,"multiple use of section label '%s', (first occurrence: %s)",anchorLabel.data(),si->fileName().data());
+ warn(listName,yyextra->lineNr,"multiple use of section label '%s', (first occurrence: %s)",qPrint(anchorLabel),qPrint(si->fileName()));
}
}
else
@@ -2944,11 +2983,11 @@ static void addSection(yyscan_t yyscanner)
{
if (si->lineNr() != -1)
{
- warn(yyextra->fileName,yyextra->lineNr,"multiple use of section label '%s' while adding section, (first occurrence: %s, line %d)",yyextra->sectionLabel.data(),si->fileName().data(),si->lineNr());
+ warn(yyextra->fileName,yyextra->lineNr,"multiple use of section label '%s' while adding section, (first occurrence: %s, line %d)",qPrint(yyextra->sectionLabel),qPrint(si->fileName()),si->lineNr());
}
else
{
- warn(yyextra->fileName,yyextra->lineNr,"multiple use of section label '%s' while adding section, (first occurrence: %s)",yyextra->sectionLabel.data(),si->fileName().data());
+ warn(yyextra->fileName,yyextra->lineNr,"multiple use of section label '%s' while adding section, (first occurrence: %s)",qPrint(yyextra->sectionLabel),qPrint(si->fileName()));
}
}
else
@@ -2971,13 +3010,13 @@ static void addCite(yyscan_t yyscanner)
{
std::unique_lock<std::mutex> lock(g_citeMutex);
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- QCString name=yytext;
+ QCString name(yytext);
if (yytext[0] =='"')
{
name=yytext+1;
name=name.left((int)yyleng-2);
}
- CitationManager::instance().insert(name.data());
+ CitationManager::instance().insert(name);
}
//-----------------------------------------------------------------------------
@@ -3004,7 +3043,7 @@ static void stripTrailingWhiteSpace(QCString &s)
break;
}
}
- //printf("stripTrailingWhitespace(%s) i=%d len=%d\n",s.data(),i,len);
+ //printf("stripTrailingWhitespace(%s) i=%d len=%d\n",qPrint(s),i,len);
if (i!=(int)len-1)
{
s.resize(i+2); // string up to and including char at pos i and \0 terminator
@@ -3040,28 +3079,28 @@ static inline void setOutput(yyscan_t yyscanner,OutputContext ctx)
switch(yyextra->xrefKind)
{
case XRef_Todo:
- addXRefItem(yyscanner,"todo",
+ addXRefItem(yyscanner,QCString("todo"),
theTranslator->trTodo(),
theTranslator->trTodoList(),
xrefAppendToPrev
);
break;
case XRef_Test:
- addXRefItem(yyscanner,"test",
+ addXRefItem(yyscanner,QCString("test"),
theTranslator->trTest(),
theTranslator->trTestList(),
xrefAppendToPrev
);
break;
case XRef_Bug:
- addXRefItem(yyscanner,"bug",
+ addXRefItem(yyscanner,QCString("bug"),
theTranslator->trBug(),
theTranslator->trBugList(),
xrefAppendToPrev
);
break;
case XRef_Deprecated:
- addXRefItem(yyscanner,"deprecated",
+ addXRefItem(yyscanner,QCString("deprecated"),
theTranslator->trDeprecated(),
theTranslator->trDeprecatedList(),
xrefAppendToPrev
@@ -3135,7 +3174,7 @@ static inline void setOutput(yyscan_t yyscanner,OutputContext ctx)
}
-static void addAnchor(yyscan_t yyscanner,const char *anchor)
+static void addAnchor(yyscan_t yyscanner,const QCString &anchor)
{
std::unique_lock<std::mutex> lock(g_sectionMutex);
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
@@ -3145,16 +3184,19 @@ static void addAnchor(yyscan_t yyscanner,const char *anchor)
{
if (si->lineNr() != -1)
{
- warn(yyextra->fileName,yyextra->lineNr,"multiple use of section label '%s' while adding anchor, (first occurrence: %s, line %d)",anchor,si->fileName().data(),si->lineNr());
+ warn(yyextra->fileName,yyextra->lineNr,
+ "multiple use of section label '%s' while adding anchor, (first occurrence: %s, line %d)",
+ qPrint(anchor),qPrint(si->fileName()),si->lineNr());
}
else
{
- warn(yyextra->fileName,yyextra->lineNr,"multiple use of section label '%s' while adding anchor, (first occurrence: %s)",anchor,si->fileName().data());
+ warn(yyextra->fileName,yyextra->lineNr,"multiple use of section label '%s' while adding anchor, (first occurrence: %s)",
+ qPrint(anchor),qPrint(si->fileName()));
}
}
else
{
- si = sm.add(anchor,yyextra->fileName,yyextra->lineNr,nullptr,SectionType::Anchor,0);
+ si = sm.add(anchor,yyextra->fileName,yyextra->lineNr,QCString(),SectionType::Anchor,0);
yyextra->current->anchors.push_back(si);
}
}
@@ -3167,6 +3209,14 @@ static inline void addOutput(yyscan_t yyscanner,const char *s)
*yyextra->pOutputString+=s;
}
+// add a string to the output
+static inline void addOutput(yyscan_t yyscanner,const QCString &s)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ //printf("addOutput(yyscanner,%s)\n",s);
+ *yyextra->pOutputString+=s;
+}
+
// add a character to the output
static inline void addOutput(yyscan_t yyscanner,char c)
{
@@ -3282,7 +3332,7 @@ bool CommentScanner::parseCommentBlock(/* in */ OutlineParserInterface *pars
yyextra->spaceBeforeCmd.resize(0);
yyextra->spaceBeforeIf.resize(0);
- printlex(yy_flex_debug, TRUE, __FILE__, fileName ? fileName.data(): NULL);
+ printlex(yy_flex_debug, TRUE, __FILE__, !fileName.isEmpty() ? qPrint(fileName): NULL);
if (!yyextra->current->inbodyDocs.isEmpty() && isInbody) // separate in body fragments
{
yyextra->current->inbodyDocs+="\n\n";
@@ -3353,7 +3403,7 @@ bool CommentScanner::parseCommentBlock(/* in */ OutlineParserInterface *pars
//printf("position=%d yyextra->parseMore=%d newEntryNeeded=%d\n",
// position,yyextra->parseMore,newEntryNeeded);
- printlex(yy_flex_debug, FALSE, __FILE__, fileName ? fileName.data(): NULL);
+ printlex(yy_flex_debug, FALSE, __FILE__, !fileName.isEmpty() ? qPrint(fileName): NULL);
return yyextra->parseMore;
}
@@ -3397,37 +3447,37 @@ void CommentScanner::initGroupInfo(Entry *entry)
yyextra->docGroup.initGroupInfo(entry);
}
-void CommentScanner::enterFile(const char *fileName,int lineNr)
+void CommentScanner::enterFile(const QCString &fileName,int lineNr)
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
yyextra->docGroup.enterFile(fileName,lineNr);
}
-void CommentScanner::leaveFile(const char *fileName,int lineNr)
+void CommentScanner::leaveFile(const QCString &fileName,int lineNr)
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
yyextra->docGroup.leaveFile(fileName,lineNr);
}
-void CommentScanner::enterCompound(const char *fileName,int lineNr,const char *name)
+void CommentScanner::enterCompound(const QCString &fileName,int lineNr,const QCString &name)
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
yyextra->docGroup.enterCompound(fileName,lineNr,name);
}
-void CommentScanner::leaveCompound(const char *fileName,int lineNr,const char *name)
+void CommentScanner::leaveCompound(const QCString &fileName,int lineNr,const QCString &name)
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
yyextra->docGroup.leaveCompound(fileName,lineNr,name);
}
-void CommentScanner::open(Entry *e,const char *fileName,int lineNr,bool implicit)
+void CommentScanner::open(Entry *e,const QCString &fileName,int lineNr,bool implicit)
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
yyextra->docGroup.open(e,fileName,lineNr,implicit);
}
-void CommentScanner::close(Entry *e,const char *fileName,int lineNr,bool foundInline,bool implicit)
+void CommentScanner::close(Entry *e,const QCString &fileName,int lineNr,bool foundInline,bool implicit)
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
diff --git a/src/conceptdef.cpp b/src/conceptdef.cpp
new file mode 100644
index 0000000..b9dd085
--- /dev/null
+++ b/src/conceptdef.cpp
@@ -0,0 +1,733 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2021 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.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#include "conceptdef.h"
+#include "definitionimpl.h"
+#include "util.h"
+#include "config.h"
+#include "doxygen.h"
+#include "language.h"
+#include "outputlist.h"
+#include "searchindex.h"
+#include "message.h"
+#include "parserintf.h"
+
+//------------------------------------------------------------------------------------
+
+class ConceptDefImpl : public DefinitionMixin<ConceptDefMutable>
+{
+ public:
+ ConceptDefImpl(const QCString &fileName,int startLine,int startColumn,
+ const QCString &name,const QCString &tagRef=QCString(),const QCString &tagFile=QCString());
+ ~ConceptDefImpl();
+
+ virtual ConceptDef *resolveAlias() { return this; }
+
+ //---------- ConceptDef
+ virtual DefType definitionType() const;
+ virtual QCString getOutputFileBase() const;
+ virtual bool hasDetailedDescription() const;
+ virtual QCString displayName(bool includeScope=true) const;
+ virtual const IncludeInfo *includeInfo() const;
+ virtual ArgumentList getTemplateParameterList() const;
+ virtual QCString anchor() const;
+ virtual bool isLinkableInProject() const;
+ virtual bool isLinkable() const;
+ virtual QCString initializer() const;
+ virtual void writeDeclarationLink(OutputList &ol,bool &found,
+ const QCString &header,bool localNames) const;
+ virtual const NamespaceDef *getNamespaceDef() const;
+ virtual const FileDef *getFileDef() const;
+
+ //---------- ConceptDefMutable
+ virtual void setIncludeFile(FileDef *fd,const QCString &incName,bool local,bool force);
+ virtual void setTemplateArguments(const ArgumentList &al);
+ virtual void setNamespace(NamespaceDef *nd);
+ virtual void setFileDef(FileDef *fd);
+ virtual void writeTagFile(TextStream &);
+ virtual void writeDocumentation(OutputList &);
+ virtual void setInitializer(const QCString &init);
+ virtual void findSectionsInDocumentation();
+
+ //---------- Helpers
+ void writeBriefDescription(OutputList &) const;
+ void writeAuthorSection(OutputList &ol) const;
+ void writeIncludeFiles(OutputList &ol) const;
+ void writeDetailedDescription(OutputList &ol,const QCString &title) const;
+ void writeDefinition(OutputList &ol,const QCString &title) const;
+
+ private:
+ QCString m_fileName;
+ std::unique_ptr<IncludeInfo> m_incInfo;
+ NamespaceDef *m_nspace = 0;
+ FileDef *m_fileDef = 0;
+ ArgumentList m_tArgList;
+ QCString m_initializer;
+};
+
+ConceptDefMutable *createConceptDef(
+ const QCString &fileName,int startLine,int startColumn,
+ const QCString &name, const QCString &tagRef,const QCString &tagFile)
+{
+ return new ConceptDefImpl(fileName,startLine,startColumn,name,tagRef,tagFile);
+}
+
+//------------------------------------------------------------------------------------
+
+class ConceptDefAliasImpl : public DefinitionAliasMixin<ConceptDef>
+{
+ public:
+ ConceptDefAliasImpl(const Definition *newScope,const ConceptDef *cd)
+ : DefinitionAliasMixin(newScope,cd) { init(); }
+ virtual ~ConceptDefAliasImpl() { deinit(); }
+
+ const ConceptDef *getCdAlias() const { return toConceptDef(getAlias()); }
+ virtual ConceptDef *resolveAlias() { return const_cast<ConceptDef*>(getCdAlias()); }
+
+ virtual DefType definitionType() const { return TypeConcept; }
+ virtual QCString getOutputFileBase() const
+ { return getCdAlias()->getOutputFileBase(); }
+ virtual QCString getReference() const
+ { return getCdAlias()->getReference(); }
+ virtual bool isReference() const
+ { return getCdAlias()->isReference(); }
+ virtual bool hasDetailedDescription() const
+ { return getCdAlias()->hasDetailedDescription(); }
+ virtual QCString displayName(bool includeScope=true) const
+ { return getCdAlias()->displayName(includeScope); }
+ virtual const IncludeInfo *includeInfo() const
+ { return getCdAlias()->includeInfo(); }
+ virtual ArgumentList getTemplateParameterList() const
+ { return getCdAlias()->getTemplateParameterList(); }
+ virtual QCString anchor() const
+ { return getCdAlias()->anchor(); }
+ virtual bool isLinkableInProject() const
+ { return getCdAlias()->isLinkableInProject(); }
+ virtual bool isLinkable() const
+ { return getCdAlias()->isLinkable(); }
+ virtual QCString initializer() const
+ { return getCdAlias()->initializer(); }
+ virtual const NamespaceDef *getNamespaceDef() const
+ { return getCdAlias()->getNamespaceDef(); }
+ virtual const FileDef *getFileDef() const
+ { return getCdAlias()->getFileDef(); }
+ virtual void writeDeclarationLink(OutputList &ol,bool &found,
+ const QCString &header,bool localNames) const
+ { getCdAlias()->writeDeclarationLink(ol,found,header,localNames); }
+};
+
+ConceptDef *createConceptDefAlias(const Definition *newScope,const ConceptDef *cd)
+{
+ ConceptDef *acd = new ConceptDefAliasImpl(newScope,cd);
+ return acd;
+}
+
+//------------------------------------------------------------------------------------
+
+ConceptDefImpl::ConceptDefImpl(const QCString &fileName,int startLine,int startColumn,
+ const QCString &name,const QCString &tagRef,const QCString &tagFile) : DefinitionMixin(fileName,startLine,startColumn,name)
+{
+ if (!tagFile.isEmpty())
+ {
+ if (!tagRef.isEmpty())
+ {
+ m_fileName = stripExtension(tagFile);
+ }
+ else
+ {
+ m_fileName = convertNameToFile(stripExtension(tagFile));
+ }
+ }
+ else
+ {
+ m_fileName = convertNameToFile(QCString("concept")+name);
+ }
+ setReference(tagRef);
+}
+
+ConceptDefImpl::~ConceptDefImpl()
+{
+}
+
+Definition::DefType ConceptDefImpl::definitionType() const
+{
+ return TypeConcept;
+}
+
+QCString ConceptDefImpl::getOutputFileBase() const
+{
+ return m_fileName;
+}
+
+bool ConceptDefImpl::hasDetailedDescription() const
+{
+ bool repeatBrief = Config_getBool(REPEAT_BRIEF);
+ bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
+ return ((!briefDescription().isEmpty() && repeatBrief) ||
+ !documentation().isEmpty() ||
+ (sourceBrowser && getStartBodyLine()!=-1 && getBodyDef()));
+}
+
+QCString ConceptDefImpl::anchor() const
+{
+ return "";
+}
+
+QCString ConceptDefImpl::displayName(bool includeScope) const
+{
+ return includeScope ? name() : localName();
+}
+
+const IncludeInfo *ConceptDefImpl::includeInfo() const
+{
+ return m_incInfo.get();
+}
+
+ArgumentList ConceptDefImpl::getTemplateParameterList() const
+{
+ return m_tArgList;
+}
+
+bool ConceptDefImpl::isLinkableInProject() const
+{
+ return hasDocumentation() && !isReference() && !isHidden();
+}
+
+bool ConceptDefImpl::isLinkable() const
+{
+ return isLinkableInProject() || isReference();
+}
+
+void ConceptDefImpl::setIncludeFile(FileDef *fd,const QCString &incName,bool local,bool force)
+{
+ if (!m_incInfo) m_incInfo = std::make_unique<IncludeInfo>();
+ if ((!incName.isEmpty() && m_incInfo->includeName.isEmpty()) ||
+ (fd!=0 && m_incInfo->fileDef==0)
+ )
+ {
+ m_incInfo->fileDef = fd;
+ m_incInfo->includeName = incName;
+ m_incInfo->local = local;
+ }
+ if (force && !incName.isEmpty())
+ {
+ m_incInfo->includeName = incName;
+ m_incInfo->local = local;
+ }
+}
+
+void ConceptDefImpl::setTemplateArguments(const ArgumentList &al)
+{
+ m_tArgList = al;
+}
+
+void ConceptDefImpl::setNamespace(NamespaceDef *nd)
+{
+ m_nspace = nd;
+}
+
+const NamespaceDef *ConceptDefImpl::getNamespaceDef() const
+{
+ return m_nspace;
+}
+
+void ConceptDefImpl::setFileDef(FileDef *fd)
+{
+ m_fileDef=fd;
+}
+
+const FileDef *ConceptDefImpl::getFileDef() const
+{
+ return m_fileDef;
+}
+
+void ConceptDefImpl::setInitializer(const QCString &init)
+{
+ m_initializer = init;
+}
+
+QCString ConceptDefImpl::initializer() const
+{
+ return m_initializer;
+}
+
+void ConceptDefImpl::writeTagFile(TextStream &tagFile)
+{
+ tagFile << " <compound kind=\"concept\">\n";
+ tagFile << " <name>" << convertToXML(name()) << "</name>\n";
+ tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>\n";
+ QCString idStr = id();
+ if (!idStr.isEmpty())
+ {
+ tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
+ }
+ writeDocAnchorsToTagFile(tagFile);
+ tagFile << " </compound>\n";
+}
+
+void ConceptDefImpl::writeBriefDescription(OutputList &ol) const
+{
+ if (hasBriefDescription())
+ {
+ DocRoot *rootNode = validatingParseDoc(briefFile(),briefLine(),this,0,
+ briefDescription(),TRUE,FALSE,
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ if (rootNode && !rootNode->isEmpty())
+ {
+ ol.startParagraph();
+ ol.pushGeneratorState();
+ ol.disableAllBut(OutputGenerator::Man);
+ ol.writeString(" - ");
+ ol.popGeneratorState();
+ ol.writeDoc(rootNode,this,0);
+ ol.pushGeneratorState();
+ ol.disable(OutputGenerator::RTF);
+ ol.writeString(" \n");
+ ol.enable(OutputGenerator::RTF);
+
+ if (hasDetailedDescription())
+ {
+ ol.disableAllBut(OutputGenerator::Html);
+ ol.startTextLink(getOutputFileBase(),"details");
+ ol.parseText(theTranslator->trMore());
+ ol.endTextLink();
+ }
+ ol.popGeneratorState();
+ ol.endParagraph();
+ }
+ delete rootNode;
+ }
+ ol.writeSynopsis();
+}
+
+void ConceptDefImpl::writeIncludeFiles(OutputList &ol) const
+{
+ if (m_incInfo)
+ {
+ QCString nm=m_incInfo->includeName.isEmpty() ?
+ (m_incInfo->fileDef ?
+ m_incInfo->fileDef->docName() : QCString()
+ ) :
+ m_incInfo->includeName;
+ if (!nm.isEmpty())
+ {
+ ol.startParagraph();
+ ol.startTypewriter();
+ ol.docify("#include ");
+ if (m_incInfo->local)
+ ol.docify("\"");
+ else
+ ol.docify("<");
+ ol.pushGeneratorState();
+ ol.disable(OutputGenerator::Html);
+ ol.docify(nm);
+ ol.disableAllBut(OutputGenerator::Html);
+ ol.enable(OutputGenerator::Html);
+ if (m_incInfo->fileDef)
+ {
+ ol.writeObjectLink(QCString(),m_incInfo->fileDef->includeName(),QCString(),nm);
+ }
+ else
+ {
+ ol.docify(nm);
+ }
+ ol.popGeneratorState();
+ if (m_incInfo->local)
+ ol.docify("\"");
+ else
+ ol.docify(">");
+ ol.endTypewriter();
+ ol.endParagraph();
+ }
+ }
+}
+
+static QCString templateSpec(const ArgumentList &al)
+{
+ TextStream t;
+ t << "template<";
+ bool first=true;
+ for (const auto &a : al)
+ {
+ if (!first) t << ", ";
+ t << a.type;
+ if (!a.name.isEmpty())
+ {
+ t << " " << a.name;
+ }
+ if (a.defval.length()!=0)
+ {
+ t << " " << a.defval;
+ }
+ first=false;
+ }
+ t << ">";
+ return t.str();
+}
+
+void ConceptDefImpl::writeDefinition(OutputList &ol,const QCString &title) const
+{
+ ol.startGroupHeader();
+ ol.parseText(title);
+ ol.endGroupHeader();
+
+ auto intf = Doxygen::parserManager->getCodeParser(".cpp");
+ intf->resetCodeParserState();
+ ol.startCodeFragment("DoxyCode");
+ QCString scopeName;
+ if (getOuterScope()!=Doxygen::globalScope) scopeName=getOuterScope()->name();
+ TextStream conceptDef;
+ conceptDef << templateSpec(m_tArgList);
+ conceptDef << "\nconcept ";
+ conceptDef << name();
+ conceptDef << " = ";
+ conceptDef << m_initializer;
+ intf->parseCode(ol,scopeName,conceptDef.str(),SrcLangExt_Cpp,false,QCString(),
+ m_fileDef, -1,-1,true,0,false,this);
+ ol.endCodeFragment("DoxyCode");
+}
+
+void ConceptDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title) const
+{
+ static bool repeatBrief = Config_getBool(REPEAT_BRIEF);
+ if (hasDetailedDescription())
+ {
+ ol.pushGeneratorState();
+ ol.disable(OutputGenerator::Html);
+ ol.writeRuler();
+ ol.popGeneratorState();
+
+ ol.pushGeneratorState();
+ ol.disableAllBut(OutputGenerator::Html);
+ ol.writeAnchor(QCString(),"details");
+ ol.popGeneratorState();
+
+ ol.startGroupHeader();
+ ol.parseText(title);
+ ol.endGroupHeader();
+
+ ol.startTextBlock();
+ // repeat brief description
+ if (!briefDescription().isEmpty() && repeatBrief)
+ {
+ ol.generateDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE,
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ }
+ if (!briefDescription().isEmpty() && repeatBrief &&
+ !documentation().isEmpty())
+ {
+ ol.pushGeneratorState();
+ ol.disable(OutputGenerator::Html);
+ ol.writeString("\n\n");
+ ol.popGeneratorState();
+ }
+
+ // write documentation
+ if (!documentation().isEmpty())
+ {
+ ol.generateDoc(docFile(),docLine(),this,0,documentation(),TRUE,FALSE,
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ }
+
+ writeSourceDef(ol,name());
+ ol.endTextBlock();
+ }
+}
+
+void ConceptDefImpl::writeAuthorSection(OutputList &ol) const
+{
+ // write Author section (Man only)
+ ol.pushGeneratorState();
+ ol.disableAllBut(OutputGenerator::Man);
+ ol.startGroupHeader();
+ ol.parseText(theTranslator->trAuthor(TRUE,TRUE));
+ ol.endGroupHeader();
+ ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString(PROJECT_NAME)));
+ ol.popGeneratorState();
+}
+
+void ConceptDefImpl::writeDocumentation(OutputList &ol)
+{
+ static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
+ QCString pageTitle = theTranslator->trConceptReference(displayName());
+ startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_ConceptVisible,!generateTreeView);
+
+ // ---- navigation part
+ if (!generateTreeView)
+ {
+ if (getOuterScope()!=Doxygen::globalScope)
+ {
+ writeNavigationPath(ol);
+ }
+ ol.endQuickIndices();
+ }
+
+ // ---- title part
+ startTitle(ol,getOutputFileBase(),this);
+ ol.parseText(pageTitle);
+ endTitle(ol,getOutputFileBase(),displayName());
+
+ // ---- contents part
+
+ ol.startContents();
+
+ if (Doxygen::searchIndex)
+ {
+ Doxygen::searchIndex->setCurrentDoc(this,anchor(),FALSE);
+ Doxygen::searchIndex->addWord(localName(),TRUE);
+ }
+
+ Doxygen::indexList->addIndexItem(this,0);
+ //---------------------------------------- start flexible part -------------------------------
+
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Concept))
+ {
+ switch (lde->kind())
+ {
+ case LayoutDocEntry::BriefDesc:
+ writeBriefDescription(ol);
+ break;
+ case LayoutDocEntry::ConceptDefinition:
+ {
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
+ writeDefinition(ol,ls->title(getLanguage()));
+ }
+ break;
+ case LayoutDocEntry::DetailedDesc:
+ {
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
+ writeDetailedDescription(ol,ls->title(getLanguage()));
+ }
+ break;
+ case LayoutDocEntry::AuthorSection:
+ writeAuthorSection(ol);
+ break;
+ case LayoutDocEntry::ClassIncludes:
+ writeIncludeFiles(ol);
+ break;
+ case LayoutDocEntry::MemberDeclStart:
+ case LayoutDocEntry::NamespaceClasses:
+ case LayoutDocEntry::NamespaceInterfaces:
+ case LayoutDocEntry::NamespaceStructs:
+ case LayoutDocEntry::NamespaceExceptions:
+ case LayoutDocEntry::NamespaceConcepts:
+ case LayoutDocEntry::NamespaceNestedNamespaces:
+ case LayoutDocEntry::NamespaceNestedConstantGroups:
+ case LayoutDocEntry::MemberGroups:
+ case LayoutDocEntry::MemberDecl:
+ case LayoutDocEntry::MemberDeclEnd:
+ case LayoutDocEntry::MemberDefStart:
+ case LayoutDocEntry::NamespaceInlineClasses:
+ case LayoutDocEntry::MemberDef:
+ case LayoutDocEntry::MemberDefEnd:
+ case LayoutDocEntry::ClassInheritanceGraph:
+ case LayoutDocEntry::ClassNestedClasses:
+ case LayoutDocEntry::ClassCollaborationGraph:
+ case LayoutDocEntry::ClassAllMembersLink:
+ case LayoutDocEntry::ClassUsedFiles:
+ case LayoutDocEntry::ClassInlineClasses:
+ case LayoutDocEntry::FileClasses:
+ case LayoutDocEntry::FileConcepts:
+ case LayoutDocEntry::FileInterfaces:
+ case LayoutDocEntry::FileStructs:
+ case LayoutDocEntry::FileExceptions:
+ case LayoutDocEntry::FileNamespaces:
+ case LayoutDocEntry::FileConstantGroups:
+ case LayoutDocEntry::FileIncludes:
+ case LayoutDocEntry::FileIncludeGraph:
+ case LayoutDocEntry::FileIncludedByGraph:
+ case LayoutDocEntry::FileInlineClasses:
+ case LayoutDocEntry::FileSourceLink:
+ case LayoutDocEntry::GroupClasses:
+ case LayoutDocEntry::GroupConcepts:
+ case LayoutDocEntry::GroupInlineClasses:
+ case LayoutDocEntry::GroupNamespaces:
+ case LayoutDocEntry::GroupDirs:
+ case LayoutDocEntry::GroupNestedGroups:
+ case LayoutDocEntry::GroupFiles:
+ case LayoutDocEntry::GroupGraph:
+ case LayoutDocEntry::GroupPageDocs:
+ case LayoutDocEntry::DirSubDirs:
+ case LayoutDocEntry::DirFiles:
+ case LayoutDocEntry::DirGraph:
+ err("Internal inconsistency: member %d should not be part of "
+ "LayoutDocManager::Namespace entry list\n",lde->kind());
+ break;
+ }
+ }
+
+ //---------------------------------------- end flexible part -------------------------------
+
+ ol.endContents();
+
+ endFileWithNavPath(this,ol);
+}
+
+void ConceptDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const QCString &header,bool localNames) const
+{
+ if (isLinkable())
+ {
+ if (!found) // first concept
+ {
+ ol.startMemberHeader("concepts");
+ if (!header.isEmpty())
+ {
+ ol.parseText(header);
+ }
+ else
+ {
+ theTranslator->trConcept(true,false);
+ }
+ ol.endMemberHeader();
+ ol.startMemberList();
+ found=TRUE;
+ }
+ ol.startMemberDeclaration();
+ ol.startMemberItem(anchor(),FALSE);
+ ol.writeString("concept ");
+ QCString cname = displayName(!localNames);
+ ol.insertMemberAlign();
+ if (isLinkable())
+ {
+ ol.writeObjectLink(getReference(),
+ getOutputFileBase(),
+ anchor(),
+ cname
+ );
+ }
+ else
+ {
+ ol.startBold();
+ ol.docify(cname);
+ ol.endBold();
+ }
+ ol.endMemberItem();
+ // add the brief description if available
+ if (!briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
+ {
+ DocRoot *rootNode = validatingParseDoc(briefFile(),briefLine(),this,0,
+ briefDescription(),FALSE,FALSE,
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ if (rootNode && !rootNode->isEmpty())
+ {
+ ol.startMemberDescription(anchor());
+ ol.writeDoc(rootNode,this,0);
+ ol.endMemberDescription();
+ }
+ delete rootNode;
+ }
+ ol.endMemberDeclaration(anchor(),QCString());
+ }
+}
+
+void ConceptDefImpl::findSectionsInDocumentation()
+{
+ docFindSections(briefDescription(),this,docFile());
+ docFindSections(documentation(),this,docFile());
+}
+
+//------------------------------------------------------------------------------------
+
+bool ConceptLinkedRefMap::declVisible() const
+{
+ bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
+ for (const auto &cd : *this)
+ {
+ bool isLink = cd->isLinkable();
+ if (isLink || !hideUndocClasses)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+void ConceptLinkedRefMap::writeDeclaration(OutputList &ol,const QCString &header,bool localNames) const
+{
+ bool found=FALSE;
+ for (const auto &cd : *this)
+ {
+ cd->writeDeclarationLink(ol,found,header,localNames);
+ }
+ if (found) ol.endMemberList();
+}
+
+//------------------------------------------------------------------------------------
+
+// --- Cast functions
+//
+ConceptDef *toConceptDef(Definition *d)
+{
+ if (d && (typeid(*d)==typeid(ConceptDefImpl) || typeid(*d)==typeid(ConceptDefAliasImpl)))
+ {
+ return static_cast<ConceptDef*>(d);
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+ConceptDef *toConceptDef(DefinitionMutable *md)
+{
+ Definition *d = toDefinition(md);
+ if (d && typeid(*d)==typeid(ConceptDefImpl))
+ {
+ return static_cast<ConceptDef*>(d);
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+const ConceptDef *toConceptDef(const Definition *d)
+{
+ if (d && (typeid(*d)==typeid(ConceptDefImpl) || typeid(*d)==typeid(ConceptDefAliasImpl)))
+ {
+ return static_cast<const ConceptDef*>(d);
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+ConceptDefMutable *toConceptDefMutable(Definition *d)
+{
+ if (d && typeid(*d)==typeid(ConceptDefImpl))
+ {
+ return static_cast<ConceptDefMutable*>(d);
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+ConceptDefMutable *toConceptDefMutable(const Definition *d)
+{
+ if (d && typeid(*d)==typeid(ConceptDefImpl))
+ {
+ return const_cast<ConceptDefMutable*>(static_cast<const ConceptDefMutable*>(d));
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+
+
diff --git a/src/conceptdef.h b/src/conceptdef.h
new file mode 100644
index 0000000..9a2075c
--- /dev/null
+++ b/src/conceptdef.h
@@ -0,0 +1,82 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2021 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.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#ifndef CONCEPTDEF_H
+#define CONCEPTDEF_H
+
+#include "definition.h"
+#include "filedef.h"
+
+class ConceptDef : public Definition
+{
+ public:
+ virtual DefType definitionType() const = 0;
+ virtual QCString getOutputFileBase() const = 0;
+ virtual bool hasDetailedDescription() const = 0;
+ virtual QCString displayName(bool includeScope=true) const = 0;
+ virtual const IncludeInfo *includeInfo() const = 0;
+ virtual ArgumentList getTemplateParameterList() const = 0;
+ virtual QCString anchor() const = 0;
+ virtual bool isLinkableInProject() const = 0;
+ virtual bool isLinkable() const = 0;
+ virtual QCString initializer() const = 0;
+ virtual void writeDeclarationLink(OutputList &ol,bool &found,
+ const QCString &header,bool localNames) const = 0;
+ virtual const NamespaceDef *getNamespaceDef() const = 0;
+ virtual const FileDef *getFileDef() const = 0;
+};
+
+class ConceptDefMutable : public DefinitionMutable, public ConceptDef
+{
+ public:
+ virtual void setIncludeFile(FileDef *fd,const QCString &incName,bool local,bool force) = 0;
+ virtual void setTemplateArguments(const ArgumentList &al) = 0;
+ virtual void setNamespace(NamespaceDef *nd) = 0;
+ virtual void setFileDef(FileDef *fd) = 0;
+ virtual void writeTagFile(TextStream &) = 0;
+ virtual void writeDocumentation(OutputList &ol) = 0;
+ virtual void setInitializer(const QCString &init) = 0;
+ virtual void findSectionsInDocumentation() = 0;
+};
+
+ConceptDefMutable *createConceptDef(
+ const QCString &fileName,int startLine,int startColumn,const QCString &name,
+ const QCString &tagRef=QCString(),const QCString &tagFile=QCString());
+
+ConceptDef *createConceptDefAlias(const Definition *newScope,const ConceptDef *cd);
+
+// ---- Map
+
+class ConceptLinkedMap : public LinkedMap<ConceptDef>
+{
+};
+
+class ConceptLinkedRefMap : public LinkedRefMap<const ConceptDef>
+{
+ public:
+ bool declVisible() const;
+ void writeDeclaration(OutputList &ol,const QCString &header,bool localNames) const;
+ void writeDocumentation(OutputList &ol,const Definition * container=0) const;
+};
+
+// ---- Cast functions
+
+ConceptDef *toConceptDef(Definition *d);
+ConceptDef *toConceptDef(DefinitionMutable *d);
+const ConceptDef *toConceptDef(const Definition *d);
+ConceptDefMutable *toConceptDefMutable(Definition *d);
+ConceptDefMutable *toConceptDefMutable(const Definition *d);
+
+#endif
diff --git a/src/condparser.cpp b/src/condparser.cpp
index ac6ff61..b968878 100644
--- a/src/condparser.cpp
+++ b/src/condparser.cpp
@@ -33,15 +33,16 @@
* - On error, an error message is returned.
* - On success, the result of the expression is either "1" or "0".
*/
-bool CondParser::parse(const char *fileName,int lineNr,const char *expr)
+bool CondParser::parse(const QCString &fileName,int lineNr,const QCString &expr)
{
+ if (expr.isEmpty()) return false;
m_expr = expr;
m_tokenType = NOTHING;
// initialize all variables
- m_e = m_expr; // let m_e point to the start of the expression
+ m_e = m_expr.data(); // let m_e point to the start of the expression
- bool answer=FALSE;
+ bool answer=false;
getToken();
if (m_tokenType==DELIMITER && m_token.isEmpty())
{
@@ -50,35 +51,11 @@ bool CondParser::parse(const char *fileName,int lineNr,const char *expr)
else if (m_err.isEmpty())
{
answer = parseLevel1();
-
-#if 0
- // check for garbage at the end of the expression
- // an expression ends with a character '\0' and token_type = delimiter
- if (m_tokenType!=DELIMITER || !m_token.isEmpty())
- {
- if (m_tokenType == DELIMITER)
- {
- if (m_token=="(" || m_token==")")
- {
- m_err=QCString("Unexpected parenthesis ")+m_token+"'";
- }
- else
- {
- // user entered a not existing operator like "//"
- m_err=QCString("Unexpected operator ")+m_token+"'";
- }
- }
- else
- {
- m_err=QCString("Unexpected part '")+m_token+"'";
- }
- }
-#endif
}
- if (m_err)
+ if (!m_err.isEmpty())
{
warn(fileName,lineNr,"problem evaluating expression '%s': %s",
- expr,m_err.data());
+ qPrint(expr),qPrint(m_err));
}
//printf("expr='%s' answer=%d\n",expr,answer);
return answer;
@@ -303,9 +280,9 @@ bool CondParser::evalOperator(int opId, bool lhs, bool rhs)
/**
* evaluate a variable
*/
-bool CondParser::evalVariable(const char *varName)
+bool CondParser::evalVariable(const QCString &varName)
{
const StringVector &list = Config_getList(ENABLED_SECTIONS);
- return std::find(list.begin(),list.end(),varName)!=list.end();
+ return std::find(list.begin(),list.end(),varName.str())!=list.end();
}
diff --git a/src/condparser.h b/src/condparser.h
index 1ad13b1..a2f806e 100644
--- a/src/condparser.h
+++ b/src/condparser.h
@@ -5,8 +5,8 @@
* Copyright (C) 1997-2015 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
+ * 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.
*
@@ -22,14 +22,14 @@
* ! NOT operator
*/
-#include <qcstring.h>
+#include "qcstring.h"
class CondParser
{
// public functions
public:
CondParser() : m_e(0), m_tokenType(NOTHING) {}
- bool parse(const char *fileName,int lineNr,const char *expr);
+ bool parse(const QCString &fileName,int lineNr,const QCString &expr);
// enumerations
private:
@@ -68,7 +68,7 @@ class CondParser
bool parseVar();
bool evalOperator(const int opId, bool lhs, bool rhs);
- bool evalVariable(const char *varName);
+ bool evalVariable(const QCString &varName);
int getOperatorId(const QCString &opName);
};
diff --git a/src/config.h b/src/config.h
index 31be3a1..45fd4f8 100644
--- a/src/config.h
+++ b/src/config.h
@@ -16,8 +16,6 @@
#ifndef CONFIG_H
#define CONFIG_H
-class FTextStream;
-
// note: this header file is generated from config.xml
#include "configvalues.h"
@@ -44,6 +42,8 @@ class FTextStream;
//#endif
//! @}
+class TextStream;
+
/** \brief Public function to deal with the configuration file. */
namespace Config
{
@@ -54,18 +54,18 @@ namespace Config
* is \c TRUE the description of each configuration option will
* be omitted.
*/
- void writeTemplate(FTextStream &t,bool shortList,bool updateOnly=FALSE);
+ void writeTemplate(TextStream &t,bool shortList,bool updateOnly=FALSE);
/*! Writes a the differences between the current configuration and the
* template configuration to stream \a t.
*/
- void compareDoxyfile(FTextStream &t);
+ void compareDoxyfile(TextStream &t);
/*! Parses a configuration file with name \a fn.
* \returns TRUE if successful, FALSE if the file could not be
* opened or read.
*/
- bool parse(const char *fileName,bool update=FALSE);
+ bool parse(const QCString &fileName,bool update=FALSE);
/*! Post processed the parsed data. Replaces raw string values by the actual values.
* and replaces environment variables.
diff --git a/src/config.xml b/src/config.xml
index 5a3543c..080230c 100644
--- a/src/config.xml
+++ b/src/config.xml
@@ -340,19 +340,6 @@ Go to the <a href="commands.html">next</a> section or return to the
<value name='Ukrainian'/>
<value name='Vietnamese'/>
</option>
- <option type='enum' id='OUTPUT_TEXT_DIRECTION' defval='None'>
- <docs>
-<![CDATA[
- The \c OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all
- documentation generated by doxygen is written. Doxygen will use this
- information to generate all generated output in the proper direction.
-]]>
- </docs>
- <value name='None'/>
- <value name='LTR'/>
- <value name='RTL'/>
- <value name='Context'/>
- </option>
<option type='bool' id='BRIEF_MEMBER_DESC' defval='1'>
<docs>
<![CDATA[
@@ -3906,5 +3893,6 @@ temporary files.
<option type='obsolete' id='MSCGEN_PATH'/>
<option type='obsolete' id='TCL_SUBST'/>
<option type='obsolete' id='COLS_IN_ALPHA_INDEX'/>
+ <option type='obsolete' id='OUTPUT_TEXT_DIRECTION'/>
</group>
</doxygenconfig>
diff --git a/src/configgen.py b/src/configgen.py
index 1dcf3b5..d3b9137 100755
--- a/src/configgen.py
+++ b/src/configgen.py
@@ -683,7 +683,7 @@ def main():
print("#ifndef CONFIGVALUES_H")
print("#define CONFIGVALUES_H")
print("")
- print("#include <qcstring.h>")
+ print("#include \"qcstring.h\"")
print("#include \"containers.h\"")
print("#include \"settings.h\"")
print("")
@@ -720,7 +720,7 @@ def main():
print(" StringVector ConfigValues::*l;");
print(" } value;");
print(" };");
- print(" const Info *get(const char *tag) const;");
+ print(" const Info *get(const QCString &tag) const;");
print(" private:")
for n in elem.childNodes:
if n.nodeType == Node.ELEMENT_NODE:
@@ -738,7 +738,7 @@ def main():
print("#include \"configimpl.h\"")
print("#include <unordered_map>")
print("")
- print("const ConfigValues::Info *ConfigValues::get(const char *tag) const");
+ print("const ConfigValues::Info *ConfigValues::get(const QCString &tag) const");
print("{");
print(" static const std::unordered_map< std::string, Info > configMap =");
print(" {");
@@ -747,7 +747,7 @@ def main():
if (n.nodeName == "group"):
parseGroupMapInit(n)
print(" };");
- print(" auto it = configMap.find(tag);");
+ print(" auto it = configMap.find(tag.str());");
print(" return it!=configMap.end() ? &it->second : nullptr;");
print("}");
print("")
diff --git a/src/configimpl.h b/src/configimpl.h
index a34c45b..d90fe8c 100644
--- a/src/configimpl.h
+++ b/src/configimpl.h
@@ -23,10 +23,12 @@
#include <unordered_map>
#include <string>
#include <memory>
+#include <iostream>
-#include "ftextstream.h"
#include "containers.h"
+#include "qcstring.h"
+class TextStream;
/** Abstract base class for any configuration option.
*/
@@ -74,17 +76,17 @@ class ConfigOption
void setUserComment(const QCString &u) { m_userComment += u; }
protected:
- virtual void writeTemplate(FTextStream &t,bool sl,bool upd) = 0;
- virtual void compareDoxyfile(FTextStream &t) = 0;
+ virtual void writeTemplate(TextStream &t,bool sl,bool upd) = 0;
+ virtual void compareDoxyfile(TextStream &t) = 0;
virtual void convertStrToVal() {}
virtual void emptyValueToDefault() {}
virtual void substEnvVars() = 0;
virtual void init() {}
- void writeBoolValue(FTextStream &t,bool v);
- void writeIntValue(FTextStream &t,int i);
- void writeStringValue(FTextStream &t,const QCString &s);
- void writeStringList(FTextStream &t,const StringVector &l);
+ void writeBoolValue(TextStream &t,bool v);
+ void writeIntValue(TextStream &t,int i);
+ void writeStringValue(TextStream &t,const QCString &s);
+ void writeStringList(TextStream &t,const StringVector &l);
QCString m_spaces;
QCString m_name;
@@ -106,8 +108,8 @@ class ConfigInfo : public ConfigOption
m_name = name;
m_doc = doc;
}
- void writeTemplate(FTextStream &t, bool sl,bool);
- void compareDoxyfile(FTextStream &){};
+ void writeTemplate(TextStream &t, bool sl,bool);
+ void compareDoxyfile(TextStream &){};
void substEnvVars() {}
};
@@ -129,8 +131,8 @@ class ConfigList : public ConfigOption
WidgetType widgetType() const { return m_widgetType; }
StringVector *valueRef() { return &m_value; }
StringVector getDefault() { return m_defaultValue; }
- void writeTemplate(FTextStream &t,bool sl,bool);
- void compareDoxyfile(FTextStream &t);
+ void writeTemplate(TextStream &t,bool sl,bool);
+ void compareDoxyfile(TextStream &t);
void substEnvVars();
void init() { m_value = m_defaultValue; }
private:
@@ -156,10 +158,10 @@ class ConfigEnum : public ConfigOption
const std::vector<QCString> &values() const { return m_valueRange; }
QCString *valueRef() { return &m_value; }
void substEnvVars();
- void writeTemplate(FTextStream &t,bool sl,bool);
+ void writeTemplate(TextStream &t,bool sl,bool);
void convertStrToVal();
- void compareDoxyfile(FTextStream &t);
- void init() { m_value = m_defValue.copy(); }
+ void compareDoxyfile(TextStream &t);
+ void init() { m_value = m_defValue; }
private:
std::vector<QCString> m_valueRange;
@@ -187,10 +189,10 @@ class ConfigString : public ConfigOption
WidgetType widgetType() const { return m_widgetType; }
void setDefaultValue(const char *v) { m_defValue = v; }
QCString *valueRef() { return &m_value; }
- void writeTemplate(FTextStream &t,bool sl,bool);
- void compareDoxyfile(FTextStream &t);
+ void writeTemplate(TextStream &t,bool sl,bool);
+ void compareDoxyfile(TextStream &t);
void substEnvVars();
- void init() { m_value = m_defValue.copy(); }
+ void init() { m_value = m_defValue; }
void emptyValueToDefault() { if(m_value.isEmpty()) m_value=m_defValue; };
private:
@@ -220,8 +222,8 @@ class ConfigInt : public ConfigOption
int maxVal() const { return m_maxVal; }
void convertStrToVal();
void substEnvVars();
- void writeTemplate(FTextStream &t,bool sl,bool upd);
- void compareDoxyfile(FTextStream &t);
+ void writeTemplate(TextStream &t,bool sl,bool upd);
+ void compareDoxyfile(TextStream &t);
void init() { m_value = m_defValue; }
private:
int m_value;
@@ -249,8 +251,8 @@ class ConfigBool : public ConfigOption
void convertStrToVal();
void substEnvVars();
void setValueString(const QCString &v) { m_valueString = v; }
- void writeTemplate(FTextStream &t,bool sl,bool upd);
- void compareDoxyfile(FTextStream &t);
+ void writeTemplate(TextStream &t,bool sl,bool upd);
+ void compareDoxyfile(TextStream &t);
void init() { m_value = m_defValue; }
private:
bool m_value;
@@ -265,8 +267,8 @@ class ConfigObsolete : public ConfigOption
public:
ConfigObsolete(const char *name) : ConfigOption(O_Obsolete)
{ m_name = name; }
- void writeTemplate(FTextStream &,bool,bool);
- void compareDoxyfile(FTextStream &) {}
+ void writeTemplate(TextStream &,bool,bool);
+ void compareDoxyfile(TextStream &) {}
void substEnvVars() {}
};
@@ -277,8 +279,8 @@ class ConfigDisabled : public ConfigOption
public:
ConfigDisabled(const char *name) : ConfigOption(O_Disabled)
{ m_name = name; }
- void writeTemplate(FTextStream &,bool,bool);
- void compareDoxyfile(FTextStream &) {}
+ void writeTemplate(TextStream &,bool,bool);
+ void compareDoxyfile(TextStream &) {}
void substEnvVars() {}
};
@@ -362,9 +364,9 @@ class ConfigImpl
/*! Returns the ConfigOption corresponding with \a name or 0 if
* the option is not supported.
*/
- ConfigOption *get(const char *name) const
+ ConfigOption *get(const QCString &name) const
{
- auto it = m_dict.find(name);
+ auto it = m_dict.find(name.str());
return it!=m_dict.end() ? it->second : nullptr;
}
/* @} */
@@ -472,12 +474,12 @@ class ConfigImpl
* is \c TRUE the description of each configuration option will
* be omitted.
*/
- void writeTemplate(FTextStream &t,bool shortIndex,bool updateOnly);
+ void writeTemplate(TextStream &t,bool shortIndex,bool updateOnly);
/*! Writes a the differences between the current configuration and the
* template configuration to stream \a t.
*/
- void compareDoxyfile(FTextStream &t);
+ void compareDoxyfile(TextStream &t);
void setHeader(const char *header) { m_header = header; }
@@ -506,14 +508,13 @@ class ConfigImpl
* \returns TRUE if successful, or FALSE if the string could not be
* parsed.
*/
- //bool parseString(const char *fn,const char *str);
- bool parseString(const char *fn,const char *str,bool upd = FALSE);
+ bool parseString(const QCString &fn,const QCString &str,bool upd = FALSE);
/*! Parse a configuration file with name \a fn.
* \returns TRUE if successful, FALSE if the file could not be
* opened or read.
*/
- bool parse(const char *fn,bool upd = FALSE);
+ bool parse(const QCString &fn,bool upd = FALSE);
/*! Called from the constructor, will add doxygen's default options
* to the configuration object
diff --git a/src/configimpl.l b/src/configimpl.l
index 1f9be8d..5171dd6 100644
--- a/src/configimpl.l
+++ b/src/configimpl.l
@@ -26,21 +26,21 @@
#include <ctype.h>
#include <stdarg.h>
#include <errno.h>
-
-#include <qfileinfo.h>
-#include <qdir.h>
-
#include <thread>
#include <algorithm>
+#include <fstream>
+#include <iostream>
#include "regex.h"
#include "configimpl.h"
#include "version.h"
#include "portable.h"
#include "message.h"
-
#include "lang_cfg.h"
#include "configoptions.h"
+#include "fileinfo.h"
+#include "dir.h"
+#include "textstream.h"
#define YY_NO_INPUT 1
#define YY_NO_UNISTD_H 1
@@ -58,14 +58,14 @@ void config_err(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
- vfprintf(stderr, (QCString(error_str) + fmt).data(), args);
+ vfprintf(stderr, qPrint(QCString(error_str) + fmt), args);
va_end(args);
}
void config_term(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
- vfprintf(stderr, (QCString(error_str) + fmt).data(), args);
+ vfprintf(stderr, qPrint(QCString(error_str) + fmt), args);
va_end(args);
fprintf(stderr, "%s\n", "Exiting...");
exit(1);
@@ -75,14 +75,14 @@ void config_warn(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
- vfprintf(stderr, (QCString(warning_str) + fmt).data(), args);
+ vfprintf(stderr, qPrint(QCString(warning_str) + fmt), args);
va_end(args);
}
static QCString configStringRecode(
const QCString &str,
- const char *fromEncoding,
- const char *toEncoding);
+ const QCString &fromEncoding,
+ const QCString &toEncoding);
#define MAX_INCLUDE_DEPTH 10
#define YY_NEVER_INTERACTIVE 1
@@ -91,7 +91,7 @@ static QCString configStringRecode(
*/
static QCString convertToComment(const QCString &s, const QCString &u)
{
- //printf("convertToComment(%s)=%s\n",s.data(),u.data());
+ //printf("convertToComment(%s)=%s\n",qPrint(s),qPrint(u));
QCString result;
if (!s.isEmpty())
{
@@ -128,23 +128,24 @@ static QCString convertToComment(const QCString &s, const QCString &u)
return result;
}
-void ConfigOption::writeBoolValue(FTextStream &t,bool v)
+void ConfigOption::writeBoolValue(TextStream &t,bool v)
{
t << " ";
if (v) t << "YES"; else t << "NO";
}
-void ConfigOption::writeIntValue(FTextStream &t,int i)
+void ConfigOption::writeIntValue(TextStream &t,int i)
{
t << " " << i;
}
-void ConfigOption::writeStringValue(FTextStream &t,const QCString &s)
+void ConfigOption::writeStringValue(TextStream &t,const QCString &s)
{
char c;
bool needsEscaping=FALSE;
// convert the string back to it original g_encoding
QCString se = configStringRecode(s,"UTF-8",m_encoding);
+ if (se.isEmpty()) return;
const char *p=se.data();
if (p)
{
@@ -170,12 +171,12 @@ void ConfigOption::writeStringValue(FTextStream &t,const QCString &s)
}
}
-void ConfigOption::writeStringList(FTextStream &t,const StringVector &l)
+void ConfigOption::writeStringList(TextStream &t,const StringVector &l)
{
bool first=TRUE;
for (const auto &p : l)
{
- if (!first) t << " \\" << endl;
+ if (!first) t << " \\\n";
QCString s=p.c_str();
if (!first)
t << " ";
@@ -198,7 +199,7 @@ void ConfigInt::convertStrToVal()
if (!ok || val<m_minVal || val>m_maxVal)
{
config_warn("argument '%s' for option %s is not a valid number in the range [%d..%d]!\n"
- "Using the default: %d!\n",m_valueString.data(),m_name.data(),m_minVal,m_maxVal,m_value);
+ "Using the default: %d!\n",qPrint(m_valueString),qPrint(m_name),m_minVal,m_maxVal,m_value);
}
else
{
@@ -223,7 +224,7 @@ void ConfigBool::convertStrToVal()
else
{
config_warn("argument '%s' for option %s is not a valid boolean value\n"
- "Using the default: %s!\n",m_valueString.data(),m_name.data(),m_value?"YES":"NO");
+ "Using the default: %s!\n",qPrint(m_valueString),qPrint(m_name),m_value?"YES":"NO");
}
}
}
@@ -246,7 +247,7 @@ void ConfigEnum::convertStrToVal()
}
config_warn("argument '%s' for option %s is not a valid enum value\n"
- "Using the default: %s!\n",m_value.data(),m_name.data(),m_defValue.data());
+ "Using the default: %s!\n",qPrint(m_value),qPrint(m_name),qPrint(m_defValue));
m_value = m_defValue;
}
@@ -322,24 +323,24 @@ bool &ConfigImpl::getBool(const char *fileName,int num,const char *name) const
/* ------------------------------------------ */
-void ConfigInfo::writeTemplate(FTextStream &t, bool sl,bool)
+void ConfigInfo::writeTemplate(TextStream &t, bool sl,bool)
{
if (!sl)
{
t << "\n";
}
t << "#---------------------------------------------------------------------------\n";
- t << "# " << m_doc << endl;
+ t << "# " << m_doc << "\n";
t << "#---------------------------------------------------------------------------\n";
}
-void ConfigList::writeTemplate(FTextStream &t,bool sl,bool)
+void ConfigList::writeTemplate(TextStream &t,bool sl,bool)
{
if (!sl)
{
- t << endl;
+ t << "\n";
t << convertToComment(m_doc, m_userComment);
- t << endl;
+ t << "\n";
}
else if (!m_userComment.isEmpty())
{
@@ -350,12 +351,12 @@ void ConfigList::writeTemplate(FTextStream &t,bool sl,bool)
t << "\n";
}
-void ConfigList::compareDoxyfile(FTextStream &t)
+void ConfigList::compareDoxyfile(TextStream &t)
{
auto get_stripped = [](std::string s) { return QCString(s.c_str()).stripWhiteSpace(); };
auto is_not_empty = [get_stripped](std::string s) { return !get_stripped(s).isEmpty(); };
- int defCnt = std::count_if( m_value.begin(), m_value.end(),is_not_empty);
- int valCnt = std::count_if(m_defaultValue.begin(),m_defaultValue.end(),is_not_empty);
+ size_t defCnt = std::count_if( m_value.begin(), m_value.end(),is_not_empty);
+ size_t valCnt = std::count_if(m_defaultValue.begin(),m_defaultValue.end(),is_not_empty);
if ( valCnt != defCnt)
{
writeTemplate(t,TRUE,TRUE);
@@ -383,13 +384,13 @@ void ConfigList::compareDoxyfile(FTextStream &t)
}
}
-void ConfigEnum::writeTemplate(FTextStream &t,bool sl,bool)
+void ConfigEnum::writeTemplate(TextStream &t,bool sl,bool)
{
if (!sl)
{
- t << endl;
+ t << "\n";
t << convertToComment(m_doc, m_userComment);
- t << endl;
+ t << "\n";
}
else if (!m_userComment.isEmpty())
{
@@ -400,18 +401,18 @@ void ConfigEnum::writeTemplate(FTextStream &t,bool sl,bool)
t << "\n";
}
-void ConfigEnum::compareDoxyfile(FTextStream &t)
+void ConfigEnum::compareDoxyfile(TextStream &t)
{
if (m_value != m_defValue) writeTemplate(t,TRUE,TRUE);
}
-void ConfigString::writeTemplate(FTextStream &t,bool sl,bool)
+void ConfigString::writeTemplate(TextStream &t,bool sl,bool)
{
if (!sl)
{
- t << endl;
+ t << "\n";
t << convertToComment(m_doc, m_userComment);
- t << endl;
+ t << "\n";
}
else if (!m_userComment.isEmpty())
{
@@ -422,18 +423,18 @@ void ConfigString::writeTemplate(FTextStream &t,bool sl,bool)
t << "\n";
}
-void ConfigString::compareDoxyfile(FTextStream &t)
+void ConfigString::compareDoxyfile(TextStream &t)
{
if (m_value.stripWhiteSpace() != m_defValue.stripWhiteSpace()) writeTemplate(t,TRUE,TRUE);
}
-void ConfigInt::writeTemplate(FTextStream &t,bool sl,bool upd)
+void ConfigInt::writeTemplate(TextStream &t,bool sl,bool upd)
{
if (!sl)
{
- t << endl;
+ t << "\n";
t << convertToComment(m_doc, m_userComment);
- t << endl;
+ t << "\n";
}
else if (!m_userComment.isEmpty())
{
@@ -451,24 +452,25 @@ void ConfigInt::writeTemplate(FTextStream &t,bool sl,bool upd)
t << "\n";
}
-void ConfigInt::compareDoxyfile(FTextStream &t)
+void ConfigInt::compareDoxyfile(TextStream &t)
{
if (m_value != m_defValue) writeTemplate(t,TRUE,TRUE);
}
-void ConfigBool::writeTemplate(FTextStream &t,bool sl,bool upd)
+void ConfigBool::writeTemplate(TextStream &t,bool sl,bool upd)
{
if (!sl)
{
- t << endl;
+ t << "\n";
t << convertToComment(m_doc, m_userComment);
- t << endl;
+ t << "\n";
}
else if (!m_userComment.isEmpty())
{
t << convertToComment("", m_userComment);
}
- t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "=";
+ QCString spaces = m_spaces.left(MAX_OPTION_LENGTH-m_name.length());
+ t << m_name << spaces << "=";
if (upd && !m_valueString.isEmpty())
{
writeStringValue(t,m_valueString);
@@ -480,13 +482,13 @@ void ConfigBool::writeTemplate(FTextStream &t,bool sl,bool upd)
t << "\n";
}
-void ConfigBool::compareDoxyfile(FTextStream &t)
+void ConfigBool::compareDoxyfile(TextStream &t)
{
if (m_value != m_defValue) writeTemplate(t,TRUE,TRUE);
}
-void ConfigObsolete::writeTemplate(FTextStream &,bool,bool) {}
-void ConfigDisabled::writeTemplate(FTextStream &,bool,bool) {}
+void ConfigObsolete::writeTemplate(TextStream &,bool,bool) {}
+void ConfigDisabled::writeTemplate(TextStream &,bool,bool) {}
/* -----------------------------------------------------------------
*
@@ -545,11 +547,9 @@ static yy_size_t yyread(char *buf,yy_size_t max_size)
static QCString configStringRecode(
const QCString &str,
- const char *fromEncoding,
- const char *toEncoding)
+ const QCString &inputEncoding,
+ const QCString &outputEncoding)
{
- QCString inputEncoding = fromEncoding;
- QCString outputEncoding = toEncoding;
if (inputEncoding.isEmpty() || outputEncoding.isEmpty() || inputEncoding==outputEncoding) return str;
int inputSize=str.length();
int outputSize=inputSize*4+1;
@@ -558,7 +558,7 @@ static QCString configStringRecode(
if (cd==(void *)(-1))
{
config_term("Error: unsupported character conversion: '%s'->'%s'\n",
- inputEncoding.data(),outputEncoding.data());
+ qPrint(inputEncoding),qPrint(outputEncoding));
}
size_t iLeft=(size_t)inputSize;
size_t oLeft=(size_t)outputSize;
@@ -569,12 +569,12 @@ static QCString configStringRecode(
outputSize-=(int)oLeft;
output.resize(outputSize+1);
output.at(outputSize)='\0';
- //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,srcBuf.data());
+ //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,qPrint(srcBuf));
}
else
{
config_term("Error: failed to translate characters from %s to %s: %s\n",
- inputEncoding.data(),outputEncoding.data(),strerror(errno));
+ qPrint(inputEncoding),qPrint(outputEncoding),strerror(errno));
}
portable_iconv_close(cd);
return output;
@@ -655,7 +655,7 @@ static void processString()
if (!warned)
{
config_warn("Invalid value for '%s' tag at line %d, file %s: Value '%s' is not properly quoted\n",
- g_cmd.data(),g_yyLineNr,g_yyFileName.data(),g_string->stripWhiteSpace().data());
+ qPrint(g_cmd),g_yyLineNr,qPrint(g_yyFileName),qPrint(g_string->stripWhiteSpace()));
}
warned=true;
}
@@ -671,14 +671,14 @@ static void processString()
// update encoding
checkEncoding();
- //printf("Processed string '%s'\n",g_string->data());
+ //printf("Processed string '%s'\n",qPrint(g_string));
}
static void processList()
{
bool allowCommaAsSeparator = g_cmd!="PREDEFINED";
- const QCString s = stripComment(g_listStr.stripWhiteSpace());
+ QCString s = stripComment(g_listStr.stripWhiteSpace());
int l = s.length();
QCString elemStr;
@@ -689,7 +689,7 @@ static void processList()
if (!elemStr.isEmpty())
{
QCString e = configStringRecode(elemStr,g_encoding,"UTF-8");
- //printf("Processed list element '%s'\n",e.data());
+ //printf("Processed list element '%s'\n",qPrint(e));
g_list->push_back(e.str());
elemStr="";
}
@@ -741,7 +741,7 @@ static void processList()
if (!warned)
{
config_warn("Invalid value for '%s' tag at line %d, file %s: Values in list '%s' are not properly space %sseparated\n",
- g_cmd.data(),g_yyLineNr,g_yyFileName.data(),g_listStr.stripWhiteSpace().data(),allowCommaAsSeparator?"or comma ":"");
+ qPrint(g_cmd),g_yyLineNr,qPrint(g_yyFileName),qPrint(g_listStr.stripWhiteSpace()),allowCommaAsSeparator?"or comma ":"");
warned=true;
}
needsSeparator=false;
@@ -759,18 +759,18 @@ static void processList()
if (insideQuote)
{
config_warn("Invalid value for '%s' tag at line %d, file %s: Values in list '%s' are not properly quoted\n",
- g_cmd.data(),g_yyLineNr,g_yyFileName.data(),g_listStr.stripWhiteSpace().data());
+ qPrint(g_cmd),g_yyLineNr,qPrint(g_yyFileName),qPrint(g_listStr.stripWhiteSpace()));
}
}
-static FILE *tryPath(const char *path,const char *fileName)
+static FILE *tryPath(const QCString &path,const QCString &fileName)
{
- QCString absName=(path ? (QCString)path+"/"+fileName : (QCString)fileName);
- QFileInfo fi(absName);
+ QCString absName=(!path.isEmpty() ? path+"/"+fileName : fileName);
+ FileInfo fi(absName.str());
if (fi.exists() && fi.isFile())
{
FILE *f=Portable::fopen(absName,"r");
- if (!f) config_err("could not open file %s for reading\n",absName.data());
+ if (!f) config_err("could not open file %s for reading\n",qPrint(absName));
return f;
}
return 0;
@@ -779,15 +779,15 @@ static FILE *tryPath(const char *path,const char *fileName)
static void substEnvVarsInStrList(StringVector &sl);
static void substEnvVarsInString(QCString &s);
-static FILE *findFile(const char *fileName)
+static FILE *findFile(const QCString &fileName)
{
- if (fileName==0)
+ if (fileName.isEmpty())
{
return 0;
}
if (Portable::isAbsolutePath(fileName))
{
- return tryPath(NULL, fileName);
+ return tryPath(QCString(), fileName);
}
substEnvVarsInStrList(g_includePathList);
for (const auto &s : g_includePathList)
@@ -799,11 +799,11 @@ static FILE *findFile(const char *fileName)
return tryPath(".",fileName);
}
-static void readIncludeFile(const char *incName)
+static void readIncludeFile(const QCString &incName)
{
if (g_includeStack.size()==MAX_INCLUDE_DEPTH) {
config_term("maximum include depth (%d) reached, %s is not included. Aborting...\n",
- MAX_INCLUDE_DEPTH,incName);
+ MAX_INCLUDE_DEPTH,qPrint(incName));
}
QCString inc = incName;
@@ -822,7 +822,7 @@ static void readIncludeFile(const char *incName)
// For debugging
#if SHOW_INCLUDES
for (size_t i=0;i<g_includeStack.size();i++) msg(" ");
- msg("@INCLUDE = %s: parsing...\n",inc.data());
+ msg("@INCLUDE = %s: parsing...\n",qPrint(inc));
#endif
// store the state of the old file
@@ -840,7 +840,7 @@ static void readIncludeFile(const char *incName)
}
else
{
- config_term("@INCLUDE = %s: not found!\n",inc.data());
+ config_term("@INCLUDE = %s: not found!\n",qPrint(inc));
}
}
@@ -878,7 +878,7 @@ static void readIncludeFile(const char *incName)
if (option==0) // oops not known
{
config_warn("ignoring unsupported tag '%s' at line %d, file %s\n",
- g_cmd.data(),g_yyLineNr,g_yyFileName.data());
+ qPrint(g_cmd),g_yyLineNr,qPrint(g_yyFileName));
BEGIN(SkipInvalid);
}
else // known tag
@@ -921,13 +921,13 @@ static void readIncludeFile(const char *incName)
if (g_configUpdate)
{
config_warn("Tag '%s' at line %d of file '%s' has become obsolete.\n"
- " This tag has been removed.\n", g_cmd.data(),g_yyLineNr,g_yyFileName.data());
+ " This tag has been removed.\n", qPrint(g_cmd),g_yyLineNr,qPrint(g_yyFileName));
}
else
{
config_warn("Tag '%s' at line %d of file '%s' has become obsolete.\n"
" To avoid this warning please remove this line from your configuration "
- "file or upgrade it using \"doxygen -u\"\n", g_cmd.data(),g_yyLineNr,g_yyFileName.data());
+ "file or upgrade it using \"doxygen -u\"\n", qPrint(g_cmd),g_yyLineNr,qPrint(g_yyFileName));
}
BEGIN(SkipInvalid);
break;
@@ -935,13 +935,13 @@ static void readIncludeFile(const char *incName)
if (g_configUpdate)
{
config_warn("Tag '%s' at line %d of file '%s' belongs to an option that was not enabled at compile time.\n"
- " This tag has been removed.\n", g_cmd.data(),g_yyLineNr,g_yyFileName.data());
+ " This tag has been removed.\n", qPrint(g_cmd),g_yyLineNr,qPrint(g_yyFileName));
}
else
{
config_warn("Tag '%s' at line %d of file '%s' belongs to an option that was not enabled at compile time.\n"
" To avoid this warning please remove this line from your configuration "
- "file or upgrade it using \"doxygen -u\", or recompile doxygen with this feature enabled.\n", g_cmd.data(),g_yyLineNr,g_yyFileName.data());
+ "file or upgrade it using \"doxygen -u\", or recompile doxygen with this feature enabled.\n", qPrint(g_cmd),g_yyLineNr,qPrint(g_yyFileName));
}
BEGIN(SkipInvalid);
break;
@@ -954,7 +954,7 @@ static void readIncludeFile(const char *incName)
if (option==0) // oops not known
{
config_warn("ignoring unsupported tag '%s' at line %d, file %s\n",
- g_cmd.data(),g_yyLineNr,g_yyFileName.data());
+ qPrint(g_cmd),g_yyLineNr,qPrint(g_yyFileName));
BEGIN(SkipInvalid);
}
else // known tag
@@ -976,19 +976,19 @@ static void readIncludeFile(const char *incName)
case ConfigOption::O_Int:
case ConfigOption::O_Bool:
config_warn("operator += not supported for '%s'. Ignoring line at line %d, file %s\n",
- yytext,g_yyLineNr,g_yyFileName.data());
+ yytext,g_yyLineNr,qPrint(g_yyFileName));
BEGIN(SkipInvalid);
break;
case ConfigOption::O_Obsolete:
config_warn("Tag '%s' at line %d of file %s has become obsolete.\n"
"To avoid this warning please update your configuration "
- "file using \"doxygen -u\"\n", g_cmd.data(),g_yyLineNr,g_yyFileName.data());
+ "file using \"doxygen -u\"\n", qPrint(g_cmd),g_yyLineNr,qPrint(g_yyFileName));
BEGIN(SkipInvalid);
break;
case ConfigOption::O_Disabled:
config_warn("Tag '%s' at line %d of file %s belongs to an option that was not enabled at compile time.\n"
"To avoid this warning please remove this line from your configuration "
- "file, upgrade it using \"doxygen -u\", or recompile doxygen with this feature enabled.\n", g_cmd.data(),g_yyLineNr,g_yyFileName.data());
+ "file, upgrade it using \"doxygen -u\", or recompile doxygen with this feature enabled.\n", qPrint(g_cmd),g_yyLineNr,qPrint(g_yyFileName));
BEGIN(SkipInvalid);
break;
}
@@ -1025,7 +1025,7 @@ static void readIncludeFile(const char *incName)
}
}
-<Start>[a-z_A-Z0-9]+ { config_warn("ignoring unknown tag '%s' at line %d, file %s\n",yytext,g_yyLineNr,g_yyFileName.data()); }
+<Start>[a-z_A-Z0-9]+ { config_warn("ignoring unknown tag '%s' at line %d, file %s\n",yytext,g_yyLineNr,qPrint(g_yyFileName)); }
/*-------------- GetString ---------------*/
<GetString>\n { processString();
@@ -1075,21 +1075,21 @@ static void readIncludeFile(const char *incName)
<*>\\[ \r\t]*\n { g_yyLineNr++; }
<*>[ \t\r]
<*>\n { g_yyLineNr++ ; }
-<*>. { config_warn("ignoring unknown character '%c' at line %d, file %s\n",yytext[0],g_yyLineNr,g_yyFileName.data()); }
+<*>. { config_warn("ignoring unknown character '%c' at line %d, file %s\n",yytext[0],g_yyLineNr,qPrint(g_yyFileName)); }
%%
/*@ ----------------------------------------------------------------------------
*/
-void ConfigImpl::writeTemplate(FTextStream &t,bool sl,bool upd)
+void ConfigImpl::writeTemplate(TextStream &t,bool sl,bool upd)
{
/* print first lines of user comment that were at the beginning of the file, might have special meaning for editors */
- if (m_startComment)
+ if (!m_startComment.isEmpty())
{
- t << takeStartComment() << endl;
+ t << takeStartComment() << "\n";
}
- t << "# Doxyfile " << getDoxygenVersion() << endl << endl;
+ t << "# Doxyfile " << getDoxygenVersion() << "\n\n";
if (!sl)
{
t << convertToComment(m_header,"");
@@ -1099,17 +1099,17 @@ void ConfigImpl::writeTemplate(FTextStream &t,bool sl,bool upd)
option->writeTemplate(t,sl,upd);
}
/* print last lines of user comment that were at the end of the file */
- if (m_userComment)
+ if (!m_userComment.isEmpty())
{
t << "\n";
t << takeUserComment();
}
}
-void ConfigImpl::compareDoxyfile(FTextStream &t)
+void ConfigImpl::compareDoxyfile(TextStream &t)
{
t << "# Difference with default Doxyfile " << getFullVersion();
- t << endl;
+ t << "\n";
for (const auto &option : m_options)
{
option->m_userComment = "";
@@ -1173,7 +1173,7 @@ static void substEnvVarsInStrList(StringVector &sl)
// here we strip the quote again
substEnvVarsInString(result);
- //printf("Result %s was quoted=%d\n",result.data(),wasQuoted);
+ //printf("Result %s was quoted=%d\n",qPrint(result),wasQuoted);
if (!wasQuoted) /* as a result of the expansion, a single string
may have expanded into a list, which we'll
@@ -1285,7 +1285,7 @@ void ConfigImpl::init()
if (opt==0)
{
config_term("Config option '%s' has invalid depends relation on unknown option '%s'\n",
- option->name().data(),depName.data());
+ qPrint(option->name()),qPrint(depName));
}
}
}
@@ -1298,68 +1298,41 @@ void ConfigImpl::create()
addConfigOptions(this);
}
-static QCString configFileToString(const char *name)
+static QCString configFileToString(const QCString &name)
{
- if (name==0 || name[0]==0) return 0;
- QFile f;
+ if (name.isEmpty()) return QCString();
- bool fileOpened=FALSE;
- if (name[0]=='-' && name[1]==0) // read from stdin
+ auto stream2string = [](std::istream &in) -> std::string
{
- fileOpened=f.open(IO_ReadOnly,stdin);
- if (fileOpened)
- {
- const int bSize=4096;
- QCString contents(bSize+1);
- int totalSize=0;
- int size;
- while ((size=f.readBlock(contents.rawData()+totalSize,bSize))==bSize)
- {
- totalSize+=bSize;
- contents.resize(totalSize+bSize+1);
- }
- totalSize+=size+2;
- contents.resize(totalSize);
- contents.at(totalSize-2)='\n'; // to help the scanner
- contents.at(totalSize-1)='\0';
- return contents;
- }
+ std::string ret;
+ char buffer[4096];
+ while (in.read(buffer, sizeof(buffer))) ret.append(buffer, sizeof(buffer));
+ ret.append(buffer, static_cast<uint>(in.gcount()));
+ if (!ret.empty() && ret[ret.length()-1]!='\n') ret+='\n'; // to help the scanner
+ return ret;
+ };
+
+ if (name=="-") // read from stdin
+ {
+ // read contents from stdin into contents string
+ return stream2string(std::cin);
}
else // read from file
{
- QFileInfo fi(name);
- if (!fi.exists() || !fi.isFile())
+ std::ifstream f(name.str(),std::istream::in);
+ if (!f.is_open())
{
- config_err("file '%s' not found\n",name);
+ config_term("file '%s' not found or could not be opened\n",qPrint(name));
return "";
}
- f.setName(name);
- fileOpened=f.open(IO_ReadOnly);
- if (fileOpened)
- {
- int fsize=f.size();
- QCString contents(fsize+2);
- f.readBlock(contents.rawData(),fsize);
- f.close();
- if (fsize==0 || contents[fsize-1]=='\n')
- contents[fsize]='\0';
- else
- contents[fsize]='\n'; // to help the scanner
- contents[fsize+1]='\0';
- return contents;
- }
+ return stream2string(f);
}
- if (!fileOpened)
- {
- config_term("cannot open file '%s' for reading\n",name);
- }
- return "";
}
-bool ConfigImpl::parseString(const char *fn,const char *str,bool update)
+bool ConfigImpl::parseString(const QCString &fn,const QCString &str,bool update)
{
g_config = ConfigImpl::instance();
- g_inputString = str;
+ g_inputString = str.data();
g_inputPosition = 0;
g_yyFileName = fn;
g_yyLineNr = 1;
@@ -1373,13 +1346,13 @@ bool ConfigImpl::parseString(const char *fn,const char *str,bool update)
return TRUE;
}
-bool ConfigImpl::parse(const char *fn,bool update)
+bool ConfigImpl::parse(const QCString &fn,bool update)
{
int retval;
g_encoding = "UTF-8";
- printlex(yy_flex_debug, TRUE, __FILE__, fn);
+ printlex(yy_flex_debug, TRUE, __FILE__, qPrint(fn));
retval = parseString(fn,configFileToString(fn), update);
- printlex(yy_flex_debug, FALSE, __FILE__, fn);
+ printlex(yy_flex_debug, FALSE, __FILE__, qPrint(fn));
return retval;
}
@@ -1393,10 +1366,10 @@ static void cleanUpPaths(StringVector &str)
std::replace(path.begin(),path.end(),'\\','/');
if ((path[0]!='/' && (path.size()<=2 || path[1]!=':')) || path[path.size()-1]!='/')
{
- QFileInfo fi(path.c_str());
+ FileInfo fi(path);
if (fi.exists() && fi.isDir())
{
- path = fi.absFilePath().utf8().str();
+ path = fi.absFilePath();
if (path[path.size()-1]!='/') path+='/';
}
}
@@ -1410,7 +1383,7 @@ static bool checkFileName(const QCString &s,const char *optionName)
if ((val=="yes" || val=="true" || val=="1" || val=="all") ||
(val=="no" || val=="false" || val=="0" || val=="none"))
{
- err("file name expected for option %s, got %s instead. Ignoring...\n",optionName,s.data());
+ err("file name expected for option %s, got %s instead. Ignoring...\n",optionName,qPrint(s));
return false;
}
return true;
@@ -1432,21 +1405,21 @@ static void checkList(const StringVector &list,const char *name, bool equalRequi
int i=item.find('=');
if (i==-1 && equalRequired)
{
- err("Illegal format for option %s, no equal sign ('=') specified for item '%s'\n",name,item.data());
+ err("Illegal format for option %s, no equal sign ('=') specified for item '%s'\n",name,qPrint(item));
}
if (i!=-1)
{
QCString myName=item.left(i).stripWhiteSpace();
if (myName.isEmpty())
{
- err("Illegal format for option %s, no name specified for item '%s'\n",name,item.data());
+ err("Illegal format for option %s, no name specified for item '%s'\n",name,qPrint(item));
}
else if (valueRequired)
{
QCString myValue=item.right(item.length()-i-1).stripWhiteSpace();
if (myValue.isEmpty())
{
- err("Illegal format for option %s, no value specified for item '%s'\n",name,item.data());
+ err("Illegal format for option %s, no value specified for item '%s'\n",name,qPrint(item));
}
}
}
@@ -1529,10 +1502,8 @@ void Config::checkAndCorrect()
StringVector stripFromPath = Config_getList(STRIP_FROM_PATH);
if (stripFromPath.empty()) // by default use the current path
{
- QString p = QDir::currentDirPath();
- if (p.at(p.length()-1)!='/')
- p.append('/');
- stripFromPath.push_back(p.utf8().str());
+ std::string p = Dir::currentDirPath()+"/";
+ stripFromPath.push_back(p);
}
else
{
@@ -1551,11 +1522,11 @@ void Config::checkAndCorrect()
QCString headerFile = Config_getString(HTML_HEADER);
if (!headerFile.isEmpty())
{
- QFileInfo fi(headerFile);
+ FileInfo fi(headerFile.str());
if (!fi.exists())
{
config_term("tag HTML_HEADER: header file '%s' "
- "does not exist\n",headerFile.data());
+ "does not exist\n",qPrint(headerFile));
}
}
@@ -1564,11 +1535,11 @@ void Config::checkAndCorrect()
QCString footerFile = Config_getString(HTML_FOOTER);
if (!footerFile.isEmpty())
{
- QFileInfo fi(footerFile);
+ FileInfo fi(footerFile.str());
if (!fi.exists())
{
config_term("tag HTML_FOOTER: footer file '%s' "
- "does not exist\n",footerFile.data());
+ "does not exist\n",qPrint(footerFile));
}
}
@@ -1579,11 +1550,11 @@ void Config::checkAndCorrect()
QCString mathJaxCodefile = Config_getString(MATHJAX_CODEFILE);
if (!mathJaxCodefile.isEmpty())
{
- QFileInfo fi(mathJaxCodefile);
+ FileInfo fi(mathJaxCodefile.str());
if (!fi.exists())
{
config_term("tag MATHJAX_CODEFILE file '%s' "
- "does not exist\n",mathJaxCodefile.data());
+ "does not exist\n",qPrint(mathJaxCodefile));
}
}
QCString path = Config_getString(MATHJAX_RELPATH);
@@ -1599,11 +1570,11 @@ void Config::checkAndCorrect()
QCString latexHeaderFile = Config_getString(LATEX_HEADER);
if (!latexHeaderFile.isEmpty())
{
- QFileInfo fi(latexHeaderFile);
+ FileInfo fi(latexHeaderFile.str());
if (!fi.exists())
{
config_term("tag LATEX_HEADER: header file '%s' "
- "does not exist\n",latexHeaderFile.data());
+ "does not exist\n",qPrint(latexHeaderFile));
}
}
@@ -1612,11 +1583,11 @@ void Config::checkAndCorrect()
QCString latexFooterFile = Config_getString(LATEX_FOOTER);
if (!latexFooterFile.isEmpty())
{
- QFileInfo fi(latexFooterFile);
+ FileInfo fi(latexFooterFile.str());
if (!fi.exists())
{
config_term("tag LATEX_FOOTER: footer file '%s' "
- "does not exist\n",latexFooterFile.data());
+ "does not exist\n",qPrint(latexFooterFile));
}
}
@@ -1625,7 +1596,7 @@ void Config::checkAndCorrect()
const StringVector &includePath = Config_getList(INCLUDE_PATH);
for (const auto &s : includePath)
{
- QFileInfo fi(s.c_str());
+ FileInfo fi(s);
if (!fi.exists()) warn_uncond("tag INCLUDE_PATH: include path '%s' "
"does not exist\n",s.c_str());
}
@@ -1643,7 +1614,7 @@ void Config::checkAndCorrect()
int i_obrace=predef.find('(');
if ((i_obrace==0) || (i_equals==0) || (i_equals==1 && predef.at(i_equals-1)==':'))
{
- err("Illegal PREDEFINED format '%s', no define name specified\n",predef.data());
+ err("Illegal PREDEFINED format '%s', no define name specified\n",qPrint(predef));
}
}
}
@@ -1654,8 +1625,8 @@ void Config::checkAndCorrect()
for (const auto &alias : aliasList)
{
// match aliases of the form re1='name=' and re2='name{2} ='
- static const reg::Ex re1(R"(\a\w*\s*=)");
- static const reg::Ex re2(R"(\a\w*{\d+}\s*=)");
+ static const reg::Ex re1(R"(^\a\w*\s*=)");
+ static const reg::Ex re2(R"(^\a\w*{\d+}\s*=)");
if (!reg::search(alias,re1) && !reg::search(alias,re2))
{
err("Illegal ALIASES format '%s'. Use \"name=value\" or \"name{n}=value\", where n is the number of arguments\n",
@@ -1765,7 +1736,7 @@ void Config::checkAndCorrect()
}
else if (dotNumThreads<=0)
{
- dotNumThreads=QMAX(2,std::thread::hardware_concurrency()+1);
+ dotNumThreads=std::max(2u,std::thread::hardware_concurrency()+1);
}
Config_updateInt(DOT_NUM_THREADS,dotNumThreads);
@@ -1774,22 +1745,23 @@ void Config::checkAndCorrect()
QCString dotPath = Config_getString(DOT_PATH);
if (!dotPath.isEmpty())
{
- QFileInfo fi(dotPath);
+ FileInfo fi(dotPath.str());
if (fi.exists() && fi.isFile()) // user specified path + exec
{
- dotPath=fi.dirPath(TRUE).utf8()+"/";
+ dotPath=fi.dirPath(TRUE)+"/";
}
else
{
- QFileInfo dp(dotPath+"/dot"+Portable::commandExtension());
+ QCString dotExe = dotPath+"/dot"+Portable::commandExtension();
+ FileInfo dp(dotExe.str());
if (!dp.exists() || !dp.isFile())
{
- warn_uncond("the dot tool could not be found at %s\n",dotPath.data());
+ warn_uncond("the dot tool could not be found at %s\n",qPrint(dotPath));
dotPath="";
}
else
{
- dotPath=dp.dirPath(TRUE).utf8()+"/";
+ dotPath=dp.dirPath(TRUE)+"/";
}
}
#if defined(_WIN32) // convert slashes
@@ -1808,29 +1780,30 @@ void Config::checkAndCorrect()
QCString plantumlJarPath = Config_getString(PLANTUML_JAR_PATH);
if (!plantumlJarPath.isEmpty())
{
- QFileInfo pu(plantumlJarPath);
+ FileInfo pu(plantumlJarPath.str());
if (pu.exists() && pu.isDir()) // PLANTUML_JAR_PATH is directory
{
- QFileInfo jar(plantumlJarPath+Portable::pathSeparator()+"plantuml.jar");
+ QCString plantumlJar = plantumlJarPath+Portable::pathSeparator()+"plantuml.jar";
+ FileInfo jar(plantumlJar.str());
if (jar.exists() && jar.isFile())
{
- plantumlJarPath = jar.dirPath(TRUE).utf8()+Portable::pathSeparator();
+ plantumlJarPath = jar.dirPath(TRUE)+Portable::pathSeparator();
}
else
{
err("Jar file plantuml.jar not found at location "
- "specified via PLANTUML_JAR_PATH: '%s'\n",plantumlJarPath.data());
+ "specified via PLANTUML_JAR_PATH: '%s'\n",qPrint(plantumlJarPath));
plantumlJarPath="";
}
}
else if (pu.exists() && pu.isFile() && plantumlJarPath.right(4)==".jar") // PLANTUML_JAR_PATH is file
{
- plantumlJarPath = pu.dirPath(TRUE).utf8()+Portable::pathSeparator();
+ plantumlJarPath = pu.dirPath(TRUE)+Portable::pathSeparator();
}
else
{
err("path specified via PLANTUML_JAR_PATH does not exist or not a directory: %s\n",
- plantumlJarPath.data());
+ qPrint(plantumlJarPath));
plantumlJarPath="";
}
}
@@ -1841,15 +1814,16 @@ void Config::checkAndCorrect()
QCString diaPath = Config_getString(DIA_PATH);
if (!diaPath.isEmpty())
{
- QFileInfo dp(diaPath+"/dia"+Portable::commandExtension());
+ QCString diaExe = diaPath+"/dia"+Portable::commandExtension();
+ FileInfo dp(diaExe.str());
if (!dp.exists() || !dp.isFile())
{
- warn_uncond("dia could not be found at %s\n",diaPath.data());
+ warn_uncond("dia could not be found at %s\n",qPrint(diaPath));
diaPath="";
}
else
{
- diaPath=dp.dirPath(TRUE).utf8()+"/";
+ diaPath=dp.dirPath(TRUE)+"/";
#if defined(_WIN32) // convert slashes
uint i=0,l=diaPath.length();
for (i=0;i<l;i++) if (diaPath.at(i)=='/') diaPath.at(i)='\\';
@@ -1868,13 +1842,13 @@ void Config::checkAndCorrect()
if (inputSources.empty())
{
// use current dir as the default
- inputSources.push_back(QDir::currentDirPath().utf8().str());
+ inputSources.push_back(Dir::currentDirPath());
}
else
{
for (const auto &s : inputSources)
{
- QFileInfo fi(s.c_str());
+ FileInfo fi(s.c_str());
if (!fi.exists())
{
warn_uncond("tag INPUT: input source '%s' does not exist\n",s.c_str());
@@ -2077,7 +2051,7 @@ void Config::checkAndCorrect()
{
if (option->kind()==ConfigOption::O_Bool)
{
- printf("disabling option %s\n",option->name().data());
+ printf("disabling option %s\n",qPrint(option->name()));
ConfigImpl_getBool("option->name("))=FALSE; // also disable this option
}
}
@@ -2088,20 +2062,27 @@ void Config::checkAndCorrect()
}
-void Config::writeTemplate(FTextStream &t,bool shortList,bool update)
+void Config::writeTemplate(TextStream &t,bool shortList,bool update)
{
ConfigImpl::instance()->writeTemplate(t,shortList,update);
}
-void Config::compareDoxyfile(FTextStream &t)
+void Config::compareDoxyfile(TextStream &t)
{
postProcess(FALSE, TRUE);
ConfigImpl::instance()->compareDoxyfile(t);
}
-bool Config::parse(const char *fileName,bool update)
+bool Config::parse(const QCString &fileName,bool update)
{
- return ConfigImpl::instance()->parse(fileName,update);
+ bool parseRes = ConfigImpl::instance()->parse(fileName,update);
+ if (!parseRes) return parseRes;
+
+ // Internally we use the default format UTF-8 and
+ // when updating etc. the output is in this format as well and not in the read format
+ ConfigString *option = (ConfigString*)g_config->get("DOXYFILE_ENCODING");
+ option->init();
+ return parseRes;
}
void Config::postProcess(bool clearHeaderAndFooter, bool compare)
diff --git a/src/constexp.l b/src/constexp.l
index acff1eb..a26d517 100644
--- a/src/constexp.l
+++ b/src/constexp.l
@@ -147,7 +147,7 @@ bool ConstExpressionParser::parse(const char *fileName,int lineNr,const std::str
constexpYYrestart( yyin, p->yyscanner );
printlex(yy_flex_debug, true, __FILE__, fileName);
- //printf("Expression: '%s'\n",s.data());
+ //printf("Expression: '%s'\n",qPrint(s));
constexpYYparse(p->yyscanner);
diff --git a/src/context.cpp b/src/context.cpp
index f4614dd..2ae62a0 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -14,7 +14,7 @@
*/
#include <assert.h>
-#include <qdir.h>
+#include <sstream>
#include "context.h"
#include "config.h"
@@ -54,6 +54,7 @@
#include "groupdef.h"
#include "searchindex.h"
#include "resourcemgr.h"
+#include "dir.h"
// TODO: pass the current file to Dot*::writeGraph, so the user can put dot graphs in other
// files as well
@@ -254,9 +255,9 @@ class PropertyMapper
void addProperty(const char *name,typename PropertyFunc::Handler handle)
{
auto it = m_map.find(name);
- if (it==m_map.end())
+ if (it!=m_map.end())
{
- err("Error: adding property '%s' more than once",name);
+ err("adding property '%s' more than once\n",name);
}
else
{
@@ -270,11 +271,11 @@ class PropertyMapper
* @returns A variant representing the properties value or an
* invalid variant if it was not found.
*/
- TemplateVariant get(const T *obj,const char *name) const
+ TemplateVariant get(const T *obj,const QCString &name) const
{
//printf("PropertyMapper::get(%s)\n",name);
TemplateVariant result;
- auto it = m_map.find(name);
+ auto it = m_map.find(name.str());
return it!=m_map.end() ? (*it->second)(obj) : TemplateVariant();
}
@@ -325,10 +326,10 @@ ConfigContext::~ConfigContext()
delete p;
}
-TemplateVariant ConfigContext::get(const char *name) const
+TemplateVariant ConfigContext::get(const QCString &name) const
{
TemplateVariant result;
- if (name)
+ if (!name.isEmpty())
{
const ConfigValues::Info *option = ConfigValues::instance().get(name);
if (option)
@@ -396,7 +397,7 @@ class DoxygenContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -424,7 +425,7 @@ DoxygenContext::~DoxygenContext()
delete p;
}
-TemplateVariant DoxygenContext::get(const char *n) const
+TemplateVariant DoxygenContext::get(const QCString &n) const
{
return p->get(n);
}
@@ -1222,7 +1223,7 @@ class TranslateContext::Private
m_vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
m_sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -1247,7 +1248,7 @@ TranslateContext::~TranslateContext()
delete p;
}
-TemplateVariant TranslateContext::get(const char *n) const
+TemplateVariant TranslateContext::get(const QCString &n) const
{
return p->get(n);
}
@@ -1257,37 +1258,34 @@ static TemplateVariant parseDoc(const Definition *def,const QCString &file,int l
{
TemplateVariant result;
DocRoot *root = validatingParseDoc(file,line,def,0,docStr,TRUE,FALSE,
- 0,isBrief,FALSE,Config_getBool(MARKDOWN_SUPPORT));
- QGString docs;
+ QCString(),isBrief,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ TextStream ts;
+ switch (g_globals.outputFormat)
{
- FTextStream ts(&docs);
- switch (g_globals.outputFormat)
- {
- case ContextOutputFormat_Html:
- {
- HtmlCodeGenerator codeGen(ts,relPath);
- HtmlDocVisitor visitor(ts,codeGen,def);
- root->accept(&visitor);
- }
- break;
- case ContextOutputFormat_Latex:
- {
- LatexCodeGenerator codeGen(ts,relPath,file);
- LatexDocVisitor visitor(ts,codeGen,def->getDefFileExtension(),FALSE);
- root->accept(&visitor);
- }
- break;
- // TODO: support other generators
- default:
- err("context.cpp: output format not yet supported");
- break;
- }
+ case ContextOutputFormat_Html:
+ {
+ HtmlCodeGenerator codeGen(ts,relPath);
+ HtmlDocVisitor visitor(ts,codeGen,def);
+ root->accept(&visitor);
+ }
+ break;
+ case ContextOutputFormat_Latex:
+ {
+ LatexCodeGenerator codeGen(ts,relPath,file);
+ LatexDocVisitor visitor(ts,codeGen,def->getDefFileExtension(),FALSE);
+ root->accept(&visitor);
+ }
+ break;
+ // TODO: support other generators
+ default:
+ err("context.cpp: output format not yet supported\n");
+ break;
}
bool isEmpty = root->isEmpty();
if (isEmpty)
result = "";
else
- result = TemplateVariant(docs,TRUE);
+ result = TemplateVariant(ts.str().c_str(),TRUE);
delete root;
return result;
}
@@ -1297,30 +1295,29 @@ static TemplateVariant parseCode(MemberDef *md,const QCString &scopeName,const Q
{
auto intf = Doxygen::parserManager->getCodeParser(md->getDefFileExtension());
intf->resetCodeParserState();
- QGString s;
- FTextStream t(&s);
+ TextStream t;
switch (g_globals.outputFormat)
{
case ContextOutputFormat_Html:
{
HtmlCodeGenerator codeGen(t,relPath);
- intf->parseCode(codeGen,scopeName,code,md->getLanguage(),FALSE,0,md->getBodyDef(),
+ intf->parseCode(codeGen,scopeName,code,md->getLanguage(),FALSE,QCString(),md->getBodyDef(),
startLine,endLine,TRUE,md,showLineNumbers,md);
}
break;
case ContextOutputFormat_Latex:
{
LatexCodeGenerator codeGen(t,relPath,md->docFile());
- intf->parseCode(codeGen,scopeName,code,md->getLanguage(),FALSE,0,md->getBodyDef(),
+ intf->parseCode(codeGen,scopeName,code,md->getLanguage(),FALSE,QCString(),md->getBodyDef(),
startLine,endLine,TRUE,md,showLineNumbers,md);
}
break;
// TODO: support other generators
default:
- err("context.cpp: output format not yet supported");
+ err("context.cpp: output format not yet supported\n");
break;
}
- return TemplateVariant(s.data(),TRUE);
+ return TemplateVariant(t.str(),TRUE);
}
static TemplateVariant parseCode(const FileDef *fd,const QCString &relPath)
@@ -1328,18 +1325,17 @@ static TemplateVariant parseCode(const FileDef *fd,const QCString &relPath)
static bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES);
auto intf = Doxygen::parserManager->getCodeParser(fd->getDefFileExtension());
intf->resetCodeParserState();
- QGString s;
- FTextStream t(&s);
+ TextStream t;
switch (g_globals.outputFormat)
{
case ContextOutputFormat_Html:
{
HtmlCodeGenerator codeGen(t,relPath);
- intf->parseCode(codeGen,0,
+ intf->parseCode(codeGen,QCString(),
fileToString(fd->absFilePath(),filterSourceFiles,TRUE), // the sources
fd->getLanguage(), // lang
FALSE, // isExampleBlock
- 0, // exampleName
+ QCString(), // exampleName
const_cast<FileDef*>(fd), // fileDef, TODO: should be const
-1, // startLine
-1, // endLine
@@ -1354,11 +1350,11 @@ static TemplateVariant parseCode(const FileDef *fd,const QCString &relPath)
case ContextOutputFormat_Latex:
{
LatexCodeGenerator codeGen(t,relPath,fd->docFile());
- intf->parseCode(codeGen,0,
+ intf->parseCode(codeGen,QCString(),
fileToString(fd->absFilePath(),filterSourceFiles,TRUE), // the sources
fd->getLanguage(), // lang
FALSE, // isExampleBlock
- 0, // exampleName
+ QCString(), // exampleName
const_cast<FileDef*>(fd), // fileDef, TODO: should be const
-1, // startLine
-1, // endLine
@@ -1372,10 +1368,10 @@ static TemplateVariant parseCode(const FileDef *fd,const QCString &relPath)
break;
// TODO: support other generators
default:
- err("context.cpp: output format not yet supported");
+ err("context.cpp: output format not yet supported\n");
break;
}
- return TemplateVariant(s.data(),TRUE);
+ return TemplateVariant(t.str().c_str(),TRUE);
}
//------------------------------------------------------------------------
@@ -1556,6 +1552,7 @@ class DefinitionContext
case Definition::TypePackage: result="package"; break;
case Definition::TypePage: result="page"; break;
case Definition::TypeDir: result="dir"; break;
+ case Definition::TypeConcept: result="concept"; break;
case Definition::TypeMember: break;
}
return result;
@@ -1697,7 +1694,7 @@ class IncludeInfoContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -1748,7 +1745,7 @@ IncludeInfoContext::~IncludeInfoContext()
delete p;
}
-TemplateVariant IncludeInfoContext::get(const char *n) const
+TemplateVariant IncludeInfoContext::get(const QCString &n) const
{
return p->get(n);
}
@@ -1880,7 +1877,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
if (!cd->cookie()) { cd->setCookie(new ClassContext::Private::Cachable(cd)); }
}
virtual ~Private() {}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -1950,14 +1947,13 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
}
TemplateVariant inheritanceDiagram() const
{
- QGString result;
+ TextStream t;
static bool haveDot = Config_getBool(HAVE_DOT);
static bool classDiagrams = Config_getBool(CLASS_DIAGRAMS);
static bool classGraph = Config_getBool(CLASS_GRAPH);
if (haveDot && (classDiagrams || classGraph))
{
DotClassGraph *cg = getClassGraph();
- FTextStream t(&result);
switch (g_globals.outputFormat)
{
case ContextOutputFormat_Html:
@@ -1980,7 +1976,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
break;
// TODO: support other generators
default:
- err("context.cpp: output format not yet supported");
+ err("context.cpp: output format not yet supported\n");
break;
}
g_globals.dynSectionId++;
@@ -1988,34 +1984,33 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
else if (classDiagrams)
{
ClassDiagram d(m_classDef);
- FTextStream t(&result);
switch (g_globals.outputFormat)
{
case ContextOutputFormat_Html:
{
- FTextStream tt(&result);
+ TextStream tt;
QCString name = convertToHtml(m_classDef->displayName());
d.writeImage(tt,g_globals.outputDir,
relPathAsString(),
m_classDef->getOutputFileBase());
- if (!result.isEmpty())
+ if (!tt.empty())
{
- t << "<div class=\"center\">" << endl;
+ t << "<div class=\"center\">\n";
t << " <img src=\"";
t << relPathAsString() << m_classDef->getOutputFileBase();
- t << ".png\" usemap=\"#" << convertToId(name) << "_map\" alt=\"\"/>" << endl;
- t << " <map id=\"" << convertToId(name) << "_map\" name=\"" << convertToId(name) << "_map\">" << endl;
- t << result;
- t << " </map>" << endl;
+ t << ".png\" usemap=\"#" << convertToId(name) << "_map\" alt=\"\"/>\n";
+ t << " <map id=\"" << convertToId(name) << "_map\" name=\"" << convertToId(name) << "_map\">\n";
+ t << tt.str();
+ t << " </map>\n";
t << "</div>";
}
else
{
- t << "<div class=\"center\">" << endl;
+ t << "<div class=\"center\">\n";
t << " <img src=\"";
t << relPathAsString() << m_classDef->getOutputFileBase();
- t << ".png\" alt=\"\"/>" << endl;
+ t << ".png\" alt=\"\"/>\n";
t << "</div>";
}
}
@@ -2027,12 +2022,12 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
break;
// TODO: support other generators
default:
- err("context.cpp: output format not yet supported");
+ err("context.cpp: output format not yet supported\n");
break;
}
g_globals.dynSectionId++;
}
- return TemplateVariant(result.data(),TRUE);
+ return TemplateVariant(t.str().c_str(),TRUE);
}
DotClassGraph *getCollaborationGraph() const
{
@@ -2051,11 +2046,10 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
TemplateVariant collaborationDiagram() const
{
static bool haveDot = Config_getBool(HAVE_DOT);
- QGString result;
+ TextStream t;
if (haveDot)
{
DotClassGraph *cg = getCollaborationGraph();
- FTextStream t(&result);
switch (g_globals.outputFormat)
{
case ContextOutputFormat_Html:
@@ -2078,12 +2072,12 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
break;
// TODO: support other generators
default:
- err("context.cpp: output format not yet supported");
+ err("context.cpp: output format not yet supported\n");
break;
}
g_globals.dynSectionId++;
}
- return TemplateVariant(result.data(),TRUE);
+ return TemplateVariant(t.str().c_str(),TRUE);
}
TemplateVariant includeInfo() const
@@ -2121,7 +2115,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
return cache.inheritedByList.get();
}
TemplateVariant getMemberList(SharedPtr<MemberListInfoContext> &list,
- MemberListType type,const char *title,bool=FALSE) const
+ MemberListType type,const QCString &title,bool=FALSE) const
{
if (!list)
{
@@ -2644,7 +2638,7 @@ PropertyMapper<ClassContext::Private> ClassContext::Private::s_inst;
ClassContext::ClassContext(const ClassDef *cd) : RefCountedContext("ClassContext")
{
- //printf("ClassContext::ClassContext(%s)\n",cd?cd->name().data():"<none>");
+ //printf("ClassContext::ClassContext(%s)\n",cd?qPrint(cd->name()):"<none>");
p = new Private(cd);
}
@@ -2653,7 +2647,7 @@ ClassContext::~ClassContext()
delete p;
}
-TemplateVariant ClassContext::get(const char *n) const
+TemplateVariant ClassContext::get(const QCString &n) const
{
return p->get(n);
}
@@ -2700,7 +2694,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri
if (!nd->cookie()) { nd->setCookie(new NamespaceContext::Private::Cachable(nd)); }
}
virtual ~Private() {}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -2783,7 +2777,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri
return cache.constantgroups.get();
}
TemplateVariant getMemberList(SharedPtr<MemberListInfoContext> &list,
- MemberListType type,const char *title,bool=FALSE) const
+ MemberListType type,const QCString &title,bool=FALSE) const
{
if (!list)
{
@@ -2944,7 +2938,7 @@ NamespaceContext::~NamespaceContext()
delete p;
}
-TemplateVariant NamespaceContext::get(const char *n) const
+TemplateVariant NamespaceContext::get(const QCString &n) const
{
return p->get(n);
}
@@ -3001,7 +2995,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
if (!fd->cookie()) { fd->setCookie(new FileContext::Private::Cachable(fd)); }
}
virtual ~Private() {}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -3056,11 +3050,10 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
TemplateVariant includeGraph() const
{
static bool haveDot = Config_getBool(HAVE_DOT);
- QGString result;
+ TextStream t;
if (haveDot)
{
DotInclDepGraph *cg = getIncludeGraph();
- FTextStream t(&result);
switch (g_globals.outputFormat)
{
case ContextOutputFormat_Html:
@@ -3083,12 +3076,12 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
break;
// TODO: support other generators
default:
- err("context.cpp: output format not yet supported");
+ err("context.cpp: output format not yet supported\n");
break;
}
g_globals.dynSectionId++;
}
- return TemplateVariant(result.data(),TRUE);
+ return TemplateVariant(t.str().c_str(),TRUE);
}
DotInclDepGraph *getIncludedByGraph() const
{
@@ -3108,11 +3101,10 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
TemplateVariant includedByGraph() const
{
static bool haveDot = Config_getBool(HAVE_DOT);
- QGString result;
+ TextStream t;
if (haveDot)
{
DotInclDepGraph *cg = getIncludedByGraph();
- FTextStream t(&result);
switch (g_globals.outputFormat)
{
case ContextOutputFormat_Html:
@@ -3135,12 +3127,12 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
break;
// TODO: support other generators
default:
- err("context.cpp: output format not yet supported");
+ err("context.cpp: output format not yet supported\n");
break;
}
g_globals.dynSectionId++;
}
- return TemplateVariant(result.data(),TRUE);
+ return TemplateVariant(t.str().c_str(),TRUE);
}
TemplateVariant hasDetails() const
{
@@ -3222,7 +3214,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
return cache.constantgroups.get();
}
TemplateVariant getMemberList(SharedPtr<MemberListInfoContext> &list,
- MemberListType type,const char *title,bool=FALSE) const
+ MemberListType type,const QCString &title,bool=FALSE) const
{
if (!list)
{
@@ -3398,7 +3390,7 @@ FileContext::~FileContext()
delete p;
}
-TemplateVariant FileContext::get(const char *n) const
+TemplateVariant FileContext::get(const QCString &n) const
{
return p->get(n);
}
@@ -3431,7 +3423,7 @@ class DirContext::Private : public DefinitionContext<DirContext::Private>
if (!dd->cookie()) { dd->setCookie(new DirContext::Private::Cachable(dd)); }
}
virtual ~Private() {}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -3514,13 +3506,12 @@ class DirContext::Private : public DefinitionContext<DirContext::Private>
}
TemplateVariant dirGraph() const
{
- QGString result;
+ TextStream t;
static bool haveDot = Config_getBool(HAVE_DOT);
static bool dirGraph = Config_getBool(DIRECTORY_GRAPH);
if (haveDot && dirGraph)
{
DotDirDeps *graph = getDirDepsGraph();
- FTextStream t(&result);
switch (g_globals.outputFormat)
{
case ContextOutputFormat_Html:
@@ -3549,12 +3540,12 @@ class DirContext::Private : public DefinitionContext<DirContext::Private>
break;
// TODO: support other generators
default:
- err("context.cpp: output format not yet supported");
+ err("context.cpp: output format not yet supported\n");
break;
}
g_globals.dynSectionId++;
}
- return TemplateVariant(result.data(),TRUE);
+ return TemplateVariant(t.str().c_str(),TRUE);
}
private:
@@ -3588,7 +3579,7 @@ DirContext::~DirContext()
delete p;
}
-TemplateVariant DirContext::get(const char *n) const
+TemplateVariant DirContext::get(const QCString &n) const
{
return p->get(n);
}
@@ -3617,7 +3608,7 @@ class PageContext::Private : public DefinitionContext<PageContext::Private>
if (!pd->cookie()) { pd->setCookie(new PageContext::Private::Cachable(pd)); }
}
virtual ~Private() {}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -3721,7 +3712,7 @@ PageContext::~PageContext()
delete p;
}
-TemplateVariant PageContext::get(const char *n) const
+TemplateVariant PageContext::get(const QCString &n) const
{
return p->get(n);
}
@@ -3731,15 +3722,15 @@ TemplateVariant PageContext::get(const char *n) const
class TextGeneratorHtml : public TextGeneratorIntf
{
public:
- TextGeneratorHtml(FTextStream &ts,const QCString &relPath)
+ TextGeneratorHtml(TextStream &ts,const QCString &relPath)
: m_ts(ts), m_relPath(relPath) {}
- void writeString(const char *s,bool keepSpaces) const
+ void writeString(const QCString &s,bool keepSpaces) const
{
static const char *hex="0123456789ABCDEF";
- if (s==0) return;
+ if (s.isEmpty()) return;
if (keepSpaces)
{
- const char *p=s;
+ const char *p=s.data();
char c;
while ((c=*p++))
{
@@ -3782,11 +3773,11 @@ class TextGeneratorHtml : public TextGeneratorIntf
}
}
- void writeLink(const char *ref,const char *f,
- const char *anchor,const char *name
+ void writeLink(const QCString &ref,const QCString &f,
+ const QCString &anchor,const QCString &name
) const
{
- if (ref)
+ if (!ref.isEmpty())
{
m_ts << "<a class=\"elRef\" ";
m_ts << externalLinkTarget();
@@ -3797,15 +3788,15 @@ class TextGeneratorHtml : public TextGeneratorIntf
}
m_ts << "href=\"";
m_ts << externalRef(m_relPath,ref,TRUE);
- if (f) m_ts << f << Doxygen::htmlFileExtension;
- if (anchor) m_ts << "#" << anchor;
+ if (!f.isEmpty()) m_ts << f << Doxygen::htmlFileExtension;
+ if (!anchor.isEmpty()) m_ts << "#" << anchor;
m_ts << "\">";
m_ts << convertToHtml(name);
m_ts << "</a>";
}
private:
- FTextStream &m_ts;
+ TextStream &m_ts;
QCString m_relPath;
};
@@ -3814,8 +3805,8 @@ class TextGeneratorHtml : public TextGeneratorIntf
class TextGeneratorLatex : public TextGeneratorIntf
{
public:
- TextGeneratorLatex(FTextStream &ts) : m_ts(ts) {}
- void writeString(const char *s,bool keepSpaces) const
+ TextGeneratorLatex(TextStream &ts) : m_ts(ts) {}
+ void writeString(const QCString &s,bool keepSpaces) const
{
if (s==0) return;
m_ts << convertToLaTeX(s,FALSE,keepSpaces);
@@ -3828,17 +3819,17 @@ class TextGeneratorLatex : public TextGeneratorIntf
m_ts << "~";
}
}
- void writeLink(const char *ref,const char *f,
- const char *anchor,const char *text
+ void writeLink(const QCString &ref,const QCString &f,
+ const QCString &anchor,const QCString &text
) const
{
static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
- if (!ref && pdfHyperlinks)
+ if (ref.isEmpty() && pdfHyperlinks)
{
m_ts << "\\mbox{\\hyperlink{";
- if (f) m_ts << stripPath(f);
- if (f && anchor) m_ts << "_";
- if (anchor) m_ts << anchor;
+ if (!f.isEmpty()) m_ts << stripPath(f);
+ if (!f.isEmpty() && !anchor.isEmpty()) m_ts << "_";
+ if (!anchor.isEmpty()) m_ts << anchor;
m_ts << "}{";
filterLatexString(m_ts,text,
false, // insideTabbing
@@ -3864,7 +3855,7 @@ class TextGeneratorLatex : public TextGeneratorIntf
}
private:
- FTextStream &m_ts;
+ TextStream &m_ts;
};
//------------------------------------------------------------------------
@@ -3878,7 +3869,7 @@ class TextGeneratorFactory
if (instance==0) instance = new TextGeneratorFactory;
return instance;
}
- TextGeneratorIntf *create(FTextStream &ts,const QCString &relPath)
+ TextGeneratorIntf *create(TextStream &ts,const QCString &relPath)
{
switch (g_globals.outputFormat)
{
@@ -3898,14 +3889,13 @@ class TextGeneratorFactory
TemplateVariant createLinkedText(const Definition *def,const QCString &relPath,const QCString &text)
{
- QGString s;
- FTextStream ts(&s);
+ TextStream ts;
TextGeneratorIntf *tg = TextGeneratorFactory::instance()->create(ts,relPath);
if (tg)
{
linkifyText(*tg,def->getOuterScope(),def->getBodyDef(),def,text);
delete tg;
- return TemplateVariant(s.data(),TRUE);
+ return TemplateVariant(ts.str().c_str(),true);
}
else
{
@@ -4069,7 +4059,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
}
}
virtual ~Private() {}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -4687,16 +4677,11 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
Cachable &cache = getCache();
if (!cache.labels)
{
- QStrList sl;
- m_memberDef->getLabels(sl,m_memberDef->getOuterScope());
+ StringVector sl = m_memberDef->getLabels(m_memberDef->getOuterScope());
TemplateList *tl = TemplateList::alloc();
- if (sl.count()>0)
+ for (const auto &s : sl)
{
- QStrListIterator it(sl);
- for (;it.current();++it)
- {
- tl->append(*it);
- }
+ tl->append(s.c_str());
}
cache.labels.reset(tl);
}
@@ -4945,8 +4930,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
if (hasCallGraph().toBool())
{
DotCallGraph *cg = getCallGraph();
- QGString result;
- FTextStream t(&result);
+ TextStream t;
switch (g_globals.outputFormat)
{
case ContextOutputFormat_Html:
@@ -4969,11 +4953,11 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
break;
// TODO: support other generators
default:
- err("context.cpp: output format not yet supported");
+ err("context.cpp: output format not yet supported\n");
break;
}
g_globals.dynSectionId++;
- return TemplateVariant(result.data(),TRUE);
+ return TemplateVariant(t.str().c_str(),TRUE);
}
else
{
@@ -4984,7 +4968,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
{
if (hasReferencedByRelation().toBool())
{
- err("context.cpp: output format not yet supported");
+ err("context.cpp: output format not yet supported\n");
}
return TemplateVariant("");
}
@@ -5017,8 +5001,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
if (hasCallerGraph().toBool())
{
DotCallGraph *cg = getCallerGraph();
- QGString result;
- FTextStream t(&result);
+ TextStream t;
switch (g_globals.outputFormat)
{
case ContextOutputFormat_Html:
@@ -5041,11 +5024,11 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
break;
// TODO: support other generators
default:
- err("context.cpp: output format not yet supported");
+ err("context.cpp: output format not yet supported\n");
break;
}
g_globals.dynSectionId++;
- return TemplateVariant(result.data(),TRUE);
+ return TemplateVariant(t.str().c_str(),TRUE);
}
else
{
@@ -5056,7 +5039,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
{
if (hasReferencesRelation().toBool())
{
- err("context.cpp: output format not yet supported");
+ err("context.cpp: output format not yet supported\n");
}
return TemplateVariant("");
}
@@ -5176,7 +5159,7 @@ MemberContext::~MemberContext()
delete p;
}
-TemplateVariant MemberContext::get(const char *n) const
+TemplateVariant MemberContext::get(const QCString &n) const
{
return p->get(n);
}
@@ -5242,7 +5225,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private>
if (!gd->cookie()) { gd->setCookie(new ModuleContext::Private::Cachable(gd)); }
}
virtual ~Private() {}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -5281,13 +5264,12 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private>
}
TemplateVariant groupGraph() const
{
- QGString result;
+ TextStream t;
static bool haveDot = Config_getBool(HAVE_DOT);
static bool groupGraphs = Config_getBool(GROUP_GRAPHS);
if (haveDot && groupGraphs)
{
DotGroupCollaboration *graph = getGroupGraph();
- FTextStream t(&result);
switch (g_globals.outputFormat)
{
case ContextOutputFormat_Html:
@@ -5314,12 +5296,12 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private>
break;
// TODO: support other generators
default:
- err("context.cpp: output format not yet supported");
+ err("context.cpp: output format not yet supported\n");
break;
}
g_globals.dynSectionId++;
}
- return TemplateVariant(result.data(),TRUE);
+ return TemplateVariant(t.str().c_str(),TRUE);
}
TemplateVariant hasDetails() const
{
@@ -5451,7 +5433,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private>
}
TemplateVariant getMemberList(SharedPtr<MemberListInfoContext> &list,
- MemberListType type,const char *title,bool=FALSE) const
+ MemberListType type,const QCString &title,bool=FALSE) const
{
if (!list)
{
@@ -5688,7 +5670,7 @@ ModuleContext::~ModuleContext()
delete p;
}
-TemplateVariant ModuleContext::get(const char *n) const
+TemplateVariant ModuleContext::get(const QCString &n) const
{
return p->get(n);
}
@@ -5767,7 +5749,7 @@ class ClassIndexContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -5853,7 +5835,7 @@ ClassIndexContext::~ClassIndexContext()
}
// TemplateStructIntf
-TemplateVariant ClassIndexContext::get(const char *n) const
+TemplateVariant ClassIndexContext::get(const QCString &n) const
{
return p->get(n);
}
@@ -5959,7 +5941,7 @@ class ClassHierarchyContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -6066,7 +6048,7 @@ ClassHierarchyContext::~ClassHierarchyContext()
delete p;
}
-TemplateVariant ClassHierarchyContext::get(const char *name) const
+TemplateVariant ClassHierarchyContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -6126,7 +6108,7 @@ class NestingNodeContext::Private
addPages(visitedClasses);
addModules(visitedClasses);
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -6388,7 +6370,7 @@ NestingNodeContext::~NestingNodeContext()
delete p;
}
-TemplateVariant NestingNodeContext::get(const char *n) const
+TemplateVariant NestingNodeContext::get(const QCString &n) const
{
return p->get(n);
}
@@ -6412,7 +6394,9 @@ class NestingContext::Private : public GenericNodeListContext
if (!nd->isAnonymous() &&
(!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
{
- bool hasChildren = namespaceHasNestedNamespace(nd);
+ bool hasChildren = namespaceHasNestedNamespace(nd) ||
+ namespaceHasNestedClass(nd,false,ClassDef::Class) ||
+ namespaceHasNestedConcept(nd);
bool isLinkable = nd->isLinkableInProject();
if (isLinkable || hasChildren)
{
@@ -6752,7 +6736,7 @@ class ClassTreeContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -6839,7 +6823,7 @@ ClassTreeContext::~ClassTreeContext()
delete p;
}
-TemplateVariant ClassTreeContext::get(const char *name) const
+TemplateVariant ClassTreeContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -6916,7 +6900,7 @@ class NamespaceTreeContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -7005,7 +6989,7 @@ NamespaceTreeContext::~NamespaceTreeContext()
delete p;
}
-TemplateVariant NamespaceTreeContext::get(const char *name) const
+TemplateVariant NamespaceTreeContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -7186,7 +7170,7 @@ class FileTreeContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -7260,7 +7244,7 @@ FileTreeContext::~FileTreeContext()
delete p;
}
-TemplateVariant FileTreeContext::get(const char *name) const
+TemplateVariant FileTreeContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -7294,7 +7278,7 @@ class PageTreeContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -7368,7 +7352,7 @@ PageTreeContext::~PageTreeContext()
delete p;
}
-TemplateVariant PageTreeContext::get(const char *name) const
+TemplateVariant PageTreeContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -7536,7 +7520,7 @@ class ModuleTreeContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -7610,7 +7594,7 @@ ModuleTreeContext::~ModuleTreeContext()
delete p;
}
-TemplateVariant ModuleTreeContext::get(const char *name) const
+TemplateVariant ModuleTreeContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -7636,7 +7620,7 @@ class NavPathElemContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -7704,7 +7688,7 @@ NavPathElemContext::~NavPathElemContext()
delete p;
}
-TemplateVariant NavPathElemContext::get(const char *name) const
+TemplateVariant NavPathElemContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -7738,7 +7722,7 @@ class ExampleTreeContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -7812,7 +7796,7 @@ ExampleTreeContext::~ExampleTreeContext()
delete p;
}
-TemplateVariant ExampleTreeContext::get(const char *name) const
+TemplateVariant ExampleTreeContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -7847,7 +7831,7 @@ class GlobalsIndexContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -7965,7 +7949,7 @@ GlobalsIndexContext::~GlobalsIndexContext()
delete p;
}
-TemplateVariant GlobalsIndexContext::get(const char *name) const
+TemplateVariant GlobalsIndexContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -8000,7 +7984,7 @@ class ClassMembersIndexContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -8120,7 +8104,7 @@ ClassMembersIndexContext::~ClassMembersIndexContext()
delete p;
}
-TemplateVariant ClassMembersIndexContext::get(const char *name) const
+TemplateVariant ClassMembersIndexContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -8155,7 +8139,7 @@ class NamespaceMembersIndexContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -8272,7 +8256,7 @@ NamespaceMembersIndexContext::~NamespaceMembersIndexContext()
delete p;
}
-TemplateVariant NamespaceMembersIndexContext::get(const char *name) const
+TemplateVariant NamespaceMembersIndexContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -8293,18 +8277,17 @@ class InheritanceGraphContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
TemplateVariant graph() const
{
- QGString result;
+ TextStream t;
static bool haveDot = Config_getBool(HAVE_DOT);
static bool graphicalHierarchy = Config_getBool(GRAPHICAL_HIERARCHY);
if (haveDot && graphicalHierarchy)
{
- FTextStream t(&result);
m_hierarchy->createGraph(m_node,t,
/*GOF_BITMAP,
EOF_Html,*/
@@ -8312,7 +8295,7 @@ class InheritanceGraphContext::Private
g_globals.outputDir+Portable::pathSeparator()+"inherits"+Doxygen::htmlFileExtension,
m_id);
}
- return TemplateVariant(result.data(),TRUE);
+ return TemplateVariant(t.str().c_str(),TRUE);
}
private:
DotGfxHierarchyTable *m_hierarchy;
@@ -8334,7 +8317,7 @@ InheritanceGraphContext::~InheritanceGraphContext()
delete p;
}
-TemplateVariant InheritanceGraphContext::get(const char *name) const
+TemplateVariant InheritanceGraphContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -8357,7 +8340,7 @@ class InheritanceNodeContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -8393,7 +8376,7 @@ InheritanceNodeContext::~InheritanceNodeContext()
delete p;
}
-TemplateVariant InheritanceNodeContext::get(const char *name) const
+TemplateVariant InheritanceNodeContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -8426,7 +8409,7 @@ InheritanceListContext::InheritanceListContext(const BaseClassList &list, bool b
{
name = cd->displayName();
}
- //printf("InheritanceListContext: adding %s baseClass=%d\n",name.data(),baseClasses);
+ //printf("InheritanceListContext: adding %s baseClass=%d\n",qPrint(name),baseClasses);
p->addClass(cd,name);
}
}
@@ -8541,7 +8524,7 @@ class MemberInfoContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -8604,7 +8587,7 @@ MemberInfoContext::~MemberInfoContext()
delete p;
}
-TemplateVariant MemberInfoContext::get(const char *name) const
+TemplateVariant MemberInfoContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -8693,7 +8676,7 @@ class MemberGroupInfoContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -8776,7 +8759,7 @@ MemberGroupInfoContext::~MemberGroupInfoContext()
delete p;
}
-TemplateVariant MemberGroupInfoContext::get(const char *name) const
+TemplateVariant MemberGroupInfoContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -8867,7 +8850,7 @@ class MemberListInfoContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -8948,7 +8931,7 @@ MemberListInfoContext::~MemberListInfoContext()
delete p;
}
-TemplateVariant MemberListInfoContext::get(const char *name) const
+TemplateVariant MemberListInfoContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -8974,7 +8957,7 @@ class InheritedMemberInfoContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -9042,7 +9025,7 @@ InheritedMemberInfoContext::~InheritedMemberInfoContext()
delete p;
}
-TemplateVariant InheritedMemberInfoContext::get(const char *name) const
+TemplateVariant InheritedMemberInfoContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -9155,7 +9138,7 @@ void InheritedMemberInfoListContext::addMemberList(
bool memberInSection = cd->countMembersIncludingGrouped(lt,cd,FALSE)>0;
bool show = (additionalList && !memberInSection) || // inherited member to show in the additional inherited members list
(!additionalList && memberInSection); // inherited member to show in a member list of the class
- //printf("%s:%s show=%d\n",cd->name().data(),MemberList::listTypeAsString(lt).data(),show);
+ //printf("%s:%s show=%d\n",qPrint(cd->name()),qPrint(MemberList::listTypeAsString(lt)),show);
if (show)
{
p->findInheritedMembers(cd,cd,lt,-1,title,additionalList,visited);
@@ -9206,7 +9189,7 @@ class ArgumentContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -9283,7 +9266,7 @@ ArgumentContext::~ArgumentContext()
delete p;
}
-TemplateVariant ArgumentContext::get(const char *name) const
+TemplateVariant ArgumentContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -9373,7 +9356,7 @@ class SymbolContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -9477,7 +9460,7 @@ SymbolContext::~SymbolContext()
delete p;
}
-TemplateVariant SymbolContext::get(const char *name) const
+TemplateVariant SymbolContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -9550,7 +9533,7 @@ class SymbolGroupContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -9596,7 +9579,7 @@ SymbolGroupContext::~SymbolGroupContext()
delete p;
}
-TemplateVariant SymbolGroupContext::get(const char *name) const
+TemplateVariant SymbolGroupContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -9677,7 +9660,7 @@ class SymbolIndexContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -9723,7 +9706,7 @@ SymbolIndexContext::~SymbolIndexContext()
delete p;
}
-TemplateVariant SymbolIndexContext::get(const char *name) const
+TemplateVariant SymbolIndexContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -9788,7 +9771,7 @@ class SearchIndexContext::Private
init=TRUE;
}
}
- TemplateVariant get(const char *n) const
+ TemplateVariant get(const QCString &n) const
{
return s_inst.get(this,n);
}
@@ -9832,7 +9815,7 @@ SearchIndexContext::~SearchIndexContext()
delete p;
}
-TemplateVariant SearchIndexContext::get(const char *name) const
+TemplateVariant SearchIndexContext::get(const QCString &name) const
{
return p->get(name);
}
@@ -9900,7 +9883,8 @@ class LatexSpaceless : public TemplateSpacelessIntf
void reset() { }
QCString remove(const QCString &s)
{
- QGString result;
+ if (s.isEmpty()) return s;
+ TextStream result;
const char *p = s.data();
char c;
while ((c=*p++))
@@ -9910,12 +9894,11 @@ class LatexSpaceless : public TemplateSpacelessIntf
case '\t': case ' ': case '\n':
break;
default:
- result+=c;
+ result << c;
break;
}
}
- result+='\0';
- return result.data();
+ return result.str();
}
private:
};
@@ -9934,7 +9917,8 @@ class HtmlSpaceless : public TemplateSpacelessIntf
}
QCString remove(const QCString &s)
{
- QGString result;
+ if (s.isEmpty()) return s;
+ TextStream result;
const char *p = s.data();
char c;
while ((c=*p++))
@@ -9943,15 +9927,15 @@ class HtmlSpaceless : public TemplateSpacelessIntf
{
case '<': // start of a tag
if (!m_insideString) m_insideTag=TRUE,m_removeSpaces=FALSE;
- result+=c;
+ result << c;
break;
case '>': // end of a tag
if (!m_insideString) m_insideTag=FALSE,m_removeSpaces=TRUE;
- result+=c;
+ result << c;
break;
case '\\': // escaped character in a string
- result+=c;
- if (m_insideString && *p) result+=*p++;
+ result << c;
+ if (m_insideString && *p) result << *p++;
break;
case '"': case '\'':
if (m_insideTag)
@@ -9965,7 +9949,7 @@ class HtmlSpaceless : public TemplateSpacelessIntf
m_insideString=c;
}
}
- result+=c;
+ result << c;
break;
case ' ': case '\t': case '\n': // whitespace
if (!m_insideTag) // outside tags strip consecutive whitespace
@@ -9974,20 +9958,19 @@ class HtmlSpaceless : public TemplateSpacelessIntf
}
else
{
- result+=' ';
+ result << ' ';
}
break;
default:
//if (m_removeSpaces) result+=' ';
- result+=c;
+ result << c;
m_removeSpaces=FALSE;
break;
}
}
- result+='\0';
- //printf("HtmlSpaceless::remove({%s})={%s} m_insideTag=%d m_insideString=%c (%d) removeSpaces=%d\n",s.data(),result.data(),
+ //printf("HtmlSpaceless::remove({%s})={%s} m_insideTag=%d m_insideString=%c (%d) removeSpaces=%d\n",qPrint(s),qPrint(result),
// m_insideTag,m_insideString,m_insideString,m_removeSpaces);
- return result.data();
+ return result.str();
}
private:
bool m_insideTag;
@@ -10118,14 +10101,14 @@ void generateOutputViaTemplate()
g_globals.outputFormat = ContextOutputFormat_Html;
g_globals.dynSectionId = 0;
g_globals.outputDir = Config_getString(HTML_OUTPUT);
- QDir dir(g_globals.outputDir);
+ Dir dir(g_globals.outputDir.str());
createSubDirs(dir);
HtmlEscaper htmlEsc;
ctx->setEscapeIntf(Config_getString(HTML_FILE_EXTENSION),&htmlEsc);
HtmlSpaceless spl;
ctx->setSpacelessIntf(&spl);
ctx->setOutputDirectory(g_globals.outputDir);
- FTextStream ts;
+ TextStream ts;
tpl->render(ts,ctx);
e.unload(tpl);
}
@@ -10143,14 +10126,14 @@ void generateOutputViaTemplate()
g_globals.outputFormat = ContextOutputFormat_Latex;
g_globals.dynSectionId = 0;
g_globals.outputDir = Config_getString(LATEX_OUTPUT);
- QDir dir(g_globals.outputDir);
+ Dir dir(g_globals.outputDir.str());
createSubDirs(dir);
LatexEscaper latexEsc;
ctx->setEscapeIntf(".tex",&latexEsc);
LatexSpaceless spl;
ctx->setSpacelessIntf(&spl);
ctx->setOutputDirectory(g_globals.outputDir);
- FTextStream ts;
+ TextStream ts;
tpl->render(ts,ctx);
e.unload(tpl);
}
@@ -10170,20 +10153,20 @@ void generateOutputViaTemplate()
#endif
}
-void generateTemplateFiles(const char *templateDir)
+void generateTemplateFiles(const QCString &templateDir)
{
- if (!templateDir) return;
- QDir thisDir;
- if (!thisDir.exists(templateDir) && !thisDir.mkdir(templateDir))
+ if (templateDir.isEmpty()) return;
+ Dir thisDir;
+ if (!thisDir.exists(templateDir.str()) && !thisDir.mkdir(templateDir.str()))
{
- err("Failed to create output directory '%s'\n",templateDir);
+ err("Failed to create output directory '%s'\n",qPrint(templateDir));
return;
}
- QCString outDir = QCString(templateDir)+"/html";
+ std::string outDir = templateDir.str()+"/html";
if (!thisDir.exists(outDir) && !thisDir.mkdir(outDir))
{
- err("Failed to create output directory '%s'\n",outDir.data());
+ err("Failed to create output directory '%s'\n",outDir.c_str());
return;
}
- ResourceMgr::instance().writeCategory("html",outDir);
+ ResourceMgr::instance().writeCategory("html",outDir.c_str());
}
diff --git a/src/context.h b/src/context.h
index 9573643..1fb934e 100644
--- a/src/context.h
+++ b/src/context.h
@@ -80,13 +80,13 @@ class RefCountedContext
int addRef()
{
++s_totalCount;
- printf("%p:%s::addRef()=%d\n",this,m_className.data(),m_refCount);
+ printf("%p:%s::addRef()=%d\n",this,qPrint(m_className),m_refCount);
return ++m_refCount;
}
int release()
{
--s_totalCount;
- printf("%p:%s::release()=%d\n",this,m_className.data(),m_refCount-1);
+ printf("%p:%s::release()=%d\n",this,qPrint(m_className),m_refCount-1);
int count = --m_refCount;
if (count<=0)
{
@@ -134,7 +134,7 @@ class ConfigContext : public RefCountedContext, public TemplateStructIntf
static ConfigContext *alloc() { return new ConfigContext; }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -153,7 +153,7 @@ class DoxygenContext : public RefCountedContext, public TemplateStructIntf
static DoxygenContext *alloc() { return new DoxygenContext; }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -172,7 +172,7 @@ class TranslateContext : public RefCountedContext, public TemplateStructIntf
static TranslateContext *alloc() { return new TranslateContext; }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -216,7 +216,7 @@ class IncludeInfoContext : public RefCountedContext, public TemplateStructIntf
{ return new IncludeInfoContext(info,lang); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -258,7 +258,7 @@ class ClassContext : public RefCountedContext, public TemplateStructIntf
static ClassContext *alloc(const ClassDef *cd) { return new ClassContext(cd); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -277,7 +277,7 @@ class NamespaceContext : public RefCountedContext, public TemplateStructIntf
static NamespaceContext *alloc(const NamespaceDef *nd) { return new NamespaceContext(nd); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -296,7 +296,7 @@ class FileContext : public RefCountedContext, public TemplateStructIntf
static FileContext *alloc(const FileDef *fd) { return new FileContext(fd); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -314,7 +314,7 @@ class DirContext : public RefCountedContext, public TemplateStructIntf
static DirContext *alloc(const DirDef *dd) { return new DirContext(dd); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -334,7 +334,7 @@ class PageContext : public RefCountedContext, public TemplateStructIntf
static PageContext *alloc(const PageDef *pd,bool isMainPage,bool isExample) { return new PageContext(pd,isMainPage,isExample); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -353,7 +353,7 @@ class MemberContext : public RefCountedContext, public TemplateStructIntf
static MemberContext *alloc(const MemberDef *md) { return new MemberContext(md); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -373,7 +373,7 @@ class ModuleContext : public RefCountedContext, public TemplateStructIntf
static ModuleContext *alloc(const GroupDef *gd) { return new ModuleContext(gd); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -413,7 +413,7 @@ class ClassIndexContext : public RefCountedContext, public TemplateStructIntf
static ClassIndexContext *alloc() { return new ClassIndexContext; }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -433,7 +433,7 @@ class InheritanceGraphContext : public RefCountedContext, public TemplateStructI
{ return new InheritanceGraphContext(hierarchy,n,id); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -453,7 +453,7 @@ class ClassInheritanceNodeContext : public RefCountedContext, public TemplateStr
{ return new ClassInheritanceNodeContext(cd); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -495,7 +495,7 @@ class ClassHierarchyContext : public RefCountedContext, public TemplateStructInt
static ClassHierarchyContext *alloc() { return new ClassHierarchyContext; }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -519,7 +519,7 @@ class NestingNodeContext : public RefCountedContext, public TemplateStructIntf
QCString id() const;
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -578,7 +578,7 @@ class ClassTreeContext : public RefCountedContext, public TemplateStructIntf
static ClassTreeContext *alloc() { return new ClassTreeContext; }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -618,7 +618,7 @@ class NamespaceTreeContext : public RefCountedContext, public TemplateStructIntf
static NamespaceTreeContext *alloc() { return new NamespaceTreeContext; }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -679,7 +679,7 @@ class FileTreeContext : public RefCountedContext, public TemplateStructIntf
static FileTreeContext *alloc() { return new FileTreeContext; }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -721,7 +721,7 @@ class PageTreeContext : public RefCountedContext, public TemplateStructIntf
static PageTreeContext *alloc(const PageLinkedMap &pages) { return new PageTreeContext(pages); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -740,7 +740,7 @@ class ModuleNodeContext : public RefCountedContext, public TemplateStructIntf
static ModuleNodeContext *alloc(const GroupDef *gd) { return new ModuleNodeContext(gd); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -783,7 +783,7 @@ class ModuleTreeContext : public RefCountedContext, public TemplateStructIntf
static ModuleTreeContext *alloc() { return new ModuleTreeContext(); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -824,7 +824,7 @@ class ExampleTreeContext : public RefCountedContext, public TemplateStructIntf
static ExampleTreeContext *alloc() { return new ExampleTreeContext; }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -843,7 +843,7 @@ class GlobalsIndexContext : public RefCountedContext, public TemplateStructIntf
static GlobalsIndexContext *alloc() { return new GlobalsIndexContext(); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -862,7 +862,7 @@ class ClassMembersIndexContext : public RefCountedContext, public TemplateStruct
static ClassMembersIndexContext *alloc() { return new ClassMembersIndexContext(); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -881,7 +881,7 @@ class NamespaceMembersIndexContext : public RefCountedContext, public TemplateSt
static NamespaceMembersIndexContext *alloc() { return new NamespaceMembersIndexContext(); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -900,7 +900,7 @@ class NavPathElemContext : public RefCountedContext, public TemplateStructIntf
static NavPathElemContext *alloc(const Definition *def) { return new NavPathElemContext(def); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -921,7 +921,7 @@ class InheritanceNodeContext : public RefCountedContext, public TemplateStructIn
{ return new InheritanceNodeContext(cd,name); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -991,7 +991,7 @@ class MemberGroupInfoContext : public RefCountedContext, public TemplateStructIn
{ return new MemberGroupInfoContext(def,relPath,mg); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -1042,7 +1042,7 @@ class MemberListInfoContext : public RefCountedContext, public TemplateStructInt
{ return new MemberListInfoContext(def,relPath,ml,title,subtitle); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -1063,7 +1063,7 @@ class MemberInfoContext : public RefCountedContext, public TemplateStructIntf
static MemberInfoContext *alloc(const MemberInfo *mi) { return new MemberInfoContext(mi); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -1083,7 +1083,7 @@ class InheritedMemberInfoContext : public RefCountedContext, public TemplateStru
{ return new InheritedMemberInfoContext(cd,ml,title); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -1147,7 +1147,7 @@ class ArgumentContext : public RefCountedContext, public TemplateStructIntf
{ return new ArgumentContext(arg,def,relPath); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -1191,7 +1191,7 @@ class SymbolContext : public RefCountedContext, public TemplateStructIntf
{ return new SymbolContext(def,prev,next); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -1236,7 +1236,7 @@ class SymbolGroupContext : public RefCountedContext, public TemplateStructIntf
{ return new SymbolGroupContext(start,end); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -1280,7 +1280,7 @@ class SymbolIndexContext : public RefCountedContext, public TemplateStructIntf
{ return new SymbolIndexContext(letter,sl,name); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -1322,7 +1322,7 @@ class SearchIndexContext : public RefCountedContext, public TemplateStructIntf
{ return new SearchIndexContext(info); }
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
@@ -1357,6 +1357,6 @@ class SearchIndicesContext : public RefCountedContext, public TemplateListIntf
//----------------------------------------------------
void generateOutputViaTemplate();
-void generateTemplateFiles(const char *templateDir);
+void generateTemplateFiles(const QCString &templateDir);
#endif
diff --git a/src/cppvalue.cpp b/src/cppvalue.cpp
index 31f0ab5..77677d9 100644
--- a/src/cppvalue.cpp
+++ b/src/cppvalue.cpp
@@ -47,7 +47,7 @@ CPPValue parseHexadecimal(const std::string& token)
else if (*p >= 'a' && *p <= 'f') val = val * 16 + *p - 'a' + 10;
else if (*p >= 'A' && *p <= 'F') val = val * 16 + *p - 'A' + 10;
}
- //printf("parseHexadecimal %s->%x\n",token.data(),val);
+ //printf("parseHexadecimal %s->%x\n",qPrint(token),val);
return CPPValue(val);
}
@@ -79,7 +79,7 @@ CPPValue parseCharacter(const std::string& token) // does not work for '\n' and
return parseOctal(token);
case 'x':
case 'X': return parseHexadecimal(token);
- default: printf("Invalid escape sequence %s found!\n",token.data());
+ default: printf("Invalid escape sequence %s found!\n",token.c_str());
return CPPValue(0L);
}
}
diff --git a/src/debug.cpp b/src/debug.cpp
index bc5abb2..ea6f272 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -22,6 +22,7 @@
#include "debug.h"
#include "message.h"
+#include "qcstring.h"
//------------------------------------------------------------------------
@@ -69,22 +70,22 @@ static char asciiToLower(char in) {
return in;
}
-static int labelToEnumValue(const char *l)
+static int labelToEnumValue(const QCString &l)
{
- std::string s = l;
+ std::string s = l.str();
std::transform(s.begin(),s.end(),s.begin(),asciiToLower);
auto it = s_labels.find(s);
return (it!=s_labels.end()) ? it->second : 0;
}
-int Debug::setFlag(const char *lab)
+int Debug::setFlag(const QCString &lab)
{
int retVal = labelToEnumValue(lab);
curMask = (DebugMask)(curMask | retVal);
return retVal;
}
-void Debug::clearFlag(const char *lab)
+void Debug::clearFlag(const QCString &lab)
{
curMask = (DebugMask)(curMask & ~labelToEnumValue(lab));
}
diff --git a/src/debug.h b/src/debug.h
index 5d4717a..bc93011 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -16,6 +16,8 @@
#ifndef _DEBUG_H
#define _DEBUG_H
+class QCString;
+
/** Class containing a print function for diagnostics. */
class Debug
{
@@ -42,8 +44,8 @@ class Debug
};
static void print(DebugMask mask,int prio,const char *fmt,...);
- static int setFlag(const char *label);
- static void clearFlag(const char *label);
+ static int setFlag(const QCString &label);
+ static void clearFlag(const QCString &label);
static bool isFlagSet(DebugMask mask);
static void printFlags();
static void setPriority(int p);
diff --git a/src/declinfo.h b/src/declinfo.h
index 2039dca..002fe8e 100644
--- a/src/declinfo.h
+++ b/src/declinfo.h
@@ -1,12 +1,12 @@
/******************************************************************************
*
- *
+ *
*
* Copyright (C) 1997-2015 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
+ * 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.
*
@@ -19,7 +19,7 @@
#define DECLINFO_H
#include <stdio.h>
-#include <qcstring.h>
+#include "qcstring.h"
#include "types.h"
extern void parseFuncDecl(const QCString &decl,
diff --git a/src/declinfo.l b/src/declinfo.l
index 9ed7738..e340df5 100644
--- a/src/declinfo.l
+++ b/src/declinfo.l
@@ -118,7 +118,7 @@ ID "$"?([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+)
REJECT;
}
addTypeName(yyscanner);
- yyextra->name += removeRedundantWhiteSpace(yytext);
+ yyextra->name += removeRedundantWhiteSpace(QCString(yytext));
}
<Start>([~!]{B}*)?{ID}/({B}*"["{B}*"]")* { // the []'s are for Java,
// the / was add to deal with multi-
@@ -126,7 +126,7 @@ ID "$"?([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+)
// the leading ~ is for a destructor
// the leading ! is for a C++/CLI finalizer (see bug 456475 and 635198)
addTypeName(yyscanner);
- yyextra->name += removeRedundantWhiteSpace(yytext);
+ yyextra->name += removeRedundantWhiteSpace(QCString(yytext));
}
<Start>{B}*"::"{B}* { // found a yyextra->scope specifier
if (!yyextra->scope.isEmpty())
@@ -135,7 +135,7 @@ ID "$"?([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+)
}
else
{
- yyextra->scope = yyextra->name.copy(); // yyextra->scope becomes yyextra->name
+ yyextra->scope = yyextra->name; // yyextra->scope becomes yyextra->name
}
yyextra->name.resize(0);
}
@@ -152,7 +152,7 @@ ID "$"?([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+)
<Start>{B}*"("({ID}"::")*{B}*[&*]({B}*("const"|"volatile"){B}+)? {
if (yyextra->insidePHP) REJECT;
addType(yyscanner);
- QCString text=yytext;
+ QCString text(yytext);
yyextra->type+=text.stripWhiteSpace();
}
<Start>{B}*")" {
@@ -220,7 +220,7 @@ static void addType(yyscan_t yyscanner)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
//printf("addType() yyextra->type='%s' yyextra->scope='%s' yyextra->name='%s'\n",
- // yyextra->type.data(),yyextra->scope.data(),yyextra->name.data());
+ // qPrint(yyextra->type),qPrint(yyextra->scope),qPrint(yyextra->name));
if (yyextra->name.isEmpty() && yyextra->scope.isEmpty()) return;
if (!yyextra->type.isEmpty()) yyextra->type+=" ";
if (!yyextra->scope.isEmpty()) yyextra->type+=yyextra->scope+"::";
@@ -233,7 +233,7 @@ static void addTypeName(yyscan_t yyscanner)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
//printf("addTypeName() yyextra->type='%s' yyextra->scope='%s' yyextra->name='%s'\n",
- // yyextra->type.data(),yyextra->scope.data(),yyextra->name.data());
+ // qPrint(yyextra->type),qPrint(yyextra->scope),qPrint(yyextra->name));
if (yyextra->name.isEmpty() ||
yyextra->name.at(yyextra->name.length()-1)==':') // end of Objective-C keyword => append to yyextra->name not yyextra->type
{
@@ -276,7 +276,7 @@ void parseFuncDecl(const QCString &decl,const SrcLangExt lang,QCString &cl,QCStr
#endif
printlex(yy_flex_debug, TRUE, __FILE__, NULL);
- yyextra->inputString = decl;
+ yyextra->inputString = decl.data();
//printf("Input='%s'\n",yyextra->inputString);
yyextra->inputPosition = 0;
yyextra->classTempListFound = FALSE;
@@ -297,7 +297,7 @@ void parseFuncDecl(const QCString &decl,const SrcLangExt lang,QCString &cl,QCStr
declinfoYYlex(g_yyscanner);
//printf("yyextra->type='%s' class='%s' yyextra->name='%s' yyextra->args='%s'\n",
- // yyextra->type.data(),yyextra->scope.data(),yyextra->name.data(),yyextra->args.data());
+ // qPrint(yyextra->type),qPrint(yyextra->scope),qPrint(yyextra->name),qPrint(yyextra->args));
int nb = yyextra->name.findRev('[');
if (nb!=-1 && yyextra->args.isEmpty()) // correct for [] in yyextra->name ambiguity (due to Java return yyextra->type allowing [])
@@ -350,7 +350,7 @@ void parseFuncDecl(const QCString &decl,const SrcLangExt lang,QCString &cl,QCStr
t=t.left(t.length()-1);
}
//printf("yyextra->type='%s' class='%s' yyextra->name='%s' yyextra->args='%s'\n",
- // t.data(),cl.data(),n.data(),a.data());
+ // qPrint(t),qPrint(cl),qPrint(n),qPrint(a));
printlex(yy_flex_debug, FALSE, __FILE__, NULL);
declinfoYYlex_destroy(g_yyscanner);
@@ -370,8 +370,8 @@ void dumpDecl(const char *s)
parseFuncDecl(s,yyextra->className,classTNames,yyextra->type,yyextra->name,yyextra->args,funcTNames);
msg("yyextra->type='%s' class='%s' classTempl='%s' yyextra->name='%s' "
"funcTemplateNames='%s' yyextra->args='%s'\n",
- yyextra->type.data(),yyextra->className.data(),classTNames.data(),
- yyextra->name.data(),funcTNames.data(),yyextra->args.data()
+ qPrint(yyextra->type),qPrint(yyextra->className),qPrint(classTNames),
+ qPrint(yyextra->name),qPrint(funcTNames),qPrint(yyextra->args)
);
}
diff --git a/src/defargs.h b/src/defargs.h
index 589eb90..a988b0b 100644
--- a/src/defargs.h
+++ b/src/defargs.h
@@ -25,7 +25,7 @@ class ArgumentList;
class QCString;
std::unique_ptr<ArgumentList> stringToArgumentList(SrcLangExt lang,
- const char *argsString,
+ const QCString &argsString,
QCString *extraTypeChars=0);
#endif
diff --git a/src/defargs.l b/src/defargs.l
index 18e9505..9385cc3 100644
--- a/src/defargs.l
+++ b/src/defargs.l
@@ -56,7 +56,6 @@
//#include <iostream.h>
#include <assert.h>
#include <ctype.h>
-#include <qcstringlist.h>
#include "defargs.h"
#include "entry.h"
@@ -166,7 +165,7 @@ CPPC "/\/"
<ReadFuncArgDef>"'"\\."'" { yyextra->curArgDefValue+=yytext; }
<ReadFuncArgDef>"'"."'" { yyextra->curArgDefValue+=yytext; }
<ReadFuncArgDef>{RAWBEGIN} { yyextra->curArgDefValue+=yytext;
- QCString text=yytext;
+ QCString text(yytext);
int i=text.find('"');
yyextra->delimiter = yytext+i+1;
yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
@@ -330,7 +329,7 @@ CPPC "/\/"
}
<CopyRawString>{RAWEND} {
yyextra->curArgDefValue+=yytext;
- QCString delimiter = yytext+1;
+ QCString delimiter(yytext+1);
delimiter=delimiter.left(delimiter.length()-1);
if (delimiter==yyextra->delimiter)
{
@@ -347,7 +346,7 @@ CPPC "/\/"
<ReadFuncArgType,ReadFuncArgDef>[,)>]{B}*({CCS}[*!]|{CPPC}[/!])"<" {
yyextra->lastDocContext=YY_START;
yyextra->lastDocChar=*yytext;
- QCString text=yytext;
+ QCString text(yytext);
if (text.find("//")!=-1)
BEGIN( ReadDocLine );
else
@@ -363,7 +362,7 @@ CPPC "/\/"
{
yyextra->curArgTypeName=removeRedundantWhiteSpace(yyextra->curArgTypeName);
yyextra->curArgDefValue=yyextra->curArgDefValue.stripWhiteSpace();
- //printf("curArgType='%s' curArgDefVal='%s'\n",yyextra->curArgTypeName.data(),yyextra->curArgDefValue.data());
+ //printf("curArgType='%s' curArgDefVal='%s'\n",qPrint(yyextra->curArgTypeName),qPrint(yyextra->curArgDefValue));
int l=yyextra->curArgTypeName.length();
if (l>0)
{
@@ -371,10 +370,10 @@ CPPC "/\/"
while (i>=0 && (isspace((uchar)yyextra->curArgTypeName.at(i)) || yyextra->curArgTypeName.at(i)=='.')) i--;
while (i>=0 && (isId(yyextra->curArgTypeName.at(i)) || yyextra->curArgTypeName.at(i)=='$')) i--;
Argument a;
- a.attrib = yyextra->curArgAttrib.copy();
+ a.attrib = yyextra->curArgAttrib;
a.typeConstraint = yyextra->curTypeConstraint.stripWhiteSpace();
//printf("a->type=%s a->name=%s i=%d l=%d\n",
- // a->type.data(),a->name.data(),i,l);
+ // qPrint(a->type),qPrint(a->name),i,l);
a.array.resize(0);
if (i==l-1 && yyextra->curArgTypeName.at(i)==')') // function argument
{
@@ -415,7 +414,7 @@ CPPC "/\/"
a.type = a.type + " " + a.name;
a.name.resize(0);
}
- //printf(" --> a->type='%s' a->name='%s'\n",a->type.data(),a->name.data());
+ //printf(" --> a->type='%s' a->name='%s'\n",qPrint(a->type),qPrint(a->name));
}
else // assume only the type was specified, try to determine name later
{
@@ -427,7 +426,7 @@ CPPC "/\/"
a.type = "";
}
a.array += removeRedundantWhiteSpace(yyextra->curArgArray);
- //printf("array=%s\n",a->array.data());
+ //printf("array=%s\n",qPrint(a->array));
int alen = a.array.length();
if (alen>2 && a.array.at(0)=='(' &&
a.array.at(alen-1)==')') // fix-up for int *(a[10])
@@ -440,10 +439,10 @@ CPPC "/\/"
a.array = a.array.mid(i);
}
}
- a.defval = yyextra->curArgDefValue.copy();
- //printf("a->type=%s a->name=%s a->defval=\"%s\"\n",a->type.data(),a->name.data(),a->defval.data());
+ a.defval = yyextra->curArgDefValue;
+ //printf("a->type=%s a->name=%s a->defval=\"%s\"\n",qPrint(a->type),qPrint(a->name),qPrint(a->defval));
a.docs = yyextra->curArgDocs.stripWhiteSpace();
- //printf("Argument '%s' '%s' adding docs='%s'\n",a->type.data(),a->name.data(),a->docs.data());
+ //printf("Argument '%s' '%s' adding docs='%s'\n",qPrint(a->type),qPrint(a->name),qPrint(a->docs));
yyextra->argList->push_back(a);
}
yyextra->curArgAttrib.resize(0);
@@ -476,13 +475,13 @@ CPPC "/\/"
}
}
<ReadFuncArgType,ReadFuncArgPtr>"$"?{ID} {
- QCString name=yytext; //resolveDefines(yytext);
+ QCString name(yytext);
if (YY_START==ReadFuncArgType && yyextra->curArgArray=="[]") // Java style array
{
yyextra->curArgTypeName+=" []";
yyextra->curArgArray.resize(0);
}
- //printf("resolveName '%s'->'%s'\n",yytext,name.data());
+ //printf("resolveName '%s'->'%s'\n",yytext,qPrint(name));
yyextra->curArgTypeName+=name;
}
<ReadFuncArgType,ReadFuncArgPtr>. {
@@ -496,8 +495,7 @@ CPPC "/\/"
yyextra->curArgDefValue+=*yytext;
}
<CopyArgRound,CopyArgRound2,CopyArgSharp,CopyArgCurly>{ID} {
- QCString name=yytext; //resolveDefines(yytext);
- *yyextra->copyArgValue+=name;
+ *yyextra->copyArgValue+=yytext;
}
<CopyArgRound,CopyArgRound2,CopyArgSharp,CopyArgCurly>. {
*yyextra->copyArgValue += *yytext;
@@ -531,7 +529,7 @@ CPPC "/\/"
BEGIN(FuncQual);
}
<FuncQual>"->" { // C++11 trailing return type
- yyextra->argList->setTrailingReturnType(" -> ");
+ yyextra->argList->setTrailingReturnType(QCString(" -> "));
BEGIN(TrailingReturn);
}
<TrailingReturn>{B}/("final"|"override"){B}* {
@@ -771,19 +769,19 @@ static bool nameIsActuallyPartOfType(QCString &name)
}
/*! Converts an argument string into an ArgumentList.
- * \param[in] lang langage of the current argument list
+ * \param[in] lang language of the current argument list
* \param[in] argsString the list of Arguments.
* \param[out] extraTypeChars point to string to which trailing characters
* for complex types are written to
*/
-std::unique_ptr<ArgumentList> stringToArgumentList(SrcLangExt lang, const char *argsString,QCString *extraTypeChars)
+std::unique_ptr<ArgumentList> stringToArgumentList(SrcLangExt lang, const QCString &argsString,QCString *extraTypeChars)
{
std::unique_ptr<ArgumentList> al = std::make_unique<ArgumentList>();
- if (argsString==0) return al;
+ if (argsString.isEmpty()) return al;
yyscan_t yyscanner;
- defargsYY_state extra(argsString,al,lang);
+ defargsYY_state extra(argsString.data(),al,lang);
defargsYYlex_init_extra(&extra,&yyscanner);
#ifdef FLEX_DEBUG
defargsYYset_debug(1,yyscanner);
@@ -799,7 +797,7 @@ std::unique_ptr<ArgumentList> stringToArgumentList(SrcLangExt lang, const char *
yyextra->argList->setNoParameters(TRUE);
}
if (extraTypeChars) *extraTypeChars=yyextra->extraTypeChars;
- //printf("stringToArgumentList(%s) result=%s\n",argsString,argListToString(*al).data());
+ //printf("stringToArgumentList(%s) result=%s\n",argsString,qPrint(argListToString(*al)));
printlex(yy_flex_debug, FALSE, __FILE__, NULL);
defargsYYlex_destroy(yyscanner);
return al;
diff --git a/src/defgen.cpp b/src/defgen.cpp
index 1cb09f5..c99d59b 100644
--- a/src/defgen.cpp
+++ b/src/defgen.cpp
@@ -18,6 +18,8 @@
#include <stdlib.h>
+#include <fstream>
+
#include "defgen.h"
#include "doxygen.h"
#include "message.h"
@@ -33,31 +35,32 @@
#include "namespacedef.h"
#include "filedef.h"
#include "filename.h"
-
-#include <qdir.h>
-#include <qfile.h>
+#include "dir.h"
+#include "textstream.h"
#define DEF_DB(x)
-static inline void writeDEFString(FTextStream &t,const char *s)
+static inline void writeDEFString(TextStream &t,const QCString &s)
{
- const char* p=s;
- char c;
-
t << '\'';
- while ((c = *(p++)))
+ if (!s.isEmpty())
{
- if (c == '\'')
- t << '\\';
- t << c;
+ const char* p=s.data();
+ char c;
+
+ while ((c = *(p++)))
+ {
+ if (c == '\'') t << '\\';
+ t << c;
+ }
}
t << '\'';
}
static void generateDEFForMember(const MemberDef *md,
- FTextStream &t,
+ TextStream &t,
const Definition *def,
- const char* Prefix)
+ const QCString &prefix)
{
QCString memPrefix;
@@ -80,9 +83,9 @@ static void generateDEFForMember(const MemberDef *md,
else if (md->getNamespaceDef())
scopeName=md->getNamespaceDef()->name();
- t << " " << Prefix << "-member = {" << endl;
+ t << " " << prefix << "-member = {\n";
memPrefix = " ";
- memPrefix.append( Prefix );
+ memPrefix.append( prefix );
memPrefix.append( "-mem-" );
QCString memType;
@@ -107,27 +110,27 @@ static void generateDEFForMember(const MemberDef *md,
case MemberType_Slot: memType="slot"; isFunc=TRUE; break;
}
- t << memPrefix << "kind = '" << memType << "';" << endl;
+ t << memPrefix << "kind = '" << memType << "';\n";
t << memPrefix << "id = '"
<< md->getOutputFileBase() << "_1" << md->anchor()
- << "';" << endl;
+ << "';\n";
t << memPrefix << "virt = ";
switch (md->virtualness())
{
- case Normal: t << "normal;" << endl; break;
- case Virtual: t << "virtual;" << endl; break;
- case Pure: t << "pure-virtual;" << endl; break;
+ case Normal: t << "normal;\n"; break;
+ case Virtual: t << "virtual;\n"; break;
+ case Pure: t << "pure-virtual;\n"; break;
default: ASSERT(0);
}
t << memPrefix << "prot = ";
switch(md->protection())
{
- case Public: t << "public;" << endl; break;
- case Protected: t << "protected;" << endl; break;
- case Private: t << "private;" << endl; break;
- case Package: t << "package;" << endl; break;
+ case Public: t << "public;\n"; break;
+ case Protected: t << "protected;\n"; break;
+ case Private: t << "private;\n"; break;
+ case Package: t << "package;\n"; break;
}
if (md->memberType()!=MemberType_Define &&
@@ -135,11 +138,11 @@ static void generateDEFForMember(const MemberDef *md,
)
{
QCString typeStr = replaceAnonymousScopes(md->typeString());
- t << memPrefix << "type = <<_EnD_oF_dEf_TeXt_" << endl << typeStr << endl
- << "_EnD_oF_dEf_TeXt_;" << endl;
+ t << memPrefix << "type = <<_EnD_oF_dEf_TeXt_\n" << typeStr << "\n"
+ << "_EnD_oF_dEf_TeXt_;\n";
}
- t << memPrefix << "name = '" << md->name() << "';" << endl;
+ t << memPrefix << "name = '" << md->name() << "';\n";
if (isFunc) //function
{
@@ -156,42 +159,42 @@ static void generateDEFForMember(const MemberDef *md,
defArg = &(*defIt);
++defIt;
}
- t << memPrefix << "param = {" << endl;
+ t << memPrefix << "param = {\n";
if (!a.attrib.isEmpty())
{
t << fcnPrefix << "attributes = ";
writeDEFString(t,a.attrib);
- t << ';' << endl;
+ t << ";\n";
}
if (!a.type.isEmpty())
{
- t << fcnPrefix << "type = <<_EnD_oF_dEf_TeXt_" << endl
- << a.type << endl << "_EnD_oF_dEf_TeXt_;" << endl;
+ t << fcnPrefix << "type = <<_EnD_oF_dEf_TeXt_\n"
+ << a.type << "\n_EnD_oF_dEf_TeXt_;\n";
}
if (!a.name.isEmpty())
{
t << fcnPrefix << "declname = ";
writeDEFString(t,a.name);
- t << ';' << endl;
+ t << ";\n";
}
if (defArg && !defArg->name.isEmpty() && defArg->name!=a.name)
{
t << fcnPrefix << "defname = ";
writeDEFString(t,defArg->name);
- t << ';' << endl;
+ t << ";\n";
}
if (!a.array.isEmpty())
{
t << fcnPrefix << "array = ";
writeDEFString(t,a.array);
- t << ';' << endl;
+ t << ";\n";
}
if (!a.defval.isEmpty())
{
- t << fcnPrefix << "defval = <<_EnD_oF_dEf_TeXt_" << endl
- << a.defval << endl << "_EnD_oF_dEf_TeXt_;" << endl;
+ t << fcnPrefix << "defval = <<_EnD_oF_dEf_TeXt_\n"
+ << a.defval << "\n_EnD_oF_dEf_TeXt_;\n";
}
- t << " }; /*" << fcnPrefix << "-param */" << endl;
+ t << " }; /*" << fcnPrefix << "-param */\n";
}
}
else if ( md->memberType()==MemberType_Define
@@ -200,16 +203,16 @@ static void generateDEFForMember(const MemberDef *md,
QCString defPrefix = " " + memPrefix + "def-";
for (const Argument &a : md->argumentList())
{
- t << memPrefix << "param = {" << endl;
- t << defPrefix << "name = '" << a.type << "';" << endl;
- t << " }; /*" << defPrefix << "-param */" << endl;
+ t << memPrefix << "param = {\n";
+ t << defPrefix << "name = '" << a.type << "';\n";
+ t << " }; /*" << defPrefix << "-param */\n";
}
}
if (!md->initializer().isEmpty())
{
- t << memPrefix << "initializer = <<_EnD_oF_dEf_TeXt_" << endl
- << md->initializer() << endl << "_EnD_oF_dEf_TeXt_;" << endl;
+ t << memPrefix << "initializer = <<_EnD_oF_dEf_TeXt_\n"
+ << md->initializer() << "\n_EnD_oF_dEf_TeXt_;\n";
}
// TODO: exceptions, const volatile
if (md->memberType()==MemberType_Enumeration) // enum
@@ -223,16 +226,16 @@ static void generateDEFForMember(const MemberDef *md,
writeDEFString(t,emd->initializer());
t << ';';
}
- t << " };" << endl;
+ t << " };\n";
}
}
- t << memPrefix << "desc-file = '" << md->getDefFileName() << "';" << endl;
- t << memPrefix << "desc-line = '" << md->getDefLine() << "';" << endl;
- t << memPrefix << "briefdesc = <<_EnD_oF_dEf_TeXt_" << endl
- << md->briefDescription() << endl << "_EnD_oF_dEf_TeXt_;" << endl;
- t << memPrefix << "documentation = <<_EnD_oF_dEf_TeXt_" << endl
- << md->documentation() << endl << "_EnD_oF_dEf_TeXt_;" << endl;
+ t << memPrefix << "desc-file = '" << md->getDefFileName() << "';\n";
+ t << memPrefix << "desc-line = '" << md->getDefLine() << "';\n";
+ t << memPrefix << "briefdesc = <<_EnD_oF_dEf_TeXt_\n"
+ << md->briefDescription() << "\n_EnD_oF_dEf_TeXt_;\n";
+ t << memPrefix << "documentation = <<_EnD_oF_dEf_TeXt_\n"
+ << md->documentation() << "\n_EnD_oF_dEf_TeXt_;\n";
//printf("md->getReferencesMembers()=%p\n",md->getReferencesMembers());
@@ -242,14 +245,14 @@ static void generateDEFForMember(const MemberDef *md,
{
if (rmd->getStartBodyLine()!=-1 && rmd->getBodyDef())
{
- t << memPrefix << "referenceto = {" << endl;
+ t << memPrefix << "referenceto = {\n";
t << refPrefix << "id = '"
<< rmd->getBodyDef()->getOutputFileBase()
<< "_1" // encoded ':' character (see util.cpp:convertNameToFile)
- << rmd->anchor() << "';" << endl;
+ << rmd->anchor() << "';\n";
t << refPrefix << "line = '"
- << rmd->getStartBodyLine() << "';" << endl;
+ << rmd->getStartBodyLine() << "';\n";
QCString scope = rmd->getScopeString();
QCString name = rmd->name();
@@ -260,7 +263,7 @@ static void generateDEFForMember(const MemberDef *md,
t << refPrefix << "name = ";
writeDEFString(t,name);
- t << ';' << endl << " };" << endl;
+ t << ';' << "\n };\n";
}
}
auto refByList = md->getReferencedByMembers();
@@ -268,14 +271,14 @@ static void generateDEFForMember(const MemberDef *md,
{
if (rmd->getStartBodyLine()!=-1 && rmd->getBodyDef())
{
- t << memPrefix << "referencedby = {" << endl;
+ t << memPrefix << "referencedby = {\n";
t << refPrefix << "id = '"
<< rmd->getBodyDef()->getOutputFileBase()
<< "_1" // encoded ':' character (see util.cpp:convertNameToFile)
- << rmd->anchor() << "';" << endl;
+ << rmd->anchor() << "';\n";
t << refPrefix << "line = '"
- << rmd->getStartBodyLine() << "';" << endl;
+ << rmd->getStartBodyLine() << "';\n";
QCString scope = rmd->getScopeString();
QCString name = rmd->name();
@@ -286,33 +289,33 @@ static void generateDEFForMember(const MemberDef *md,
t << refPrefix << "name = ";
writeDEFString(t,name);
- t << ';' << endl << " };" << endl;
+ t << ';' << "\n };\n";
}
}
- t << " }; /* " << Prefix << "-member */" << endl;
+ t << " }; /* " << prefix << "-member */\n";
}
static void generateDEFClassSection(const ClassDef *cd,
- FTextStream &t,
+ TextStream &t,
const MemberList *ml,
- const char *kind)
+ const QCString &kind)
{
if (cd && ml && !ml->empty())
{
- t << " cp-section = {" << endl;
- t << " sec-kind = '" << kind << "';" << endl;
+ t << " cp-section = {\n";
+ t << " sec-kind = '" << kind << "';\n";
for (const auto &md : *ml)
{
generateDEFForMember(md,t,cd,"sec");
}
- t << " }; /* cp-section */" << endl;
+ t << " }; /* cp-section */\n";
}
}
-static void generateDEFForClass(const ClassDef *cd,FTextStream &t)
+static void generateDEFForClass(const ClassDef *cd,TextStream &t)
{
// + brief description
// + detailed description
@@ -332,22 +335,22 @@ static void generateDEFForClass(const ClassDef *cd,FTextStream &t)
if (cd->name().find('@')!=-1) return; // skip anonymous compounds.
if (cd->templateMaster()!=0) return; // skip generated template instances.
- t << cd->compoundTypeString() << " = {" << endl;
- t << " cp-id = '" << cd->getOutputFileBase() << "';" << endl;
- t << " cp-name = '" << cd->name() << "';" << endl;
+ t << cd->compoundTypeString() << " = {\n";
+ t << " cp-id = '" << cd->getOutputFileBase() << "';\n";
+ t << " cp-name = '" << cd->name() << "';\n";
for (const auto &bcd : cd->baseClasses())
{
- t << " cp-ref = {" << endl << " ref-type = base;" << endl;
+ t << " cp-ref = {\n" << " ref-type = base;\n";
t << " ref-id = '"
- << bcd.classDef->getOutputFileBase() << "';" << endl;
+ << bcd.classDef->getOutputFileBase() << "';\n";
t << " ref-prot = ";
switch (bcd.prot)
{
- case Public: t << "public;" << endl; break;
+ case Public: t << "public;\n"; break;
case Package: // package scope is not possible
- case Protected: t << "protected;" << endl; break;
- case Private: t << "private;" << endl; break;
+ case Protected: t << "protected;\n"; break;
+ case Private: t << "private;\n"; break;
}
t << " ref-virt = ";
switch(bcd.virt)
@@ -356,21 +359,21 @@ static void generateDEFForClass(const ClassDef *cd,FTextStream &t)
case Virtual: t << "virtual;"; break;
case Pure: t << "pure-virtual;"; break;
}
- t << endl << " };" << endl;
+ t << "\n };\n";
}
for (const auto &bcd : cd->subClasses())
{
- t << " cp-ref = {" << endl << " ref-type = derived;" << endl;
+ t << " cp-ref = {\n" << " ref-type = derived;\n";
t << " ref-id = '"
- << bcd.classDef->getOutputFileBase() << "';" << endl;
+ << bcd.classDef->getOutputFileBase() << "';\n";
t << " ref-prot = ";
switch (bcd.prot)
{
- case Public: t << "public;" << endl; break;
+ case Public: t << "public;\n"; break;
case Package: // packet scope is not possible!
- case Protected: t << "protected;" << endl; break;
- case Private: t << "private;" << endl; break;
+ case Protected: t << "protected;\n"; break;
+ case Private: t << "private;\n"; break;
}
t << " ref-virt = ";
switch (bcd.virt)
@@ -379,7 +382,7 @@ static void generateDEFForClass(const ClassDef *cd,FTextStream &t)
case Virtual: t << "virtual;"; break;
case Pure: t << "pure-virtual;"; break;
}
- t << endl << " };" << endl;
+ t << "\n };\n";
}
size_t numMembers = 0;
@@ -419,55 +422,55 @@ static void generateDEFForClass(const ClassDef *cd,FTextStream &t)
generateDEFClassSection(cd,t,cd->getMemberList(MemberListType_related),"related");
}
- t << " cp-filename = '" << cd->getDefFileName() << "';" << endl;
- t << " cp-fileline = '" << cd->getDefLine() << "';" << endl;
- t << " cp-briefdesc = <<_EnD_oF_dEf_TeXt_" << endl
- << cd->briefDescription() << endl << "_EnD_oF_dEf_TeXt_;" << endl;
+ t << " cp-filename = '" << cd->getDefFileName() << "';\n";
+ t << " cp-fileline = '" << cd->getDefLine() << "';\n";
+ t << " cp-briefdesc = <<_EnD_oF_dEf_TeXt_\n"
+ << cd->briefDescription() << "\n_EnD_oF_dEf_TeXt_;\n";
- t << " cp-documentation = <<_EnD_oF_dEf_TeXt_" << endl
- << cd->documentation() << endl << "_EnD_oF_dEf_TeXt_;" << endl;
+ t << " cp-documentation = <<_EnD_oF_dEf_TeXt_\n"
+ << cd->documentation() << "\n_EnD_oF_dEf_TeXt_;\n";
DotClassGraph inheritanceGraph(cd,Inheritance);
if (!inheritanceGraph.isTrivial())
{
- t << " cp-inheritancegraph = <<_EnD_oF_dEf_TeXt_" << endl;
+ t << " cp-inheritancegraph = <<_EnD_oF_dEf_TeXt_\n";
inheritanceGraph.writeDEF(t);
- t << endl << "_EnD_oF_dEf_TeXt_;" << endl;
+ t << "\n_EnD_oF_dEf_TeXt_;\n";
}
DotClassGraph collaborationGraph(cd,Collaboration);
if (!collaborationGraph.isTrivial())
{
- t << " cp-collaborationgraph = <<_EnD_oF_dEf_TeXt_" << endl;
+ t << " cp-collaborationgraph = <<_EnD_oF_dEf_TeXt_\n";
collaborationGraph.writeDEF(t);
- t << endl << "_EnD_oF_dEf_TeXt_;" << endl;
+ t << "\n_EnD_oF_dEf_TeXt_;\n";
}
- t << "}; /* " << cd->compoundTypeString() << " */" << endl;
+ t << "}; /* " << cd->compoundTypeString() << " */\n";
}
static void generateDEFSection(const Definition *d,
- FTextStream &t,
+ TextStream &t,
const MemberList *ml,
- const char *kind)
+ const QCString &kind)
{
if (ml && !ml->empty())
{
- t << " " << kind << " = {" << endl;
+ t << " " << kind << " = {\n";
for (const auto &md : *ml)
{
generateDEFForMember(md,t,d,kind);
}
- t << " };" << endl;
+ t << " };\n";
}
}
-static void generateDEFForNamespace(const NamespaceDef *nd,FTextStream &t)
+static void generateDEFForNamespace(const NamespaceDef *nd,TextStream &t)
{
if (nd->isReference()) return; // skip external references
- t << " namespace = {" << endl;
- t << " ns-id = '" << nd->getOutputFileBase() << "';" << endl;
+ t << " namespace = {\n";
+ t << " ns-id = '" << nd->getOutputFileBase() << "';\n";
t << " ns-name = ";
writeDEFString(t,nd->name());
- t << ';' << endl;
+ t << ";\n";
generateDEFSection(nd,t,nd->getMemberList(MemberListType_decDefineMembers),"define");
generateDEFSection(nd,t,nd->getMemberList(MemberListType_decProtoMembers),"prototype");
@@ -478,25 +481,25 @@ static void generateDEFForNamespace(const NamespaceDef *nd,FTextStream &t)
generateDEFSection(nd,t,nd->getMemberList(MemberListType_decFuncMembers),"func");
generateDEFSection(nd,t,nd->getMemberList(MemberListType_decVarMembers),"var");
- t << " ns-filename = '" << nd->getDefFileName() << "';" << endl;
- t << " ns-fileline = '" << nd->getDefLine() << "';" << endl;
- t << " ns-briefdesc = <<_EnD_oF_dEf_TeXt_" << endl
- << nd->briefDescription() << endl << "_EnD_oF_dEf_TeXt_;" << endl;
+ t << " ns-filename = '" << nd->getDefFileName() << "';\n";
+ t << " ns-fileline = '" << nd->getDefLine() << "';\n";
+ t << " ns-briefdesc = <<_EnD_oF_dEf_TeXt_\n"
+ << nd->briefDescription() << "\n_EnD_oF_dEf_TeXt_;\n";
- t << " ns-documentation = <<_EnD_oF_dEf_TeXt_" << endl
- << nd->documentation() << endl << "_EnD_oF_dEf_TeXt_;" << endl;
- t << " };" << endl;
+ t << " ns-documentation = <<_EnD_oF_dEf_TeXt_\n"
+ << nd->documentation() << "\n_EnD_oF_dEf_TeXt_;\n";
+ t << " };\n";
}
-static void generateDEFForFile(const FileDef *fd,FTextStream &t)
+static void generateDEFForFile(const FileDef *fd,TextStream &t)
{
if (fd->isReference()) return; // skip external references
- t << "file = {" << endl;
- t << " file-id = '" << fd->getOutputFileBase() << "';" << endl;
+ t << "file = {\n";
+ t << " file-id = '" << fd->getOutputFileBase() << "';\n";
t << " file-name = ";
writeDEFString(t,fd->name());
- t << ';' << endl;
+ t << ";\n";
generateDEFSection(fd,t,fd->getMemberList(MemberListType_decDefineMembers),"define");
generateDEFSection(fd,t,fd->getMemberList(MemberListType_decProtoMembers),"prototype");
@@ -507,73 +510,38 @@ static void generateDEFForFile(const FileDef *fd,FTextStream &t)
generateDEFSection(fd,t,fd->getMemberList(MemberListType_decFuncMembers),"func");
generateDEFSection(fd,t,fd->getMemberList(MemberListType_decVarMembers),"var");
- t << " file-full-name = '" << fd->getDefFileName() << "';" << endl;
- t << " file-first-line = '" << fd->getDefLine() << "';" << endl;
+ t << " file-full-name = '" << fd->getDefFileName() << "';\n";
+ t << " file-first-line = '" << fd->getDefLine() << "';\n";
- t << " file-briefdesc = <<_EnD_oF_dEf_TeXt_" << endl
- << fd->briefDescription() << endl << "_EnD_oF_dEf_TeXt_;" << endl;
+ t << " file-briefdesc = <<_EnD_oF_dEf_TeXt_\n"
+ << fd->briefDescription() << "\n_EnD_oF_dEf_TeXt_;\n";
- t << " file-documentation = <<_EnD_oF_dEf_TeXt_" << endl
- << fd->documentation() << endl << "_EnD_oF_dEf_TeXt_;" << endl;
+ t << " file-documentation = <<_EnD_oF_dEf_TeXt_\n"
+ << fd->documentation() << "\n_EnD_oF_dEf_TeXt_;\n";
- t << "}; /* file */" << endl;
+ t << "}; /* file */\n";
}
void generateDEF()
{
- QCString outputDirectory = Config_getString(OUTPUT_DIRECTORY);
- if (outputDirectory.isEmpty())
- {
- outputDirectory=QDir::currentDirPath().utf8();
- }
- else
- {
- QDir dir(outputDirectory);
- if (!dir.exists())
- {
- dir.setPath(QDir::currentDirPath());
- if (!dir.mkdir(outputDirectory))
- {
- term("tag OUTPUT_DIRECTORY: Output directory '%s' does not "
- "exist and cannot be created\n",outputDirectory.data());
- }
- else
- {
- msg("Notice: Output directory '%s' does not exist. "
- "I have created it for you.\n", outputDirectory.data());
- }
- dir.cd(outputDirectory);
- }
- outputDirectory=dir.absPath().utf8();
- }
-
- QDir dir(outputDirectory);
- if (!dir.exists())
- {
- dir.setPath(QDir::currentDirPath());
- if (!dir.mkdir(outputDirectory))
- {
- err("Cannot create directory %s\n",outputDirectory.data());
- return;
- }
- }
- QDir defDir(outputDirectory+"/def");
- if (!defDir.exists() && !defDir.mkdir(outputDirectory+"/def"))
+ QCString outputDirectory = Config_getString(OUTPUT_DIRECTORY)+"/def";
+ Dir defDir(outputDirectory.str());
+ if (!defDir.exists() && !defDir.mkdir(outputDirectory.str()))
{
- err("Could not create def directory in %s\n",outputDirectory.data());
+ err("Could not create def directory in %s\n",qPrint(outputDirectory));
return;
}
- QCString fileName=outputDirectory+"/def/doxygen.def";
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
+ QCString fileName=outputDirectory+"/doxygen.def";
+ std::ofstream f(fileName.str(),std::ostream::out | std::ostream::binary);
+ if (!f.is_open())
{
- err("Cannot open file %s for writing!\n",fileName.data());
+ err("Cannot open file %s for writing!\n",qPrint(fileName));
return;
}
- FTextStream t(&f);
- t << "AutoGen Definitions dummy;" << endl;
+ TextStream t(&f);
+ t << "AutoGen Definitions dummy;\n";
if (Doxygen::classLinkedMap->size()+
Doxygen::inputNameLinkedMap->size()+
@@ -597,6 +565,6 @@ void generateDEF()
}
else
{
- t << "dummy_value = true;" << endl;
+ t << "dummy_value = true;\n";
}
}
diff --git a/src/define.h b/src/define.h
index 23da59d..6cbb636 100644
--- a/src/define.h
+++ b/src/define.h
@@ -21,7 +21,7 @@
#include <string>
#include <unordered_map>
-#include <qcstring.h>
+#include "qcstring.h"
#include "containers.h"
class FileDef;
diff --git a/src/definition.cpp b/src/definition.cpp
index 70c1839..e9f479c 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -1,8 +1,6 @@
/******************************************************************************
*
- *
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2021 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
@@ -49,7 +47,7 @@
#include "pagedef.h"
#include "bufstr.h"
#include "reflist.h"
-
+#include "utf8.h"
//-----------------------------------------------------------------------------------------
@@ -58,7 +56,7 @@ class DefinitionImpl::IMPL
{
public:
~IMPL();
- void init(const char *df, const char *n);
+ void init(const QCString &df, const QCString &n);
void setDefFileName(const QCString &df);
Definition *def = 0;
@@ -123,7 +121,7 @@ void DefinitionImpl::IMPL::setDefFileName(const QCString &df)
}
}
-void DefinitionImpl::IMPL::init(const char *df, const char *n)
+void DefinitionImpl::IMPL::init(const QCString &df, const QCString &n)
{
setDefFileName(df);
QCString lname = n;
@@ -136,7 +134,7 @@ void DefinitionImpl::IMPL::init(const char *df, const char *n)
{
localName=n;
}
- //printf("m_localName=%s\n",m_localName.data());
+ //printf("m_localName=%s\n",qPrint(m_localName));
brief = 0;
details = 0;
@@ -160,11 +158,11 @@ void DefinitionImpl::setDefFile(const QCString &df,int defLine,int defCol)
//-----------------------------------------------------------------------------------------
-static bool matchExcludedSymbols(const char *name)
+static bool matchExcludedSymbols(const QCString &name)
{
const StringVector &exclSyms = Config_getList(EXCLUDE_SYMBOLS);
if (exclSyms.empty()) return FALSE; // nothing specified
- std::string symName = name;
+ std::string symName = name.str();
for (const auto &pat : exclSyms)
{
QCString pattern = pat.c_str();
@@ -187,14 +185,14 @@ static bool matchExcludedSymbols(const char *name)
(ui+pl==sl || pattern.at(pattern.length()-1)=='*' || (!isId(symName.at(ui+pl)) && !forceEnd))
)
{
- //printf("--> name=%s pattern=%s match at %d\n",symName.data(),pattern.data(),i);
+ //printf("--> name=%s pattern=%s match at %d\n",qPrint(symName),qPrint(pattern),i);
return TRUE;
}
}
}
else if (!pattern.isEmpty()) // match words
{
- size_t i = symName.find(pattern);
+ size_t i = symName.find(pattern.str());
if (i!=std::string::npos) // we have a match!
{
size_t ui=i;
@@ -205,7 +203,7 @@ static bool matchExcludedSymbols(const char *name)
(ui+pl==sl || (!isId(symName.at(ui+pl)) && !forceEnd))
)
{
- //printf("--> name=%s pattern=%s match at %d\n",symName.data(),pattern.data(),i);
+ //printf("--> name=%s pattern=%s match at %d\n",qPrint(symName),qPrint(pattern),i);
return TRUE;
}
}
@@ -215,7 +213,7 @@ static bool matchExcludedSymbols(const char *name)
return FALSE;
}
-static void addToMap(const char *name,Definition *d)
+static void addToMap(const QCString &name,Definition *d)
{
bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
QCString symbolName = name;
@@ -229,14 +227,14 @@ static void addToMap(const char *name,Definition *d)
}
}
-static void removeFromMap(const char *name,Definition *d)
+static void removeFromMap(const QCString &name,Definition *d)
{
Doxygen::symbolMap.remove(name,d);
}
DefinitionImpl::DefinitionImpl(Definition *def,
- const char *df,int dl,int dc,
- const char *name,const char *b,
+ const QCString &df,int dl,int dc,
+ const QCString &name,const char *b,
const char *d,bool isSymbol)
{
m_impl = new DefinitionImpl::IMPL;
@@ -293,23 +291,23 @@ DefinitionImpl::~DefinitionImpl()
m_impl=0;
}
-void DefinitionImpl::setName(const char *name)
+void DefinitionImpl::setName(const QCString &name)
{
- if (name==0) return;
+ if (name.isEmpty()) return;
m_impl->name = name;
m_impl->isAnonymous = m_impl->name.isEmpty() ||
m_impl->name.at(0)=='@' ||
m_impl->name.find("::@")!=-1;
}
-void DefinitionImpl::setId(const char *id)
+void DefinitionImpl::setId(const QCString &id)
{
- if (id==0) return;
+ if (id.isEmpty()) return;
m_impl->id = id;
if (Doxygen::clangUsrMap)
{
- //printf("DefinitionImpl::setId '%s'->'%s'\n",id,m_impl->name.data());
- Doxygen::clangUsrMap->insert(std::make_pair(id,m_impl->def));
+ //printf("DefinitionImpl::setId '%s'->'%s'\n",id,qPrint(m_impl->name));
+ Doxygen::clangUsrMap->insert(std::make_pair(id.str(),m_impl->def));
}
}
@@ -320,14 +318,14 @@ QCString DefinitionImpl::id() const
void DefinitionImpl::addSectionsToDefinition(const std::vector<const SectionInfo*> &anchorList)
{
- //printf("%s: addSectionsToDefinition(%d)\n",name().data(),anchorList->count());
+ //printf("%s: addSectionsToDefinition(%d)\n",qPrint(name()),anchorList->count());
for (const SectionInfo *si : anchorList)
{
//printf("Add section '%s' to definition '%s'\n",
- // si->label().data(),name().data());
+ // qPrint(si->label()),qPrint(name()));
SectionManager &sm = SectionManager::instance();
SectionInfo *gsi=sm.find(si->label());
- //printf("===== label=%s gsi=%p\n",si->label.data(),gsi);
+ //printf("===== label=%s gsi=%p\n",qPrint(si->label),gsi);
if (gsi==0)
{
gsi = sm.add(*si);
@@ -342,7 +340,7 @@ void DefinitionImpl::addSectionsToDefinition(const std::vector<const SectionInfo
bool DefinitionImpl::hasSections() const
{
- //printf("DefinitionImpl::hasSections(%s) #sections=%d\n",name().data(),
+ //printf("DefinitionImpl::hasSections(%s) #sections=%d\n",qPrint(name()),
// m_impl->sectionRefs.size());
if (m_impl->sectionRefs.empty()) return FALSE;
for (const SectionInfo *si : m_impl->sectionRefs)
@@ -366,7 +364,7 @@ void DefinitionImpl::addSectionsToIndex()
SectionType type = si->type();
if (isSection(type))
{
- //printf(" level=%d title=%s\n",level,si->title.data());
+ //printf(" level=%d title=%s\n",level,qPrint(si->title));
int nextLevel = (int)type;
int i;
if (nextLevel>level)
@@ -405,11 +403,11 @@ void DefinitionImpl::addSectionsToIndex()
}
}
-void DefinitionImpl::writeDocAnchorsToTagFile(FTextStream &tagFile) const
+void DefinitionImpl::writeDocAnchorsToTagFile(TextStream &tagFile) const
{
if (!m_impl->sectionRefs.empty())
{
- //printf("%s: writeDocAnchorsToTagFile(%d)\n",name().data(),m_impl->sectionRef.size());
+ //printf("%s: writeDocAnchorsToTagFile(%d)\n",qPrint(name()),m_impl->sectionRef.size());
for (const SectionInfo *si : m_impl->sectionRefs)
{
if (!si->generated() && si->ref().isEmpty() && !si->label().startsWith("autotoc_md"))
@@ -421,7 +419,7 @@ void DefinitionImpl::writeDocAnchorsToTagFile(FTextStream &tagFile) const
{
tagFile << " title=\"" << convertToXML(si->title()) << "\"";
}
- tagFile << ">" << si->label() << "</docanchor>" << endl;
+ tagFile << ">" << si->label() << "</docanchor>\n";
}
}
}
@@ -437,7 +435,7 @@ bool DefinitionImpl::_docsAlreadyAdded(const QCString &doc,QCString &sigList)
MD5Buffer((const unsigned char *)docStr.data(),docStr.length(),md5_sig);
MD5SigToString(md5_sig,sigStr.rawData(),33);
//printf("%s:_docsAlreadyAdded doc='%s' sig='%s' docSigs='%s'\n",
- // name().data(),doc.data(),sigStr.data(),sigList.data());
+ // qPrint(name()),qPrint(doc),qPrint(sigStr),qPrint(sigList));
if (sigList.find(sigStr)==-1) // new docs, add signature to prevent re-adding it
{
sigList+=":"+sigStr;
@@ -449,11 +447,11 @@ bool DefinitionImpl::_docsAlreadyAdded(const QCString &doc,QCString &sigList)
}
}
-void DefinitionImpl::_setDocumentation(const char *d,const char *docFile,int docLine,
+void DefinitionImpl::_setDocumentation(const QCString &d,const QCString &docFile,int docLine,
bool stripWhiteSpace,bool atTop)
{
- //printf("%s::setDocumentation(%s,%s,%d,%d)\n",name().data(),d,docFile,docLine,stripWhiteSpace);
- if (d==0) return;
+ //printf("%s::setDocumentation(%s,%s,%d,%d)\n",qPrint(name()),d,docFile,docLine,stripWhiteSpace);
+ if (d.isEmpty()) return;
QCString doc = d;
if (stripWhiteSpace)
{
@@ -465,7 +463,7 @@ void DefinitionImpl::_setDocumentation(const char *d,const char *docFile,int doc
}
if (!_docsAlreadyAdded(doc,m_impl->docSignatures))
{
- //printf("setting docs for %s: '%s'\n",name().data(),m_doc.data());
+ //printf("setting docs for %s: '%s'\n",qPrint(name()),qPrint(m_doc));
if (m_impl->details==0)
{
m_impl->details = new DocInfo;
@@ -495,27 +493,13 @@ void DefinitionImpl::_setDocumentation(const char *d,const char *docFile,int doc
}
}
-void DefinitionImpl::setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace)
+void DefinitionImpl::setDocumentation(const QCString &d,const QCString &docFile,int docLine,bool stripWhiteSpace)
{
- if (d==0) return;
+ if (d.isEmpty()) return;
_setDocumentation(d,docFile,docLine,stripWhiteSpace,FALSE);
}
-#define uni_isupper(c) (QChar(c).category()==QChar::Letter_Uppercase)
-
-// do a UTF-8 aware search for the last real character and return TRUE
-// if that is a multibyte one.
-static bool lastCharIsMultibyte(const QCString &s)
-{
- uint l = s.length();
- int p = 0;
- int pp = -1;
- while ((p=nextUtf8CharPosition(s,l,(uint)p))<(int)l) pp=p;
- if (pp==-1 || ((uchar)s[pp])<0x80) return FALSE;
- return TRUE;
-}
-
-void DefinitionImpl::_setBriefDescription(const char *b,const char *briefFile,int briefLine)
+void DefinitionImpl::_setBriefDescription(const QCString &b,const QCString &briefFile,int briefLine)
{
static QCString outputLanguage = Config_getEnum(OUTPUT_LANGUAGE);
static bool needsDot = outputLanguage!="Japanese" &&
@@ -534,7 +518,7 @@ void DefinitionImpl::_setBriefDescription(const char *b,const char *briefFile,in
{
case '.': case '!': case '?': case '>': case ':': case ')': break;
default:
- if (uni_isupper(brief.at(0)) && !lastCharIsMultibyte(brief)) brief+='.';
+ if (isUTF8CharUpperCase(brief.str(),0) && !lastUTF8CharIsMultibyte(brief.str())) brief+='.';
break;
}
}
@@ -572,13 +556,13 @@ void DefinitionImpl::_setBriefDescription(const char *b,const char *briefFile,in
}
}
-void DefinitionImpl::setBriefDescription(const char *b,const char *briefFile,int briefLine)
+void DefinitionImpl::setBriefDescription(const QCString &b,const QCString &briefFile,int briefLine)
{
- if (b==0) return;
+ if (b.isEmpty()) return;
_setBriefDescription(b,briefFile,briefLine);
}
-void DefinitionImpl::_setInbodyDocumentation(const char *doc,const char *inbodyFile,int inbodyLine)
+void DefinitionImpl::_setInbodyDocumentation(const QCString &doc,const QCString &inbodyFile,int inbodyLine)
{
if (m_impl->inbodyDocs==0)
{
@@ -596,9 +580,9 @@ void DefinitionImpl::_setInbodyDocumentation(const char *doc,const char *inbodyF
}
}
-void DefinitionImpl::setInbodyDocumentation(const char *d,const char *inbodyFile,int inbodyLine)
+void DefinitionImpl::setInbodyDocumentation(const QCString &d,const QCString &inbodyFile,int inbodyLine)
{
- if (d==0) return;
+ if (d.isEmpty()) return;
_setInbodyDocumentation(d,inbodyFile,inbodyLine);
}
@@ -745,7 +729,7 @@ static FilterCache g_filterCache;
* The line actually containing the bracket is returned via endLine.
* Note that for VHDL code the bracket search is not done.
*/
-bool readCodeFragment(const char *fileName,
+bool readCodeFragment(const QCString &fileName,
int &startLine,int &endLine,QCString &result)
{
//printf("readCodeFragment(%s,startLine=%d,endLine=%d)\n",fileName,startLine,endLine);
@@ -881,7 +865,7 @@ bool readCodeFragment(const char *fileName,
}
result = transcodeCharacterStringToUTF8(result);
if (!result.isEmpty() && result.at(result.length()-1)!='\n') result += "\n";
- //printf("readCodeFragment(%d-%d)=%s\n",startLine,endLine,result.data());
+ //printf("readCodeFragment(%d-%d)=%s\n",startLine,endLine,qPrint(result));
return found;
}
@@ -918,7 +902,7 @@ QCString DefinitionImpl::getSourceAnchor() const
}
/*! Write a reference to the source code defining this definition */
-void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) const
+void DefinitionImpl::writeSourceDef(OutputList &ol,const QCString &) const
{
static bool latexSourceCode = Config_getBool(LATEX_SOURCE_CODE);
static bool rtfSourceCode = Config_getBool(RTF_SOURCE_CODE);
@@ -956,7 +940,7 @@ void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) const
ol.disable(OutputGenerator::RTF);
}
// write line link (HTML and optionally LaTeX, Docbook, RTF)
- ol.writeObjectLink(0,fn,anchorStr,lineStr);
+ ol.writeObjectLink(QCString(),fn,anchorStr,lineStr);
ol.enableAll();
ol.disable(OutputGenerator::Html);
if (latexSourceCode)
@@ -994,7 +978,7 @@ void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) const
ol.disable(OutputGenerator::RTF);
}
// write file link (HTML, LaTeX optionally, RTF optionally)
- ol.writeObjectLink(0,fn,0,m_impl->body->fileDef->name());
+ ol.writeObjectLink(QCString(),fn,QCString(),m_impl->body->fileDef->name());
ol.enableAll();
ol.disable(OutputGenerator::Html);
if (latexSourceCode)
@@ -1035,7 +1019,7 @@ void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) const
ol.disable(OutputGenerator::RTF);
}
// write file link (HTML only)
- ol.writeObjectLink(0,fn,0,m_impl->body->fileDef->name());
+ ol.writeObjectLink(QCString(),fn,QCString(),m_impl->body->fileDef->name());
ol.enableAll();
ol.disable(OutputGenerator::Html);
if (latexSourceCode)
@@ -1074,7 +1058,7 @@ void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) const
ol.enable(OutputGenerator::RTF);
}
// write line link (HTML only)
- ol.writeObjectLink(0,fn,anchorStr,lineStr);
+ ol.writeObjectLink(QCString(),fn,anchorStr,lineStr);
ol.enableAll();
ol.disable(OutputGenerator::Html);
if (latexSourceCode)
@@ -1108,7 +1092,7 @@ void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) const
void DefinitionImpl::setBodySegment(int defLine, int bls,int ble)
{
- //printf("setBodySegment(%d,%d) for %s\n",bls,ble,name().data());
+ //printf("setBodySegment(%d,%d) for %s\n",bls,ble,qPrint(name()));
if (m_impl->body==0) m_impl->body = new BodyInfo;
m_impl->body->defLine = defLine;
m_impl->body->startLine = bls;
@@ -1129,11 +1113,11 @@ bool DefinitionImpl::hasSources() const
}
/*! Write code of this definition into the documentation */
-void DefinitionImpl::writeInlineCode(OutputList &ol,const char *scopeName) const
+void DefinitionImpl::writeInlineCode(OutputList &ol,const QCString &scopeName) const
{
static bool inlineSources = Config_getBool(INLINE_SOURCES);
ol.pushGeneratorState();
- //printf("Source Fragment %s: %d-%d bodyDef=%p\n",name().data(),
+ //printf("Source Fragment %s: %d-%d bodyDef=%p\n",qPrint(name()),
// m_startBodyLine,m_endBodyLine,m_bodyDef);
if (inlineSources && hasSources())
{
@@ -1144,10 +1128,10 @@ void DefinitionImpl::writeInlineCode(OutputList &ol,const char *scopeName) const
)
{
//printf("Adding code fragment '%s' ext='%s'\n",
- // codeFragment.data(),m_impl->defFileExt.data());
+ // qPrint(codeFragment),qPrint(m_impl->defFileExt));
auto intf = Doxygen::parserManager->getCodeParser(m_impl->defFileExt);
intf->resetCodeParserState();
- //printf("Read:\n'%s'\n\n",codeFragment.data());
+ //printf("Read:\n'%s'\n\n",qPrint(codeFragment));
const MemberDef *thisMd = 0;
if (m_impl->def->definitionType()==Definition::TypeMember)
{
@@ -1160,7 +1144,7 @@ void DefinitionImpl::writeInlineCode(OutputList &ol,const char *scopeName) const
codeFragment, // input
m_impl->lang, // lang
FALSE, // isExample
- 0, // exampleName
+ QCString(), // exampleName
m_impl->body->fileDef, // fileDef
actualStart, // startLine
actualEnd, // endLine
@@ -1192,7 +1176,7 @@ static inline std::vector<const MemberDef*> refMapToVector(const std::unordered_
/*! Write a reference to the source code fragments in which this
* definition is used.
*/
-void DefinitionImpl::_writeSourceRefList(OutputList &ol,const char *scopeName,
+void DefinitionImpl::_writeSourceRefList(OutputList &ol,const QCString &scopeName,
const QCString &text,const std::unordered_map<std::string,const MemberDef *> &membersMap,
bool /*funcOnly*/) const
{
@@ -1213,7 +1197,7 @@ void DefinitionImpl::_writeSourceRefList(OutputList &ol,const char *scopeName,
{
QCString scope=md->getScopeString();
QCString name=md->name();
- //printf("class=%p scope=%s scopeName=%s\n",md->getClassDef(),scope.data(),scopeName);
+ //printf("class=%p scope=%s scopeName=%s\n",md->getClassDef(),qPrint(scope),scopeName);
if (!scope.isEmpty() && scope!=scopeName)
{
name.prepend(scope+getLanguageSpecificSeparator(m_impl->lang));
@@ -1255,8 +1239,8 @@ void DefinitionImpl::_writeSourceRefList(OutputList &ol,const char *scopeName,
const int maxLineNrStr = 10;
char anchorStr[maxLineNrStr];
qsnprintf(anchorStr,maxLineNrStr,"l%05d",md->getStartBodyLine());
- //printf("Write object link to %s\n",md->getBodyDef()->getSourceFileBase().data());
- ol.writeObjectLink(0,md->getBodyDef()->getSourceFileBase(),anchorStr,name);
+ //printf("Write object link to %s\n",qPrint(md->getBodyDef()->getSourceFileBase()));
+ ol.writeObjectLink(QCString(),md->getBodyDef()->getSourceFileBase(),anchorStr,name);
ol.popGeneratorState();
// for the other output formats just mention the name
@@ -1340,12 +1324,12 @@ void DefinitionImpl::_writeSourceRefList(OutputList &ol,const char *scopeName,
ol.popGeneratorState();
}
-void DefinitionImpl::writeSourceReffedBy(OutputList &ol,const char *scopeName) const
+void DefinitionImpl::writeSourceReffedBy(OutputList &ol,const QCString &scopeName) const
{
_writeSourceRefList(ol,scopeName,theTranslator->trReferencedBy(),m_impl->sourceRefByDict,FALSE);
}
-void DefinitionImpl::writeSourceRefs(OutputList &ol,const char *scopeName) const
+void DefinitionImpl::writeSourceRefs(OutputList &ol,const QCString &scopeName) const
{
_writeSourceRefList(ol,scopeName,theTranslator->trReferences(),m_impl->sourceRefsDict,TRUE);
}
@@ -1407,7 +1391,7 @@ void DefinitionImpl::addSourceReferences(const MemberDef *md)
}
}
-const Definition *DefinitionImpl::findInnerCompound(const char *) const
+const Definition *DefinitionImpl::findInnerCompound(const QCString &) const
{
return 0;
}
@@ -1427,7 +1411,7 @@ QCString DefinitionImpl::qualifiedName() const
return m_impl->qualifiedName;
}
- //printf("start %s::qualifiedName() localName=%s\n",name().data(),m_impl->localName.data());
+ //printf("start %s::qualifiedName() localName=%s\n",qPrint(name()),qPrint(m_impl->localName));
if (m_impl->outerScope==0)
{
if (m_impl->localName=="<globalScope>")
@@ -1452,14 +1436,14 @@ QCString DefinitionImpl::qualifiedName() const
getLanguageSpecificSeparator(getLanguage())+
m_impl->localName;
}
- //printf("end %s::qualifiedName()=%s\n",name().data(),m_impl->qualifiedName.data());
+ //printf("end %s::qualifiedName()=%s\n",qPrint(name()),qPrint(m_impl->qualifiedName));
//count--;
return m_impl->qualifiedName;
}
void DefinitionImpl::setOuterScope(Definition *d)
{
- //printf("%s::setOuterScope(%s)\n",name().data(),d?d->name().data():"<none>");
+ //printf("%s::setOuterScope(%s)\n",qPrint(name()),d?qPrint(d->name()):"<none>");
Definition *p = m_impl->outerScope;
bool found=false;
// make sure that we are not creating a recursive scope relation.
@@ -1505,7 +1489,7 @@ void DefinitionImpl::mergeRefItems(Definition *d)
[](RefItem *left,RefItem *right)
{ return left->id() <right->id() ||
(left->id()==right->id() &&
- qstrcmp(left->list()->listName(),right->list()->listName())<0);
+ left->list()->listName() < right->list()->listName());
});
// filter out duplicates
@@ -1517,7 +1501,7 @@ void DefinitionImpl::mergeRefItems(Definition *d)
m_impl->xrefListItems.erase(last, m_impl->xrefListItems.end());
}
-int DefinitionImpl::_getXRefListId(const char *listName) const
+int DefinitionImpl::_getXRefListId(const QCString &listName) const
{
for (const RefItem *item : m_impl->xrefListItems)
{
@@ -1545,14 +1529,14 @@ QCString DefinitionImpl::pathFragment() const
{
if (!result.isEmpty()) result+="/";
if (m_impl->def->definitionType()==Definition::TypeGroup &&
- (toGroupDef(m_impl->def))->groupTitle())
+ !toGroupDef(m_impl->def)->groupTitle().isEmpty())
{
- result+=(toGroupDef(m_impl->def))->groupTitle();
+ result+=toGroupDef(m_impl->def)->groupTitle();
}
else if (m_impl->def->definitionType()==Definition::TypePage &&
- (toPageDef(m_impl->def))->hasTitle())
+ toPageDef(m_impl->def)->hasTitle())
{
- result+=(toPageDef(m_impl->def))->title();
+ result+=toPageDef(m_impl->def)->title();
}
else
{
@@ -1581,19 +1565,22 @@ QCString DefinitionImpl::navigationPathAsString() const
{
result+=outerScope->navigationPathAsString();
}
- else if (m_impl->def->definitionType()==Definition::TypeFile && (toFileDef(m_impl->def))->getDirDef())
+ else if (m_impl->def->definitionType()==Definition::TypeFile &&
+ toFileDef(m_impl->def)->getDirDef())
{
result+=(toFileDef(m_impl->def))->getDirDef()->navigationPathAsString();
}
result+="<li class=\"navelem\">";
if (m_impl->def->isLinkable())
{
- if (m_impl->def->definitionType()==Definition::TypeGroup && (toGroupDef(m_impl->def))->groupTitle())
+ if (m_impl->def->definitionType()==Definition::TypeGroup &&
+ !toGroupDef(m_impl->def)->groupTitle().isEmpty())
{
result+="<a class=\"el\" href=\"$relpath^"+m_impl->def->getOutputFileBase()+Doxygen::htmlFileExtension+"\">"+
- convertToHtml((toGroupDef(m_impl->def))->groupTitle())+"</a>";
+ convertToHtml(toGroupDef(m_impl->def)->groupTitle())+"</a>";
}
- else if (m_impl->def->definitionType()==Definition::TypePage && (toPageDef(m_impl->def))->hasTitle())
+ else if (m_impl->def->definitionType()==Definition::TypePage &&
+ toPageDef(m_impl->def)->hasTitle())
{
result+="<a class=\"el\" href=\"$relpath^"+m_impl->def->getOutputFileBase()+Doxygen::htmlFileExtension+"\">"+
convertToHtml((toPageDef(m_impl->def))->title())+"</a>";
@@ -1663,7 +1650,7 @@ void DefinitionImpl::writeToc(OutputList &ol, const LocalToc &localToc) const
SectionType type = si->type();
if (isSection(type))
{
- //printf(" level=%d title=%s\n",level,si->title.data());
+ //printf(" level=%d title=%s\n",level,qPrint(si->title));
int nextLevel = (int)type;
if (nextLevel>level)
{
@@ -1729,7 +1716,7 @@ void DefinitionImpl::writeToc(OutputList &ol, const LocalToc &localToc) const
SectionType type = si->type();
if (isSection(type))
{
- //printf(" level=%d title=%s\n",level,si->title.data());
+ //printf(" level=%d title=%s\n",level,qPrint(si->title));
int nextLevel = (int)type;
if (nextLevel>level)
{
@@ -1826,7 +1813,7 @@ static bool stripWord(QCString &s,QCString w)
//----------------------------------------------------------------------------
// some quasi intelligent brief description abbreviator :^)
-QCString abbreviate(const char *s,const char *name)
+static QCString abbreviate(const QCString &s,const QCString &name)
{
QCString scopelessName=name;
int i=scopelessName.findRev("::");
@@ -1861,7 +1848,7 @@ QCString abbreviate(const char *s,const char *name)
QCString DefinitionImpl::briefDescription(bool abbr) const
{
- //printf("%s::briefDescription(%d)='%s'\n",name().data(),abbr,m_impl->brief?m_impl->brief->doc.data():"<none>");
+ //printf("%s::briefDescription(%d)='%s'\n",qPrint(name()),abbr,m_impl->brief?qPrint(m_impl->brief->doc):"<none>");
return m_impl->brief ?
(abbr ? abbreviate(m_impl->brief->doc,m_impl->def->displayName()) : m_impl->brief->doc) :
QCString("");
@@ -2035,7 +2022,7 @@ void DefinitionImpl::mergeReferencedBy(const Definition *other)
}
-void DefinitionImpl::setReference(const char *r)
+void DefinitionImpl::setReference(const QCString &r)
{
m_impl->ref=r;
}
@@ -2055,7 +2042,7 @@ void DefinitionImpl::setArtificial(bool b)
m_impl->isArtificial = b;
}
-void DefinitionImpl::setLocalName(const QCString name)
+void DefinitionImpl::setLocalName(const QCString &name)
{
m_impl->localName=name;
}
@@ -2090,7 +2077,7 @@ QCString DefinitionImpl::externalReference(const QCString &relPath) const
auto it = Doxygen::tagDestinationMap.find(ref.str());
if (it!=Doxygen::tagDestinationMap.end())
{
- QCString result = it->second;
+ QCString result(it->second);
uint l = result.length();
if (!relPath.isEmpty() && l>0 && result.at(0)=='.')
{ // relative path -> prepend relPath.
@@ -2167,7 +2154,7 @@ void DefinitionAliasImpl::deinit()
QCString DefinitionAliasImpl::qualifiedName() const
{
- //printf("start %s::qualifiedName() localName=%s\n",name().data(),m_impl->localName.data());
+ //printf("start %s::qualifiedName() localName=%s\n",qPrint(name()),qPrint(m_impl->localName));
if (m_scope==0)
{
return m_def->localName();
diff --git a/src/definition.h b/src/definition.h
index 4c0c566..6a1edfa 100644
--- a/src/definition.h
+++ b/src/definition.h
@@ -39,7 +39,7 @@ class SectionInfo;
class Definition;
class DefinitionMutable;
class DefinitionImpl;
-class FTextStream;
+class TextStream;
/** Data associated with a detailed description. */
struct DocInfo
@@ -90,7 +90,8 @@ class Definition
TypeGroup = 4,
TypePackage = 5,
TypePage = 6,
- TypeDir = 7
+ TypeDir = 7,
+ TypeConcept = 8
};
@@ -263,7 +264,7 @@ class Definition
virtual const RefItemVector &xrefListItems() const = 0;
- virtual const Definition *findInnerCompound(const char *name) const = 0;
+ virtual const Definition *findInnerCompound(const QCString &name) const = 0;
virtual Definition *getOuterScope() const = 0;
virtual std::vector<const MemberDef *> getReferencesMembers() const = 0;
@@ -316,30 +317,30 @@ class DefinitionMutable
//-----------------------------------------------------------------------------------
/*! Sets a new \a name for the definition */
- virtual void setName(const char *name) = 0;
+ virtual void setName(const QCString &name) = 0;
/*! Sets a unique id for the symbol. Used for libclang integration. */
- virtual void setId(const char *name) = 0;
+ virtual void setId(const QCString &name) = 0;
/*! Set a new file name and position */
virtual void setDefFile(const QCString& df,int defLine,int defColumn) = 0;
/*! Sets the documentation of this definition to \a d. */
- virtual void setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace=TRUE) = 0;
+ virtual void setDocumentation(const QCString &d,const QCString &docFile,int docLine,bool stripWhiteSpace=TRUE) = 0;
/*! Sets the brief description of this definition to \a b.
* A dot is added to the sentence if not available.
*/
- virtual void setBriefDescription(const char *b,const char *briefFile,int briefLine) = 0;
+ virtual void setBriefDescription(const QCString &b,const QCString &briefFile,int briefLine) = 0;
/*! Set the documentation that was found inside the body of an item.
* If there was already some documentation set, the new documentation
* will be appended.
*/
- virtual void setInbodyDocumentation(const char *d,const char *docFile,int docLine) = 0;
+ virtual void setInbodyDocumentation(const QCString &d,const QCString &docFile,int docLine) = 0;
/*! Sets the tag file id via which this definition was imported. */
- virtual void setReference(const char *r) = 0;
+ virtual void setReference(const QCString &r) = 0;
// source references
virtual void setBodySegment(int defLine, int bls,int ble) = 0;
@@ -352,7 +353,7 @@ class DefinitionMutable
virtual void setArtificial(bool b) = 0;
virtual void setLanguage(SrcLangExt lang) = 0;
- virtual void setLocalName(const QCString name) = 0;
+ virtual void setLocalName(const QCString &name) = 0;
//-----------------------------------------------------------------------------------
// --- actions ----
@@ -376,14 +377,14 @@ class DefinitionMutable
//-----------------------------------------------------------------------------------
// --- writing output ----
//-----------------------------------------------------------------------------------
- virtual void writeSourceDef(OutputList &ol,const char *scopeName) const = 0;
- virtual void writeInlineCode(OutputList &ol,const char *scopeName) const = 0;
- virtual void writeSourceRefs(OutputList &ol,const char *scopeName) const = 0;
- virtual void writeSourceReffedBy(OutputList &ol,const char *scopeName) const = 0;
+ virtual void writeSourceDef(OutputList &ol,const QCString &scopeName) const = 0;
+ virtual void writeInlineCode(OutputList &ol,const QCString &scopeName) const = 0;
+ virtual void writeSourceRefs(OutputList &ol,const QCString &scopeName) const = 0;
+ virtual void writeSourceReffedBy(OutputList &ol,const QCString &scopeName) const = 0;
virtual void writeNavigationPath(OutputList &ol) const = 0;
virtual void writeQuickMemberLinks(OutputList &,const MemberDef *) const = 0;
virtual void writeSummaryLinks(OutputList &) const = 0;
- virtual void writeDocAnchorsToTagFile(FTextStream &) const = 0;
+ virtual void writeDocAnchorsToTagFile(TextStream &) const = 0;
virtual void writeToc(OutputList &ol, const LocalToc &lt) const = 0;
// ---------------------------------
@@ -403,7 +404,7 @@ DefinitionMutable *toDefinitionMutable(const Definition *d);
* via \a result. The function returns TRUE if successful and FALSE
* in case of an error.
*/
-bool readCodeFragment(const char *fileName,
+bool readCodeFragment(const QCString &fileName,
int &startLine,int &endLine,
QCString &result);
#endif
diff --git a/src/definitionimpl.h b/src/definitionimpl.h
index 541e346..aeb3f8d 100644
--- a/src/definitionimpl.h
+++ b/src/definitionimpl.h
@@ -28,8 +28,8 @@ class DefinitionImpl
public:
DefinitionImpl(
Definition *def,
- const char *defFileName,int defLine,int defColumn,
- const char *name,const char *b=0,const char *d=0,
+ const QCString &defFileName,int defLine,int defColumn,
+ const QCString &name,const char *b=0,const char *d=0,
bool isSymbol=TRUE);
virtual ~DefinitionImpl();
@@ -71,7 +71,7 @@ class DefinitionImpl
const GroupList &partOfGroups() const;
bool isLinkableViaGroup() const;
const RefItemVector &xrefListItems() const;
- const Definition *findInnerCompound(const char *name) const;
+ const Definition *findInnerCompound(const QCString &name) const;
Definition *getOuterScope() const;
std::vector<const MemberDef *> getReferencesMembers() const;
std::vector<const MemberDef *> getReferencedByMembers() const;
@@ -80,13 +80,13 @@ class DefinitionImpl
bool hasBriefDescription() const;
QCString id() const;
const SectionRefs &getSectionRefs() const;
- void setName(const char *name);
- void setId(const char *name);
+ void setName(const QCString &name);
+ void setId(const QCString &name);
void setDefFile(const QCString& df,int defLine,int defColumn);
- void setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace=TRUE);
- void setBriefDescription(const char *b,const char *briefFile,int briefLine);
- void setInbodyDocumentation(const char *d,const char *docFile,int docLine);
- void setReference(const char *r);
+ void setDocumentation(const QCString &d,const QCString &docFile,int docLine,bool stripWhiteSpace=TRUE);
+ void setBriefDescription(const QCString &b,const QCString &briefFile,int briefLine);
+ void setInbodyDocumentation(const QCString &d,const QCString &docFile,int docLine);
+ void setReference(const QCString &r);
void addSectionsToDefinition(const std::vector<const SectionInfo*> &anchorList);
void setBodySegment(int defLine,int bls,int ble);
void setBodyDef(FileDef *fd);
@@ -101,18 +101,18 @@ class DefinitionImpl
void setHidden(bool b);
void setArtificial(bool b);
void setLanguage(SrcLangExt lang);
- void writeSourceDef(OutputList &ol,const char *scopeName) const;
- void writeInlineCode(OutputList &ol,const char *scopeName) const;
- void writeSourceRefs(OutputList &ol,const char *scopeName) const;
- void writeSourceReffedBy(OutputList &ol,const char *scopeName) const;
+ void writeSourceDef(OutputList &ol,const QCString &scopeName) const;
+ void writeInlineCode(OutputList &ol,const QCString &scopeName) const;
+ void writeSourceRefs(OutputList &ol,const QCString &scopeName) const;
+ void writeSourceReffedBy(OutputList &ol,const QCString &scopeName) const;
void makePartOfGroup(const GroupDef *gd);
void writeNavigationPath(OutputList &ol) const;
QCString navigationPathAsString() const;
void writeQuickMemberLinks(OutputList &,const MemberDef *) const;
void writeSummaryLinks(OutputList &) const;
QCString pathFragment() const;
- void writeDocAnchorsToTagFile(FTextStream &) const;
- void setLocalName(const QCString name);
+ void writeDocAnchorsToTagFile(TextStream &) const;
+ void setLocalName(const QCString &name);
void addSectionsToIndex();
void writeToc(OutputList &ol, const LocalToc &lt) const;
void setCookie(Definition::Cookie *cookie) const;
@@ -125,12 +125,12 @@ class DefinitionImpl
private:
- int _getXRefListId(const char *listName) const;
- void _writeSourceRefList(OutputList &ol,const char *scopeName,const QCString &text,
+ int _getXRefListId(const QCString &listName) const;
+ void _writeSourceRefList(OutputList &ol,const QCString &scopeName,const QCString &text,
const std::unordered_map<std::string,const MemberDef *> &members,bool) const;
- void _setBriefDescription(const char *b,const char *briefFile,int briefLine);
- void _setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace,bool atTop);
- void _setInbodyDocumentation(const char *d,const char *docFile,int docLine);
+ void _setBriefDescription(const QCString &b,const QCString &briefFile,int briefLine);
+ void _setDocumentation(const QCString &d,const QCString &docFile,int docLine,bool stripWhiteSpace,bool atTop);
+ void _setInbodyDocumentation(const QCString &d,const QCString &docFile,int docLine);
bool _docsAlreadyAdded(const QCString &doc,QCString &sigList);
// PIMPL idiom
@@ -144,8 +144,8 @@ class DefinitionMixin : public Base
public:
/*! Create a new definition */
DefinitionMixin(
- const char *defFileName,int defLine,int defColumn,
- const char *name,const char *b=0,const char *d=0,
+ const QCString &defFileName,int defLine,int defColumn,
+ const QCString &name,const char *b=0,const char *d=0,
bool isSymbol=TRUE) : m_impl(this,defFileName,defLine,defColumn,name,b,d,isSymbol) {}
virtual ~DefinitionMixin() {}
@@ -190,7 +190,7 @@ class DefinitionMixin : public Base
virtual const GroupList &partOfGroups() const { return m_impl.partOfGroups(); }
virtual bool isLinkableViaGroup() const { return m_impl.isLinkableViaGroup(); }
virtual const RefItemVector &xrefListItems() const { return m_impl.xrefListItems(); }
- virtual const Definition *findInnerCompound(const char *name) const { return m_impl.findInnerCompound(name); }
+ virtual const Definition *findInnerCompound(const QCString &name) const { return m_impl.findInnerCompound(name); }
virtual Definition *getOuterScope() const { return m_impl.getOuterScope(); }
virtual std::vector<const MemberDef *> getReferencesMembers() const { return m_impl.getReferencesMembers(); }
virtual std::vector<const MemberDef *> getReferencedByMembers() const { return m_impl.getReferencedByMembers(); }
@@ -201,17 +201,17 @@ class DefinitionMixin : public Base
virtual const SectionRefs &getSectionRefs() const { return m_impl.getSectionRefs(); }
//======== DefinitionMutable
- virtual void setName(const char *name) { m_impl.setName(name); }
- virtual void setId(const char *name) { m_impl.setId(name); }
+ virtual void setName(const QCString &name) { m_impl.setName(name); }
+ virtual void setId(const QCString &name) { m_impl.setId(name); }
virtual void setDefFile(const QCString& df,int defLine,int defColumn)
{ m_impl.setDefFile(df,defLine,defColumn); }
- virtual void setDocumentation(const char *doc,const char *docFile,int docLine,bool stripWhiteSpace=TRUE)
+ virtual void setDocumentation(const QCString &doc,const QCString &docFile,int docLine,bool stripWhiteSpace=TRUE)
{ m_impl.setDocumentation(doc,docFile,docLine,stripWhiteSpace); }
- virtual void setBriefDescription(const char *brief,const char *briefFile,int briefLine)
+ virtual void setBriefDescription(const QCString &brief,const QCString &briefFile,int briefLine)
{ m_impl.setBriefDescription(brief,briefFile,briefLine); }
- virtual void setInbodyDocumentation(const char *doc,const char *docFile,int docLine)
+ virtual void setInbodyDocumentation(const QCString &doc,const QCString &docFile,int docLine)
{ m_impl.setInbodyDocumentation(doc,docFile,docLine); }
- virtual void setReference(const char *r)
+ virtual void setReference(const QCString &r)
{ m_impl.setReference(r); }
virtual void addSectionsToDefinition(const std::vector<const SectionInfo*> &anchorList)
{ m_impl.addSectionsToDefinition(anchorList); }
@@ -241,13 +241,13 @@ class DefinitionMixin : public Base
{ m_impl.setArtificial(b); }
virtual void setLanguage(SrcLangExt lang)
{ m_impl.setLanguage(lang); }
- virtual void writeSourceDef(OutputList &ol,const char *scopeName) const
+ virtual void writeSourceDef(OutputList &ol,const QCString &scopeName) const
{ m_impl.writeSourceDef(ol,scopeName); }
- virtual void writeInlineCode(OutputList &ol,const char *scopeName) const
+ virtual void writeInlineCode(OutputList &ol,const QCString &scopeName) const
{ m_impl.writeInlineCode(ol,scopeName); }
- virtual void writeSourceRefs(OutputList &ol,const char *scopeName) const
+ virtual void writeSourceRefs(OutputList &ol,const QCString &scopeName) const
{ m_impl.writeSourceRefs(ol,scopeName); }
- virtual void writeSourceReffedBy(OutputList &ol,const char *scopeName) const
+ virtual void writeSourceReffedBy(OutputList &ol,const QCString &scopeName) const
{ m_impl.writeSourceReffedBy(ol,scopeName); }
virtual void makePartOfGroup(const GroupDef *gd)
{ m_impl.makePartOfGroup(gd); }
@@ -261,9 +261,9 @@ class DefinitionMixin : public Base
{ m_impl.writeSummaryLinks(ol); }
virtual QCString pathFragment() const
{ return m_impl.pathFragment(); }
- virtual void writeDocAnchorsToTagFile(FTextStream &fs) const
+ virtual void writeDocAnchorsToTagFile(TextStream &fs) const
{ m_impl.writeDocAnchorsToTagFile(fs); }
- virtual void setLocalName(const QCString name)
+ virtual void setLocalName(const QCString &name)
{ m_impl.setLocalName(name); }
virtual void addSectionsToIndex()
{ m_impl.addSectionsToIndex(); }
@@ -399,7 +399,7 @@ class DefinitionAliasMixin : public Base
{ return m_alias->isLinkableViaGroup(); }
virtual const RefItemVector &xrefListItems() const
{ return m_alias->xrefListItems(); }
- virtual const Definition *findInnerCompound(const char *name) const
+ virtual const Definition *findInnerCompound(const QCString &name) const
{ return m_alias->findInnerCompound(name); }
virtual Definition *getOuterScope() const
{ return const_cast<Definition*>(m_scope); }
diff --git a/src/dia.cpp b/src/dia.cpp
index 4a00a17..13c1316 100644
--- a/src/dia.cpp
+++ b/src/dia.cpp
@@ -1,12 +1,10 @@
/******************************************************************************
*
- *
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2021 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
+ * 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.
*
@@ -20,23 +18,23 @@
#include "config.h"
#include "message.h"
#include "util.h"
+#include "dir.h"
-#include <qdir.h>
static const int maxCmdLine = 40960;
-void writeDiaGraphFromFile(const char *inFile,const char *outDir,
- const char *outFile,DiaOutputFormat format)
+void writeDiaGraphFromFile(const QCString &inFile,const QCString &outDir,
+ const QCString &outFile,DiaOutputFormat format)
{
QCString absOutFile = outDir;
absOutFile+=Portable::pathSeparator();
absOutFile+=outFile;
// chdir to the output dir, so dot can find the font file.
- QCString oldDir = QDir::currentDirPath().utf8();
+ std::string oldDir = Dir::currentDirPath();
// go to the html output directory (i.e. path)
- QDir::setCurrent(outDir);
- //printf("Going to dir %s\n",QDir::currentDirPath().data());
+ Dir::setCurrent(outDir.str());
+ //printf("Going to dir %s\n",Dir::currentDirPath().c_str());
QCString diaExe = Config_getString(DIA_PATH)+"dia"+Portable::commandExtension();
QCString diaArgs;
QCString extension;
@@ -61,12 +59,12 @@ void writeDiaGraphFromFile(const char *inFile,const char *outDir,
diaArgs+="\"";
int exitCode;
- //printf("*** running: %s %s outDir:%s %s\n",diaExe.data(),diaArgs.data(),outDir,outFile);
+ //printf("*** running: %s %s outDir:%s %s\n",qPrint(diaExe),qPrint(diaArgs),outDir,outFile);
Portable::sysTimerStart();
if ((exitCode=Portable::system(diaExe,diaArgs,FALSE))!=0)
{
err("Problems running %s. Check your installation or look typos in you dia file %s\n",
- diaExe.data(),inFile);
+ qPrint(diaExe),qPrint(inFile));
Portable::sysTimerStop();
goto error;
}
@@ -75,7 +73,7 @@ void writeDiaGraphFromFile(const char *inFile,const char *outDir,
{
QCString epstopdfArgs(maxCmdLine);
epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
- outFile,outFile);
+ qPrint(outFile),qPrint(outFile));
Portable::sysTimerStart();
if (Portable::system("epstopdf",epstopdfArgs)!=0)
{
@@ -85,6 +83,6 @@ void writeDiaGraphFromFile(const char *inFile,const char *outDir,
}
error:
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
}
diff --git a/src/dia.h b/src/dia.h
index 93d7b04..bd0a378 100644
--- a/src/dia.h
+++ b/src/dia.h
@@ -1,12 +1,12 @@
/******************************************************************************
*
- *
+ *
*
* Copyright (C) 1997-2015 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
+ * 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.
*
@@ -19,12 +19,11 @@
#define _DIA_H
class QCString;
-class FTextStream;
enum DiaOutputFormat { DIA_BITMAP , DIA_EPS };
-void writeDiaGraphFromFile(const char *inFile,const char *outDir,
- const char *outFile,DiaOutputFormat format);
+void writeDiaGraphFromFile(const QCString &inFile,const QCString &outDir,
+ const QCString &outFile,DiaOutputFormat format);
#endif
diff --git a/src/diagram.cpp b/src/diagram.cpp
index 052c1f4..0f20636 100644
--- a/src/diagram.cpp
+++ b/src/diagram.cpp
@@ -15,8 +15,8 @@
#include <stdio.h>
#include <stdlib.h>
-#include "ftextstream.h"
-#include <qfile.h>
+#include <fstream>
+#include <algorithm>
#include "diagram.h"
#include "image.h"
@@ -28,6 +28,7 @@
#include "portable.h"
#include "index.h"
#include "classlist.h"
+#include "textstream.h"
//-----------------------------------------------------------------------------
@@ -40,7 +41,7 @@ class DiagramItem
{
public:
DiagramItem(DiagramItem *p,uint number,const ClassDef *cd,
- Protection prot,Specifier virt,const char *ts);
+ Protection prot,Specifier virt,const QCString &ts);
QCString label() const;
QCString fileName() const;
DiagramItem *parentItem() { return m_parent; }
@@ -80,7 +81,7 @@ class DiagramRow
using reverse_iterator = typename Vec::reverse_iterator;
DiagramRow(TreeDiagram *d,uint l) : m_diagram(d), m_level(l) {}
void insertClass(DiagramItem *parent,const ClassDef *cd,bool doBases,
- Protection prot,Specifier virt,const char *ts);
+ Protection prot,Specifier virt,const QCString &ts);
uint number() { return m_level; }
DiagramItem *item(int index) { return m_items.at(index).get(); }
@@ -107,13 +108,13 @@ class TreeDiagram
uint computeRows();
void moveChildren(DiagramItem *root,int dx);
void computeExtremes(uint *labelWidth,uint *xpos);
- void drawBoxes(FTextStream &t,Image *image,
+ void drawBoxes(TextStream &t,Image *image,
bool doBase,bool bitmap,
uint baseRows,uint superRows,
uint cellWidth,uint cellHeight,
QCString relPath="",
bool generateMap=TRUE);
- void drawConnectors(FTextStream &t,Image *image,
+ void drawConnectors(TextStream &t,Image *image,
bool doBase,bool bitmap,
uint baseRows,uint superRows,
uint cellWidth,uint cellheight);
@@ -176,7 +177,7 @@ static QCString protToString(Protection p)
case Protected: return "dashed";
case Private: return "dotted";
}
- return 0;
+ return QCString();
}
static uint virtToMask(Specifier p)
@@ -232,7 +233,7 @@ static void writeBitmapBox(DiagramItem *di,Image *image,
}
}
-static void writeVectorBox(FTextStream &t,DiagramItem *di,
+static void writeVectorBox(TextStream &t,DiagramItem *di,
float x,float y,bool children=FALSE)
{
if (di->virtualness()==Virtual) t << "dashed\n";
@@ -241,7 +242,7 @@ static void writeVectorBox(FTextStream &t,DiagramItem *di,
if (di->virtualness()==Virtual) t << "solid\n";
}
-static void writeMapArea(FTextStream &t,const ClassDef *cd,QCString relPath,
+static void writeMapArea(TextStream &t,const ClassDef *cd,QCString relPath,
uint x,uint y,uint w,uint h)
{
if (cd->isLinkable())
@@ -267,13 +268,13 @@ static void writeMapArea(FTextStream &t,const ClassDef *cd,QCString relPath,
}
t << "alt=\"" << convertToXML(cd->displayName());
t << "\" shape=\"rect\" coords=\"" << x << "," << y << ",";
- t << (x+w) << "," << (y+h) << "\"/>" << endl;
+ t << (x+w) << "," << (y+h) << "\"/>\n";
}
}
//-----------------------------------------------------------------------------
DiagramItem::DiagramItem(DiagramItem *p,uint number,const ClassDef *cd,
- Protection pr,Specifier vi,const char *ts)
+ Protection pr,Specifier vi,const QCString &ts)
: m_parent(p), m_num(number), m_prot(pr), m_virt(vi), m_templSpec(ts), m_classDef(cd)
{
}
@@ -332,7 +333,7 @@ void DiagramItem::addChild(DiagramItem *di)
//---------------------------------------------------------------------------
void DiagramRow::insertClass(DiagramItem *parent,const ClassDef *cd,bool doBases,
- Protection prot,Specifier virt,const char *ts)
+ Protection prot,Specifier virt,const QCString &ts)
{
auto di = std::make_unique<DiagramItem>(parent, m_diagram->row(m_level)->numItems(),
cd,prot,virt,ts);
@@ -365,7 +366,7 @@ void DiagramRow::insertClass(DiagramItem *parent,const ClassDef *cd,bool doBases
{
row->insertClass(di_ptr,ccd,doBases,bcd.prot,
doBases?bcd.virt:Normal,
- doBases?bcd.templSpecifiers.data():"");
+ doBases?bcd.templSpecifiers:QCString());
}
}
}
@@ -378,7 +379,7 @@ TreeDiagram::TreeDiagram(const ClassDef *root,bool doBases)
auto row = std::make_unique<DiagramRow>(this,0);
DiagramRow *row_ptr = row.get();
m_rows.push_back(std::move(row));
- row_ptr->insertClass(0,root,doBases,Public,Normal,0);
+ row_ptr->insertClass(0,root,doBases,Public,Normal,QCString());
}
void TreeDiagram::moveChildren(DiagramItem *root,int dx)
@@ -393,7 +394,7 @@ void TreeDiagram::moveChildren(DiagramItem *root,int dx)
bool TreeDiagram::layoutTree(DiagramItem *root,uint r)
{
bool moved=FALSE;
- //printf("layoutTree(%s,%d)\n",root->label().data(),r);
+ //printf("layoutTree(%s,%d)\n",qPrint(root->label()),r);
if (root->numChildren()>0)
{
@@ -520,8 +521,8 @@ void TreeDiagram::computeExtremes(uint *maxLabelLen,uint *maxXPos)
for (const auto &di : *dr) // for each item in a row
{
if (di->isInList()) done=TRUE;
- if (maxXPos) mx=QMAX(mx,(uint)di->xPos());
- if (maxLabelLen) ml=QMAX(ml,Image::stringLength(di->label()));
+ if (maxXPos) mx=std::max(mx,(uint)di->xPos());
+ if (maxLabelLen) ml=std::max(ml,Image::stringLength(di->label()));
}
if (done) break;
}
@@ -564,7 +565,7 @@ class DualDirIterator
typename C::reverse_iterator m_rit;
};
-void TreeDiagram::drawBoxes(FTextStream &t,Image *image,
+void TreeDiagram::drawBoxes(TextStream &t,Image *image,
bool doBase,bool bitmap,
uint baseRows,uint superRows,
uint cellWidth,uint cellHeight,
@@ -694,7 +695,7 @@ void TreeDiagram::drawBoxes(FTextStream &t,Image *image,
}
}
-void TreeDiagram::drawConnectors(FTextStream &t,Image *image,
+void TreeDiagram::drawConnectors(TextStream &t,Image *image,
bool doBase,bool bitmap,
uint baseRows,uint superRows,
uint cellWidth,uint cellHeight)
@@ -742,7 +743,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image,
}
else // draw vectors
{
- t << protToString(di->protection()) << endl;
+ t << protToString(di->protection()) << "\n";
if (doBase)
{
t << "1 " << (di->xPos()/(float)gridWidth) << " "
@@ -811,7 +812,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image,
}
else
{
- t << protToString(di->protection()) << endl;
+ t << protToString(di->protection()) << "\n";
if (doBase)
{
t << "1 " << xf << " " << yf << " hedge\n";
@@ -850,7 +851,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image,
}
else
{
- t << protToString(di->protection()) << endl;
+ t << protToString(di->protection()) << "\n";
if (doBase)
{
t << "1 " << xf << " " << yf << " hedge\n";
@@ -859,7 +860,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image,
{
t << "0 " << xf << " " << yf << " hedge\n";
}
- t << protToString(getMinProtectionLevel(dil)) << endl;
+ t << protToString(getMinProtectionLevel(dil)) << "\n";
if (doBase)
{
t << xf << " " << ysf << " " << yf << " vedge\n";
@@ -909,7 +910,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image,
}
else // draw pixels
{
- t << protToString(di->protection()) << endl;
+ t << protToString(di->protection()) << "\n";
if (doBase)
{
t << "1 " << di->xPos()/(float)gridWidth << " "
@@ -949,7 +950,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image,
}
else
{
- t << protToString(p) << endl;
+ t << protToString(p) << "\n";
if (doBase)
{
t << "0 " << di->xPos()/(float)gridWidth << " "
@@ -984,7 +985,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image,
}
else
{
- t << protToString(p) << endl;
+ t << protToString(p) << "\n";
if (doBase)
{
t << first->xPos()/(float)gridWidth << " "
@@ -1043,8 +1044,8 @@ ClassDiagram::~ClassDiagram()
{
}
-void ClassDiagram::writeFigure(FTextStream &output,const char *path,
- const char *fileName) const
+void ClassDiagram::writeFigure(TextStream &output,const QCString &path,
+ const QCString &fileName) const
{
uint baseRows=p->base.computeRows();
uint superRows=p->super.computeRows();
@@ -1052,12 +1053,12 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path,
p->base.computeExtremes(&baseMaxLabelWidth,&baseMaxX);
p->super.computeExtremes(&superMaxLabelWidth,&superMaxX);
- uint rows=QMAX(1,baseRows+superRows-1);
- uint cols=(QMAX(baseMaxX,superMaxX)+gridWidth*2-1)/gridWidth;
+ uint rows=std::max(1u,baseRows+superRows-1);
+ uint cols=(std::max(baseMaxX,superMaxX)+gridWidth*2-1)/gridWidth;
// Estimate the image aspect width and height in pixels.
uint estHeight = rows*40;
- uint estWidth = cols*(20+QMAX(baseMaxLabelWidth,superMaxLabelWidth));
+ uint estWidth = cols*(20+std::max(baseMaxLabelWidth,superMaxLabelWidth));
//printf("Estimated size %d x %d\n",estWidth,estHeight);
const float pageWidth = 14.0f; // estimated page width in cm.
@@ -1065,8 +1066,8 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path,
// errors.
// compute the image height in centimeters based on the estimates
- float realHeight = QMIN(rows,12); // real height in cm
- float realWidth = realHeight * estWidth/(float)estHeight;
+ float realHeight = static_cast<float>(std::min(rows,12u)); // real height in cm
+ float realWidth = realHeight * estWidth/static_cast<float>(estHeight);
if (realWidth>pageWidth) // assume that the page width is about 15 cm
{
realHeight*=pageWidth/realWidth;
@@ -1078,7 +1079,7 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path,
"\\begin{center}\n"
"\\leavevmode\n";
output << "\\includegraphics[height=" << realHeight << "cm]{"
- << fileName << "}" << endl;
+ << fileName << "}\n";
output << "\\end{center}\n"
"\\end{figure}\n";
@@ -1086,244 +1087,247 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path,
QCString epsBaseName=(QCString)path+"/"+fileName;
QCString epsName=epsBaseName+".eps";
- QFile f1;
- f1.setName(epsName.data());
- if (!f1.open(IO_WriteOnly))
+ std::ofstream f(epsName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- term("Could not open file %s for writing\n",f1.name().data());
+ term("Could not open file %s for writing\n",qPrint(epsName));
}
- FTextStream t(&f1);
-
- //printf("writeEPS() rows=%d cols=%d\n",rows,cols);
-
- // generate EPS header and postscript variables and procedures
-
- t << "%!PS-Adobe-2.0 EPSF-2.0\n";
- t << "%%Title: ClassName\n";
- t << "%%Creator: Doxygen\n";
- t << "%%CreationDate: Time\n";
- t << "%%For: \n";
- t << "%Magnification: 1.00\n";
- t << "%%Orientation: Portrait\n";
- t << "%%BoundingBox: 0 0 500 " << estHeight*500.0f/(float)estWidth << "\n";
- t << "%%Pages: 0\n";
- t << "%%BeginSetup\n";
- t << "%%EndSetup\n";
- t << "%%EndComments\n";
- t << "\n";
- t << "% ----- variables -----\n";
- t << "\n";
- t << "/boxwidth 0 def\n";
- t << "/boxheight 40 def\n";
- t << "/fontheight 24 def\n";
- t << "/marginwidth 10 def\n";
- t << "/distx 20 def\n";
- t << "/disty 40 def\n";
- t << "/boundaspect " << estWidth/(float)estHeight << " def % aspect ratio of the BoundingBox (width/height)\n";
- t << "/boundx 500 def\n";
- t << "/boundy boundx boundaspect div def\n";
- t << "/xspacing 0 def\n";
- t << "/yspacing 0 def\n";
- t << "/rows " << rows << " def\n";
- t << "/cols " << cols << " def\n";
- t << "/scalefactor 0 def\n";
- t << "/boxfont /Times-Roman findfont fontheight scalefont def\n";
- t << "\n";
- t << "% ----- procedures -----\n";
- t << "\n";
- t << "/dotted { [1 4] 0 setdash } def\n";
- t << "/dashed { [5] 0 setdash } def\n";
- t << "/solid { [] 0 setdash } def\n";
- t << "\n";
- t << "/max % result = MAX(arg1,arg2)\n";
- t << "{\n";
- t << " /a exch def\n";
- t << " /b exch def\n";
- t << " a b gt {a} {b} ifelse\n";
- t << "} def\n";
- t << "\n";
- t << "/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2)\n";
- t << "{\n";
- t << " 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max\n";
- t << "} def\n";
- t << "\n";
- t << "/cw % boxwidth = MAX(boxwidth, stringwidth(arg1))\n";
- t << "{\n";
- t << " /str exch def\n";
- t << " /boxwidth boxwidth str stringwidth pop max def\n";
- t << "} def\n";
- t << "\n";
- t << "/box % draws a box with text 'arg1' at grid pos (arg2,arg3)\n";
- t << "{ gsave\n";
- t << " 2 setlinewidth\n";
- t << " newpath\n";
- t << " exch xspacing mul xoffset add\n";
- t << " exch yspacing mul\n";
- t << " moveto\n";
- t << " boxwidth 0 rlineto \n";
- t << " 0 boxheight rlineto \n";
- t << " boxwidth neg 0 rlineto \n";
- t << " 0 boxheight neg rlineto \n";
- t << " closepath\n";
- t << " dup stringwidth pop neg boxwidth add 2 div\n";
- t << " boxheight fontheight 2 div sub 2 div\n";
- t << " rmoveto show stroke\n";
- t << " grestore\n";
- t << "} def \n";
- t << "\n";
- t << "/mark\n";
- t << "{ newpath\n";
- t << " exch xspacing mul xoffset add boxwidth add\n";
- t << " exch yspacing mul\n";
- t << " moveto\n";
- t << " 0 boxheight 4 div rlineto\n";
- t << " boxheight neg 4 div boxheight neg 4 div rlineto\n";
- t << " closepath\n";
- t << " eofill\n";
- t << " stroke\n";
- t << "} def\n";
- t << "\n";
- t << "/arrow\n";
- t << "{ newpath\n";
- t << " moveto\n";
- t << " 3 -8 rlineto\n";
- t << " -6 0 rlineto\n";
- t << " 3 8 rlineto\n";
- t << " closepath\n";
- t << " eofill\n";
- t << " stroke\n";
- t << "} def\n";
- t << "\n";
- t << "/out % draws an output connector for the block at (arg1,arg2)\n";
- t << "{\n";
- t << " newpath\n";
- t << " exch xspacing mul xoffset add boxwidth 2 div add\n";
- t << " exch yspacing mul boxheight add\n";
- t << " /y exch def\n";
- t << " /x exch def\n";
- t << " x y moveto\n";
- t << " 0 disty 2 div rlineto \n";
- t << " stroke\n";
- t << " 1 eq { x y disty 2 div add arrow } if\n";
- t << "} def\n";
- t << "\n";
- t << "/in % draws an input connector for the block at (arg1,arg2)\n";
- t << "{\n";
- t << " newpath\n";
- t << " exch xspacing mul xoffset add boxwidth 2 div add\n";
- t << " exch yspacing mul disty 2 div sub\n";
- t << " /y exch def\n";
- t << " /x exch def\n";
- t << " x y moveto\n";
- t << " 0 disty 2 div rlineto\n";
- t << " stroke\n";
- t << " 1 eq { x y disty 2 div add arrow } if\n";
- t << "} def\n";
- t << "\n";
- t << "/hedge\n";
- t << "{\n";
- t << " exch xspacing mul xoffset add boxwidth 2 div add\n";
- t << " exch yspacing mul boxheight 2 div sub\n";
- t << " /y exch def\n";
- t << " /x exch def\n";
- t << " newpath\n";
- t << " x y moveto\n";
- t << " boxwidth 2 div distx add 0 rlineto\n";
- t << " stroke\n";
- t << " 1 eq\n";
- t << " { newpath x boxwidth 2 div distx add add y moveto\n";
- t << " -8 3 rlineto\n";
- t << " 0 -6 rlineto\n";
- t << " 8 3 rlineto\n";
- t << " closepath\n";
- t << " eofill\n";
- t << " stroke\n";
- t << " } if\n";
- t << "} def\n";
- t << "\n";
- t << "/vedge\n";
- t << "{\n";
- t << " /ye exch def\n";
- t << " /ys exch def\n";
- t << " /xs exch def\n";
- t << " newpath\n";
- t << " xs xspacing mul xoffset add boxwidth 2 div add dup\n";
- t << " ys yspacing mul boxheight 2 div sub\n";
- t << " moveto\n";
- t << " ye yspacing mul boxheight 2 div sub\n";
- t << " lineto\n";
- t << " stroke\n";
- t << "} def\n";
- t << "\n";
- t << "/conn % connections the blocks from col 'arg1' to 'arg2' of row 'arg3'\n";
- t << "{\n";
- t << " /ys exch def\n";
- t << " /xe exch def\n";
- t << " /xs exch def\n";
- t << " newpath\n";
- t << " xs xspacing mul xoffset add boxwidth 2 div add\n";
- t << " ys yspacing mul disty 2 div sub\n";
- t << " moveto\n";
- t << " xspacing xe xs sub mul 0\n";
- t << " rlineto\n";
- t << " stroke\n";
- t << "} def\n";
- t << "\n";
- t << "% ----- main ------\n";
- t << "\n";
- t << "boxfont setfont\n";
- t << "1 boundaspect scale\n";
-
-
- for (const auto &dr : p->base)
+ else
{
- bool done=FALSE;
- for (const auto &di : *dr)
+ TextStream t(&f);
+
+ //printf("writeEPS() rows=%d cols=%d\n",rows,cols);
+
+ // generate EPS header and postscript variables and procedures
+
+ t << "%!PS-Adobe-2.0 EPSF-2.0\n";
+ t << "%%Title: ClassName\n";
+ t << "%%Creator: Doxygen\n";
+ t << "%%CreationDate: Time\n";
+ t << "%%For: \n";
+ t << "%Magnification: 1.00\n";
+ t << "%%Orientation: Portrait\n";
+ t << "%%BoundingBox: 0 0 500 " << estHeight*500.0f/(float)estWidth << "\n";
+ t << "%%Pages: 0\n";
+ t << "%%BeginSetup\n";
+ t << "%%EndSetup\n";
+ t << "%%EndComments\n";
+ t << "\n";
+ t << "% ----- variables -----\n";
+ t << "\n";
+ t << "/boxwidth 0 def\n";
+ t << "/boxheight 40 def\n";
+ t << "/fontheight 24 def\n";
+ t << "/marginwidth 10 def\n";
+ t << "/distx 20 def\n";
+ t << "/disty 40 def\n";
+ t << "/boundaspect " << estWidth/(float)estHeight << " def % aspect ratio of the BoundingBox (width/height)\n";
+ t << "/boundx 500 def\n";
+ t << "/boundy boundx boundaspect div def\n";
+ t << "/xspacing 0 def\n";
+ t << "/yspacing 0 def\n";
+ t << "/rows " << rows << " def\n";
+ t << "/cols " << cols << " def\n";
+ t << "/scalefactor 0 def\n";
+ t << "/boxfont /Times-Roman findfont fontheight scalefont def\n";
+ t << "\n";
+ t << "% ----- procedures -----\n";
+ t << "\n";
+ t << "/dotted { [1 4] 0 setdash } def\n";
+ t << "/dashed { [5] 0 setdash } def\n";
+ t << "/solid { [] 0 setdash } def\n";
+ t << "\n";
+ t << "/max % result = MAX(arg1,arg2)\n";
+ t << "{\n";
+ t << " /a exch def\n";
+ t << " /b exch def\n";
+ t << " a b gt {a} {b} ifelse\n";
+ t << "} def\n";
+ t << "\n";
+ t << "/xoffset % result = MAX(0,(scalefactor-(boxwidth*cols+distx*(cols-1)))/2)\n";
+ t << "{\n";
+ t << " 0 scalefactor boxwidth cols mul distx cols 1 sub mul add sub 2 div max\n";
+ t << "} def\n";
+ t << "\n";
+ t << "/cw % boxwidth = MAX(boxwidth, stringwidth(arg1))\n";
+ t << "{\n";
+ t << " /str exch def\n";
+ t << " /boxwidth boxwidth str stringwidth pop max def\n";
+ t << "} def\n";
+ t << "\n";
+ t << "/box % draws a box with text 'arg1' at grid pos (arg2,arg3)\n";
+ t << "{ gsave\n";
+ t << " 2 setlinewidth\n";
+ t << " newpath\n";
+ t << " exch xspacing mul xoffset add\n";
+ t << " exch yspacing mul\n";
+ t << " moveto\n";
+ t << " boxwidth 0 rlineto \n";
+ t << " 0 boxheight rlineto \n";
+ t << " boxwidth neg 0 rlineto \n";
+ t << " 0 boxheight neg rlineto \n";
+ t << " closepath\n";
+ t << " dup stringwidth pop neg boxwidth add 2 div\n";
+ t << " boxheight fontheight 2 div sub 2 div\n";
+ t << " rmoveto show stroke\n";
+ t << " grestore\n";
+ t << "} def \n";
+ t << "\n";
+ t << "/mark\n";
+ t << "{ newpath\n";
+ t << " exch xspacing mul xoffset add boxwidth add\n";
+ t << " exch yspacing mul\n";
+ t << " moveto\n";
+ t << " 0 boxheight 4 div rlineto\n";
+ t << " boxheight neg 4 div boxheight neg 4 div rlineto\n";
+ t << " closepath\n";
+ t << " eofill\n";
+ t << " stroke\n";
+ t << "} def\n";
+ t << "\n";
+ t << "/arrow\n";
+ t << "{ newpath\n";
+ t << " moveto\n";
+ t << " 3 -8 rlineto\n";
+ t << " -6 0 rlineto\n";
+ t << " 3 8 rlineto\n";
+ t << " closepath\n";
+ t << " eofill\n";
+ t << " stroke\n";
+ t << "} def\n";
+ t << "\n";
+ t << "/out % draws an output connector for the block at (arg1,arg2)\n";
+ t << "{\n";
+ t << " newpath\n";
+ t << " exch xspacing mul xoffset add boxwidth 2 div add\n";
+ t << " exch yspacing mul boxheight add\n";
+ t << " /y exch def\n";
+ t << " /x exch def\n";
+ t << " x y moveto\n";
+ t << " 0 disty 2 div rlineto \n";
+ t << " stroke\n";
+ t << " 1 eq { x y disty 2 div add arrow } if\n";
+ t << "} def\n";
+ t << "\n";
+ t << "/in % draws an input connector for the block at (arg1,arg2)\n";
+ t << "{\n";
+ t << " newpath\n";
+ t << " exch xspacing mul xoffset add boxwidth 2 div add\n";
+ t << " exch yspacing mul disty 2 div sub\n";
+ t << " /y exch def\n";
+ t << " /x exch def\n";
+ t << " x y moveto\n";
+ t << " 0 disty 2 div rlineto\n";
+ t << " stroke\n";
+ t << " 1 eq { x y disty 2 div add arrow } if\n";
+ t << "} def\n";
+ t << "\n";
+ t << "/hedge\n";
+ t << "{\n";
+ t << " exch xspacing mul xoffset add boxwidth 2 div add\n";
+ t << " exch yspacing mul boxheight 2 div sub\n";
+ t << " /y exch def\n";
+ t << " /x exch def\n";
+ t << " newpath\n";
+ t << " x y moveto\n";
+ t << " boxwidth 2 div distx add 0 rlineto\n";
+ t << " stroke\n";
+ t << " 1 eq\n";
+ t << " { newpath x boxwidth 2 div distx add add y moveto\n";
+ t << " -8 3 rlineto\n";
+ t << " 0 -6 rlineto\n";
+ t << " 8 3 rlineto\n";
+ t << " closepath\n";
+ t << " eofill\n";
+ t << " stroke\n";
+ t << " } if\n";
+ t << "} def\n";
+ t << "\n";
+ t << "/vedge\n";
+ t << "{\n";
+ t << " /ye exch def\n";
+ t << " /ys exch def\n";
+ t << " /xs exch def\n";
+ t << " newpath\n";
+ t << " xs xspacing mul xoffset add boxwidth 2 div add dup\n";
+ t << " ys yspacing mul boxheight 2 div sub\n";
+ t << " moveto\n";
+ t << " ye yspacing mul boxheight 2 div sub\n";
+ t << " lineto\n";
+ t << " stroke\n";
+ t << "} def\n";
+ t << "\n";
+ t << "/conn % connections the blocks from col 'arg1' to 'arg2' of row 'arg3'\n";
+ t << "{\n";
+ t << " /ys exch def\n";
+ t << " /xe exch def\n";
+ t << " /xs exch def\n";
+ t << " newpath\n";
+ t << " xs xspacing mul xoffset add boxwidth 2 div add\n";
+ t << " ys yspacing mul disty 2 div sub\n";
+ t << " moveto\n";
+ t << " xspacing xe xs sub mul 0\n";
+ t << " rlineto\n";
+ t << " stroke\n";
+ t << "} def\n";
+ t << "\n";
+ t << "% ----- main ------\n";
+ t << "\n";
+ t << "boxfont setfont\n";
+ t << "1 boundaspect scale\n";
+
+
+ for (const auto &dr : p->base)
{
- done=di->isInList();
- t << "(" << convertToPSString(di->label()) << ") cw\n";
+ bool done=FALSE;
+ for (const auto &di : *dr)
+ {
+ done=di->isInList();
+ t << "(" << convertToPSString(di->label()) << ") cw\n";
+ }
+ if (done) break;
}
- if (done) break;
- }
- auto it = p->super.begin();
- if (it!=p->super.end()) ++it;
- for (;it!=p->super.end();++it)
- {
- const auto &dr = *it;
- bool done=FALSE;
- for (const auto &di : *dr)
+ auto it = p->super.begin();
+ if (it!=p->super.end()) ++it;
+ for (;it!=p->super.end();++it)
{
- done=di->isInList();
- t << "(" << convertToPSString(di->label()) << ") cw\n";
+ const auto &dr = *it;
+ bool done=FALSE;
+ for (const auto &di : *dr)
+ {
+ done=di->isInList();
+ t << "(" << convertToPSString(di->label()) << ") cw\n";
+ }
+ if (done) break;
}
- if (done) break;
- }
- t << "/boxwidth boxwidth marginwidth 2 mul add def\n"
- << "/xspacing boxwidth distx add def\n"
- << "/yspacing boxheight disty add def\n"
- << "/scalefactor \n"
- << " boxwidth cols mul distx cols 1 sub mul add\n"
- << " boxheight rows mul disty rows 1 sub mul add boundaspect mul \n"
- << " max def\n"
- << "boundx scalefactor div boundy scalefactor div scale\n";
+ t << "/boxwidth boxwidth marginwidth 2 mul add def\n"
+ << "/xspacing boxwidth distx add def\n"
+ << "/yspacing boxheight disty add def\n"
+ << "/scalefactor \n"
+ << " boxwidth cols mul distx cols 1 sub mul add\n"
+ << " boxheight rows mul disty rows 1 sub mul add boundaspect mul \n"
+ << " max def\n"
+ << "boundx scalefactor div boundy scalefactor div scale\n";
- t << "\n% ----- classes -----\n\n";
- p->base.drawBoxes(t,0,TRUE,FALSE,baseRows,superRows,0,0);
- p->super.drawBoxes(t,0,FALSE,FALSE,baseRows,superRows,0,0);
+ t << "\n% ----- classes -----\n\n";
+ p->base.drawBoxes(t,0,TRUE,FALSE,baseRows,superRows,0,0);
+ p->super.drawBoxes(t,0,FALSE,FALSE,baseRows,superRows,0,0);
- t << "\n% ----- relations -----\n\n";
- p->base.drawConnectors(t,0,TRUE,FALSE,baseRows,superRows,0,0);
- p->super.drawConnectors(t,0,FALSE,FALSE,baseRows,superRows,0,0);
+ t << "\n% ----- relations -----\n\n";
+ p->base.drawConnectors(t,0,TRUE,FALSE,baseRows,superRows,0,0);
+ p->super.drawConnectors(t,0,FALSE,FALSE,baseRows,superRows,0,0);
+
+ }
+ f.close();
- f1.close();
if (Config_getBool(USE_PDFLATEX))
{
QCString epstopdfArgs(4096);
epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
- epsBaseName.data(),epsBaseName.data());
- //printf("Converting eps using '%s'\n",epstopdfArgs.data());
+ qPrint(epsBaseName),qPrint(epsBaseName));
+ //printf("Converting eps using '%s'\n",qPrint(epstopdfArgs));
Portable::sysTimerStart();
if (Portable::system("epstopdf",epstopdfArgs)!=0)
{
@@ -1336,8 +1340,8 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path,
}
-void ClassDiagram::writeImage(FTextStream &t,const char *path,
- const char *relPath,const char *fileName,
+void ClassDiagram::writeImage(TextStream &t,const QCString &path,
+ const QCString &relPath,const QCString &fileName,
bool generateMap) const
{
uint baseRows=p->base.computeRows();
@@ -1348,9 +1352,9 @@ void ClassDiagram::writeImage(FTextStream &t,const char *path,
p->base.computeExtremes(&lb,&xb);
p->super.computeExtremes(&ls,&xs);
- uint cellWidth = QMAX(lb,ls)+labelHorMargin*2;
- uint maxXPos = QMAX(xb,xs);
- uint labelVertMargin = 6; //QMAX(6,(cellWidth-fontHeight)/6); // aspect at least 1:3
+ uint cellWidth = std::max(lb,ls)+labelHorMargin*2;
+ uint maxXPos = std::max(xb,xs);
+ uint labelVertMargin = 6; //std::max(6,(cellWidth-fontHeight)/6); // aspect at least 1:3
uint cellHeight = labelVertMargin*2+fontHeight;
uint imageWidth = (maxXPos+gridWidth)*cellWidth/gridWidth+
(maxXPos*labelHorSpacing)/gridWidth;
diff --git a/src/diagram.h b/src/diagram.h
index d8e7612..e2544e0 100644
--- a/src/diagram.h
+++ b/src/diagram.h
@@ -20,9 +20,10 @@
#define DIAGRAM_H
#include <memory>
+#include "qcstring.h"
class ClassDef;
-class FTextStream;
+class TextStream;
/** Class representing a built-in class diagram. */
class ClassDiagram
@@ -30,10 +31,10 @@ class ClassDiagram
public:
ClassDiagram(const ClassDef *root);
~ClassDiagram();
- void writeFigure(FTextStream &t,const char *path,
- const char *file) const;
- void writeImage(FTextStream &t,const char *path,const char *relPath,
- const char *file,bool generateMap=TRUE) const;
+ void writeFigure(TextStream &t,const QCString &path,
+ const QCString &file) const;
+ void writeImage(TextStream &t,const QCString &path,const QCString &relPath,
+ const QCString &file,bool generateMap=true) const;
private:
struct Private;
std::unique_ptr<Private> p;
diff --git a/src/dir.cpp b/src/dir.cpp
new file mode 100644
index 0000000..327bc72
--- /dev/null
+++ b/src/dir.cpp
@@ -0,0 +1,303 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2021 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.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#include "filesystem.hpp"
+#include "dir.h"
+
+namespace fs = ghc::filesystem;
+
+//-----------------------------------------------------------------------------------------------
+
+struct DirEntry::Private
+{
+ fs::directory_entry entry;
+};
+
+DirEntry::DirEntry() : p(std::make_unique<Private>())
+{
+}
+
+DirEntry::~DirEntry()
+{
+}
+
+bool DirEntry::is_directory() const
+{
+ return p->entry.is_directory();
+}
+
+bool DirEntry::is_regular_file() const
+{
+ return p->entry.is_regular_file();
+}
+
+bool DirEntry::is_symlink() const
+{
+ return p->entry.is_symlink();
+}
+
+std::string DirEntry::path() const
+{
+ return p->entry.path().string();
+}
+
+//-----------------------------------------------------------------------------------------------
+
+struct DirIterator::Private
+{
+ Private() : it() {}
+ Private(const std::string &path) : it(path) {}
+ fs::directory_iterator it;
+ mutable DirEntry current;
+};
+
+DirIterator::DirIterator() : p(std::make_unique<Private>())
+{
+}
+
+DirIterator::DirIterator(const std::string &path) : p(std::make_unique<Private>(path))
+{
+}
+
+DirIterator::DirIterator(const DirIterator &it) : p(std::make_unique<Private>())
+{
+ p->it = it.p->it;
+}
+
+DirIterator::~DirIterator()
+{
+}
+
+DirIterator &DirIterator::operator=(const DirIterator &it)
+{
+ if (&it!=this)
+ {
+ p->it = it.p->it;
+ }
+ return *this;
+}
+
+DirIterator DirIterator::operator++()
+{
+ DirIterator result;
+ result.p->it = ++p->it;
+ return result;
+}
+
+const DirIterator::value_type &DirIterator::operator*() const
+{
+ p->current.p->entry = *p->it;
+ return p->current;
+}
+
+const DirIterator::value_type *DirIterator::operator->() const
+{
+ p->current.p->entry = *p->it;
+ return &p->current;
+}
+
+bool operator==(const DirIterator &it1,const DirIterator &it2)
+{
+ return it1.p->it!=it2.p->it;
+}
+
+bool operator!=(const DirIterator &it1,const DirIterator &it2)
+{
+ return it1.p->it!=it2.p->it;
+}
+
+DirIterator begin(DirIterator it) noexcept
+{
+ return it;
+}
+
+DirIterator end(const DirIterator &) noexcept
+{
+ return DirIterator();
+}
+
+
+//-----------------------------------------------------------------------------------------------
+
+
+struct Dir::Private
+{
+ fs::path path;
+};
+
+Dir::Dir() : p(std::make_unique<Private>())
+{
+ std::error_code ec;
+ p->path = fs::current_path(ec);
+}
+
+Dir::Dir(const Dir &d) : p(std::make_unique<Private>())
+{
+ p->path = d.p->path;
+}
+
+Dir &Dir::operator=(const Dir &d)
+{
+ if (&d!=this)
+ {
+ p->path = d.p->path;
+ }
+ return *this;
+}
+
+Dir::Dir(const std::string &path) : p(std::make_unique<Private>())
+{
+ setPath(path);
+}
+
+Dir::~Dir()
+{
+}
+
+void Dir::setPath(const std::string &path)
+{
+ p->path = path;
+}
+
+std::string Dir::path() const
+{
+ return p->path.string();
+}
+
+DirIterator Dir::iterator() const
+{
+ return DirIterator(p->path.string());
+}
+
+static void correctPath(std::string &s)
+{
+ std::replace( s.begin(), s.end(), '\\', '/' );
+}
+
+bool Dir::exists(const std::string &path,bool acceptsAbsPath) const
+{
+ std::string result = filePath(path,acceptsAbsPath);
+ std::error_code ec;
+ bool exist = fs::exists(fs::path(result),ec);
+ return !ec && exist;
+}
+
+bool Dir::exists() const
+{
+ FileInfo fi(p->path.string());
+ return fi.exists() && fi.isDir();
+}
+
+bool Dir::isRelative() const
+{
+ return isRelativePath(p->path.string());
+}
+
+bool Dir::isRelativePath(const std::string &path)
+{
+ return fs::path(path).is_relative();
+}
+
+std::string Dir::filePath(const std::string &path,bool acceptsAbsPath) const
+{
+ std::string result;
+ if (acceptsAbsPath && !isRelativePath(path))
+ {
+ result = path;
+ }
+ else
+ {
+ result = (p->path / path).string();
+ }
+ correctPath(result);
+ return result;
+}
+
+bool Dir::mkdir(const std::string &path,bool acceptsAbsPath) const
+{
+ std::error_code ec;
+ std::string result = filePath(path,acceptsAbsPath);
+ if (exists(path,acceptsAbsPath))
+ {
+ return true;
+ }
+ else
+ {
+ return fs::create_directory(result,ec);
+ }
+}
+
+bool Dir::rmdir(const std::string &path,bool acceptsAbsPath) const
+{
+ return remove(path,acceptsAbsPath);
+}
+
+bool Dir::remove(const std::string &path,bool acceptsAbsPath) const
+{
+ std::error_code ec;
+ std::string result = filePath(path,acceptsAbsPath);
+ return fs::remove(result,ec);
+}
+
+bool Dir::rename(const std::string &orgName,const std::string &newName,bool acceptsAbsPath) const
+{
+ std::error_code ec;
+ std::string fn1 = filePath(orgName,acceptsAbsPath);
+ std::string fn2 = filePath(newName,acceptsAbsPath);
+ fs::rename(fn1,fn2,ec);
+ return !ec;
+}
+
+bool Dir::copy(const std::string &srcName,const std::string &dstName,bool acceptsAbsPath) const
+{
+ const auto copyOptions = fs::copy_options::overwrite_existing;
+ std::error_code ec;
+ std::string sn = filePath(srcName,acceptsAbsPath);
+ std::string dn = filePath(dstName,acceptsAbsPath);
+ fs::copy(sn,dn,copyOptions,ec);
+ return !ec;
+}
+
+std::string Dir::currentDirPath()
+{
+ std::error_code ec;
+ std::string result = fs::current_path(ec).string();
+ correctPath(result);
+ return result;
+}
+
+bool Dir::setCurrent(const std::string &path)
+{
+ std::error_code ec;
+ fs::current_path(path,ec);
+ return !ec;
+}
+
+std::string Dir::cleanDirPath(const std::string &path)
+{
+ std::error_code ec;
+ std::string result = fs::path(path).lexically_normal().string();
+ correctPath(result);
+ return result;
+}
+
+std::string Dir::absPath() const
+{
+ std::error_code ec;
+ std::string result = fs::absolute(p->path,ec).string();
+ correctPath(result);
+ return result;
+}
+
diff --git a/src/dir.h b/src/dir.h
new file mode 100644
index 0000000..0a1cc12
--- /dev/null
+++ b/src/dir.h
@@ -0,0 +1,104 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2021 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.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#ifndef DIR_H
+#define DIR_H
+
+#include <string>
+#include <memory>
+
+#include "fileinfo.h"
+
+class DirEntry
+{
+ public:
+ ~DirEntry();
+ bool is_directory() const;
+ bool is_regular_file() const;
+ bool is_symlink() const;
+ std::string path() const;
+ private:
+ friend class DirIterator;
+ DirEntry();
+ struct Private;
+ std::unique_ptr<Private> p;
+};
+
+class DirIterator
+{
+ public:
+ using value_type = DirEntry;
+ using difference_type = std::ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type&;
+ using iterator_category = std::input_iterator_tag;
+ DirIterator(const DirIterator &it);
+ DirIterator &operator=(const DirIterator &it);
+ DirIterator operator++();
+ const value_type &operator*() const;
+ const value_type *operator->() const;
+
+ friend bool operator==(const DirIterator &it1,const DirIterator &it2);
+ friend bool operator!=(const DirIterator &it1,const DirIterator &it2);
+ friend DirIterator begin(DirIterator it) noexcept;
+ friend DirIterator end(const DirIterator &) noexcept;
+ ~DirIterator();
+
+ private:
+ friend class Dir;
+ DirIterator();
+ DirIterator(const std::string &path);
+ struct Private;
+ std::unique_ptr<Private> p;
+};
+
+/** Class representing a directory in the file system */
+class Dir final
+{
+ public:
+ Dir();
+ Dir(const std::string &path);
+ Dir(const Dir &d);
+ Dir &operator=(const Dir &d);
+ ~Dir();
+ void setPath(const std::string &path);
+ std::string path() const;
+
+ DirIterator iterator() const;
+
+ bool exists() const;
+ std::string filePath(const std::string &path,bool acceptsAbsPath=true) const;
+ bool exists(const std::string &path,bool acceptsAbsPath=true) const;
+ bool mkdir(const std::string &path,bool acceptsAbsPath=true) const;
+ bool rmdir(const std::string &path,bool acceptsAbsPath=true) const;
+ bool remove(const std::string &path,bool acceptsAbsPath=true) const;
+ bool rename(const std::string &orgName,const std::string &newName,
+ bool acceptsAbsPath=true) const;
+ bool copy(const std::string &src,const std::string &dest,bool acceptsAbsPath=true) const;
+ std::string absPath() const;
+
+ bool isRelative() const;
+
+ static bool isRelativePath(const std::string &path);
+ static std::string currentDirPath();
+ static bool setCurrent(const std::string &path);
+ static std::string cleanDirPath(const std::string &path);
+
+ private:
+ struct Private;
+ std::unique_ptr<Private> p;
+};
+
+#endif
diff --git a/src/dirdef.cpp b/src/dirdef.cpp
index 5e5ca93..72681d9 100644
--- a/src/dirdef.cpp
+++ b/src/dirdef.cpp
@@ -26,7 +26,6 @@
#include "dot.h"
#include "dotdirdeps.h"
#include "layout.h"
-#include "ftextstream.h"
#include "config.h"
#include "docparser.h"
#include "definitionimpl.h"
@@ -38,7 +37,7 @@
class DirDefImpl : public DefinitionMixin<DirDef>
{
public:
- DirDefImpl(const char *path);
+ DirDefImpl(const QCString &path);
virtual ~DirDefImpl();
virtual DefType definitionType() const { return TypeDir; }
@@ -62,7 +61,7 @@ class DirDefImpl : public DefinitionMixin<DirDef>
virtual QCString shortTitle() const;
virtual bool hasDetailedDescription() const;
virtual void writeDocumentation(OutputList &ol);
- virtual void writeTagFile(FTextStream &t);
+ virtual void writeTagFile(TextStream &t);
virtual void setDiskName(const QCString &name) { m_diskName = name; }
virtual void sort();
virtual void setParent(DirDef *parent);
@@ -84,7 +83,7 @@ class DirDefImpl : public DefinitionMixin<DirDef>
void startMemberDeclarations(OutputList &ol);
void endMemberDeclarations(OutputList &ol);
- static DirDef *createNewDir(const char *path);
+ static DirDef *createNewDir(const QCString &path);
static bool matchPath(const QCString &path,const StringVector &l);
DirList m_subdirs;
@@ -98,7 +97,7 @@ class DirDefImpl : public DefinitionMixin<DirDef>
UsedDirLinkedMap m_usedDirs;
};
-DirDef *createDirDef(const char *path)
+DirDef *createDirDef(const QCString &path)
{
return new DirDefImpl(path);
}
@@ -109,7 +108,7 @@ DirDef *createDirDef(const char *path)
static int g_dirCount=0;
-DirDefImpl::DirDefImpl(const char *path) : DefinitionMixin(path,1,1,path)
+DirDefImpl::DirDefImpl(const QCString &path) : DefinitionMixin(path,1,1,path)
{
bool fullPathNames = Config_getBool(FULL_PATH_NAMES);
// get display name (stripping the paths mentioned in STRIP_FROM_PATH)
@@ -210,7 +209,7 @@ static QCString encodeDirName(const QCString &anchor)
QCString DirDefImpl::getOutputFileBase() const
{
//printf("DirDefImpl::getOutputFileBase() %s->dir_%s\n",
- // m_diskName.data(),encodeDirName(m_diskName).data());
+ // qPrint(m_diskName),qPrint(encodeDirName(m_diskName)));
return "dir_"+encodeDirName(m_diskName);
}
@@ -225,7 +224,7 @@ void DirDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
ol.popGeneratorState();
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- ol.writeAnchor(0,"details");
+ ol.writeAnchor(QCString(),"details");
ol.popGeneratorState();
ol.startGroupHeader();
ol.parseText(title);
@@ -235,7 +234,7 @@ void DirDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF))
{
ol.generateDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
// separator between brief and details
if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF) &&
@@ -256,7 +255,7 @@ void DirDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
if (!documentation().isEmpty())
{
ol.generateDoc(docFile(),docLine(),this,0,documentation()+"\n",TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
}
}
@@ -267,7 +266,7 @@ void DirDefImpl::writeBriefDescription(OutputList &ol)
{
DocRoot *rootNode = validatingParseDoc(
briefFile(),briefLine(),this,0,briefDescription(),TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
if (rootNode && !rootNode->isEmpty())
{
ol.startParagraph();
@@ -286,7 +285,7 @@ void DirDefImpl::writeBriefDescription(OutputList &ol)
)
{
ol.disableAllBut(OutputGenerator::Html);
- ol.startTextLink(0,"details");
+ ol.startTextLink(QCString(),"details");
ol.parseText(theTranslator->trMore());
ol.endTextLink();
}
@@ -307,7 +306,7 @@ void DirDefImpl::writeDirectoryGraph(OutputList &ol)
DotDirDeps dirDep(this);
if (!dirDep.isTrivial())
{
- msg("Generating dependency graph for directory %s\n",displayName().data());
+ msg("Generating dependency graph for directory %s\n",qPrint(displayName()));
ol.disable(OutputGenerator::Man);
//ol.startParagraph();
ol.startDirDepGraph();
@@ -345,7 +344,7 @@ void DirDefImpl::writeSubDirList(OutputList &ol)
ol.startMemberItem(dd->getOutputFileBase(),0);
ol.parseText(theTranslator->trDir(FALSE,TRUE)+" ");
ol.insertMemberAlign();
- ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),0,dd->shortName());
+ ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),QCString(),dd->shortName());
ol.endMemberItem();
if (!dd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
{
@@ -353,14 +352,14 @@ void DirDefImpl::writeSubDirList(OutputList &ol)
ol.generateDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),
FALSE, // indexWords
FALSE, // isExample
- 0, // exampleName
+ QCString(), // exampleName
TRUE, // single line
TRUE, // link from index
Config_getBool(MARKDOWN_SUPPORT)
);
ol.endMemberDescription();
}
- ol.endMemberDeclaration(0,0);
+ ol.endMemberDeclaration(QCString(),QCString());
}
}
@@ -396,7 +395,7 @@ void DirDefImpl::writeFileList(OutputList &ol)
ol.insertMemberAlign();
if (fd->isLinkable())
{
- ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,fd->name());
+ ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fd->name());
}
else
{
@@ -409,7 +408,7 @@ void DirDefImpl::writeFileList(OutputList &ol)
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
ol.docify(" ");
- ol.startTextLink(fd->includeName(),0);
+ ol.startTextLink(fd->includeName(),QCString());
ol.docify("[");
ol.parseText(theTranslator->trCode());
ol.docify("]");
@@ -423,14 +422,14 @@ void DirDefImpl::writeFileList(OutputList &ol)
ol.generateDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),
FALSE, // indexWords
FALSE, // isExample
- 0, // exampleName
+ QCString(), // exampleName
TRUE, // single line
TRUE, // link from index
Config_getBool(MARKDOWN_SUPPORT)
);
ol.endMemberDescription();
}
- ol.endMemberDeclaration(0,0);
+ ol.endMemberDeclaration(QCString(),QCString());
}
}
ol.endMemberList();
@@ -458,12 +457,12 @@ bool DirDefImpl::hasDetailedDescription() const
return (!briefDescription().isEmpty() && repeatBrief) || !documentation().isEmpty();
}
-void DirDefImpl::writeTagFile(FTextStream &tagFile)
+void DirDefImpl::writeTagFile(TextStream &tagFile)
{
- tagFile << " <compound kind=\"dir\">" << endl;
- tagFile << " <name>" << convertToXML(displayName()) << "</name>" << endl;
- tagFile << " <path>" << convertToXML(name()) << "</path>" << endl;
- tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>" << endl;
+ tagFile << " <compound kind=\"dir\">\n";
+ tagFile << " <name>" << convertToXML(displayName()) << "</name>\n";
+ tagFile << " <path>" << convertToXML(name()) << "</path>\n";
+ tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>\n";
for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Directory))
{
switch (lde->kind())
@@ -474,7 +473,7 @@ void DirDefImpl::writeTagFile(FTextStream &tagFile)
{
for(const auto dd : m_subdirs)
{
- tagFile << " <dir>" << convertToXML(dd->displayName()) << "</dir>" << endl;
+ tagFile << " <dir>" << convertToXML(dd->displayName()) << "</dir>\n";
}
}
}
@@ -483,7 +482,7 @@ void DirDefImpl::writeTagFile(FTextStream &tagFile)
{
for (const auto &fd : m_fileList)
{
- tagFile << " <file>" << convertToXML(fd->name()) << "</file>" << endl;
+ tagFile << " <file>" << convertToXML(fd->name()) << "</file>\n";
}
}
break;
@@ -492,7 +491,7 @@ void DirDefImpl::writeTagFile(FTextStream &tagFile)
}
}
writeDocAnchorsToTagFile(tagFile);
- tagFile << " </compound>" << endl;
+ tagFile << " </compound>\n";
}
void DirDefImpl::writeDocumentation(OutputList &ol)
@@ -562,11 +561,14 @@ void DirDefImpl::writeDocumentation(OutputList &ol)
case LayoutDocEntry::NamespaceNestedNamespaces:
case LayoutDocEntry::NamespaceNestedConstantGroups:
case LayoutDocEntry::NamespaceClasses:
+ case LayoutDocEntry::NamespaceConcepts:
case LayoutDocEntry::NamespaceInterfaces:
case LayoutDocEntry::NamespaceStructs:
case LayoutDocEntry::NamespaceExceptions:
case LayoutDocEntry::NamespaceInlineClasses:
+ case LayoutDocEntry::ConceptDefinition:
case LayoutDocEntry::FileClasses:
+ case LayoutDocEntry::FileConcepts:
case LayoutDocEntry::FileInterfaces:
case LayoutDocEntry::FileStructs:
case LayoutDocEntry::FileExceptions:
@@ -578,6 +580,7 @@ void DirDefImpl::writeDocumentation(OutputList &ol)
case LayoutDocEntry::FileSourceLink:
case LayoutDocEntry::FileInlineClasses:
case LayoutDocEntry::GroupClasses:
+ case LayoutDocEntry::GroupConcepts:
case LayoutDocEntry::GroupInlineClasses:
case LayoutDocEntry::GroupNamespaces:
case LayoutDocEntry::GroupDirs:
@@ -632,10 +635,10 @@ void DirDefImpl::addUsesDependency(const DirDef *dir,const FileDef *srcFd,
if (this==dir) return; // do not add self-dependencies
//static int count=0;
//printf(" %d add dependency %s->%s due to %s->%s\n",
- // count++,shortName().data(),
- // dir->shortName().data(),
- // srcFd->name().data(),
- // dstFd->name().data());
+ // count++,qPrint(shortName()),
+ // qPrint(dir->shortName()),
+ // qPrint(srcFd->name()),
+ // qPrint(dstFd->name()));
// levels match => add direct dependency
bool added=FALSE;
@@ -683,12 +686,12 @@ void DirDefImpl::computeDependencies()
{
for (const auto &fd : m_fileList)
{
- //printf(" File %s\n",fd->name().data());
- //printf("** dir=%s file=%s\n",shortName().data(),fd->name().data());
+ //printf(" File %s\n",qPrint(fd->name()));
+ //printf("** dir=%s file=%s\n",qPrint(shortName()),qPrint(fd->name()));
for (const auto &ii : fd->includeFileList())
{
- //printf(" > %s\n",ii->includeName.data());
- //printf(" #include %s\n",ii->includeName.data());
+ //printf(" > %s\n",qPrint(ii->includeName));
+ //printf(" #include %s\n",qPrint(ii->includeName));
if (ii.fileDef && ii.fileDef->isLinkable()) // linkable file
{
DirDef *usedDir = ii.fileDef->getDirDef();
@@ -696,7 +699,7 @@ void DirDefImpl::computeDependencies()
{
// add dependency: thisDir->usedDir
//static int count=0;
- //printf(" %d: add dependency %s->%s\n",count++,name().data(),usedDir->name().data());
+ //printf(" %d: add dependency %s->%s\n",count++,qPrint(name()),qPrint(usedDir->name()));
addUsesDependency(usedDir,fd,ii.fileDef,FALSE);
}
}
@@ -758,12 +761,12 @@ void UsedDir::sort()
});
}
-FilePair *UsedDir::findFilePair(const char *name)
+FilePair *UsedDir::findFilePair(const QCString &name)
{
return m_filePairs.find(name);
}
-DirDef *DirDefImpl::createNewDir(const char *path)
+DirDef *DirDefImpl::createNewDir(const QCString &path)
{
ASSERT(path!=0);
DirDef *dir = Doxygen::dirLinkedMap->find(path);
@@ -773,7 +776,7 @@ DirDef *DirDefImpl::createNewDir(const char *path)
std::unique_ptr<DirDef>(
createDirDef(path)));
//printf("Adding new dir %s\n",path);
- //printf("createNewDir %s short=%s\n",path,dir->shortName().data());
+ //printf("createNewDir %s short=%s\n",path,qPrint(dir->shortName()));
}
return dir;
}
@@ -796,7 +799,7 @@ bool DirDefImpl::matchPath(const QCString &path,const StringVector &l)
*/
DirDef *DirDefImpl::mergeDirectoryInTree(const QCString &path)
{
- //printf("DirDefImpl::mergeDirectoryInTree(%s)\n",path.data());
+ //printf("DirDefImpl::mergeDirectoryInTree(%s)\n",qPrint(path));
int p=0,i=0;
DirDef *dir=0;
while ((i=path.find('/',p))!=-1)
@@ -827,7 +830,7 @@ static void writePartialDirPath(OutputList &ol,const DirDef *root,const DirDef *
writePartialDirPath(ol,root,target->parent());
ol.writeString("&#160;/&#160;");
}
- ol.writeObjectLink(target->getReference(),target->getOutputFileBase(),0,target->shortName());
+ ol.writeObjectLink(target->getReference(),target->getOutputFileBase(),QCString(),target->shortName());
}
static void writePartialFilePath(OutputList &ol,const DirDef *root,const FileDef *fd)
@@ -839,7 +842,7 @@ static void writePartialFilePath(OutputList &ol,const DirDef *root,const FileDef
}
if (fd->isLinkable())
{
- ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,fd->name());
+ ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fd->name());
}
else
{
@@ -856,11 +859,9 @@ void DirRelation::writeDocumentation(OutputList &ol)
ol.disableAllBut(OutputGenerator::Html);
QCString shortTitle=theTranslator->trDirRelation(
- m_src->shortName()+" &rarr; "+
- m_dst->dir()->shortName());
+ (m_src->shortName()+" &rarr; "+m_dst->dir()->shortName()));
QCString title=theTranslator->trDirRelation(
- m_src->displayName()+" -> "+
- m_dst->dir()->shortName());
+ (m_src->displayName()+" -> "+m_dst->dir()->shortName()));
startFile(ol,getOutputFileBase(),getOutputFileBase(),
title,HLI_None,!generateTreeView,m_src->getOutputFileBase());
@@ -935,7 +936,7 @@ static void computeCommonDirPrefix()
QCString dirName = dir->name();
if (dirName.length()>path.length())
{
- if (qstrncmp(dirName,path,l)!=0) // dirName does not start with path
+ if (dirName.left(l)!=path) // dirName does not start with path
{
i=path.findRev('/',(int)l-2);
if (i==-1) // no unique prefix -> stop
@@ -980,7 +981,7 @@ static void computeCommonDirPrefix()
{
QCString diskName = dir->name().right(dir->name().length()-path.length());
dir->setDiskName(diskName);
- //printf("set disk name: %s -> %s\n",dir->name().data(),diskName.data());
+ //printf("set disk name: %s -> %s\n",qPrint(dir->name()),qPrint(diskName));
}
}
@@ -991,7 +992,7 @@ void buildDirectories()
{
for (const auto &fd : *fn)
{
- //printf("buildDirectories %s\n",fd->name().data());
+ //printf("buildDirectories %s\n",qPrint(fd->name()));
if (fd->getReference().isEmpty())
{
DirDef *dir;
@@ -1021,7 +1022,7 @@ void buildDirectories()
{
parent->addSubDir(dir.get());
//printf("DirDefImpl::addSubdir(): Adding subdir\n%s to\n%s\n",
- // dir->displayName().data(), parent->displayName().data());
+ // qPrint(dir->displayName()), qPrint(parent->displayName()));
}
}
}
@@ -1051,7 +1052,7 @@ void computeDirDependencies()
// compute uses dependencies between directories
for (const auto &dir : *Doxygen::dirLinkedMap)
{
- //printf("computeDependencies for %s: #dirs=%d\n",dir->name().data(),Doxygen::directories.count());
+ //printf("computeDependencies for %s: #dirs=%d\n",qPrint(dir->name()),Doxygen::directories.count());
dir->computeDependencies();
}
diff --git a/src/dirdef.h b/src/dirdef.h
index 0e3db91..3d775d0 100644
--- a/src/dirdef.h
+++ b/src/dirdef.h
@@ -16,19 +16,18 @@
#ifndef DIRDEF_H
#define DIRDEF_H
-#include "linkedmap.h"
-#include "definition.h"
#include <vector>
#include <map>
-#include <qcstring.h>
+
+#include "qcstring.h"
+#include "linkedmap.h"
+#include "definition.h"
class FileList;
-class QStrList;
class FileDef;
class OutputList;
class UsedDir;
-class FTextStream;
class FilePair;
class FilePairDict;
class DirDef;
@@ -67,7 +66,7 @@ class UsedDir
UsedDir(const DirDef *dir,bool inherited);
virtual ~UsedDir();
void addFileDep(const FileDef *srcFd,const FileDef *dstFd);
- FilePair *findFilePair(const char *name);
+ FilePair *findFilePair(const QCString &name);
const FilePairLinkedMap &filePairs() const { return m_filePairs; }
const DirDef *dir() const { return m_dir; }
bool inherited() const { return m_inherited; }
@@ -113,7 +112,7 @@ class DirDef : public DefinitionMutable, public Definition
// generate output
virtual void writeDocumentation(OutputList &ol) = 0;
- virtual void writeTagFile(FTextStream &t) = 0;
+ virtual void writeTagFile(TextStream &t) = 0;
virtual void setDiskName(const QCString &name) = 0;
virtual void sort() = 0;
@@ -165,6 +164,5 @@ class DirRelationLinkedMap : public LinkedMap<DirRelation>
void buildDirectories();
void generateDirDocs(OutputList &ol);
void computeDirDependencies();
-void writeDirDependencyGraph(const char *file);
#endif
diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp
index 4319dda..ab2fb84 100644
--- a/src/docbookgen.cpp
+++ b/src/docbookgen.cpp
@@ -17,8 +17,6 @@
#include <stdlib.h>
-#include <qdir.h>
-#include <qfile.h>
#include "docbookgen.h"
#include "doxygen.h"
#include "message.h"
@@ -51,6 +49,7 @@
#include "membergroup.h"
#include "dirdef.h"
#include "section.h"
+#include "dir.h"
// no debug info
#define Docbook_DB(x) do {} while(0)
@@ -72,13 +71,15 @@
#endif
//------------------
-inline void writeDocbookString(FTextStream &t,const char *s)
+inline void writeDocbookString(TextStream &t,const QCString &s)
{
t << convertToDocBook(s);
}
-inline void writeDocbookCodeString(FTextStream &t,const char *s, int &col)
+inline void writeDocbookCodeString(TextStream &t,const QCString &str, int &col)
{
+ if (str.isEmpty()) return;
+ const char *s = str.data();
char c;
while ((c=*s++))
{
@@ -117,7 +118,7 @@ inline void writeDocbookCodeString(FTextStream &t,const char *s, int &col)
}
}
-static void addIndexTerm(FTextStream &t, QCString prim, QCString sec = "")
+static void addIndexTerm(TextStream &t, QCString prim, QCString sec = "")
{
t << "<indexterm><primary>";
t << convertToDocBook(prim);
@@ -128,94 +129,98 @@ static void addIndexTerm(FTextStream &t, QCString prim, QCString sec = "")
t << convertToDocBook(sec);
t << "</secondary>";
}
- t << "</indexterm>" << endl;
+ t << "</indexterm>\n";
}
-void writeDocbookLink(FTextStream &t,const char * /*extRef*/,const char *compoundId,
- const char *anchorId,const char * text,const char * /*tooltip*/)
+void writeDocbookLink(TextStream &t,const QCString & /*extRef*/,const QCString &compoundId,
+ const QCString &anchorId,const QCString & text,const QCString & /*tooltip*/)
{
t << "<link linkend=\"_" << stripPath(compoundId);
- if (anchorId) t << "_1" << anchorId;
+ if (!anchorId.isEmpty()) t << "_1" << anchorId;
t << "\"";
t << ">";
writeDocbookString(t,text);
t << "</link>";
}
-DocbookCodeGenerator::DocbookCodeGenerator(FTextStream &t)
+DocbookCodeGenerator::DocbookCodeGenerator(TextStream &t) : m_t(t)
{
m_prettyCode=Config_getBool(DOCBOOK_PROGRAMLISTING);
- setTextStream(t);
-}
-
-DocbookCodeGenerator::DocbookCodeGenerator()
-{
}
DocbookCodeGenerator::~DocbookCodeGenerator() {}
-void DocbookCodeGenerator::codify(const char *text)
+void DocbookCodeGenerator::codify(const QCString &text)
{
Docbook_DB(("(codify \"%s\")\n",text));
writeDocbookCodeString(m_t,text,m_col);
}
-void DocbookCodeGenerator::writeCodeLink(const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip)
+
+void DocbookCodeGenerator::writeCodeLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip)
{
Docbook_DB(("(writeCodeLink)\n"));
writeDocbookLink(m_t,ref,file,anchor,name,tooltip);
- m_col+=(int)strlen(name);
+ m_col+=name.length();
}
-void DocbookCodeGenerator::writeCodeLinkLine(const char *,const char *file,
- const char *,const char *name,
- const char *)
+
+void DocbookCodeGenerator::writeCodeLinkLine(const QCString &,const QCString &file,
+ const QCString &,const QCString &name,
+ const QCString &)
{
Docbook_DB(("(writeCodeLinkLine)\n"));
m_t << "<anchor xml:id=\"_" << stripExtensionGeneral(stripPath(file),".xml");
m_t << "_1l";
writeDocbookString(m_t,name);
m_t << "\"/>";
- m_col+=(int)strlen(name);
+ m_col+=name.length();
}
-void DocbookCodeGenerator::writeTooltip(const char *, const DocLinkInfo &, const char *,
- const char *, const SourceLinkInfo &, const SourceLinkInfo &
+
+void DocbookCodeGenerator::writeTooltip(const QCString &, const DocLinkInfo &, const QCString &,
+ const QCString &, const SourceLinkInfo &, const SourceLinkInfo &
)
{
Docbook_DB(("(writeToolTip)\n"));
}
+
void DocbookCodeGenerator::startCodeLine(bool)
{
Docbook_DB(("(startCodeLine)\n"));
m_insideCodeLine=TRUE;
m_col=0;
}
+
void DocbookCodeGenerator::endCodeLine()
{
- if (m_insideCodeLine) m_t << endl;
+ if (m_insideCodeLine) m_t << "\n";
Docbook_DB(("(endCodeLine)\n"));
m_lineNumber = -1;
m_refId.resize(0);
m_external.resize(0);
m_insideCodeLine=FALSE;
}
-void DocbookCodeGenerator::startFontClass(const char *colorClass)
+
+void DocbookCodeGenerator::startFontClass(const QCString &colorClass)
{
Docbook_DB(("(startFontClass)\n"));
m_t << "<emphasis role=\"" << colorClass << "\">";
m_insideSpecialHL=TRUE;
}
+
void DocbookCodeGenerator::endFontClass()
{
Docbook_DB(("(endFontClass)\n"));
m_t << "</emphasis>"; // non DocBook
m_insideSpecialHL=FALSE;
}
-void DocbookCodeGenerator::writeCodeAnchor(const char *)
+
+void DocbookCodeGenerator::writeCodeAnchor(const QCString &)
{
Docbook_DB(("(writeCodeAnchor)\n"));
}
-void DocbookCodeGenerator::writeLineNumber(const char *ref,const char *fileName,
- const char *anchor,int l)
+
+void DocbookCodeGenerator::writeLineNumber(const QCString &ref,const QCString &fileName,
+ const QCString &anchor,int l)
{
Docbook_DB(("(writeLineNumber)\n"));
m_insideCodeLine = TRUE;
@@ -224,10 +229,10 @@ void DocbookCodeGenerator::writeLineNumber(const char *ref,const char *fileName,
QCString lineNumber;
lineNumber.sprintf("%05d",l);
- if (fileName && !m_sourceFileName.isEmpty())
+ if (!fileName.isEmpty() && !m_sourceFileName.isEmpty())
{
- writeCodeLinkLine(ref,m_sourceFileName,anchor,lineNumber,0);
- writeCodeLink(ref,fileName,anchor,lineNumber,0);
+ writeCodeLinkLine(ref,m_sourceFileName,anchor,lineNumber,QCString());
+ writeCodeLink(ref,fileName,anchor,lineNumber,QCString());
}
else
{
@@ -241,23 +246,27 @@ void DocbookCodeGenerator::writeLineNumber(const char *ref,const char *fileName,
}
m_col=0;
}
-void DocbookCodeGenerator::setCurrentDoc(const Definition *,const char *,bool)
+
+void DocbookCodeGenerator::setCurrentDoc(const Definition *,const QCString &,bool)
{
}
-void DocbookCodeGenerator::addWord(const char *,bool)
+
+void DocbookCodeGenerator::addWord(const QCString &,bool)
{
}
+
void DocbookCodeGenerator::finish()
{
endCodeLine();
}
-void DocbookCodeGenerator::startCodeFragment(const char *)
+
+void DocbookCodeGenerator::startCodeFragment(const QCString &)
{
DB_GEN_C1(m_t)
m_t << "<programlisting>";
}
-void DocbookCodeGenerator::endCodeFragment(const char *)
+void DocbookCodeGenerator::endCodeFragment(const QCString &)
{
DB_GEN_C1(m_t)
//endCodeLine checks is there is still an open code line, if so closes it.
@@ -268,12 +277,12 @@ DB_GEN_C1(m_t)
//-------------------------------------------------------------------------------
-DocbookGenerator::DocbookGenerator() : OutputGenerator(Config_getString(DOCBOOK_OUTPUT))
+DocbookGenerator::DocbookGenerator() : OutputGenerator(Config_getString(DOCBOOK_OUTPUT)), m_codeGen(m_t)
{
DB_GEN_C
}
-DocbookGenerator::DocbookGenerator(const DocbookGenerator &og) : OutputGenerator(og)
+DocbookGenerator::DocbookGenerator(const DocbookGenerator &og) : OutputGenerator(og), m_codeGen(og.m_codeGen)
{
}
@@ -296,16 +305,16 @@ DB_GEN_C
void DocbookGenerator::init()
{
QCString dir=Config_getString(DOCBOOK_OUTPUT);
- QDir d(dir);
- if (!d.exists() && !d.mkdir(dir))
+ Dir d(dir.str());
+ if (!d.exists() && !d.mkdir(dir.str()))
{
- term("Could not create output directory %s\n",dir.data());
+ term("Could not create output directory %s\n",qPrint(dir));
}
createSubDirs(d);
}
-void DocbookGenerator::startFile(const char *name,const char *,const char *,int)
+void DocbookGenerator::startFile(const QCString &name,const QCString &,const QCString &,int)
{
DB_GEN_C
QCString fileName=name;
@@ -325,28 +334,27 @@ DB_GEN_C
relPath = relativePathToRoot(fileName);
if (fileName.right(4)!=".xml") fileName+=".xml";
startPlainFile(fileName);
- m_codeGen.setTextStream(t);
m_codeGen.setRelativePath(relPath);
m_codeGen.setSourceFileName(stripPath(fileName));
- t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
- t << "<" << fileType << " xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
- if (!pageName.isEmpty()) t << " xml:id=\"_" << stripPath(pageName) << "\"";
- t << " xml:lang=\"" << theTranslator->trISOLang() << "\"";
- t << ">" << endl;
+ m_t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";;
+ m_t << "<" << fileType << " xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
+ if (!pageName.isEmpty()) m_t << " xml:id=\"_" << stripPath(pageName) << "\"";
+ m_t << " xml:lang=\"" << theTranslator->trISOLang() << "\"";
+ m_t << ">\n";
}
void DocbookGenerator::endFile()
{
DB_GEN_C
- if (m_inDetail) t << "</section>" << endl;
+ if (m_inDetail) m_t << "</section>\n";
m_inDetail = FALSE;
while (m_inLevel != -1)
{
- t << "</section>" << endl;
+ m_t << "</section>\n";
m_inLevel--;
}
- if (m_inGroup) t << "</section>" << endl;
+ if (m_inGroup) m_t << "</section>\n";
m_inGroup = FALSE;
QCString fileType="section";
@@ -359,7 +367,7 @@ DB_GEN_C
{
fileType="chapter";
}
- t << "</" << fileType << ">" << endl;
+ m_t << "</" << fileType << ">\n";
endPlainFile();
m_codeGen.setSourceFileName("");
}
@@ -372,16 +380,16 @@ DB_GEN_C2("IndexSections " << is)
case isTitlePageStart:
{
QCString dbk_projectName = Config_getString(PROJECT_NAME);
- t << " <info>" << endl;
- t << " <title>" << convertToDocBook(dbk_projectName) << "</title>" << endl;
- t << " </info>" << endl;
+ m_t << " <info>\n";
+ m_t << " <title>" << convertToDocBook(dbk_projectName) << "</title>\n";
+ m_t << " </info>\n";
}
break;
case isTitlePageAuthor:
break;
case isMainPage:
- t << "<chapter>" << endl;
- t << " <title>";
+ m_t << "<chapter>\n";
+ m_t << " <title>";
break;
case isModuleIndex:
//Module Index}\n"
@@ -392,11 +400,14 @@ DB_GEN_C2("IndexSections " << is)
case isNamespaceIndex:
//Namespace Index}\n"
break;
+ case isConceptIndex:
+ //Concept Index}\n"
+ break;
case isClassHierarchyIndex:
//Hierarchical Index}\n"
break;
case isCompoundIndex:
- //t << "{"; //Class Index}\n"
+ //m_t << "{"; //Class Index}\n"
break;
case isFileIndex:
//Annotated File Index}\n"
@@ -405,28 +416,32 @@ DB_GEN_C2("IndexSections " << is)
//Annotated Page Index}\n"
break;
case isModuleDocumentation:
- t << "<chapter>\n";
- t << " <title>";
+ m_t << "<chapter>\n";
+ m_t << " <title>";
break;
case isDirDocumentation:
- t << "<chapter>\n";
- t << " <title>";
+ m_t << "<chapter>\n";
+ m_t << " <title>";
break;
case isNamespaceDocumentation:
- t << "<chapter>\n";
- t << " <title>";
+ m_t << "<chapter>\n";
+ m_t << " <title>";
+ break;
+ case isConceptDocumentation:
+ m_t << "<chapter>\n";
+ m_t << " <title>";
break;
case isClassDocumentation:
- t << "<chapter>\n";
- t << " <title>";
+ m_t << "<chapter>\n";
+ m_t << " <title>";
break;
case isFileDocumentation:
- t << "<chapter>\n";
- t << " <title>";
+ m_t << "<chapter>\n";
+ m_t << " <title>";
break;
case isExampleDocumentation:
- t << "<chapter>\n";
- t << " <title>";
+ m_t << "<chapter>\n";
+ m_t << " <title>";
break;
case isPageDocumentation:
break;
@@ -448,78 +463,95 @@ DB_GEN_C2("IndexSections " << is)
case isTitlePageAuthor:
break;
case isMainPage:
- t << "</title>" << endl;
- t << " <xi:include href=\"mainpage.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
- t << "</chapter>" << endl;
+ m_t << "</title>\n";
+ m_t << " <xi:include href=\"mainpage.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
+ m_t << "</chapter>\n";
break;
case isModuleIndex:
- //t << "</chapter>" << endl;
+ //m_t << "</chapter>\n";
break;
case isDirIndex:
- //t << "<xi:include href=\"dirs.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>";
- //t << "</chapter>" << endl;
+ //m_t << "<xi:include href=\"dirs.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>";
+ //m_t << "</chapter>\n";
break;
case isNamespaceIndex:
- //t << "<xi:include href=\"namespaces.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>";
- //t << "</chapter>" << endl;
+ //m_t << "<xi:include href=\"namespaces.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>";
+ //m_t << "</chapter>\n";
+ break;
+ case isConceptIndex:
+ //m_t << "<xi:include href=\"concepts.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>";
+ //m_t << "</chapter>\n";
break;
case isClassHierarchyIndex:
- //t << "<xi:include href=\"hierarchy.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>";
- //t << "</chapter>" << endl;
+ //m_t << "<xi:include href=\"hierarchy.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>";
+ //m_t << "</chapter>\n";
break;
case isCompoundIndex:
- //t << "</chapter>" << endl;
+ //m_t << "</chapter>\n";
break;
case isFileIndex:
- //t << "<xi:include href=\"files.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>";
- //t << "</chapter>" << endl;
+ //m_t << "<xi:include href=\"files.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>";
+ //m_t << "</chapter>\n";
break;
case isPageIndex:
- //t << "<xi:include href=\"pages.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>";
- //t << "</chapter>" << endl;
+ //m_t << "<xi:include href=\"pages.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>";
+ //m_t << "</chapter>\n";
break;
case isModuleDocumentation:
{
- t << "</title>" << endl;
+ m_t << "</title>\n";
for (const auto &gd : *Doxygen::groupLinkedMap)
{
if (!gd->isReference())
{
- t << " <xi:include href=\"" << gd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
+ m_t << " <xi:include href=\"" << gd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
}
}
}
- t << "</chapter>\n";
+ m_t << "</chapter>\n";
break;
case isDirDocumentation:
{
- t << "</title>" << endl;
+ m_t << "</title>\n";
for (const auto &dd : *Doxygen::dirLinkedMap)
{
if (dd->isLinkableInProject())
{
- t << "< xi:include href=\"" << dd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
+ m_t << "< xi:include href=\"" << dd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
}
}
}
- t << "</chapter>\n";
+ m_t << "</chapter>\n";
break;
case isNamespaceDocumentation:
{
- t << "</title>" << endl;
+ m_t << "</title>\n";
for (const auto &nd : *Doxygen::namespaceLinkedMap)
{
if (nd->isLinkableInProject() && !nd->isAlias())
{
- t << "<xi:include href=\"" << nd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
+ m_t << "<xi:include href=\"" << nd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
}
}
}
- t << "</chapter>\n";
+ m_t << "</chapter>\n";
+ break;
+ case isConceptDocumentation:
+ {
+ m_t << "</title>\n";
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ if (cd->isLinkableInProject() && !cd->isAlias())
+ {
+ m_t << "<xi:include href=\"" << cd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
+ }
+ }
+ }
+ m_t << "</chapter>\n";
break;
case isClassDocumentation:
{
- t << "</title>" << endl;
+ m_t << "</title>\n";
for (const auto &cd : *Doxygen::classLinkedMap)
{
if (cd->isLinkableInProject() &&
@@ -528,15 +560,15 @@ DB_GEN_C2("IndexSections " << is)
!cd->isAlias()
)
{
- t << " <xi:include href=\"" << cd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
+ m_t << " <xi:include href=\"" << cd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
}
}
}
- t << "</chapter>\n";
+ m_t << "</chapter>\n";
break;
case isFileDocumentation:
{
- t << "</title>" << endl;
+ m_t << "</title>\n";
bool isFirst=TRUE;
for (const auto &fn : *Doxygen::inputNameLinkedMap)
{
@@ -546,64 +578,64 @@ DB_GEN_C2("IndexSections " << is)
{
if (isFirst)
{
- t << " <xi:include href=\"" << fd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
+ m_t << " <xi:include href=\"" << fd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
{
- t << " <xi:include href=\"" << fd->getSourceFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
+ m_t << " <xi:include href=\"" << fd->getSourceFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
}
isFirst=FALSE;
}
else
{
- t << " <xi:include href=\"" << fd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
+ m_t << " <xi:include href=\"" << fd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
{
- t << " <xi:include href=\"" << fd->getSourceFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
+ m_t << " <xi:include href=\"" << fd->getSourceFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
}
}
}
}
}
}
- t << "</chapter>\n";
+ m_t << "</chapter>\n";
break;
case isExampleDocumentation:
{
- t << "</title>" << endl;
+ m_t << "</title>\n";
for (const auto &pd : *Doxygen::exampleLinkedMap)
{
- t << " <xi:include href=\"" << pd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
+ m_t << " <xi:include href=\"" << pd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
}
}
- t << "</chapter>\n";
+ m_t << "</chapter>\n";
break;
case isPageDocumentation:
break;
case isPageDocumentation2:
break;
case isEndIndex:
- t << "<index/>" << endl;
+ m_t << "<index/>\n";
break;
}
}
-void DocbookGenerator::writePageLink(const char *name, bool /*first*/)
+void DocbookGenerator::writePageLink(const QCString &name, bool /*first*/)
{
DB_GEN_C
for (const auto &pd : *Doxygen::pageLinkedMap)
{
if (!pd->getGroupDef() && !pd->isReference() && pd->name() == stripPath(name))
{
- t << "<chapter>\n";
+ m_t << "<chapter>\n";
if (pd->hasTitle())
{
- t << " <title>" << convertToDocBook(pd->title()) << "</title>" << endl;
+ m_t << " <title>" << convertToDocBook(pd->title()) << "</title>\n";
}
else
{
- t << " <title>" << convertToDocBook(pd->name()) << "</title>" << endl;
+ m_t << " <title>" << convertToDocBook(pd->name()) << "</title>\n";
}
- t << " <xi:include href=\"" << pd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
- t << "</chapter>\n";
+ m_t << " <xi:include href=\"" << pd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n";
+ m_t << "</chapter>\n";
}
}
}
@@ -612,126 +644,130 @@ void DocbookGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef
{
DB_GEN_C
DocbookDocVisitor *visitor =
- new DocbookDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""));
+ new DocbookDocVisitor(m_t,*this,ctx?ctx->getDefFileExtension():QCString());
n->accept(visitor);
delete visitor;
}
-void DocbookGenerator::startParagraph(const char *)
+void DocbookGenerator::startParagraph(const QCString &)
{
DB_GEN_C
- t << "<para>" << endl;
+ m_t << "<para>\n";
}
void DocbookGenerator::endParagraph()
{
DB_GEN_C
- t << "</para>" << endl;
+ m_t << "</para>\n";
}
-void DocbookGenerator::writeString(const char *text)
+void DocbookGenerator::writeString(const QCString &text)
{
DB_GEN_C
- t << text;
+ m_t << text;
}
-void DocbookGenerator::startMemberHeader(const char *,int)
+void DocbookGenerator::startMemberHeader(const QCString &,int)
{
DB_GEN_C
- t << "<simplesect>" << endl;
+ m_t << "<simplesect>\n";
m_inSimpleSect[m_levelListItem] = TRUE;
- t << " <title>";
+ m_t << " <title>";
}
void DocbookGenerator::endMemberHeader()
{
DB_GEN_C
- t << " </title>" << endl;
+ m_t << " </title>\n";
}
-void DocbookGenerator::docify(const char *str)
+void DocbookGenerator::docify(const QCString &str)
{
DB_GEN_C
- t << convertToDocBook(str);
+ m_t << convertToDocBook(str);
}
-void DocbookGenerator::writeObjectLink(const char *, const char *f,
- const char *anchor, const char *text)
+void DocbookGenerator::writeObjectLink(const QCString &, const QCString &f,
+ const QCString &anchor, const QCString &text)
{
DB_GEN_C
- if (anchor)
- if (f) t << "<link linkend=\"_" << stripPath(f) << "_1" << anchor << "\">";
- else t << "<link linkend=\"_" << anchor << "\">";
+ if (!anchor.isEmpty())
+ {
+ if (!f.isEmpty()) m_t << "<link linkend=\"_" << stripPath(f) << "_1" << anchor << "\">";
+ else m_t << "<link linkend=\"_" << anchor << "\">";
+ }
else
- t << "<link linkend=\"_" << stripPath(f) << "\">";
+ {
+ m_t << "<link linkend=\"_" << stripPath(f) << "\">";
+ }
docify(text);
- t << "</link>";
+ m_t << "</link>";
}
void DocbookGenerator::startMemberList()
{
DB_GEN_C
- t << " <itemizedlist>" << endl;
+ m_t << " <itemizedlist>\n";
m_levelListItem++;
}
void DocbookGenerator::endMemberList()
{
DB_GEN_C
- if (m_inListItem[m_levelListItem]) t << "</listitem>" << endl;
+ if (m_inListItem[m_levelListItem]) m_t << "</listitem>\n";
m_inListItem[m_levelListItem] = FALSE;
- t << " </itemizedlist>" << endl;
+ m_t << " </itemizedlist>\n";
m_levelListItem = (m_levelListItem> 0 ? m_levelListItem - 1 : 0);
- if (m_inSimpleSect[m_levelListItem]) t << "</simplesect>" << endl;
+ if (m_inSimpleSect[m_levelListItem]) m_t << "</simplesect>\n";
m_inSimpleSect[m_levelListItem] = FALSE;
}
-void DocbookGenerator::startMemberItem(const char *,int,const char *)
+void DocbookGenerator::startMemberItem(const QCString &,int,const QCString &)
{
DB_GEN_C
- if (m_inListItem[m_levelListItem]) t << "</listitem>" << endl;
- t << " <listitem><para>";
+ if (m_inListItem[m_levelListItem]) m_t << "</listitem>\n";
+ m_t << " <listitem><para>";
m_inListItem[m_levelListItem] = TRUE;
}
void DocbookGenerator::endMemberItem()
{
DB_GEN_C
- t << "</para>" << endl;
+ m_t << "</para>\n";
}
void DocbookGenerator::startBold()
{
DB_GEN_C
- t << "<emphasis role=\"strong\">";
+ m_t << "<emphasis role=\"strong\">";
}
void DocbookGenerator::endBold()
{
DB_GEN_C
- t << "</emphasis>";
+ m_t << "</emphasis>";
}
void DocbookGenerator::startGroupHeader(int extraIndentLevel)
{
DB_GEN_C2("m_inLevel " << m_inLevel)
DB_GEN_C2("extraIndentLevel " << extraIndentLevel)
m_firstMember = TRUE;
- if (m_inSimpleSect[m_levelListItem]) t << "</simplesect>" << endl;
+ if (m_inSimpleSect[m_levelListItem]) m_t << "</simplesect>\n";
m_inSimpleSect[m_levelListItem] = FALSE;
if (m_inLevel != -1) m_inGroup = TRUE;
- if (m_inLevel == extraIndentLevel) t << "</section>" << endl;
+ if (m_inLevel == extraIndentLevel) m_t << "</section>\n";
m_inLevel = extraIndentLevel;
- t << "<section>" << endl;
- t << "<title>";
+ m_t << "<section>\n";
+ m_t << "<title>";
}
void DocbookGenerator::writeRuler()
{
DB_GEN_C2("m_inLevel " << m_inLevel)
DB_GEN_C2("m_inGroup " << m_inGroup)
- if (m_inGroup) t << "</section>" << endl;
+ if (m_inGroup) m_t << "</section>\n";
m_inGroup = FALSE;
}
void DocbookGenerator::endGroupHeader(int)
{
DB_GEN_C
- t << "</title>" << endl;
+ m_t << "</title>\n";
}
void DocbookGenerator::startParameterList(bool openBracket)
{
DB_GEN_C
- if (openBracket) t << "(";
+ if (openBracket) m_t << "(";
}
void DocbookGenerator::endParameterList()
{
@@ -740,22 +776,22 @@ DB_GEN_C
void DocbookGenerator::writeNonBreakableSpace(int n)
{
DB_GEN_C
- for (int i=0;i<n;i++) t << " ";
+ for (int i=0;i<n;i++) m_t << " ";
}
-void DocbookGenerator::lineBreak(const char *)
+void DocbookGenerator::lineBreak(const QCString &)
{
DB_GEN_C
- t << endl;
+ m_t << "\n";
}
void DocbookGenerator::startTypewriter()
{
DB_GEN_C
- if (!m_denseText) t << "<computeroutput>";
+ if (!m_denseText) m_t << "<computeroutput>";
}
void DocbookGenerator::endTypewriter()
{
DB_GEN_C
- if (!m_denseText) t << "</computeroutput>" << endl;
+ if (!m_denseText) m_t << "</computeroutput>\n";
}
void DocbookGenerator::startTextBlock(bool dense)
{
@@ -763,7 +799,7 @@ DB_GEN_C
if (dense)
{
m_denseText = TRUE;
- t << "<programlisting>";
+ m_t << "<programlisting>";
}
}
void DocbookGenerator::endTextBlock(bool)
@@ -772,65 +808,65 @@ DB_GEN_C
if (m_denseText)
{
m_denseText = FALSE;
- t << "</programlisting>";
+ m_t << "</programlisting>";
}
}
-void DocbookGenerator::startMemberDoc(const char *clname, const char *memname, const char *, const char *title,
+void DocbookGenerator::startMemberDoc(const QCString &clname, const QCString &memname, const QCString &, const QCString &title,
int memCount, int memTotal, bool)
{
DB_GEN_C2("m_inLevel " << m_inLevel)
- t << " <section>" << endl;
- t << " <title>" << convertToDocBook(title);
+ m_t << " <section>\n";
+ m_t << " <title>" << convertToDocBook(title);
if (memTotal>1)
{
- t << "<computeroutput>[" << memCount << "/" << memTotal << "]</computeroutput>";
+ m_t << "<computeroutput>[" << memCount << "/" << memTotal << "]</computeroutput>";
}
- t << "</title>" << endl;
- if (memname && memname[0]!='@')
+ m_t << "</title>\n";
+ if (!memname.isEmpty() && memname[0]!='@')
{
- addIndexTerm(t,memname,clname);
- addIndexTerm(t,clname,memname);
+ addIndexTerm(m_t,memname,clname);
+ addIndexTerm(m_t,clname,memname);
}
}
void DocbookGenerator::endMemberDoc(bool)
{
DB_GEN_C
- t << "</computeroutput></para>";
+ m_t << "</computeroutput></para>";
}
-void DocbookGenerator::startTitleHead(const char *)
+void DocbookGenerator::startTitleHead(const QCString &)
{
DB_GEN_C
- t << "<title>";
+ m_t << "<title>";
}
-void DocbookGenerator::endTitleHead(const char *,const char *name)
+void DocbookGenerator::endTitleHead(const QCString &,const QCString &name)
{
DB_GEN_C
- t << "</title>" << endl;
- if (name) addIndexTerm(t, name);
+ m_t << "</title>\n";
+ if (!name.isEmpty()) addIndexTerm(m_t, name);
}
-void DocbookGenerator::startDoxyAnchor(const char *fName,const char *,
- const char *anchor,const char *,
- const char *)
+void DocbookGenerator::startDoxyAnchor(const QCString &fName,const QCString &,
+ const QCString &anchor,const QCString &,
+ const QCString &)
{
DB_GEN_C
if (!m_inListItem[m_levelListItem] && !m_descTable)
{
- if (!m_firstMember) t << " </section>";
+ if (!m_firstMember) m_t << " </section>";
m_firstMember = FALSE;
}
- if (anchor)
+ if (!anchor.isEmpty())
{
- t << "<anchor xml:id=\"_" << stripPath(fName) << "_1" << anchor << "\"/>";
+ m_t << "<anchor xml:id=\"_" << stripPath(fName) << "_1" << anchor << "\"/>";
}
}
-void DocbookGenerator::endDoxyAnchor(const char *,const char *)
+void DocbookGenerator::endDoxyAnchor(const QCString &,const QCString &)
{
DB_GEN_C
}
void DocbookGenerator::startMemberDocName(bool)
{
DB_GEN_C
- t << "<para><computeroutput>";
+ m_t << "<para><computeroutput>";
}
void DocbookGenerator::endMemberDocName()
{
@@ -839,12 +875,12 @@ DB_GEN_C
void DocbookGenerator::startMemberGroupHeader(bool)
{
DB_GEN_C
- t << "<simplesect><title>";
+ m_t << "<simplesect><title>";
}
void DocbookGenerator::endMemberGroupHeader()
{
DB_GEN_C
- t << "</title>" << endl;
+ m_t << "</title>\n";
}
void DocbookGenerator::startMemberGroup()
{
@@ -853,38 +889,38 @@ DB_GEN_C
void DocbookGenerator::endMemberGroup(bool)
{
DB_GEN_C
- t << "</simplesect>" << endl;
+ m_t << "</simplesect>\n";
}
void DocbookGenerator::startClassDiagram()
{
DB_GEN_C
- t << "<para>";
+ m_t << "<para>";
}
-void DocbookGenerator::endClassDiagram(const ClassDiagram &d, const char *fileName,const char *)
+void DocbookGenerator::endClassDiagram(const ClassDiagram &d, const QCString &fileName,const QCString &)
{
DB_GEN_C
- t << " <informalfigure>" << endl;
- t << " <mediaobject>" << endl;
- t << " <imageobject>" << endl;
- t << " <imagedata width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\""
- << relPath << fileName << ".png\">" << "</imagedata>" << endl;
- t << " </imageobject>" << endl;
- d.writeImage(t,dir(),relPath,fileName,FALSE);
- t << " </mediaobject>" << endl;
- t << " </informalfigure>" << endl;
- t << "</para>" << endl;
+ m_t << " <informalfigure>\n";
+ m_t << " <mediaobject>\n";
+ m_t << " <imageobject>\n";
+ m_t << " <imagedata width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\""
+ << relPath << fileName << ".png\">" << "</imagedata>\n";
+ m_t << " </imageobject>\n";
+ d.writeImage(m_t,dir(),relPath,fileName,FALSE);
+ m_t << " </mediaobject>\n";
+ m_t << " </informalfigure>\n";
+ m_t << "</para>\n";
}
void DocbookGenerator::startLabels()
{
DB_GEN_C
}
-void DocbookGenerator::writeLabel(const char *l,bool isLast)
+void DocbookGenerator::writeLabel(const QCString &l,bool isLast)
{
DB_GEN_C
- t << "<computeroutput>[" << l << "]</computeroutput>";
- if (!isLast) t << ", ";
+ m_t << "<computeroutput>[" << l << "]</computeroutput>";
+ if (!isLast) m_t << ", ";
}
void DocbookGenerator::endLabels()
@@ -894,25 +930,25 @@ DB_GEN_C
void DocbookGenerator::startExamples()
{
DB_GEN_C
- t << "<simplesect><title>";
+ m_t << "<simplesect><title>";
docify(theTranslator->trExamples());
- t << "</title>";
+ m_t << "</title>";
}
void DocbookGenerator::endExamples()
{
DB_GEN_C
- t << "</simplesect>" << endl;
+ m_t << "</simplesect>\n";
}
void DocbookGenerator::startSubsubsection()
{
DB_GEN_C
- t << "<simplesect><title>";
+ m_t << "<simplesect><title>";
}
void DocbookGenerator::endSubsubsection()
{
DB_GEN_C
- t << "</title></simplesect>" << endl;
+ m_t << "</title></simplesect>\n";
}
void DocbookGenerator::writeChar(char c)
{
@@ -925,33 +961,37 @@ DB_GEN_C
void DocbookGenerator::startMemberDocPrefixItem()
{
DB_GEN_C
- t << "<computeroutput>";
+ m_t << "<computeroutput>";
}
void DocbookGenerator::endMemberDocPrefixItem()
{
DB_GEN_C
- t << "</computeroutput>";
+ m_t << "</computeroutput>";
}
-void DocbookGenerator::exceptionEntry(const char* prefix,bool closeBracket)
+void DocbookGenerator::exceptionEntry(const QCString &prefix,bool closeBracket)
{
DB_GEN_C
- if (prefix)
- t << " " << prefix << "(";
+ if (!prefix.isEmpty())
+ {
+ m_t << " " << prefix << "(";
+ }
else if (closeBracket)
- t << ")";
- t << " ";
+ {
+ m_t << ")";
+ }
+ m_t << " ";
}
void DocbookGenerator::startParameterName(bool)
{
DB_GEN_C
- t << " ";
+ m_t << " ";
}
void DocbookGenerator::endParameterName(bool last,bool /*emptyList*/,bool closeBracket)
{
DB_GEN_C
if (last)
{
- if (closeBracket) t << ")";
+ if (closeBracket) m_t << ")";
}
}
void DocbookGenerator::startMemberTemplateParams()
@@ -959,65 +999,65 @@ void DocbookGenerator::startMemberTemplateParams()
DB_GEN_C
}
-void DocbookGenerator::endMemberTemplateParams(const char *,const char *)
+void DocbookGenerator::endMemberTemplateParams(const QCString &,const QCString &)
{
DB_GEN_C
- t << "</para>";
- t << "<para>";
+ m_t << "</para>";
+ m_t << "<para>";
}
-void DocbookGenerator::startSection(const char *lab,const char *,SectionType)
+void DocbookGenerator::startSection(const QCString &lab,const QCString &,SectionType)
{
DB_GEN_C
- t << " <section xml:id=\"_" << stripPath(lab) << "\">";
- t << "<title>";
+ m_t << " <section xml:id=\"_" << stripPath(lab) << "\">";
+ m_t << "<title>";
}
-void DocbookGenerator::endSection(const char *,SectionType)
+void DocbookGenerator::endSection(const QCString &,SectionType)
{
DB_GEN_C
- t << "</title>";
- t << " </section>";
+ m_t << "</title>";
+ m_t << " </section>";
}
-void DocbookGenerator::addIndexItem(const char *prim,const char *sec)
+void DocbookGenerator::addIndexItem(const QCString &prim,const QCString &sec)
{
DB_GEN_C
- addIndexTerm(t, prim, sec);
+ addIndexTerm(m_t, prim, sec);
}
-void DocbookGenerator::startDescTable(const char *title)
+void DocbookGenerator::startDescTable(const QCString &title)
{
DB_GEN_C
int ncols = 2;
- t << "<informaltable frame=\"all\">" << endl;
- if (title)t << "<title>" << convertToDocBook(title) << "</title>" << endl;
- t << " <tgroup cols=\"" << ncols << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">" << endl;
+ m_t << "<informaltable frame=\"all\">\n";
+ if (!title.isEmpty()) m_t << "<title>" << convertToDocBook(title) << "</title>\n";
+ m_t << " <tgroup cols=\"" << ncols << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
for (int i = 0; i < ncols; i++)
{
- t << " <colspec colname='c" << i+1 << "'/>\n";
+ m_t << " <colspec colname='c" << i+1 << "'/>\n";
}
- t << "<tbody>\n";
+ m_t << "<tbody>\n";
m_descTable = TRUE;
}
void DocbookGenerator::endDescTable()
{
DB_GEN_C
- t << " </tbody>" << endl;
- t << " </tgroup>" << endl;
- t << "</informaltable>" << endl;
+ m_t << " </tbody>\n";
+ m_t << " </tgroup>\n";
+ m_t << "</informaltable>\n";
m_descTable = FALSE;
}
void DocbookGenerator::startDescTableRow()
{
DB_GEN_C
- t << "<row>";
- t << "<entry>";
+ m_t << "<row>";
+ m_t << "<entry>";
}
void DocbookGenerator::endDescTableRow()
{
DB_GEN_C
- t << "</row>";
+ m_t << "</row>";
}
void DocbookGenerator::startDescTableTitle()
@@ -1033,13 +1073,13 @@ DB_GEN_C
void DocbookGenerator::startDescTableData()
{
DB_GEN_C
- t << "</entry><entry>";
+ m_t << "</entry><entry>";
}
void DocbookGenerator::endDescTableData()
{
DB_GEN_C
- t << "</entry>";
+ m_t << "</entry>";
}
void DocbookGenerator::startGroupCollaboration()
{
@@ -1048,7 +1088,7 @@ DB_GEN_C
void DocbookGenerator::endGroupCollaboration(DotGroupCollaboration &g)
{
DB_GEN_C
- g.writeGraph(t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,FALSE);
+ g.writeGraph(m_t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,FALSE);
}
void DocbookGenerator::startDotGraph()
{
@@ -1057,7 +1097,7 @@ DB_GEN_C
void DocbookGenerator::endDotGraph(DotClassGraph &g)
{
DB_GEN_C
- g.writeGraph(t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,TRUE,FALSE);
+ g.writeGraph(m_t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,TRUE,FALSE);
}
void DocbookGenerator::startInclDepGraph()
{
@@ -1066,7 +1106,7 @@ DB_GEN_C
void DocbookGenerator::endInclDepGraph(DotInclDepGraph &g)
{
DB_GEN_C
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,FALSE);
+ QCString fn = g.writeGraph(m_t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,FALSE);
}
void DocbookGenerator::startCallGraph()
{
@@ -1075,7 +1115,7 @@ DB_GEN_C
void DocbookGenerator::endCallGraph(DotCallGraph &g)
{
DB_GEN_C
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,FALSE);
+ QCString fn = g.writeGraph(m_t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,FALSE);
}
void DocbookGenerator::startDirDepGraph()
{
@@ -1084,7 +1124,7 @@ DB_GEN_C
void DocbookGenerator::endDirDepGraph(DotDirDeps &g)
{
DB_GEN_C
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,FALSE);
+ QCString fn = g.writeGraph(m_t,GOF_BITMAP,EOF_DocBook,dir(),fileName(),relPath,FALSE);
}
void DocbookGenerator::startMemberDocList()
{
@@ -1095,17 +1135,17 @@ void DocbookGenerator::endMemberDocList()
DB_GEN_C
m_inGroup = TRUE;
}
-void DocbookGenerator::startConstraintList(const char *header)
+void DocbookGenerator::startConstraintList(const QCString &header)
{
DB_GEN_C
- t << "<simplesect><title>";
+ m_t << "<simplesect><title>";
docify(header);
- t << "</title>" << endl;
+ m_t << "</title>\n";
}
void DocbookGenerator::startConstraintParam()
{
DB_GEN_C
- t << "<para><emphasis role=\"strong\">";
+ m_t << "<para><emphasis role=\"strong\">";
}
void DocbookGenerator::endConstraintParam()
{
@@ -1114,12 +1154,12 @@ DB_GEN_C
void DocbookGenerator::startConstraintType()
{
DB_GEN_C
- t << ":";
+ m_t << ":";
}
void DocbookGenerator::endConstraintType()
{
DB_GEN_C
- t << "</emphasis></para>" << endl;
+ m_t << "</emphasis></para>\n";
}
void DocbookGenerator::startConstraintDocs()
{
@@ -1132,5 +1172,5 @@ DB_GEN_C
void DocbookGenerator::endConstraintList()
{
DB_GEN_C
- t << "</simplesect>" << endl;
+ m_t << "</simplesect>\n";
}
diff --git a/src/docbookgen.h b/src/docbookgen.h
index 214ec97..aba1527 100644
--- a/src/docbookgen.h
+++ b/src/docbookgen.h
@@ -15,50 +15,45 @@
#ifndef DOCBOOKGEN_H
#define DOCBOOKGEN_H
+#include <iostream>
+
#include "config.h"
#include "outputgen.h"
class DocbookCodeGenerator : public CodeOutputInterface
{
public:
- DocbookCodeGenerator(FTextStream &t);
- DocbookCodeGenerator();
+ DocbookCodeGenerator(TextStream &t);
virtual ~DocbookCodeGenerator();
- void setTextStream(FTextStream &t)
- {
- m_streamSet = t.device()!=0;
- m_t.setDevice(t.device());
- }
void setRelativePath(const QCString &path) { m_relPath = path; }
void setSourceFileName(const QCString &sourceFileName) { m_sourceFileName = sourceFileName; }
QCString sourceFileName() { return m_sourceFileName; }
- void codify(const char *text);
- void writeCodeLink(const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip);
- void writeCodeLinkLine(const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip);
- void writeTooltip(const char *, const DocLinkInfo &, const char *,
- const char *, const SourceLinkInfo &, const SourceLinkInfo &
+ void codify(const QCString &text);
+ void writeCodeLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip);
+ void writeCodeLinkLine(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip);
+ void writeTooltip(const QCString &, const DocLinkInfo &, const QCString &,
+ const QCString &, const SourceLinkInfo &, const SourceLinkInfo &
);
void startCodeLine(bool);
void endCodeLine();
- void startFontClass(const char *colorClass);
+ void startFontClass(const QCString &colorClass);
void endFontClass();
- void writeCodeAnchor(const char *);
- void writeLineNumber(const char *extRef,const char *compId,
- const char *anchorId,int l);
- void setCurrentDoc(const Definition *,const char *,bool);
- void addWord(const char *,bool);
+ void writeCodeAnchor(const QCString &);
+ void writeLineNumber(const QCString &extRef,const QCString &compId,
+ const QCString &anchorId,int l);
+ void setCurrentDoc(const Definition *,const QCString &,bool);
+ void addWord(const QCString &,bool);
void finish();
- void startCodeFragment(const char *style);
- void endCodeFragment(const char *style);
+ void startCodeFragment(const QCString &style);
+ void endCodeFragment(const QCString &style);
private:
- FTextStream m_t;
- bool m_streamSet = false;
+ TextStream &m_t;
QCString m_refId;
QCString m_external;
int m_lineNumber = -1;
@@ -108,31 +103,31 @@ class DocbookGenerator : public OutputGenerator
OutputType type() const { return Docbook; }
// --- CodeOutputInterface
- void codify(const char *text)
+ void codify(const QCString &text)
{ m_codeGen.codify(text); }
- void writeCodeLink(const char *ref, const char *file,
- const char *anchor,const char *name,
- const char *tooltip)
+ void writeCodeLink(const QCString &ref, const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip)
{ m_codeGen.writeCodeLink(ref,file,anchor,name,tooltip); }
- void writeLineNumber(const char *ref,const char *file,const char *anchor,int lineNumber)
+ void writeLineNumber(const QCString &ref,const QCString &file,const QCString &anchor,int lineNumber)
{ m_codeGen.writeLineNumber(ref,file,anchor,lineNumber); }
- void writeTooltip(const char *id, const DocLinkInfo &docInfo, const char *decl,
- const char *desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo
+ void writeTooltip(const QCString &id, const DocLinkInfo &docInfo, const QCString &decl,
+ const QCString &desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo
)
{ m_codeGen.writeTooltip(id,docInfo,decl,desc,defInfo,declInfo); }
void startCodeLine(bool hasLineNumbers)
{ m_codeGen.startCodeLine(hasLineNumbers); }
void endCodeLine()
{ m_codeGen.endCodeLine(); }
- void startFontClass(const char *s)
+ void startFontClass(const QCString &s)
{ m_codeGen.startFontClass(s); }
void endFontClass()
{ m_codeGen.endFontClass(); }
- void writeCodeAnchor(const char *anchor)
+ void writeCodeAnchor(const QCString &anchor)
{ m_codeGen.writeCodeAnchor(anchor); }
- void startCodeFragment(const char *style)
+ void startCodeFragment(const QCString &style)
{ m_codeGen.startCodeFragment(style); }
- void endCodeFragment(const char *style)
+ void endCodeFragment(const QCString &style)
{ m_codeGen.endCodeFragment(style); }
// ---------------------------
@@ -141,19 +136,19 @@ class DocbookGenerator : public OutputGenerator
///////////////////////////////////////////////////////////////
// structural output interface
///////////////////////////////////////////////////////////////
- void startFile(const char *name,const char *manName,
- const char *title,int id);
+ void startFile(const QCString &name,const QCString &manName,
+ const QCString &title,int id);
void writeSearchInfo(){DB_GEN_EMPTY};
- void writeFooter(const char *){DB_GEN_NEW};
+ void writeFooter(const QCString &){DB_GEN_NEW};
void endFile();
void startIndexSection(IndexSections);
void endIndexSection(IndexSections);
- void writePageLink(const char *,bool);
+ void writePageLink(const QCString &,bool);
void startProjectNumber(){DB_GEN_NEW};
void endProjectNumber(){DB_GEN_NEW};
void writeStyleInfo(int){DB_GEN_EMPTY};
- void startTitleHead(const char *);
- void endTitleHead(const char *fileName,const char *name);
+ void startTitleHead(const QCString &);
+ void endTitleHead(const QCString &fileName,const QCString &name);
void startIndexListItem(){DB_GEN_NEW};
void endIndexListItem(){DB_GEN_NEW};
void startIndexList(){DB_GEN_NEW};
@@ -161,21 +156,21 @@ class DocbookGenerator : public OutputGenerator
void startIndexKey(){DB_GEN_NEW};
void endIndexKey(){DB_GEN_NEW};
void startIndexValue(bool){DB_GEN_NEW};
- void endIndexValue(const char *,bool){DB_GEN_NEW};
+ void endIndexValue(const QCString &,bool){DB_GEN_NEW};
void startItemList() {DB_GEN_EMPTY};
void endItemList() {DB_GEN_EMPTY};
- void startIndexItem(const char *,const char *){DB_GEN_NEW};
- void endIndexItem(const char *,const char *){DB_GEN_NEW};
+ void startIndexItem(const QCString &,const QCString &){DB_GEN_NEW};
+ void endIndexItem(const QCString &,const QCString &){DB_GEN_NEW};
void startItemListItem() {DB_GEN_EMPTY};
void endItemListItem() {DB_GEN_EMPTY};
- void docify(const char *text);
+ void docify(const QCString &text);
void writeChar(char);
- void writeString(const char *);
- void startParagraph(const char *);
+ void writeString(const QCString &);
+ void startParagraph(const QCString &);
void endParagraph();
- void writeObjectLink(const char *,const char *,const char *,const char *);
- void startHtmlLink(const char *){DB_GEN_NEW};
+ void writeObjectLink(const QCString &,const QCString &,const QCString &,const QCString &);
+ void startHtmlLink(const QCString &){DB_GEN_NEW};
void endHtmlLink(){DB_GEN_NEW};
void startBold();
void endBold();
@@ -196,17 +191,17 @@ class DocbookGenerator : public OutputGenerator
void endSmall(){DB_GEN_NEW};
void startExamples();
void endExamples();
- void startParamList(BaseOutputDocInterface::ParamListTypes,const char *){DB_GEN_NEW};
+ void startParamList(BaseOutputDocInterface::ParamListTypes,const QCString &){DB_GEN_NEW};
void endParamList(){DB_GEN_NEW};
void startTitle(){DB_GEN_NEW};
void endTitle(){DB_GEN_NEW};
- void writeAnchor(const char *,const char *){DB_GEN_EMPTY};
- void startSection(const char *,const char *,SectionType);
- void endSection(const char *,SectionType);
- void lineBreak(const char *);
- void addIndexItem(const char *,const char *);
+ void writeAnchor(const QCString &,const QCString &){DB_GEN_EMPTY};
+ void startSection(const QCString &,const QCString &,SectionType);
+ void endSection(const QCString &,SectionType);
+ void lineBreak(const QCString &);
+ void addIndexItem(const QCString &,const QCString &);
void writeNonBreakableSpace(int);
- void startDescTable(const char *);
+ void startDescTable(const QCString &);
void endDescTable();
void startDescTableRow();
void endDescTableRow();
@@ -214,10 +209,10 @@ class DocbookGenerator : public OutputGenerator
void endDescTableTitle();
void startDescTableData();
void endDescTableData();
- void startTextLink(const char *,const char *){DB_GEN_NEW};
+ void startTextLink(const QCString &,const QCString &){DB_GEN_NEW};
void endTextLink(){DB_GEN_NEW};
void startPageRef(){DB_GEN_NEW};
- void endPageRef(const char *,const char *){DB_GEN_NEW};
+ void endPageRef(const QCString &,const QCString &){DB_GEN_NEW};
void startSubsection(){DB_GEN_NEW};
void endSubsection(){DB_GEN_NEW};
void startSubsubsection();
@@ -230,7 +225,7 @@ class DocbookGenerator : public OutputGenerator
void endMemberSections(){DB_GEN_EMPTY};
void startHeaderSection(){DB_GEN_EMPTY};
void endHeaderSection(){DB_GEN_EMPTY};
- void startMemberHeader(const char *anchor, int typ);
+ void startMemberHeader(const QCString &anchor, int typ);
void endMemberHeader();
void startMemberSubtitle(){DB_GEN_EMPTY};
void endMemberSubtitle(){DB_GEN_EMPTY};
@@ -242,10 +237,12 @@ class DocbookGenerator : public OutputGenerator
void endInlineHeader(){DB_GEN_NEW};
void startAnonTypeScope(int){DB_GEN_EMPTY};
void endAnonTypeScope(int){DB_GEN_EMPTY};
- void startMemberItem(const char *,int,const char *);
+ void startMemberItem(const QCString &,int,const QCString &);
void endMemberItem();
void startMemberTemplateParams();
- void endMemberTemplateParams(const char *,const char *);
+ void endMemberTemplateParams(const QCString &,const QCString &);
+ void startCompoundTemplateParams() { startSubsubsection(); }
+ void endCompoundTemplateParams() { endSubsubsection(); }
void startMemberGroupHeader(bool);
void endMemberGroupHeader();
void startMemberGroupDocs(){DB_GEN_EMPTY};
@@ -254,29 +251,29 @@ class DocbookGenerator : public OutputGenerator
void endMemberGroup(bool);
void insertMemberAlign(bool){DB_GEN_EMPTY};
void insertMemberAlignLeft(int,bool){DB_GEN_EMPTY};
- void startMemberDoc(const char *,const char *,
- const char *,const char *,int,int,bool);
+ void startMemberDoc(const QCString &,const QCString &,
+ const QCString &,const QCString &,int,int,bool);
void endMemberDoc(bool);
- void startDoxyAnchor(const char *fName,const char *manName,
- const char *anchor,const char *name,
- const char *args);
- void endDoxyAnchor(const char *fileName,const char *anchor);
+ void startDoxyAnchor(const QCString &fName,const QCString &manName,
+ const QCString &anchor,const QCString &name,
+ const QCString &args);
+ void endDoxyAnchor(const QCString &fileName,const QCString &anchor);
void writeLatexSpacing(){DB_GEN_EMPTY}
- void writeStartAnnoItem(const char *,const char *,
- const char *,const char *){DB_GEN_NEW};
- void writeEndAnnoItem(const char *){DB_GEN_NEW};
- void startMemberDescription(const char *,const char *,bool){DB_GEN_EMPTY};
+ void writeStartAnnoItem(const QCString &,const QCString &,
+ const QCString &,const QCString &){DB_GEN_NEW};
+ void writeEndAnnoItem(const QCString &){DB_GEN_NEW};
+ void startMemberDescription(const QCString &,const QCString &,bool){DB_GEN_EMPTY};
void endMemberDescription(){DB_GEN_EMPTY};
void startMemberDeclaration(){DB_GEN_EMPTY};
- void endMemberDeclaration(const char *,const char *){DB_GEN_EMPTY};
- void writeInheritedSectionTitle(const char *,const char *,
- const char *,const char *,
- const char *,const char *){DB_GEN_NEW};
+ void endMemberDeclaration(const QCString &,const QCString &){DB_GEN_EMPTY};
+ void writeInheritedSectionTitle(const QCString &,const QCString &,
+ const QCString &,const QCString &,
+ const QCString &,const QCString &){DB_GEN_NEW};
void startIndent(){DB_GEN_EMPTY};
void endIndent(){DB_GEN_EMPTY};
void writeSynopsis(){DB_GEN_EMPTY};
void startClassDiagram();
- void endClassDiagram(const ClassDiagram &,const char *,const char *);
+ void endClassDiagram(const ClassDiagram &,const QCString &,const QCString &);
void startDotGraph();
void endDotGraph(DotClassGraph &g);
void startInclDepGraph();
@@ -290,14 +287,14 @@ class DocbookGenerator : public OutputGenerator
void writeGraphicalHierarchy(DotGfxHierarchyTable &){DB_GEN_NEW};
void startQuickIndices(){DB_GEN_EMPTY};
void endQuickIndices(){DB_GEN_EMPTY};
- void writeSplitBar(const char *){DB_GEN_EMPTY};
- void writeNavigationPath(const char *){DB_GEN_NEW};
+ void writeSplitBar(const QCString &){DB_GEN_EMPTY};
+ void writeNavigationPath(const QCString &){DB_GEN_NEW};
void writeLogo(){DB_GEN_NEW};
- void writeQuickLinks(bool,HighlightedItem,const char *){DB_GEN_EMPTY};
- void writeSummaryLink(const char *,const char *,const char *,bool){DB_GEN_EMPTY};
+ void writeQuickLinks(bool,HighlightedItem,const QCString &){DB_GEN_EMPTY};
+ void writeSummaryLink(const QCString &,const QCString &,const QCString &,bool){DB_GEN_EMPTY};
void startContents(){DB_GEN_EMPTY};
void endContents(){DB_GEN_EMPTY};
- void startPageDoc(const char *){DB_GEN_EMPTY}
+ void startPageDoc(const QCString &){DB_GEN_EMPTY}
void endPageDoc() {DB_GEN_EMPTY}
void startTextBlock(bool);
void endTextBlock(bool);
@@ -306,15 +303,15 @@ class DocbookGenerator : public OutputGenerator
void endMemberDocPrefixItem();
void startMemberDocName(bool);
void endMemberDocName();
- void startParameterType(bool,const char *){DB_GEN_EMPTY};
+ void startParameterType(bool,const QCString &){DB_GEN_EMPTY};
void endParameterType(){DB_GEN_EMPTY};
void startParameterName(bool);
void endParameterName(bool,bool,bool);
void startParameterList(bool);
void endParameterList();
- void exceptionEntry(const char*,bool);
+ void exceptionEntry(const QCString &,bool);
- void startConstraintList(const char *);
+ void startConstraintList(const QCString &);
void startConstraintParam();
void endConstraintParam();
void startConstraintType();
@@ -333,11 +330,11 @@ class DocbookGenerator : public OutputGenerator
void endInlineMemberDoc(){DB_GEN_NEW};
void startLabels();
- void writeLabel(const char *,bool);
+ void writeLabel(const QCString &,bool);
void endLabels();
- void setCurrentDoc(const Definition *,const char *,bool) {DB_GEN_EMPTY}
- void addWord(const char *,bool) {DB_GEN_EMPTY}
+ void setCurrentDoc(const Definition *,const QCString &,bool) {DB_GEN_EMPTY}
+ void addWord(const QCString &,bool) {DB_GEN_EMPTY}
private:
diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp
index 84d85c7..f5133d6 100644
--- a/src/docbookvisitor.cpp
+++ b/src/docbookvisitor.cpp
@@ -13,8 +13,7 @@
*
*/
-
-#include <qfileinfo.h>
+#include <fstream>
#include "docbookvisitor.h"
#include "docparser.h"
@@ -35,6 +34,7 @@
#include "emoji.h"
#include "plantuml.h"
#include "growbuf.h"
+#include "fileinfo.h"
#if 0
#define DB_VIS_C DB_VIS_C1(m_t)
@@ -48,12 +48,12 @@
#define DB_VIS_C2a(x,y)
#endif
-static QCString filterId(const char *s)
+static QCString filterId(const QCString &s)
{
+ if (s.isEmpty()) return s;
static GrowBuf growBuf;
growBuf.clear();
- if (s==0) return "";
- const char *p=s;
+ const char *p=s.data();
char c;
while ((c=*p++))
{
@@ -89,7 +89,7 @@ void DocbookDocVisitor::visitCaption(const DocNodeList &children)
for (const auto &n : children) n->accept(this);
}
-void DocbookDocVisitor::visitPreStart(FTextStream &t,
+void DocbookDocVisitor::visitPreStart(TextStream &t,
const DocNodeList &children,
bool hasCaption,
const QCString &name,
@@ -99,17 +99,17 @@ void DocbookDocVisitor::visitPreStart(FTextStream &t,
{
if (hasCaption && !inlineImage)
{
- t << " <figure>" << endl;
- t << " <title>" << endl;
+ t << " <figure>\n";
+ t << " <title>\n";
visitCaption(children);
- t << " </title>" << endl;
+ t << " </title>\n";
}
else
{
- t << " <informalfigure>" << endl;
+ t << " <informalfigure>\n";
}
- t << " <mediaobject>" << endl;
- t << " <imageobject>" << endl;
+ t << " <mediaobject>\n";
+ t << " <imageobject>\n";
t << " <imagedata";
if (!width.isEmpty())
{
@@ -124,42 +124,42 @@ void DocbookDocVisitor::visitPreStart(FTextStream &t,
t << " depth=\"" << convertToDocBook(height) << "\"";
}
t << " align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << name << "\">";
- t << "</imagedata>" << endl;
- t << " </imageobject>" << endl;
+ t << "</imagedata>\n";
+ t << " </imageobject>\n";
if (hasCaption && !inlineImage)
{
- t << " <!--" << endl; // Needed for general formatting with title for other formats
+ t << " <!--\n"; // Needed for general formatting with title for other formats
}
}
-void DocbookDocVisitor::visitPostEnd(FTextStream &t, bool hasCaption, bool inlineImage)
+void DocbookDocVisitor::visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage)
{
- t << endl;
+ t << "\n";
if (hasCaption && !inlineImage)
{
- t << " -->" << endl; // Needed for general formatting with title for other formats
+ t << " -->\n"; // Needed for general formatting with title for other formats
}
- t << " </mediaobject>" << endl;
+ t << " </mediaobject>\n";
if (hasCaption && !inlineImage)
{
- t << " </figure>" << endl;
+ t << " </figure>\n";
}
else
{
- t << " </informalfigure>" << endl;
+ t << " </informalfigure>\n";
}
}
-DocbookDocVisitor::DocbookDocVisitor(FTextStream &t,CodeOutputInterface &ci,const char *langExt)
+DocbookDocVisitor::DocbookDocVisitor(TextStream &t,CodeOutputInterface &ci,const QCString &langExt)
: DocVisitor(DocVisitor_Docbook), m_t(t), m_ci(ci),m_langExt(langExt)
{
DB_VIS_C
- // m_t << "<section>" << endl;
+ // m_t << "<section>\n";
}
DocbookDocVisitor::~DocbookDocVisitor()
{
DB_VIS_C
- // m_t << "</section>" << endl;
+ // m_t << "</section>\n";
}
//--------------------------------------
@@ -242,9 +242,9 @@ void DocbookDocVisitor::visit(DocLineBreak *)
{
DB_VIS_C
if (m_hide) return;
- m_t << endl << "<literallayout>&#160;&#xa;</literallayout>" << endl;
+ m_t << "\n<literallayout>&#160;&#xa;</literallayout>\n";
// gives nicer results but gives problems as it is not allowed in <pare> and also problems with dblatex
- // m_t << endl << "<sbr/>" << endl;
+ // m_t << "\n" << "<sbr/>\n";
}
void DocbookDocVisitor::visit(DocHorRuler *)
@@ -345,22 +345,23 @@ DB_VIS_C
QCString baseName(4096);
QCString name;
QCString stext = s->text();
- m_t << "<para>" << endl;
+ m_t << "<para>\n";
name.sprintf("%s%d", "dot_inline_dotgraph_", dotindex);
baseName.sprintf("%s%d",
- (Config_getString(DOCBOOK_OUTPUT)+"/inline_dotgraph_").data(),
+ qPrint(Config_getString(DOCBOOK_OUTPUT)+"/inline_dotgraph_"),
dotindex++
);
- QFile file(baseName+".dot");
- if (!file.open(IO_WriteOnly))
+ std::string fileName = baseName.str()+".dot";
+ std::ofstream file(fileName,std::ofstream::out | std::ofstream::binary);
+ if (!file.is_open())
{
- err("Could not open file %s.dot for writing\n",baseName.data());
+ err("Could not open file %s for writing\n",fileName.c_str());
}
- file.writeBlock( stext, stext.length() );
+ file.write( stext.data(), stext.length() );
file.close();
writeDotFile(baseName, s);
- m_t << "</para>" << endl;
- if (Config_getBool(DOT_CLEANUP)) file.remove();
+ m_t << "</para>\n";
+ if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName);
}
break;
case DocVerbatim::Msc:
@@ -369,25 +370,26 @@ DB_VIS_C
QCString baseName(4096);
QCString name;
QCString stext = s->text();
- m_t << "<para>" << endl;
+ m_t << "<para>\n";
name.sprintf("%s%d", "msc_inline_mscgraph_", mscindex);
baseName.sprintf("%s%d",
(Config_getString(DOCBOOK_OUTPUT)+"/inline_mscgraph_").data(),
mscindex++
);
- QFile file(baseName+".msc");
- if (!file.open(IO_WriteOnly))
+ std::string fileName = baseName.str()+".msc";
+ std::ofstream file(fileName,std::ofstream::out | std::ofstream::binary);
+ if (!file.is_open())
{
- err("Could not open file %s.msc for writing\n",baseName.data());
+ err("Could not open file %s for writing\n",fileName.c_str());
}
QCString text = "msc {";
text+=stext;
text+="}";
- file.writeBlock( text, text.length() );
+ file.write( text.data(), text.length() );
file.close();
writeMscFile(baseName,s);
- m_t << "</para>" << endl;
- if (Config_getBool(DOT_CLEANUP)) file.remove();
+ m_t << "</para>\n";
+ if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName);
}
break;
case DocVerbatim::PlantUML:
@@ -400,9 +402,9 @@ DB_VIS_C
{
shortName=shortName.right((int)shortName.length()-i-1);
}
- m_t << "<para>" << endl;
+ m_t << "<para>\n";
writePlantUMLFile(baseName,s);
- m_t << "</para>" << endl;
+ m_t << "</para>\n";
}
break;
}
@@ -425,8 +427,8 @@ DB_VIS_C
case DocInclude::IncWithLines:
{
m_t << "<literallayout><computeroutput>";
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
getCodeParser(inc->extension()).parseCode(m_ci,inc->context(),
inc->text(),
langExt,
@@ -474,8 +476,8 @@ DB_VIS_C
break;
case DocInclude::SnipWithLines:
{
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
m_t << "<literallayout><computeroutput>";
getCodeParser(inc->extension()).parseCode(m_ci,
inc->context(),
@@ -525,8 +527,8 @@ DB_VIS_C
FileDef *fd = 0;
if (!op->includeFileName().isEmpty())
{
- QFileInfo cfi( op->includeFileName() );
- fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( op->includeFileName().str() );
+ fd = createFileDef( cfi.dirPath(), cfi.fileName() );
}
getCodeParser(locLangExt).parseCode(m_ci,op->context(),
@@ -551,7 +553,7 @@ DB_VIS_C
}
else
{
- if (!m_hide) m_t << endl;
+ if (!m_hide) m_t << "\n";
}
}
@@ -560,14 +562,14 @@ void DocbookDocVisitor::visit(DocFormula *f)
DB_VIS_C
if (m_hide) return;
- if (f->isInline()) m_t << "<inlinemediaobject>" << endl;
- else m_t << " <mediaobject>" << endl;
- m_t << " <imageobject>" << endl;
+ if (f->isInline()) m_t << "<inlinemediaobject>\n";
+ else m_t << " <mediaobject>\n";
+ m_t << " <imageobject>\n";
m_t << " <imagedata ";
- m_t << "align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << f->relPath() << f->name() << ".png\"/>" << endl;
- m_t << " </imageobject>" << endl;
- if (f->isInline()) m_t << "</inlinemediaobject>" << endl;
- else m_t << " </mediaobject>" << endl;
+ m_t << "align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << f->relPath() << f->name() << ".png\"/>\n";
+ m_t << " </imageobject>\n";
+ if (f->isInline()) m_t << "</inlinemediaobject>\n";
+ else m_t << " </mediaobject>\n";
}
void DocbookDocVisitor::visit(DocIndexEntry *ie)
@@ -576,7 +578,7 @@ DB_VIS_C
if (m_hide) return;
m_t << "<indexterm><primary>";
filter(ie->entry());
- m_t << "</primary></indexterm>" << endl;
+ m_t << "</primary></indexterm>\n";
}
void DocbookDocVisitor::visit(DocSimpleSectSep *)
@@ -644,7 +646,7 @@ void DocbookDocVisitor::visitPre(DocPara *)
{
DB_VIS_C
if (m_hide) return;
- m_t << endl;
+ m_t << "\n";
m_t << "<para>";
}
@@ -653,7 +655,7 @@ void DocbookDocVisitor::visitPost(DocPara *)
DB_VIS_C
if (m_hide) return;
m_t << "</para>";
- m_t << endl;
+ m_t << "\n";
}
void DocbookDocVisitor::visitPre(DocRoot *)
@@ -677,161 +679,161 @@ DB_VIS_C
case DocSimpleSect::See:
if (m_insidePre)
{
- m_t << "<formalpara><title>" << theTranslator->trSeeAlso() << "</title>" << endl;
+ m_t << "<formalpara><title>" << theTranslator->trSeeAlso() << "</title>\n";
}
else
{
- m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSeeAlso()) << "</title>" << endl;
+ m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSeeAlso()) << "</title>\n";
}
break;
case DocSimpleSect::Return:
if (m_insidePre)
{
- m_t << "<formalpara><title>" << theTranslator->trReturns()<< "</title>" << endl;
+ m_t << "<formalpara><title>" << theTranslator->trReturns()<< "</title>\n";
}
else
{
- m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trReturns()) << "</title>" << endl;
+ m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trReturns()) << "</title>\n";
}
break;
case DocSimpleSect::Author:
if (m_insidePre)
{
- m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, TRUE) << "</title>" << endl;
+ m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, TRUE) << "</title>\n";
}
else
{
- m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, TRUE)) << "</title>" << endl;
+ m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, TRUE)) << "</title>\n";
}
break;
case DocSimpleSect::Authors:
if (m_insidePre)
{
- m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, FALSE) << "</title>" << endl;
+ m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, FALSE) << "</title>\n";
}
else
{
- m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, FALSE)) << "</title>" << endl;
+ m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, FALSE)) << "</title>\n";
}
break;
case DocSimpleSect::Version:
if (m_insidePre)
{
- m_t << "<formalpara><title>" << theTranslator->trVersion() << "</title>" << endl;
+ m_t << "<formalpara><title>" << theTranslator->trVersion() << "</title>\n";
}
else
{
- m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trVersion()) << "</title>" << endl;
+ m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trVersion()) << "</title>\n";
}
break;
case DocSimpleSect::Since:
if (m_insidePre)
{
- m_t << "<formalpara><title>" << theTranslator->trSince() << "</title>" << endl;
+ m_t << "<formalpara><title>" << theTranslator->trSince() << "</title>\n";
}
else
{
- m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSince()) << "</title>" << endl;
+ m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSince()) << "</title>\n";
}
break;
case DocSimpleSect::Date:
if (m_insidePre)
{
- m_t << "<formalpara><title>" << theTranslator->trDate() << "</title>" << endl;
+ m_t << "<formalpara><title>" << theTranslator->trDate() << "</title>\n";
}
else
{
- m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trDate()) << "</title>" << endl;
+ m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trDate()) << "</title>\n";
}
break;
case DocSimpleSect::Note:
if (m_insidePre)
{
- m_t << "<note><title>" << theTranslator->trNote() << "</title>" << endl;
+ m_t << "<note><title>" << theTranslator->trNote() << "</title>\n";
}
else
{
- m_t << "<note><title>" << convertToDocBook(theTranslator->trNote()) << "</title>" << endl;
+ m_t << "<note><title>" << convertToDocBook(theTranslator->trNote()) << "</title>\n";
}
break;
case DocSimpleSect::Warning:
if (m_insidePre)
{
- m_t << "<warning><title>" << theTranslator->trWarning() << "</title>" << endl;
+ m_t << "<warning><title>" << theTranslator->trWarning() << "</title>\n";
}
else
{
- m_t << "<warning><title>" << convertToDocBook(theTranslator->trWarning()) << "</title>" << endl;
+ m_t << "<warning><title>" << convertToDocBook(theTranslator->trWarning()) << "</title>\n";
}
break;
case DocSimpleSect::Pre:
if (m_insidePre)
{
- m_t << "<formalpara><title>" << theTranslator->trPrecondition() << "</title>" << endl;
+ m_t << "<formalpara><title>" << theTranslator->trPrecondition() << "</title>\n";
}
else
{
- m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPrecondition()) << "</title>" << endl;
+ m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPrecondition()) << "</title>\n";
}
break;
case DocSimpleSect::Post:
if (m_insidePre)
{
- m_t << "<formalpara><title>" << theTranslator->trPostcondition() << "</title>" << endl;
+ m_t << "<formalpara><title>" << theTranslator->trPostcondition() << "</title>\n";
}
else
{
- m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPostcondition()) << "</title>" << endl;
+ m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPostcondition()) << "</title>\n";
}
break;
case DocSimpleSect::Copyright:
if (m_insidePre)
{
- m_t << "<formalpara><title>" << theTranslator->trCopyright() << "</title>" << endl;
+ m_t << "<formalpara><title>" << theTranslator->trCopyright() << "</title>\n";
}
else
{
- m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trCopyright()) << "</title>" << endl;
+ m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trCopyright()) << "</title>\n";
}
break;
case DocSimpleSect::Invar:
if (m_insidePre)
{
- m_t << "<formalpara><title>" << theTranslator->trInvariant() << "</title>" << endl;
+ m_t << "<formalpara><title>" << theTranslator->trInvariant() << "</title>\n";
}
else
{
- m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trInvariant()) << "</title>" << endl;
+ m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trInvariant()) << "</title>\n";
}
break;
case DocSimpleSect::Remark:
// <remark> is miising the <title> possibility
if (m_insidePre)
{
- m_t << "<formalpara><title>" << theTranslator->trRemarks() << "</title>" << endl;
+ m_t << "<formalpara><title>" << theTranslator->trRemarks() << "</title>\n";
}
else
{
- m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trRemarks()) << "</title>" << endl;
+ m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trRemarks()) << "</title>\n";
}
break;
case DocSimpleSect::Attention:
if (m_insidePre)
{
- m_t << "<caution><title>" << theTranslator->trAttention() << "</title>" << endl;
+ m_t << "<caution><title>" << theTranslator->trAttention() << "</title>\n";
}
else
{
- m_t << "<caution><title>" << convertToDocBook(theTranslator->trAttention()) << "</title>" << endl;
+ m_t << "<caution><title>" << convertToDocBook(theTranslator->trAttention()) << "</title>\n";
}
break;
case DocSimpleSect::User:
case DocSimpleSect::Rcs:
case DocSimpleSect::Unknown:
if (s->hasTitle())
- m_t << "<formalpara>" << endl;
+ m_t << "<formalpara>\n";
else
- m_t << "<para>" << endl;
+ m_t << "<para>\n";
break;
}
}
@@ -846,21 +848,21 @@ DB_VIS_C
case DocSimpleSect::Rcs:
case DocSimpleSect::Unknown:
if (s->hasTitle())
- m_t << "</formalpara>" << endl;
+ m_t << "</formalpara>\n";
else
- m_t << "</para>" << endl;
+ m_t << "</para>\n";
break;
case DocSimpleSect::Note:
- m_t << "</note>" << endl;
+ m_t << "</note>\n";
break;
case DocSimpleSect::Attention:
- m_t << "</caution>" << endl;
+ m_t << "</caution>\n";
break;
case DocSimpleSect::Warning:
- m_t << "</warning>" << endl;
+ m_t << "</warning>\n";
break;
default:
- m_t << "</formalpara>" << endl;
+ m_t << "</formalpara>\n";
break;
}
}
@@ -913,10 +915,10 @@ DB_VIS_C
if (m_hide) return;
m_t << "<section xml:id=\"_" << stripPath(s->file());
if (!s->anchor().isEmpty()) m_t << "_1" << s->anchor();
- m_t << "\">" << endl;
+ m_t << "\">\n";
m_t << "<title>";
filter(s->title());
- m_t << "</title>" << endl;
+ m_t << "</title>\n";
}
void DocbookDocVisitor::visitPost(DocSection *)
@@ -1006,8 +1008,8 @@ void DocbookDocVisitor::visitPre(DocHtmlTable *t)
DB_VIS_C
m_bodySet.push(false);
if (m_hide) return;
- m_t << "<informaltable frame=\"all\">" << endl;
- m_t << " <tgroup cols=\"" << (unsigned int)t->numColumns() << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">" << endl;
+ m_t << "<informaltable frame=\"all\">\n";
+ m_t << " <tgroup cols=\"" << (unsigned int)t->numColumns() << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
for (uint i = 0; i <t->numColumns(); i++)
{
// do something with colwidth based of cell width specification (be aware of possible colspan in the header)?
@@ -1019,10 +1021,10 @@ void DocbookDocVisitor::visitPost(DocHtmlTable *)
{
DB_VIS_C
if (m_hide) return;
- if (m_bodySet.top()) m_t << " </tbody>" << endl;
+ if (m_bodySet.top()) m_t << " </tbody>\n";
m_bodySet.pop();
- m_t << " </tgroup>" << endl;
- m_t << "</informaltable>" << endl;
+ m_t << " </tgroup>\n";
+ m_t << "</informaltable>\n";
}
void DocbookDocVisitor::visitPre(DocHtmlRow *tr)
@@ -1190,7 +1192,7 @@ DB_VIS_C
if (img->type()==DocImage::DocBook)
{
if (m_hide) return;
- m_t << endl;
+ m_t << "\n";
QCString baseName=img->name();
int i;
if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1)
@@ -1227,19 +1229,7 @@ DB_VIS_C
{
m_file=fd->absFilePath();
}
- QFile inImage(m_file);
- QFile outImage(Config_getString(DOCBOOK_OUTPUT)+"/"+baseName.data());
- if (inImage.open(IO_ReadOnly))
- {
- if (outImage.open(IO_WriteOnly))
- {
- char *buffer = new char[inImage.size()];
- inImage.readBlock(buffer,inImage.size());
- outImage.writeBlock(buffer,inImage.size());
- outImage.flush();
- delete[] buffer;
- }
- }
+ copyFile(m_file,Config_getString(DOCBOOK_OUTPUT)+"/"+baseName);
}
else
{
@@ -1308,7 +1298,7 @@ DB_VIS_C
if (m_hide) return;
if (ref->isSubPage())
{
- startLink(0,ref->anchor());
+ startLink(QCString(),ref->anchor());
}
else
{
@@ -1337,30 +1327,30 @@ void DocbookDocVisitor::visitPost(DocSecRefItem *)
{
DB_VIS_C
if (m_hide) return;
- m_t << "</tocentry>" << endl;
+ m_t << "</tocentry>\n";
}
void DocbookDocVisitor::visitPre(DocSecRefList *)
{
DB_VIS_C
if (m_hide) return;
- m_t << "<toc>" << endl;
+ m_t << "<toc>\n";
}
void DocbookDocVisitor::visitPost(DocSecRefList *)
{
DB_VIS_C
if (m_hide) return;
- m_t << "</toc>" << endl;
+ m_t << "</toc>\n";
}
void DocbookDocVisitor::visitPre(DocParamSect *s)
{
DB_VIS_C
if (m_hide) return;
- m_t << endl;
- m_t << " <formalpara>" << endl;
- m_t << " <title>" << endl;
+ m_t << "\n";
+ m_t << " <formalpara>\n";
+ m_t << " <title>\n";
switch(s->type())
{
case DocParamSect::Param: m_t << theTranslator->trParameters(); break;
@@ -1370,9 +1360,9 @@ DB_VIS_C
default:
ASSERT(0);
}
- m_t << " </title>" << endl;
- m_t << " <para>" << endl;
- m_t << " <table frame=\"all\">" << endl;
+ m_t << " </title>\n";
+ m_t << " <para>\n";
+ m_t << " <table frame=\"all\">\n";
int ncols = 2;
if (s->type() == DocParamSect::Param)
{
@@ -1381,24 +1371,24 @@ DB_VIS_C
if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
}
- m_t << " <tgroup cols=\"" << ncols << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">" << endl;
+ m_t << " <tgroup cols=\"" << ncols << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
for (int i = 1; i <= ncols; i++)
{
- if (i == ncols) m_t << " <colspec colwidth=\"4*\"/>" << endl;
- else m_t << " <colspec colwidth=\"1*\"/>" << endl;
+ if (i == ncols) m_t << " <colspec colwidth=\"4*\"/>\n";
+ else m_t << " <colspec colwidth=\"1*\"/>\n";
}
- m_t << " <tbody>" << endl;
+ m_t << " <tbody>\n";
}
void DocbookDocVisitor::visitPost(DocParamSect *)
{
DB_VIS_C
if (m_hide) return;
- m_t << " </tbody>" << endl;
- m_t << " </tgroup>" << endl;
- m_t << " </table>" << endl;
- m_t << " </para>" << endl;
- m_t << " </formalpara>" << endl;
+ m_t << " </tbody>\n";
+ m_t << " </tgroup>\n";
+ m_t << " </table>\n";
+ m_t << " </para>\n";
+ m_t << " </formalpara>\n";
m_t << " ";
}
@@ -1406,7 +1396,7 @@ void DocbookDocVisitor::visitPre(DocParamList *pl)
{
DB_VIS_C
if (m_hide) return;
- m_t << " <row>" << endl;
+ m_t << " <row>\n";
DocParamSect *sect = 0;
if (pl->parent() && pl->parent()->kind()==DocNode::Kind_ParamSect)
@@ -1459,7 +1449,7 @@ DB_VIS_C
if (pl->parameters().empty())
{
- m_t << " <entry></entry>" << endl;
+ m_t << " <entry></entry>\n";
}
else
{
@@ -1481,7 +1471,7 @@ DB_VIS_C
}
cnt++;
}
- m_t << "</entry>" << endl;
+ m_t << "</entry>\n";
}
m_t << " <entry>";
}
@@ -1490,8 +1480,8 @@ void DocbookDocVisitor::visitPost(DocParamList *)
{
DB_VIS_C
if (m_hide) return;
- m_t << "</entry>" << endl;
- m_t << " </row>" << endl;
+ m_t << "</entry>\n";
+ m_t << " </row>\n";
}
void DocbookDocVisitor::visitPre(DocXRefItem *x)
@@ -1582,7 +1572,7 @@ DB_VIS_C
}
-void DocbookDocVisitor::filter(const char *str)
+void DocbookDocVisitor::filter(const QCString &str)
{
DB_VIS_C
m_t << convertToDocBook(str);
@@ -1594,7 +1584,7 @@ DB_VIS_C
m_t << "<link linkend=\"_" << stripPath(file);
if (!anchor.isEmpty())
{
- if (file) m_t << "_1";
+ if (!file.isEmpty()) m_t << "_1";
m_t << anchor;
}
m_t << "\">";
@@ -1659,7 +1649,7 @@ DB_VIS_C
baseName.prepend("msc_");
QCString outDir = Config_getString(DOCBOOK_OUTPUT);
writeMscGraphFromFile(fileName,outDir,baseName,MSC_BITMAP);
- m_t << "<para>" << endl;
+ m_t << "<para>\n";
visitPreStart(m_t, children, hasCaption, baseName + ".png", width, height);
}
@@ -1668,7 +1658,7 @@ void DocbookDocVisitor::endMscFile(bool hasCaption)
DB_VIS_C
if (m_hide) return;
visitPostEnd(m_t, hasCaption);
- m_t << "</para>" << endl;
+ m_t << "</para>\n";
}
void DocbookDocVisitor::writeDiaFile(const QCString &baseName, DocVerbatim *s)
@@ -1708,7 +1698,7 @@ DB_VIS_C
baseName.prepend("dia_");
QCString outDir = Config_getString(DOCBOOK_OUTPUT);
writeDiaGraphFromFile(fileName,outDir,baseName,DIA_BITMAP);
- m_t << "<para>" << endl;
+ m_t << "<para>\n";
visitPreStart(m_t, children, hasCaption, baseName + ".png", width, height);
}
@@ -1717,7 +1707,7 @@ void DocbookDocVisitor::endDiaFile(bool hasCaption)
DB_VIS_C
if (m_hide) return;
visitPostEnd(m_t, hasCaption);
- m_t << "</para>" << endl;
+ m_t << "</para>\n";
}
void DocbookDocVisitor::writeDotFile(const QCString &baseName, DocVerbatim *s)
@@ -1758,7 +1748,7 @@ DB_VIS_C
QCString outDir = Config_getString(DOCBOOK_OUTPUT);
QCString imgExt = getDotImageExtension();
writeDotGraphFromFile(fileName,outDir,baseName,GOF_BITMAP);
- m_t << "<para>" << endl;
+ m_t << "<para>\n";
visitPreStart(m_t, children, hasCaption, baseName + "." + imgExt, width, height);
}
@@ -1766,8 +1756,8 @@ void DocbookDocVisitor::endDotFile(bool hasCaption)
{
DB_VIS_C
if (m_hide) return;
- m_t << endl;
+ m_t << "\n";
visitPostEnd(m_t, hasCaption);
- m_t << "</para>" << endl;
+ m_t << "</para>\n";
}
diff --git a/src/docbookvisitor.h b/src/docbookvisitor.h
index ad53116..5580de0 100644
--- a/src/docbookvisitor.h
+++ b/src/docbookvisitor.h
@@ -16,20 +16,22 @@
#ifndef _DOCBOOKDOCVISITOR_H
#define _DOCBOOKDOCVISITOR_H
+#include <iostream>
+
#include "containers.h"
#include "docvisitor.h"
-#include <qcstring.h>
-#include <docparser.h>
+#include "docparser.h"
+#include "qcstring.h"
-class FTextStream;
class CodeOutputInterface;
class QCString;
+class TextStream;
/*! @brief Concrete visitor implementation for Docbook output. */
class DocbookDocVisitor : public DocVisitor
{
public:
- DocbookDocVisitor(FTextStream &t,CodeOutputInterface &ci,const char *langExt);
+ DocbookDocVisitor(TextStream &t,CodeOutputInterface &ci,const QCString &langExt);
~DocbookDocVisitor();
//--------------------------------------
// visitor functions for leaf nodes
@@ -137,7 +139,7 @@ class DocbookDocVisitor : public DocVisitor
//--------------------------------------
// helper functions
//--------------------------------------
- void filter(const char *str);
+ void filter(const QCString &str);
void startLink(const QCString &file,
const QCString &anchor);
void endLink();
@@ -154,19 +156,19 @@ class DocbookDocVisitor : public DocVisitor
void endDotFile(bool hasCaption);
void writeDotFile(const QCString &fileName, DocVerbatim *s);
void writePlantUMLFile(const QCString &fileName, DocVerbatim *s);
- void visitPreStart(FTextStream &t,
+ void visitPreStart(TextStream &t,
const DocNodeList &children,
bool hasCaption,
const QCString &name,
const QCString &width,
const QCString &height,
bool inlineImage = FALSE);
- void visitPostEnd(FTextStream &t, bool hasCaption, bool inlineImage = FALSE);
+ void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage = FALSE);
void visitCaption(const DocNodeList &children);
//--------------------------------------
// state variables
//--------------------------------------
- FTextStream &m_t;
+ TextStream &m_t;
CodeOutputInterface &m_ci;
bool m_insidePre = false;
bool m_hide = false;
diff --git a/src/docgroup.cpp b/src/docgroup.cpp
index 49fb9dc..07ff8f3 100644
--- a/src/docgroup.cpp
+++ b/src/docgroup.cpp
@@ -22,7 +22,7 @@
static std::atomic_int g_groupId;
-void DocGroup::enterFile(const char *fileName,int)
+void DocGroup::enterFile(const QCString &fileName,int)
{
m_openCount = 0;
m_autoGroupStack.clear();
@@ -32,7 +32,7 @@ void DocGroup::enterFile(const char *fileName,int)
m_compoundName=fileName;
}
-void DocGroup::leaveFile(const char *fileName,int line)
+void DocGroup::leaveFile(const QCString &fileName,int line)
{
//if (m_memberGroupId!=DOX_NOGROUP)
//{
@@ -51,11 +51,11 @@ void DocGroup::leaveFile(const char *fileName,int line)
}
}
-void DocGroup::enterCompound(const char *fileName,int line,const char *name)
+void DocGroup::enterCompound(const QCString &fileName,int line,const QCString &name)
{
if (m_memberGroupId!=DOX_NOGROUP)
{
- warn(fileName,line,"try to put compound %s inside a member group\n",name);
+ warn(fileName,line,"try to put compound %s inside a member group\n",qPrint(name));
}
m_memberGroupId=DOX_NOGROUP;
m_memberGroupRelates.resize(0);
@@ -73,12 +73,12 @@ void DocGroup::enterCompound(const char *fileName,int line,const char *name)
//printf("groupEnterCompound(%s)\n",name);
}
-void DocGroup::leaveCompound(const char *,int,const char * /*name*/)
+void DocGroup::leaveCompound(const QCString &,int,const QCString & /*name*/)
{
//printf("groupLeaveCompound(%s)\n",name);
//if (m_memberGroupId!=DOX_NOGROUP)
//{
- // warn(fileName,line,"end of compound %s while inside a member group\n",name);
+ // warn(fileName,line,"end of compound %s while inside a member group\n",qPrint(name));
//}
m_memberGroupId=DOX_NOGROUP;
m_memberGroupRelates.resize(0);
@@ -88,7 +88,7 @@ void DocGroup::leaveCompound(const char *,int,const char * /*name*/)
int DocGroup::findExistingGroup(const MemberGroupInfo *info)
{
- //printf("findExistingGroup %s:%s\n",info->header.data(),info->compoundName.data());
+ //printf("findExistingGroup %s:%s\n",qPrint(info->header),qPrint(info->compoundName));
for (const auto &kv : Doxygen::memberGroupInfoMap)
{
if (m_compoundName==kv.second->compoundName && // same file or scope
@@ -103,18 +103,18 @@ int DocGroup::findExistingGroup(const MemberGroupInfo *info)
return ++g_groupId; // start new group
}
-void DocGroup::open(Entry *e,const char *,int, bool implicit)
+void DocGroup::open(Entry *e,const QCString &,int, bool implicit)
{
if (!implicit) m_openCount++;
//printf("==> openGroup(name=%s,sec=%x) m_autoGroupStack=%d\n",
- // e->name.data(),e->section,m_autoGroupStack.size());
+ // qPrint(e->name),e->section,m_autoGroupStack.size());
if (e->section==Entry::GROUPDOC_SEC) // auto group
{
m_autoGroupStack.push_back(Grouping(e->name,e->groupingPri()));
}
else // start of a member group
{
- //printf(" membergroup id=%d %s\n",m_memberGroupId,m_memberGroupHeader.data());
+ //printf(" membergroup id=%d %s\n",m_memberGroupId,qPrint(m_memberGroupHeader));
if (m_memberGroupId==DOX_NOGROUP) // no group started yet
{
auto info = std::make_unique<MemberGroupInfo>();
@@ -133,7 +133,7 @@ void DocGroup::open(Entry *e,const char *,int, bool implicit)
}
}
-void DocGroup::close(Entry *e,const char *fileName,int line,bool foundInline,bool implicit)
+void DocGroup::close(Entry *e,const QCString &fileName,int line,bool foundInline,bool implicit)
{
if (!implicit)
{
@@ -147,7 +147,7 @@ void DocGroup::close(Entry *e,const char *fileName,int line,bool foundInline,boo
}
}
//printf("==> closeGroup(name=%s,sec=%x,file=%s,line=%d) m_autoGroupStack=%d\n",
- // e->name.data(),e->section,fileName,line,m_autoGroupStack.size());
+ // qPrint(e->name),e->section,fileName,line,m_autoGroupStack.size());
if (m_memberGroupId!=DOX_NOGROUP) // end of member group
{
auto it = Doxygen::memberGroupInfoMap.find(m_memberGroupId);
@@ -170,7 +170,7 @@ void DocGroup::close(Entry *e,const char *fileName,int line,bool foundInline,boo
m_autoGroupStack.pop_back();
// see bug577005: we should not remove the last group for e
if (!foundInline && !e->groups.empty()) e->groups.pop_back();
- //printf("Removing %s e=%p\n",grp->groupname.data(),e);
+ //printf("Removing %s e=%p\n",qPrint(grp->groupname),e);
if (!foundInline) initGroupInfo(e);
}
}
@@ -178,14 +178,14 @@ void DocGroup::close(Entry *e,const char *fileName,int line,bool foundInline,boo
void DocGroup::initGroupInfo(Entry *e)
{
//printf("==> initGroup(id=%d,related=%s,e=%p)\n",m_memberGroupId,
- // m_memberGroupRelates.data(),e);
+ // qPrint(m_memberGroupRelates),e);
e->mGrpId = m_memberGroupId;
e->relates = m_memberGroupRelates;
if (!m_autoGroupStack.empty())
{
//printf("Appending group %s to %s: count=%d entry=%p\n",
- // m_autoGroupStack.top()->groupname.data(),
- // e->name.data(),e->groups->count(),e);
+ // qPrint(m_autoGroupStack.top()->groupname),
+ // qPrint(e->name),e->groups->count(),e);
e->groups.push_back(Grouping(m_autoGroupStack.back()));
}
}
diff --git a/src/docgroup.h b/src/docgroup.h
index 696e4f7..de22098 100644
--- a/src/docgroup.h
+++ b/src/docgroup.h
@@ -27,12 +27,12 @@ class DocGroup
DocGroup() {};
public:
- void enterFile(const char *fileName,int);
- void leaveFile(const char *fileName,int line);
- void enterCompound(const char *fileName,int line,const char *name);
- void leaveCompound(const char *,int,const char * /*name*/);
- void open(Entry *e,const char *,int,bool implicit=false);
- void close(Entry *e,const char *fileName,int line,bool foundInline,bool implicit=false);
+ void enterFile(const QCString &fileName,int);
+ void leaveFile(const QCString &fileName,int line);
+ void enterCompound(const QCString &fileName,int line,const QCString &name);
+ void leaveCompound(const QCString &,int,const QCString & /*name*/);
+ void open(Entry *e,const QCString &,int,bool implicit=false);
+ void close(Entry *e,const QCString &fileName,int line,bool foundInline,bool implicit=false);
void initGroupInfo(Entry *e);
bool isEmpty() const;
void clearHeader();
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 75fe570..23b3729 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -17,12 +17,9 @@
#include <stdlib.h>
#include <cassert>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qcstring.h>
#include <ctype.h>
-#include <qcstringlist.h>
+#include "qcstring.h"
#include "regex.h"
#include "doxygen.h"
#include "debug.h"
@@ -52,8 +49,10 @@
#include "markdown.h"
#include "htmlentity.h"
#include "emoji.h"
+#include "fileinfo.h"
+#include "dir.h"
-#define TK_COMMAND_CHAR(token) ((token)==TK_COMMAND_AT ? '@' : '\\')
+#define TK_COMMAND_CHAR(token) ((token)==TK_COMMAND_AT ? "@" : "\\")
// debug off
#define DBG(x) do {} while(0)
@@ -183,7 +182,7 @@ static void docParserPushContext(bool saveParamInfo=TRUE)
{
//QCString indent;
//indent.fill(' ',g_parserStack.count()*2+2);
- //printf("%sdocParserPushContext() count=%d\n",indent.data(),g_nodeStack.count());
+ //printf("%sdocParserPushContext() count=%d\n",qPrint(indent),g_nodeStack.count());
doctokenizerYYpushContext();
@@ -267,7 +266,7 @@ static void docParserPopContext(bool keepParamInfo=FALSE)
//QCString indent;
//indent.fill(' ',g_parserStack.count()*2+2);
- //printf("%sdocParserPopContext() count=%d\n",indent.data(),g_nodeStack.count());
+ //printf("%sdocParserPopContext() count=%d\n",qPrint(indent),g_nodeStack.count());
}
//---------------------------------------------------------------------------
@@ -299,7 +298,7 @@ static void unescapeCRef(QCString &s)
* copies the image to the output directory (which depends on the \a type
* parameter).
*/
-static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool dowarn = true)
+static QCString findAndCopyImage(const QCString &fileName,DocImage::Type type, bool dowarn = true)
{
QCString result;
bool ambig;
@@ -313,12 +312,12 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
text.sprintf("image file name %s is ambiguous.\n",qPrint(fileName));
text+="Possible candidates:\n";
text+=showFileDefMatches(Doxygen::imageNameLinkedMap,fileName);
- warn_doc_error(g_fileName,getDoctokinizerLineNr(),"%s", text.data());
+ warn_doc_error(g_fileName,getDoctokinizerLineNr(),"%s", qPrint(text));
}
QCString inputFile = fd->absFilePath();
- QFile inImage(inputFile);
- if (inImage.open(IO_ReadOnly))
+ FileInfo infi(inputFile.str());
+ if (infi.exists())
{
result = fileName;
int i;
@@ -326,7 +325,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
{
result = result.right((int)result.length()-i-1);
}
- //printf("fileName=%s result=%s\n",fileName,result.data());
+ //printf("fileName=%s result=%s\n",fileName,qPrint(result));
QCString outputDir;
switch(type)
{
@@ -348,37 +347,21 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
break;
}
QCString outputFile = outputDir+"/"+result;
- QFileInfo outfi(outputFile);
+ FileInfo outfi(outputFile.str());
if (outfi.isSymLink())
{
- QFile::remove(outputFile);
+ Dir().remove(outputFile.str());
warn_doc_error(g_fileName,getDoctokinizerLineNr(),
"destination of image %s is a symlink, replacing with image",
qPrint(outputFile));
}
if (outputFile!=inputFile) // prevent copying to ourself
{
- QFile outImage(outputFile.data());
- if (outImage.open(IO_WriteOnly)) // copy the image
+ if (copyFile(inputFile,outputFile) && type==DocImage::Html)
{
- char *buffer = new char[inImage.size()];
- inImage.readBlock(buffer,inImage.size());
- outImage.writeBlock(buffer,inImage.size());
- outImage.flush();
- delete[] buffer;
- if (type==DocImage::Html) Doxygen::indexList->addImageFile(result);
- }
- else
- {
- warn_doc_error(g_fileName,getDoctokinizerLineNr(),
- "could not write output image %s",qPrint(outputFile));
+ Doxygen::indexList->addImageFile(result);
}
}
- //else
- //{
- // warn(g_fileName,getDoctokinizerLineNr(),
- // "Prevented to copy file %s onto itself!\n",qPrint(inputFile));
- //}
}
else
{
@@ -394,8 +377,8 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
QCString baseName = fd->name().left(fd->name().length()-4);
QCString epstopdfArgs(4096);
epstopdfArgs.sprintf("\"%s/%s.eps\" --outfile=\"%s/%s.pdf\"",
- outputDir.data(), baseName.data(),
- outputDir.data(), baseName.data());
+ qPrint(outputDir), qPrint(baseName),
+ qPrint(outputDir), qPrint(baseName));
Portable::sysTimerStart();
if (Portable::system("epstopdf",epstopdfArgs)!=0)
{
@@ -444,14 +427,14 @@ static void checkArgumentName(const std::string &name)
const auto &match = *it;
QCString aName=match.str();
if (lang==SrcLangExt_Fortran) aName=aName.lower();
- //printf("aName='%s'\n",aName.data());
+ //printf("aName='%s'\n",qPrint(aName));
bool found=FALSE;
for (const Argument &a : al)
{
QCString argName = g_memberDef->isDefine() ? a.type : a.name;
if (lang==SrcLangExt_Fortran) argName=argName.lower();
argName=argName.stripWhiteSpace();
- //printf("argName='%s' aName=%s\n",argName.data(),aName.data());
+ //printf("argName='%s' aName=%s\n",qPrint(argName),qPrint(aName));
if (argName.right(3)=="...") argName=argName.left(argName.length()-3);
if (aName==argName)
{
@@ -498,9 +481,9 @@ static void checkRetvalName(const QCString &name)
warn_doc_error(g_memberDef->getDefFileName(),
g_memberDef->getDefLine(),
"%s",
- ("return value '" + name + "' of " +
+ qPrint("return value '" + name + "' of " +
QCString(g_memberDef->qualifiedName()) +
- " has multiple documentation sections").data());
+ " has multiple documentation sections"));
}
g_retvalsFound.insert(name.str());
}
@@ -542,7 +525,7 @@ static void checkUnOrMultipleDocumentedParams()
{
for (const auto &par : g_paramsFound)
{
- if (argName == par) count++;
+ if (argName == QCString(par)) count++;
}
}
if ((count > 1) && Config_getBool(WARN_IF_DOC_ERROR))
@@ -550,10 +533,10 @@ static void checkUnOrMultipleDocumentedParams()
warn_doc_error(g_memberDef->getDefFileName(),
g_memberDef->getDefLine(),
"%s",
- ("argument '" + aName +
+ qPrint("argument '" + aName +
"' from the argument list of " +
QCString(g_memberDef->qualifiedName()) +
- " has multiple @param documentation sections").data());
+ " has multiple @param documentation sections"));
}
}
if ((notArgCnt>0) && Config_getBool(WARN_IF_INCOMPLETE_DOC))
@@ -591,7 +574,7 @@ static void checkUnOrMultipleDocumentedParams()
warn_incomplete_doc(g_memberDef->getDefFileName(),
g_memberDef->getDefLine(),
"%s",
- substitute(errMsg,"%","%%").data());
+ qPrint(substitute(errMsg,"%","%%")));
}
}
}
@@ -600,7 +583,7 @@ static void checkUnOrMultipleDocumentedParams()
//---------------------------------------------------------------------------
/*! Strips known html and tex extensions from \a text. */
-static QCString stripKnownExtensions(const char *text)
+static QCString stripKnownExtensions(const QCString &text)
{
QCString result=text;
if (result.right(4)==".tex")
@@ -690,10 +673,10 @@ static bool insideTable(DocNode *n)
* @retval TRUE if name was found.
* @retval FALSE if name was not found.
*/
-static bool findDocsForMemberOrCompound(const char *commandName,
- QCString *pDoc,
- QCString *pBrief,
- const Definition **pDef)
+static bool findDocsForMemberOrCompound(const QCString &commandName,
+ QCString *pDoc,
+ QCString *pBrief,
+ const Definition **pDef)
{
//printf("findDocsForMemberOrCompound(%s)\n",commandName);
*pDoc="";
@@ -765,11 +748,11 @@ static bool findDocsForMemberOrCompound(const char *commandName,
const ClassDef *cd=0;
const NamespaceDef *nd=0;
bool found = getDefs(
- g_context.find('.')==-1?g_context.data():"", // find('.') is a hack to detect files
+ g_context.find('.')==-1?g_context:QCString(), // find('.') is a hack to detect files
name,
- args.isEmpty()?0:args.data(),
+ args.isEmpty() ? QCString() : args,
md,cd,fd,nd,gd,FALSE,0,TRUE);
- //printf("found=%d context=%s name=%s\n",found,g_context.data(),name.data());
+ //printf("found=%d context=%s name=%s\n",found,qPrint(g_context),qPrint(name));
if (found && md)
{
*pDoc=md->documentation();
@@ -787,7 +770,7 @@ static bool findDocsForMemberOrCompound(const char *commandName,
{
fullName.prepend(g_context.left(scopeOffset)+"::");
}
- //printf("Trying fullName='%s'\n",fullName.data());
+ //printf("Trying fullName='%s'\n",qPrint(fullName));
// try class, namespace, group, page, file reference
cd = Doxygen::classLinkedMap->find(fullName);
@@ -823,7 +806,7 @@ static bool findDocsForMemberOrCompound(const char *commandName,
//---------------------------------------------------------------------------
inline void errorHandleDefaultToken(DocNode *parent,int tok,
- DocNodeList &children,const char *txt)
+ DocNodeList &children,const QCString &txt)
{
const char *cmd_start = "\\";
switch (tok)
@@ -834,16 +817,16 @@ inline void errorHandleDefaultToken(DocNode *parent,int tok,
case TK_COMMAND_BS:
children.push_back(std::make_unique<DocWord>(parent,TK_COMMAND_CHAR(tok) + g_token->name));
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Illegal command %s as part of a %s",
- qPrint(cmd_start + g_token->name),txt);
+ qPrint(cmd_start + g_token->name),qPrint(txt));
break;
case TK_SYMBOL:
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Unsupported symbol %s found found as part of a %s",
- qPrint(g_token->name), txt);
+ qPrint(g_token->name), qPrint(txt));
break;
default:
children.push_back(std::make_unique<DocWord>(parent,g_token->name));
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Unexpected token %s found as part of a %s",
- tokToString(tok), txt);
+ tokToString(tok), qPrint(txt));
break;
}
}
@@ -919,7 +902,7 @@ static void handleStyleEnter(DocNode *parent,DocNodeList &children,
* encountered.
*/
static void handleStyleLeave(DocNode *parent,DocNodeList &children,
- DocStyleChange::Style s,const char *tagName)
+ DocStyleChange::Style s,const QCString &tagName)
{
DBG(("HandleStyleLeave\n"));
QCString tagNameLower = QCString(tagName).lower();
@@ -1081,7 +1064,7 @@ static void handleLinkedWord(DocNode *parent,DocNodeList &children,bool ignoreAu
ClassDef *cd=0;
bool ambig;
FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,g_fileName,ambig);
- //printf("handleLinkedWord(%s) g_context=%s\n",g_token->name.data(),g_context.data());
+ //printf("handleLinkedWord(%s) g_context=%s\n",qPrint(g_token->name),qPrint(g_context));
if (!g_insideHtmlLink &&
(resolveRef(g_context,g_token->name,g_inSeeBlock,&compound,&member,TRUE,fd,TRUE)
|| (!g_context.isEmpty() && // also try with global scope
@@ -1114,7 +1097,7 @@ static void handleLinkedWord(DocNode *parent,DocNodeList &children,bool ignoreAu
}
else if (compound->definitionType()==Definition::TypeGroup)
{
- name=(toGroupDef(compound))->groupTitle();
+ name=toGroupDef(compound)->groupTitle();
}
children.push_back(
std::make_unique<DocLinkedWord>(
@@ -1273,7 +1256,7 @@ static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, DocNodeLis
}
if (!defaultHandleToken(parent,tok,children))
{
- errorHandleDefaultToken(parent,tok,children,Mappers::cmdMapper->find(cmd).data());
+ errorHandleDefaultToken(parent,tok,children,Mappers::cmdMapper->find(cmd));
}
}
// parse size attributes
@@ -1302,7 +1285,7 @@ static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, DocNodeLis
else
{
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Unknown option '%s' after \\%s command, expected 'width' or 'height'",
- qPrint(g_token->name), Mappers::cmdMapper->find(cmd).data());
+ qPrint(g_token->name), qPrint(Mappers::cmdMapper->find(cmd)));
break;
}
}
@@ -1524,7 +1507,7 @@ reparsetoken:
(void)doctokenizerYYlex();
scope = g_token->name;
g_context = scope;
- //printf("Found scope='%s'\n",scope.data());
+ //printf("Found scope='%s'\n",qPrint(scope));
doctokenizerYYsetStatePara();
}
break;
@@ -1737,7 +1720,7 @@ static void handleImg(DocNode *parent, DocNodeList &children,const HtmlAttribLis
uint index=0;
for (const auto &opt : tagHtmlAttribs)
{
- //printf("option name=%s value=%s\n",opt.name.data(),opt.value.data());
+ //printf("option name=%s value=%s\n",qPrint(opt.name),qPrint(opt.value));
if (opt.name=="src" && !opt.value.isEmpty())
{
// copy attributes
@@ -1780,7 +1763,7 @@ DocEmoji::DocEmoji(DocNode *parent,const QCString &symName) :
if (locSymName.at(0)!=':') locSymName.prepend(":");
}
m_symName = locSymName;
- m_index = EmojiEntityMapper::instance()->symbol2index(m_symName);
+ m_index = EmojiEntityMapper::instance()->symbol2index(m_symName.str());
if (m_index==-1)
{
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Found unsupported emoji symbol '%s'\n",qPrint(m_symName));
@@ -1796,7 +1779,7 @@ static int internalValidatingParseDoc(DocNode *parent,DocNodeList &children,
if (doc.isEmpty()) return retval;
- doctokenizerYYinit(doc,g_fileName,g_markdownSupport);
+ doctokenizerYYinit(doc.data(),g_fileName,g_markdownSupport);
// first parse any number of paragraphs
bool isFirst=TRUE;
@@ -1834,9 +1817,9 @@ static int internalValidatingParseDoc(DocNode *parent,DocNodeList &children,
static void readTextFileByName(const QCString &file,QCString &text)
{
- if (Portable::isAbsolutePath(file.data()))
+ if (Portable::isAbsolutePath(file))
{
- QFileInfo fi(file);
+ FileInfo fi(file.str());
if (fi.exists())
{
text = fileToString(file,Config_getBool(FILTER_SOURCE_FILES));
@@ -1846,11 +1829,11 @@ static void readTextFileByName(const QCString &file,QCString &text)
const StringVector &examplePathList = Config_getList(EXAMPLE_PATH);
for (const auto &s : examplePathList)
{
- QCString absFileName = QCString(s.c_str())+Portable::pathSeparator()+file;
- QFileInfo fi(absFileName);
+ std::string absFileName = s+(Portable::pathSeparator()+file).str();
+ FileInfo fi(absFileName);
if (fi.exists())
{
- text = fileToString(absFileName,Config_getBool(FILTER_SOURCE_FILES));
+ text = fileToString(QCString(absFileName),Config_getBool(FILTER_SOURCE_FILES));
return;
}
}
@@ -1882,7 +1865,7 @@ DocWord::DocWord(DocNode *parent,const QCString &word) :
m_word(word)
{
m_parent = parent;
- //printf("new word %s url=%s\n",word.data(),g_searchUrl.data());
+ //printf("new word %s url=%s\n",qPrint(word),qPrint(g_searchUrl));
if (Doxygen::searchIndex && !g_searchUrl.isEmpty())
{
Doxygen::searchIndex->addWord(word,FALSE);
@@ -1900,7 +1883,7 @@ DocLinkedWord::DocLinkedWord(DocNode *parent,const QCString &word,
{
m_parent = parent;
//printf("DocLinkedWord: new word %s url=%s tooltip='%s'\n",
- // word.data(),g_searchUrl.data(),tooltip.data());
+ // qPrint(word),qPrint(g_searchUrl),qPrint(tooltip));
if (Doxygen::searchIndex && !g_searchUrl.isEmpty())
{
Doxygen::searchIndex->addWord(word,FALSE);
@@ -1944,7 +1927,7 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor)
const SectionInfo *sec = SectionManager::instance().find(id);
if (sec)
{
- //printf("Found anchor %s\n",id.data());
+ //printf("Found anchor %s\n",qPrint(id));
m_file = sec->fileName();
m_anchor = sec->label();
}
@@ -1991,7 +1974,7 @@ void DocInclude::parse()
g_includeFileLength = m_text.length();
g_includeFileLine = 0;
g_includeFileShowLineNo = (m_type == DontIncWithLines || m_type == IncWithLines);
- //printf("g_includeFile=<<%s>>\n",g_includeFileText.data());
+ //printf("g_includeFile=<<%s>>\n",qPrint(g_includeFileText));
break;
case VerbInclude:
// fall through
@@ -2012,7 +1995,7 @@ void DocInclude::parse()
if (!m_blockId.isEmpty() && (count=m_text.contains(m_blockId.data()))!=2)
{
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"block marked with %s for \\snippet should appear twice in file %s, found it %d times\n",
- m_blockId.data(),m_file.data(),count);
+ qPrint(m_blockId),qPrint(m_file),count);
}
break;
case DocInclude::SnippetDoc:
@@ -2035,11 +2018,11 @@ void DocIncOperator::parse()
}
m_includeFileName = g_includeFileName;
- const char *p = g_includeFileText;
+ const char *p = g_includeFileText.data();
uint l = g_includeFileLength;
uint o = g_includeFileOffset;
int il = g_includeFileLine;
- DBG(("DocIncOperator::parse() text=%s off=%d len=%d\n",qPrint(p),o,l));
+ DBG(("DocIncOperator::parse() text=%s off=%d len=%d\n",p,o,l));
uint so = o,bo;
bool nonEmpty = FALSE;
switch(type())
@@ -2066,7 +2049,7 @@ void DocIncOperator::parse()
m_text = g_includeFileText.mid(so,o-so);
DBG(("DocIncOperator::parse() Line: %s\n",qPrint(m_text)));
}
- g_includeFileOffset = QMIN(l,o+1); // set pointer to start of new line
+ g_includeFileOffset = std::min(l,o+1); // set pointer to start of new line
m_showLineNo = g_includeFileShowLineNo;
break;
case SkipLine:
@@ -2097,7 +2080,7 @@ void DocIncOperator::parse()
}
o++; // skip new line
}
- g_includeFileOffset = QMIN(l,o+1); // set pointer to start of new line
+ g_includeFileOffset = std::min(l,o+1); // set pointer to start of new line
m_showLineNo = g_includeFileShowLineNo;
break;
case Skip:
@@ -2157,7 +2140,7 @@ void DocIncOperator::parse()
}
o++; // skip new line
}
- g_includeFileOffset = QMIN(l,o+1); // set pointer to start of new line
+ g_includeFileOffset = std::min(l,o+1); // set pointer to start of new line
m_showLineNo = g_includeFileShowLineNo;
break;
}
@@ -2165,7 +2148,7 @@ void DocIncOperator::parse()
//---------------------------------------------------------------------------
-DocXRefItem::DocXRefItem(DocNode *parent,int id,const char *key) :
+DocXRefItem::DocXRefItem(DocNode *parent,int id,const QCString &key) :
m_id(id), m_key(key), m_relPath(g_relPath)
{
m_parent = parent;
@@ -2192,7 +2175,7 @@ bool DocXRefItem::parse()
}
m_title = refList->sectionTitle();
//printf("DocXRefItem: file=%s anchor=%s title=%s\n",
- // m_file.data(),m_anchor.data(),m_title.data());
+ // qPrint(m_file),qPrint(m_anchor),qPrint(m_title));
if (!item->text().isEmpty())
{
@@ -2401,7 +2384,7 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) :
m_parent = parent;
const Definition *compound = 0;
QCString anchor;
- //printf("DocRef::DocRef(target=%s,context=%s)\n",target.data(),context.data());
+ //printf("DocRef::DocRef(target=%s,context=%s)\n",qPrint(target),qPrint(context));
ASSERT(!target.isEmpty());
SrcLangExt lang = getLanguageFromFileName(target);
m_relPath = g_relPath;
@@ -2437,7 +2420,7 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) :
m_isSubPage = pd && pd->hasParentPage();
if (sec->type()!=SectionType::Page || m_isSubPage) m_anchor = sec->label();
//printf("m_text=%s,m_ref=%s,m_file=%s,type=%d\n",
- // m_text.data(),m_ref.data(),m_file.data(),m_refType);
+ // qPrint(m_text),qPrint(m_ref),qPrint(m_file),m_refType);
return;
}
else if (resolveLink(context,target,TRUE,&compound,anchor))
@@ -2452,13 +2435,13 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) :
{
if (anchor.isEmpty() && /* compound link */
compound->definitionType()==Definition::TypeGroup && /* is group */
- (toGroupDef(compound))->groupTitle() /* with title */
+ !toGroupDef(compound)->groupTitle().isEmpty() /* with title */
)
{
m_text=(toGroupDef(compound))->groupTitle(); // use group's title as link
}
else if (compound->definitionType()==Definition::TypeMember &&
- (toMemberDef(compound))->isObjCMethod())
+ toMemberDef(compound)->isObjCMethod())
{
// Objective C Method
const MemberDef *member = toMemberDef(compound);
@@ -2468,12 +2451,12 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) :
m_file = compound->getOutputFileBase();
m_ref = compound->getReference();
- //printf("isFile=%d compound=%s (%d)\n",isFile,compound->name().data(),
+ //printf("isFile=%d compound=%s (%d)\n",isFile,qPrint(compound->name()),
// compound->definitionType());
return;
}
else if (compound && compound->definitionType()==Definition::TypeFile &&
- (toFileDef(compound))->generateSourceFile()
+ toFileDef(compound)->generateSourceFile()
) // undocumented file that has source code we can link to
{
m_file = compound->getSourceFileBase();
@@ -2553,12 +2536,12 @@ DocCite::DocCite(DocNode *parent,const QCString &target,const QCString &) //cont
{
size_t numBibFiles = Config_getList(CITE_BIB_FILES).size();
m_parent = parent;
- //printf("DocCite::DocCite(target=%s)\n",target.data());
+ //printf("DocCite::DocCite(target=%s)\n",qPrint(target));
ASSERT(!target.isEmpty());
m_relPath = g_relPath;
const CitationManager &ct = CitationManager::instance();
const CiteInfo *cite = ct.find(target);
- //printf("cite=%p text='%s' numBibFiles=%d\n",cite,cite?cite->text.data():"<null>",numBibFiles);
+ //printf("cite=%p text='%s' numBibFiles=%d\n",cite,cite?qPrint(cite->text):"<null>",numBibFiles);
if (numBibFiles>0 && cite && !cite->text().isEmpty()) // ref to citation
{
m_text = cite->text();
@@ -2566,7 +2549,7 @@ DocCite::DocCite(DocNode *parent,const QCString &target,const QCString &) //cont
m_anchor = ct.anchorPrefix()+cite->label();
m_file = convertNameToFile(ct.fileName(),FALSE,TRUE);
//printf("CITE ==> m_text=%s,m_ref=%s,m_file=%s,m_anchor=%s\n",
- // m_text.data(),m_ref.data(),m_file.data(),m_anchor.data());
+ // qPrint(m_text),qPrint(m_ref),qPrint(m_file),qPrint(m_anchor));
return;
}
m_text = target;
@@ -2599,8 +2582,7 @@ DocLink::DocLink(DocNode *parent,const QCString &target)
{
m_refText = m_refText.right(m_refText.length()-1);
}
- if (resolveLink(g_context,stripKnownExtensions(target),g_inSeeBlock,
- &compound,anchor))
+ if (resolveLink(g_context,stripKnownExtensions(target),g_inSeeBlock,&compound,anchor))
{
m_anchor = anchor;
if (compound && compound->isLinkable())
@@ -3087,7 +3069,7 @@ int DocInternal::parse(int level)
)
{
DocSection *s=new DocSection(this,
- QMIN(level+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ std::min(level+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
@@ -3206,7 +3188,7 @@ DocHtmlCaption::DocHtmlCaption(DocNode *parent,const HtmlAttribList &attribs)
const SectionInfo *sec = SectionManager::instance().find(opt.value);
if (sec)
{
- //printf("Found anchor %s\n",id.data());
+ //printf("Found anchor %s\n",qPrint(id));
m_file = sec->fileName();
m_anchor = sec->label();
m_hasCaptionId = TRUE;
@@ -3358,7 +3340,7 @@ uint DocHtmlCell::colSpan() const
{
if (attr.name.lower()=="colspan")
{
- return QMAX(1,attr.value.toUInt());
+ return std::max(1u,attr.value.toUInt());
}
}
return 1;
@@ -4309,7 +4291,7 @@ int DocAutoList::parse()
//printf("DocAutoList::parse(): retval=0x%x g_token->indent=%d m_indent=%d "
// "m_isEnumList=%d g_token->isEnumList=%d g_token->name=%s\n",
// retval,g_token->indent,m_indent,m_isEnumList,g_token->isEnumList,
- // g_token->name.data());
+ // qPrint(g_token->name));
//printf("num=%d g_token->id=%d\n",num,g_token->id);
}
while (retval==TK_LISTITEM && // new list item
@@ -5076,24 +5058,28 @@ void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t)
doctokenizerYYsetStateOptions();
tok=doctokenizerYYlex();
doctokenizerYYsetStatePara();
- QCStringList optList=QCStringList::split(",",g_token->name);
- if (t==DocInclude::Include && optList.contains("lineno"))
+ StringVector optList=split(g_token->name.str(),",");
+ auto contains = [&optList](const char *kw)
+ {
+ return std::find(optList.begin(),optList.end(),kw)!=optList.end();
+ };
+ if (t==DocInclude::Include && contains("lineno"))
{
t = DocInclude::IncWithLines;
}
- else if (t==DocInclude::Snippet && optList.contains("lineno"))
+ else if (t==DocInclude::Snippet && contains("lineno"))
{
t = DocInclude::SnipWithLines;
}
- else if (t==DocInclude::DontInclude && optList.contains("lineno"))
+ else if (t==DocInclude::DontInclude && contains("lineno"))
{
t = DocInclude::DontIncWithLines;
}
- else if (t==DocInclude::Include && optList.contains("doc"))
+ else if (t==DocInclude::Include && contains("doc"))
{
t = DocInclude::IncludeDoc;
}
- else if (t==DocInclude::Snippet && optList.contains("doc"))
+ else if (t==DocInclude::Snippet && contains("doc"))
{
t = DocInclude::SnippetDoc;
}
@@ -5256,7 +5242,7 @@ void DocPara::handleInheritDoc()
if (reMd) // member from which was inherited.
{
const MemberDef *thisMd = g_memberDef;
- //printf("{InheritDocs:%s=>%s}\n",g_memberDef->qualifiedName().data(),reMd->qualifiedName().data());
+ //printf("{InheritDocs:%s=>%s}\n",qPrint(g_memberDef->qualifiedName()),qPrint(reMd->qualifiedName()));
docParserPushContext();
g_scope=reMd->getOuterScope();
if (g_scope!=Doxygen::globalScope)
@@ -5286,7 +5272,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
{
case CMD_UNKNOWN:
m_children.push_back(std::make_unique<DocWord>(this,TK_COMMAND_CHAR(tok) + cmdName));
- warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Found unknown command '%c%s'",TK_COMMAND_CHAR(tok),qPrint(cmdName));
+ warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Found unknown command '%s%s'",TK_COMMAND_CHAR(tok),qPrint(cmdName));
break;
case CMD_EMPHASIS:
m_children.push_back(std::make_unique<DocStyleChange>(this,(uint)g_nodeStack.size(),DocStyleChange::Italic,cmdName,TRUE));
@@ -5809,7 +5795,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
tagId!=HTML_UNKNOWN && tagId!=HTML_IMG && tagId!=HTML_BR && tagId!=HTML_HR && tagId!=HTML_P)
{
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"HTML tag ('<%s/>') may not use the 'empty tag' XHTML syntax.",
- tagName.data());
+ qPrint(tagName));
}
switch (tagId)
{
@@ -6035,7 +6021,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
QCString paramName;
if (findAttribute(tagHtmlAttribs,"name",&paramName))
{
- //printf("paramName=%s\n",paramName.data());
+ //printf("paramName=%s\n",qPrint(paramName));
m_children.push_back(std::make_unique<DocStyleChange>(this,(uint)g_nodeStack.size(),DocStyleChange::Italic,tagName,TRUE));
m_children.push_back(std::make_unique<DocWord>(this,paramName));
m_children.push_back(std::make_unique<DocStyleChange>(this,(uint)g_nodeStack.size(),DocStyleChange::Italic,tagName,FALSE));
@@ -6590,7 +6576,7 @@ reparsetoken:
{
// simple section cannot start in this paragraph, need
// to unwind the stack and remember the command.
- g_token->simpleSectName = g_token->name.copy();
+ g_token->simpleSectName = g_token->name;
retval=RetVal_SimpleSec;
goto endparagraph;
}
@@ -6807,7 +6793,7 @@ int DocSection::parse()
while (retval==RetVal_Subsection) // more sections follow
{
DocSection *s=new DocSection(this,
- QMIN(2+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ std::min(2+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
@@ -6821,13 +6807,13 @@ int DocSection::parse()
while (retval==RetVal_Subsubsection) // more sections follow
{
DocSection *s=new DocSection(this,
- QMIN(3+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ std::min(3+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
if (!(m_level<Doxygen::subpageNestingLevel+2 && retval == RetVal_Subsection)) break;
}
- else if (retval==RetVal_Paragraph && m_level<=QMIN(5,Doxygen::subpageNestingLevel+3))
+ else if (retval==RetVal_Paragraph && m_level<=std::min(5,Doxygen::subpageNestingLevel+3))
{
if ((m_level<=2+Doxygen::subpageNestingLevel) && !g_token->sectionId.startsWith("autotoc_md"))
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Unexpected paragraph command found inside %s!",sectionLevelToName[m_level]);
@@ -6835,7 +6821,7 @@ int DocSection::parse()
while (retval==RetVal_Paragraph) // more sections follow
{
DocSection *s=new DocSection(this,
- QMIN(4+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ std::min(4+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
@@ -7008,7 +6994,7 @@ void DocRoot::parse()
if (sec)
{
DocSection *s=new DocSection(this,
- QMIN(4+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ std::min(4+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
@@ -7037,7 +7023,7 @@ void DocRoot::parse()
if (sec)
{
DocSection *s=new DocSection(this,
- QMIN(3+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ std::min(3+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
@@ -7068,7 +7054,7 @@ void DocRoot::parse()
if (sec)
{
DocSection *s=new DocSection(this,
- QMIN(2+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ std::min(2+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
@@ -7108,7 +7094,7 @@ void DocRoot::parse()
if (sec)
{
DocSection *s=new DocSection(this,
- QMIN(1+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ std::min(1+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
@@ -7183,7 +7169,7 @@ static QCString extractCopyDocId(const char *data, uint &j, uint len)
QCString id(e-s+1);
if (e>s) memcpy(id.rawData(),data+s,e-s);
id.at(e-s)='\0';
- //printf("extractCopyDocId='%s' input='%s'\n",id.data(),&data[s]);
+ //printf("extractCopyDocId='%s' input='%s'\n",qPrint(id),&data[s]);
return id;
}
@@ -7223,7 +7209,7 @@ static uint isVerbatimSection(const char *data,uint i,uint len,QCString &endMark
CHECK_FOR_COMMAND("docbookonly",endMarker="enddocbookonly");
CHECK_FOR_COMMAND("startuml",endMarker="enduml");
}
- //printf("isVerbatimSection(%s)=%d)\n",QCString(&data[i]).left(10).data(),j);
+ //printf("isVerbatimSection(%s)=%d)\n",qPrint(QCString(&data[i]).left(10)),j);
return j;
}
@@ -7234,7 +7220,7 @@ static uint skipToEndMarker(const char *data,uint i,uint len,const QCString &end
if ((data[i]=='@' || data[i]=='\\') && // start of command character
(i==0 || (data[i-1]!='@' && data[i-1]!='\\'))) // that is not escaped
{
- if (i+endMarker.length()+1<=len && qstrncmp(data+i+1,endMarker,endMarker.length())==0)
+ if (i+endMarker.length()+1<=len && qstrncmp(data+i+1,endMarker.data(),endMarker.length())==0)
{
return i+endMarker.length()+1;
}
@@ -7265,10 +7251,10 @@ static QCString processCopyDoc(const char *data,uint &len)
QCString id = extractCopyDocId(data,j,len);
const Definition *def = 0;
QCString doc,brief;
- //printf("resolving docs='%s'\n",id.data());
+ //printf("resolving docs='%s'\n",qPrint(id));
if (findDocsForMemberOrCompound(id,&doc,&brief,&def))
{
- //printf("found it def=%p brief='%s' doc='%s' isBrief=%d\n",def,brief.data(),doc.data(),isBrief);
+ //printf("found it def=%p brief='%s' doc='%s' isBrief=%d\n",def,qPrint(brief),qPrint(doc),isBrief);
auto it = std::find(g_copyStack.begin(),g_copyStack.end(),def);
if (it==g_copyStack.end()) // definition not parsed earlier
{
@@ -7276,12 +7262,12 @@ static QCString processCopyDoc(const char *data,uint &len)
if (isBrief)
{
uint l=brief.length();
- buf.addStr(processCopyDoc(brief,l));
+ buf.addStr(processCopyDoc(brief.data(),l));
}
else
{
uint l=doc.length();
- buf.addStr(processCopyDoc(doc,l));
+ buf.addStr(processCopyDoc(doc.data(),l));
}
g_copyStack.pop_back();
}
@@ -7289,14 +7275,14 @@ static QCString processCopyDoc(const char *data,uint &len)
{
warn_doc_error(g_fileName,getDoctokinizerLineNr(),
"Found recursive @copy%s or @copydoc relation for argument '%s'.\n",
- isBrief?"brief":"details",id.data());
+ isBrief?"brief":"details",qPrint(id));
}
}
else
{
warn_doc_error(g_fileName,getDoctokinizerLineNr(),
"@copy%s or @copydoc target '%s' not found", isBrief?"brief":"details",
- id.data());
+ qPrint(id));
}
// skip over command
i=j;
@@ -7331,15 +7317,15 @@ static QCString processCopyDoc(const char *data,uint &len)
//---------------------------------------------------------------------------
-DocRoot *validatingParseDoc(const char *fileName,int startLine,
+DocRoot *validatingParseDoc(const QCString &fileName,int startLine,
const Definition *ctx,const MemberDef *md,
- const char *input,bool indexWords,
- bool isExample, const char *exampleName,
+ const QCString &input,bool indexWords,
+ bool isExample, const QCString &exampleName,
bool singleLine, bool linkFromIndex,
bool markdownSupport)
{
- //printf("validatingParseDoc(%s,%s)=[%s]\n",ctx?ctx->name().data():"<none>",
- // md?md->name().data():"<none>",
+ //printf("validatingParseDoc(%s,%s)=[%s]\n",ctx?qPrint(ctx->name()):"<none>",
+ // md?qPrint(md->name()):"<none>",
// input);
//printf("========== validating %s at line %d\n",fileName,startLine);
//printf("---------------- input --------------------\n%s\n----------- end input -------------------\n",input);
@@ -7474,7 +7460,7 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine,
g_relPath = (!linkFromIndex && ctx) ?
QCString(relativePathToRoot(ctx->getOutputFileBase())) :
QCString("");
- //printf("ctx->name=%s relPath=%s\n",ctx->name().data(),g_relPath.data());
+ //printf("ctx->name=%s relPath=%s\n",qPrint(ctx->name()),qPrint(g_relPath));
g_memberDef = md;
while (!g_nodeStack.empty()) g_nodeStack.pop();
while (!g_styleStack.empty()) g_styleStack.pop();
@@ -7493,16 +7479,16 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine,
g_paramsFound.clear();
g_markdownSupport = markdownSupport;
- //printf("Starting comment block at %s:%d\n",g_fileName.data(),startLine);
+ //printf("Starting comment block at %s:%d\n",qPrint(g_fileName),startLine);
setDoctokinizerLineNr(startLine);
- uint inpLen=qstrlen(input);
- QCString inpStr = processCopyDoc(input,inpLen);
+ uint ioLen = input.length();
+ QCString inpStr = processCopyDoc(input.data(),ioLen);
if (inpStr.isEmpty() || inpStr.at(inpStr.length()-1)!='\n')
{
inpStr+='\n';
}
- //printf("processCopyDoc(in='%s' out='%s')\n",input,inpStr.data());
- doctokenizerYYinit(inpStr,g_fileName,markdownSupport);
+ //printf("processCopyDoc(in='%s' out='%s')\n",input,qPrint(inpStr));
+ doctokenizerYYinit(inpStr.data(),g_fileName,markdownSupport);
// build abstract syntax tree
DocRoot *root = new DocRoot(md!=0,singleLine);
@@ -7528,13 +7514,13 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine,
// restore original parser state
docParserPopContext();
- //printf(">>>>>> end validatingParseDoc(%s,%s)\n",ctx?ctx->name().data():"<none>",
- // md?md->name().data():"<none>");
+ //printf(">>>>>> end validatingParseDoc(%s,%s)\n",ctx?qPrint(ctx->name()):"<none>",
+ // md?qPrint(md->name()):"<none>");
return root;
}
-DocText *validatingParseText(const char *input)
+DocText *validatingParseText(const QCString &input)
{
// store parser state so we can re-enter this function if needed
docParserPushContext();
@@ -7565,10 +7551,10 @@ DocText *validatingParseText(const char *input)
DocText *txt = new DocText;
- if (input)
+ if (!input.isEmpty())
{
setDoctokinizerLineNr(1);
- doctokenizerYYinit(input,g_fileName,Config_getBool(MARKDOWN_SUPPORT));
+ doctokenizerYYinit(input.data(),g_fileName,Config_getBool(MARKDOWN_SUPPORT));
// build abstract syntax tree
txt->parse();
@@ -7587,9 +7573,9 @@ DocText *validatingParseText(const char *input)
return txt;
}
-void docFindSections(const char *input,
+void docFindSections(const QCString &input,
const Definition *d,
- const char *fileName)
+ const QCString &fileName)
{
doctokenizerYYFindSections(input,d,fileName);
}
diff --git a/src/docparser.h b/src/docparser.h
index 3f243e2..3de54bd 100644
--- a/src/docparser.h
+++ b/src/docparser.h
@@ -23,8 +23,7 @@
#include <vector>
#include <memory>
-#include <qcstring.h>
-
+#include "qcstring.h"
#include "docvisitor.h"
#include "htmlattrib.h"
@@ -57,22 +56,22 @@ class MemberGroup;
* @returns Root node of the abstract syntax tree. Ownership of the
* pointer is handed over to the caller.
*/
-DocRoot *validatingParseDoc(const char *fileName,int startLine,
+DocRoot *validatingParseDoc(const QCString &fileName,int startLine,
const Definition *context, const MemberDef *md,
- const char *input,bool indexWords,
- bool isExample,const char *exampleName,
+ const QCString &input,bool indexWords,
+ bool isExample,const QCString &exampleName,
bool singleLine,bool linkFromIndex,
bool markdownSupport);
/*! Main entry point for parsing simple text fragments. These
* fragments are limited to words, whitespace and symbols.
*/
-DocText *validatingParseText(const char *input);
+DocText *validatingParseText(const QCString &input);
/*! Searches for section and anchor commands in the input */
-void docFindSections(const char *input,
+void docFindSections(const QCString &input,
const Definition *d,
- const char *fileName);
+ const QCString &fileName);
//---------------------------------------------------------------------------
@@ -160,9 +159,6 @@ class DocNode
/*! Returns TRUE iff this node is inside a preformatted section */
bool isPreformatted() const { return m_insidePre; }
- //virtual QString::Direction getTextDir() const { return QString::DirNeutral; }
- //virtual QString::Direction getTextBasicDir() const { return QString::DirNeutral; }
-
protected:
/*! Sets whether or not this item is inside a preformatted section */
void setInsidePreformatted(bool p) { m_insidePre = p; }
@@ -540,9 +536,9 @@ class DocInclude : public DocNode
IncWithLines, Snippet , IncludeDoc, SnippetDoc, SnipWithLines,
DontIncWithLines, RtfInclude, ManInclude, DocbookInclude, XmlInclude};
DocInclude(DocNode *parent,const QCString &file,
- const QCString context, Type t,
- bool isExample,const QCString exampleFile,
- const QCString blockId, bool isBlock) :
+ const QCString &context, Type t,
+ bool isExample,const QCString &exampleFile,
+ const QCString &blockId, bool isBlock) :
m_file(file), m_context(context), m_type(t),
m_isExample(isExample), m_isBlock(isBlock),
m_exampleFile(exampleFile), m_blockId(blockId) { m_parent = parent; }
@@ -552,7 +548,7 @@ class DocInclude : public DocNode
if (i!=-1)
return m_file.right(m_file.length()-(uint)i);
else
- return "";
+ return QCString();
}
Type type() const { return m_type; }
QCString text() const { return m_text; }
@@ -718,7 +714,7 @@ class DocTitle : public CompAccept<DocTitle>
class DocXRefItem : public CompAccept<DocXRefItem>
{
public:
- DocXRefItem(DocNode *parent,int id,const char *key);
+ DocXRefItem(DocNode *parent,int id,const QCString &key);
Kind kind() const { return Kind_XRefItem; }
QCString file() const { return m_file; }
QCString anchor() const { return m_anchor; }
diff --git a/src/docsets.cpp b/src/docsets.cpp
index f7c8c18..bf589c4 100644
--- a/src/docsets.cpp
+++ b/src/docsets.cpp
@@ -15,8 +15,8 @@
#include <set>
#include <stack>
+#include <fstream>
-#include <qfile.h>
#include "docsets.h"
#include "config.h"
#include "message.h"
@@ -27,15 +27,15 @@
#include "memberdef.h"
#include "namespacedef.h"
#include "util.h"
-#include "ftextstream.h"
+#include "textstream.h"
struct DocSets::Private
{
QCString indent();
- QFile nf;
- QFile tf;
- FTextStream nts;
- FTextStream tts;
+ std::ofstream ntf;
+ TextStream nts;
+ std::ofstream ttf;
+ TextStream tts;
std::stack<bool> indentStack;
std::set<std::string> scopes;
};
@@ -67,135 +67,135 @@ void DocSets::initialize()
// -- write Makefile
{
- QCString mfName = Config_getString(HTML_OUTPUT) + "/Makefile";
- QFile makefile(mfName);
- if (!makefile.open(IO_WriteOnly))
- {
- term("Could not open file %s for writing\n",mfName.data());
- }
- FTextStream ts(&makefile);
+ QCString mfName = Config_getString(HTML_OUTPUT) + "/Makefile";
+ std::ofstream ts(mfName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!ts.is_open())
+ {
+ term("Could not open file %s for writing\n",qPrint(mfName));
+ }
- ts << "DOCSET_NAME=" << bundleId << ".docset\n"
- "DOCSET_CONTENTS=$(DOCSET_NAME)/Contents\n"
- "DOCSET_RESOURCES=$(DOCSET_CONTENTS)/Resources\n"
- "DOCSET_DOCUMENTS=$(DOCSET_RESOURCES)/Documents\n"
- "DESTDIR=~/Library/Developer/Shared/Documentation/DocSets\n"
- "XCODE_INSTALL=\"$(shell xcode-select -print-path)\"\n"
- "\n"
- "all: docset\n"
- "\n"
- "docset:\n"
- "\tmkdir -p $(DOCSET_DOCUMENTS)\n"
- "\tcp Nodes.xml $(DOCSET_RESOURCES)\n"
- "\tcp Tokens.xml $(DOCSET_RESOURCES)\n"
- "\tcp Info.plist $(DOCSET_CONTENTS)\n"
- "\ttar --exclude $(DOCSET_NAME) \\\n"
- "\t --exclude Nodes.xml \\\n"
- "\t --exclude Tokens.xml \\\n"
- "\t --exclude Info.plist \\\n"
- "\t --exclude Makefile -c -f - . \\\n"
- "\t | (cd $(DOCSET_DOCUMENTS); tar xvf -)\n"
- "\t$(XCODE_INSTALL)/usr/bin/docsetutil index $(DOCSET_NAME)\n"
- "\trm -f $(DOCSET_DOCUMENTS)/Nodes.xml\n"
- "\trm -f $(DOCSET_DOCUMENTS)/Info.plist\n"
- "\trm -f $(DOCSET_DOCUMENTS)/Makefile\n"
- "\trm -f $(DOCSET_RESOURCES)/Nodes.xml\n"
- "\trm -f $(DOCSET_RESOURCES)/Tokens.xml\n"
- "\n"
- "clean:\n"
- "\trm -rf $(DOCSET_NAME)\n"
- "\n"
- "install: docset\n"
- "\tmkdir -p $(DESTDIR)\n"
- "\tcp -R $(DOCSET_NAME) $(DESTDIR)\n"
- "\n"
- "uninstall:\n"
- "\trm -rf $(DESTDIR)/$(DOCSET_NAME)\n"
- "\n"
- "always:\n";
+ ts << "DOCSET_NAME=" << bundleId << ".docset\n"
+ "DOCSET_CONTENTS=$(DOCSET_NAME)/Contents\n"
+ "DOCSET_RESOURCES=$(DOCSET_CONTENTS)/Resources\n"
+ "DOCSET_DOCUMENTS=$(DOCSET_RESOURCES)/Documents\n"
+ "DESTDIR=~/Library/Developer/Shared/Documentation/DocSets\n"
+ "XCODE_INSTALL=\"$(shell xcode-select -print-path)\"\n"
+ "\n"
+ "all: docset\n"
+ "\n"
+ "docset:\n"
+ "\tmkdir -p $(DOCSET_DOCUMENTS)\n"
+ "\tcp Nodes.xml $(DOCSET_RESOURCES)\n"
+ "\tcp Tokens.xml $(DOCSET_RESOURCES)\n"
+ "\tcp Info.plist $(DOCSET_CONTENTS)\n"
+ "\ttar --exclude $(DOCSET_NAME) \\\n"
+ "\t --exclude Nodes.xml \\\n"
+ "\t --exclude Tokens.xml \\\n"
+ "\t --exclude Info.plist \\\n"
+ "\t --exclude Makefile -c -f - . \\\n"
+ "\t | (cd $(DOCSET_DOCUMENTS); tar xvf -)\n"
+ "\t$(XCODE_INSTALL)/usr/bin/docsetutil index $(DOCSET_NAME)\n"
+ "\trm -f $(DOCSET_DOCUMENTS)/Nodes.xml\n"
+ "\trm -f $(DOCSET_DOCUMENTS)/Info.plist\n"
+ "\trm -f $(DOCSET_DOCUMENTS)/Makefile\n"
+ "\trm -f $(DOCSET_RESOURCES)/Nodes.xml\n"
+ "\trm -f $(DOCSET_RESOURCES)/Tokens.xml\n"
+ "\n"
+ "clean:\n"
+ "\trm -rf $(DOCSET_NAME)\n"
+ "\n"
+ "install: docset\n"
+ "\tmkdir -p $(DESTDIR)\n"
+ "\tcp -R $(DOCSET_NAME) $(DESTDIR)\n"
+ "\n"
+ "uninstall:\n"
+ "\trm -rf $(DESTDIR)/$(DOCSET_NAME)\n"
+ "\n"
+ "always:\n";
}
// -- write Info.plist
{
- QCString plName = Config_getString(HTML_OUTPUT) + "/Info.plist";
- QFile plist(plName);
- if (!plist.open(IO_WriteOnly))
- {
- term("Could not open file %s for writing\n",plName.data());
- }
- FTextStream ts(&plist);
+ QCString plName = Config_getString(HTML_OUTPUT) + "/Info.plist";
+ std::ofstream ts(plName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!ts.is_open())
+ {
+ term("Could not open file %s for writing\n",qPrint(plName));
+ }
- ts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"\n"
- "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
- "<plist version=\"1.0\">\n"
- "<dict>\n"
- " <key>CFBundleName</key>\n"
- " <string>" << projectName << "</string>\n"
- " <key>CFBundleIdentifier</key>\n"
- " <string>" << bundleId << "</string>\n"
- " <key>CFBundleVersion</key>\n"
- " <string>" << projectNumber << "</string>\n"
- " <key>DocSetFeedName</key>\n"
- " <string>" << feedName << "</string>\n"
- " <key>DocSetPublisherIdentifier</key>\n"
- " <string>" << publisherId << "</string>\n"
- " <key>DocSetPublisherName</key>\n"
- " <string>" << publisherName << "</string>\n"
- // markers for Dash
- " <key>DashDocSetFamily</key>\n"
- " <string>doxy</string>\n"
- " <key>DocSetPlatformFamily</key>\n"
- " <string>doxygen</string>\n"
- "</dict>\n"
- "</plist>\n";
+ ts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"\n"
+ "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
+ "<plist version=\"1.0\">\n"
+ "<dict>\n"
+ " <key>CFBundleName</key>\n"
+ " <string>" << projectName << "</string>\n"
+ " <key>CFBundleIdentifier</key>\n"
+ " <string>" << bundleId << "</string>\n"
+ " <key>CFBundleVersion</key>\n"
+ " <string>" << projectNumber << "</string>\n"
+ " <key>DocSetFeedName</key>\n"
+ " <string>" << feedName << "</string>\n"
+ " <key>DocSetPublisherIdentifier</key>\n"
+ " <string>" << publisherId << "</string>\n"
+ " <key>DocSetPublisherName</key>\n"
+ " <string>" << publisherName << "</string>\n"
+ // markers for Dash
+ " <key>DashDocSetFamily</key>\n"
+ " <string>doxy</string>\n"
+ " <key>DocSetPlatformFamily</key>\n"
+ " <string>doxygen</string>\n"
+ "</dict>\n"
+ "</plist>\n";
}
// -- start Nodes.xml
QCString notes = Config_getString(HTML_OUTPUT) + "/Nodes.xml";
- p->nf.setName(notes);
- if (!p->nf.open(IO_WriteOnly))
+ p->ntf.open(notes.str(),std::ofstream::out | std::ofstream::binary);
+ if (!p->ntf.is_open())
{
- term("Could not open file %s for writing\n",notes.data());
+ term("Could not open file %s for writing\n",qPrint(notes));
}
+ p->nts.setStream(&p->ntf);
//QCString indexName=Config_getBool(GENERATE_TREEVIEW)?"main":"index";
QCString indexName="index";
- p->nts.setDevice(&p->nf);
- p->nts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
- p->nts << "<DocSetNodes version=\"1.0\">" << endl;
- p->nts << " <TOC>" << endl;
- p->nts << " <Node>" << endl;
- p->nts << " <Name>Root</Name>" << endl;
- p->nts << " <Path>" << indexName << Doxygen::htmlFileExtension << "</Path>" << endl;
- p->nts << " <Subnodes>" << endl;
+ p->nts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ p->nts << "<DocSetNodes version=\"1.0\">\n";
+ p->nts << " <TOC>\n";
+ p->nts << " <Node>\n";
+ p->nts << " <Name>Root</Name>\n";
+ p->nts << " <Path>" << indexName << Doxygen::htmlFileExtension << "</Path>\n";
+ p->nts << " <Subnodes>\n";
p->indentStack.push(true);
QCString tokens = Config_getString(HTML_OUTPUT) + "/Tokens.xml";
- p->tf.setName(tokens);
- if (!p->tf.open(IO_WriteOnly))
+ p->ttf.open(tokens.str(),std::ofstream::out | std::ofstream::binary);
+ if (!p->ttf.is_open())
{
- term("Could not open file %s for writing\n",tokens.data());
+ term("Could not open file %s for writing\n",qPrint(tokens));
}
- p->tts.setDevice(&p->tf);
- p->tts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
- p->tts << "<Tokens version=\"1.0\">" << endl;
+ p->tts.setStream(&p->ttf);
+ p->tts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ p->tts << "<Tokens version=\"1.0\">\n";
}
void DocSets::finalize()
{
if (!p->indentStack.top())
{
- p->nts << p->indent() << " </Node>" << endl;
+ p->nts << p->indent() << " </Node>\n";
}
p->indentStack.pop();
- p->nts << " </Subnodes>" << endl;
- p->nts << " </Node>" << endl;
- p->nts << " </TOC>" << endl;
- p->nts << "</DocSetNodes>" << endl;
- p->nf.close();
+ p->nts << " </Subnodes>\n";
+ p->nts << " </Node>\n";
+ p->nts << " </TOC>\n";
+ p->nts << "</DocSetNodes>\n";
+ p->nts.flush();
+ p->ntf.close();
- p->tts << "</Tokens>" << endl;
- p->tf.close();
+ p->tts << "</Tokens>\n";
+ p->tts.flush();
+ p->ttf.close();
}
QCString DocSets::Private::indent()
@@ -208,7 +208,7 @@ QCString DocSets::Private::indent()
void DocSets::incContentsDepth()
{
//printf("DocSets::incContentsDepth() depth=%zu\n",p->indentStack.size());
- p->nts << p->indent() << "<Subnodes>" << endl;
+ p->nts << p->indent() << "<Subnodes>\n";
p->indentStack.push(true);
}
@@ -216,18 +216,18 @@ void DocSets::decContentsDepth()
{
if (!p->indentStack.top())
{
- p->nts << p->indent() << " </Node>" << endl;
+ p->nts << p->indent() << " </Node>\n";
}
- p->nts << p->indent() << "</Subnodes>" << endl;
+ p->nts << p->indent() << "</Subnodes>\n";
p->indentStack.pop();
//printf("DocSets::decContentsDepth() depth=%zu\n",p->indentStack.size());
}
void DocSets::addContentsItem(bool isDir,
- const char *name,
- const char *ref,
- const char *file,
- const char *anchor,
+ const QCString &name,
+ const QCString &ref,
+ const QCString &file,
+ const QCString &anchor,
bool /* separateIndex */,
bool /* addToNavIndex */,
const Definition * /*def*/)
@@ -238,38 +238,38 @@ void DocSets::addContentsItem(bool isDir,
{
if (!p->indentStack.top())
{
- p->nts << p->indent() << " </Node>" << endl;
+ p->nts << p->indent() << " </Node>\n";
}
p->indentStack.top()=false;
- p->nts << p->indent() << " <Node>" << endl;
- p->nts << p->indent() << " <Name>" << convertToXML(name) << "</Name>" << endl;
- if (file && file[0]=='^') // URL marker
+ p->nts << p->indent() << " <Node>\n";
+ p->nts << p->indent() << " <Name>" << convertToXML(name) << "</Name>\n";
+ if (!file.isEmpty() && file[0]=='^') // URL marker
{
p->nts << p->indent() << " <URL>" << convertToXML(&file[1])
- << "</URL>" << endl;
+ << "</URL>\n";
}
else // relative file
{
p->nts << p->indent() << " <Path>";
- if (file && file[0]=='!') // user specified file
+ if (!file.isEmpty() && file[0]=='!') // user specified file
{
p->nts << convertToXML(&file[1]);
}
- else if (file) // doxygen generated file
+ else if (!file.isEmpty()) // doxygen generated file
{
p->nts << file << Doxygen::htmlFileExtension;
}
- p->nts << "</Path>" << endl;
- if (file && anchor)
+ p->nts << "</Path>\n";
+ if (!file.isEmpty() && !anchor.isEmpty())
{
- p->nts << p->indent() << " <Anchor>" << anchor << "</Anchor>" << endl;
+ p->nts << p->indent() << " <Anchor>" << anchor << "</Anchor>\n";
}
}
}
}
void DocSets::addIndexItem(const Definition *context,const MemberDef *md,
- const char *,const char *)
+ const QCString &,const QCString &)
{
if (md==0 && context==0) return;
@@ -477,57 +477,57 @@ void DocSets::addIndexItem(const Definition *context,const MemberDef *md,
}
if (p->scopes.find(context->getOutputFileBase().str())==p->scopes.end())
{
- writeToken(p->tts,context,type,lang,scope,0,decl);
+ writeToken(p->tts,context,type,lang,scope,QCString(),decl);
p->scopes.insert(context->getOutputFileBase().str());
}
}
}
-void DocSets::writeToken(FTextStream &t,
+void DocSets::writeToken(TextStream &t,
const Definition *d,
const QCString &type,
const QCString &lang,
- const char *scope,
- const char *anchor,
- const char *decl)
+ const QCString &scope,
+ const QCString &anchor,
+ const QCString &decl)
{
- t << " <Token>" << endl;
- t << " <TokenIdentifier>" << endl;
+ t << " <Token>\n";
+ t << " <TokenIdentifier>\n";
QCString name = d->name();
if (name.right(2)=="-p") name=name.left(name.length()-2);
- t << " <Name>" << convertToXML(name) << "</Name>" << endl;
+ t << " <Name>" << convertToXML(name) << "</Name>\n";
if (!lang.isEmpty())
{
- t << " <APILanguage>" << lang << "</APILanguage>" << endl;
+ t << " <APILanguage>" << lang << "</APILanguage>\n";
}
if (!type.isEmpty())
{
- t << " <Type>" << type << "</Type>" << endl;
+ t << " <Type>" << type << "</Type>\n";
}
- if (scope)
+ if (!scope.isEmpty())
{
- t << " <Scope>" << convertToXML(scope) << "</Scope>" << endl;
+ t << " <Scope>" << convertToXML(scope) << "</Scope>\n";
}
- t << " </TokenIdentifier>" << endl;
+ t << " </TokenIdentifier>\n";
t << " <Path>" << d->getOutputFileBase()
- << Doxygen::htmlFileExtension << "</Path>" << endl;
- if (anchor)
+ << Doxygen::htmlFileExtension << "</Path>\n";
+ if (!anchor.isEmpty())
{
- t << " <Anchor>" << anchor << "</Anchor>" << endl;
+ t << " <Anchor>" << anchor << "</Anchor>\n";
}
QCString tooltip = d->briefDescriptionAsTooltip();
if (!tooltip.isEmpty())
{
- t << " <Abstract>" << convertToXML(tooltip) << "</Abstract>" << endl;
+ t << " <Abstract>" << convertToXML(tooltip) << "</Abstract>\n";
}
- if (decl)
+ if (!decl.isEmpty())
{
- t << " <DeclaredIn>" << convertToXML(decl) << "</DeclaredIn>" << endl;
+ t << " <DeclaredIn>" << convertToXML(decl) << "</DeclaredIn>\n";
}
- t << " </Token>" << endl;
+ t << " </Token>\n";
}
-void DocSets::addIndexFile(const char *name)
+void DocSets::addIndexFile(const QCString &name)
{
(void)name;
}
diff --git a/src/docsets.h b/src/docsets.h
index 6065cfe..03146f1 100644
--- a/src/docsets.h
+++ b/src/docsets.h
@@ -20,9 +20,9 @@
#include "index.h"
-class QFile;
+class TextStream;
+
class Definition;
-class FTextStream;
/** A class that generates docset files.
*
@@ -40,25 +40,25 @@ class DocSets : public IndexIntf
void incContentsDepth();
void decContentsDepth();
void addContentsItem(bool isDir,
- const char *name,
- const char *ref,
- const char *file,
- const char *anchor,
+ const QCString &name,
+ const QCString &ref,
+ const QCString &file,
+ const QCString &anchor,
bool separateIndex,
bool addToNavIndex,
const Definition *def
);
void addIndexItem(const Definition *context,const MemberDef *md,
- const char *sectionAnchor,const char *title);
- void addIndexFile(const char *name);
- void addImageFile(const char *) {}
- void addStyleSheetFile(const char *) {}
+ const QCString &sectionAnchor,const QCString &title);
+ void addIndexFile(const QCString &name);
+ void addImageFile(const QCString &) {}
+ void addStyleSheetFile(const QCString &) {}
private:
- void writeToken(FTextStream &t, const Definition *d,
+ void writeToken(TextStream &t, const Definition *d,
const QCString &type, const QCString &lang,
- const char *scope=0, const char *anchor=0,
- const char *decl=0);
+ const QCString &scope=QCString(), const QCString &anchor=QCString(),
+ const QCString &decl=QCString());
struct Private;
std::unique_ptr<Private> p;
diff --git a/src/doctokenizer.h b/src/doctokenizer.h
index ec73e61..02dbecd 100644
--- a/src/doctokenizer.h
+++ b/src/doctokenizer.h
@@ -19,9 +19,10 @@
#ifndef _DOCTOKENIZER_H
#define _DOCTOKENIZER_H
-#include <qcstring.h>
#include <stdio.h>
+
#include "htmlattrib.h"
+#include "qcstring.h"
class Definition;
@@ -123,9 +124,9 @@ void setDoctokinizerLineNr(int lineno);
int getDoctokinizerLineNr(void);
// operations on the scanner
-void doctokenizerYYFindSections(const char *input,const Definition *d,
- const char *fileName);
-void doctokenizerYYinit(const char *input,const char *fileName,bool markdownSupport);
+void doctokenizerYYFindSections(const QCString &input,const Definition *d,
+ const QCString &fileName);
+void doctokenizerYYinit(const char *input,const QCString &fileName,bool markdownSupport);
void doctokenizerYYcleanup();
void doctokenizerYYpushContext();
bool doctokenizerYYpopContext();
@@ -156,7 +157,7 @@ void doctokenizerYYsetStateText();
void doctokenizerYYsetStateSkipTitle();
void doctokenizerYYsetStateAnchor();
void doctokenizerYYsetInsidePre(bool b);
-void doctokenizerYYpushBackHtmlTag(const char *tag);
+void doctokenizerYYpushBackHtmlTag(const QCString &tag);
void doctokenizerYYsetStateSnippet();
void doctokenizerYYstartAutoList();
void doctokenizerYYendAutoList();
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index eaf8a43..b29afcb 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -27,8 +27,7 @@
#include <ctype.h>
#include <stack>
#include <string>
-
-#include <qfile.h>
+#include <cassert>
#include "doctokenizer.h"
#include "cmdmapper.h"
@@ -117,12 +116,12 @@ bool doctokenizerYYpopContext()
QCString extractPartAfterNewLine(const QCString &text)
{
- int nl1 = text.findRev('\n');
- if (nl1!=-1)
+ int nl1 = text.find('\n');
+ int nl2 = text.find("\\ilinebr");
+ if (nl1!=-1 && nl1<nl2)
{
return text.mid(nl1+1);
}
- int nl2 = text.findRev("\\ilinebr");
if (nl2!=-1)
{
if (text.at(nl2+8)==' ') nl2++; // skip space after \\ilinebr
@@ -154,9 +153,10 @@ const char *tokToString(int token)
return "ERROR";
}
-static int computeIndent(const char *str,int length)
+static int computeIndent(const char *str,size_t length)
{
- int i;
+ if (str==0 || length==std::string::npos) return 0;
+ size_t i;
int indent=0;
static int tabSize=Config_getInt(TAB_SIZE);
for (i=0;i<length;i++)
@@ -181,7 +181,7 @@ static int computeIndent(const char *str,int length)
static void processSection()
{
- //printf("%s: found section/anchor with name '%s'\n",g_fileName.data(),g_secLabel.data());
+ //printf("%s: found section/anchor with name '%s'\n",qPrint(g_fileName),qPrint(g_secLabel));
QCString file;
if (g_definition)
{
@@ -189,7 +189,7 @@ static void processSection()
}
else
{
- warn(g_fileName,g_yyLineNr,"Found section/anchor %s without context\n",g_secLabel.data());
+ warn(g_fileName,g_yyLineNr,"Found section/anchor %s without context\n",qPrint(g_secLabel));
}
SectionInfo *si = SectionManager::instance().find(g_secLabel);
if (si)
@@ -201,7 +201,7 @@ static void processSection()
static void handleHtmlTag()
{
- QCString tagText=yytext;
+ QCString tagText(yytext);
g_token->attribs.clear();
g_token->endTag = FALSE;
g_token->emptyTag = FALSE;
@@ -293,7 +293,7 @@ static void handleHtmlTag()
{
}
//printf("=====> Adding option name=<%s> value=<%s>\n",
- // opt.name.data(),opt.value.data());
+ // qPrint(opt.name),qPrint(opt.value));
g_token->attribs.push_back(opt);
}
g_token->attribsStr = tagText.mid(startAttribList,i-startAttribList);
@@ -499,8 +499,9 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
<St_Para>\r /* skip carriage return */
<St_Para>^{LISTITEM} { /* list item */
lineCount(yytext,yyleng);
- QCString text=yytext;
- int dashPos = text.findRev('-');
+ QCString text(yytext);
+ size_t dashPos = static_cast<size_t>(text.findRev('-'));
+ assert(dashPos!=std::string::npos);
g_token->isEnumList = text.at(dashPos+1)=='#';
g_token->id = -1;
g_token->indent = computeIndent(yytext,dashPos);
@@ -514,11 +515,12 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
else
{
lineCount(yytext,yyleng);
- std::string text=yytext;
+ std::string text(yytext);
static const reg::Ex re(R"([*+][^*+]*$)"); // find last + or *
reg::Match match;
reg::search(text,match,re);
size_t listPos = match.position();
+ assert(listPos!=std::string::npos);
g_token->isEnumList = FALSE;
g_token->id = -1;
g_token->indent = computeIndent(yytext,listPos);
@@ -532,23 +534,26 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
}
else
{
- std::string text=yytext;
+ std::string text(yytext);
static const reg::Ex re(R"(\d+)");
reg::Match match;
reg::search(text,match,re);
+ size_t markPos = match.position();
+ assert(markPos!=std::string::npos);
g_token->isEnumList = true;
g_token->id = std::stoul(match.str());
- g_token->indent = computeIndent(yytext,match.position());
+ g_token->indent = computeIndent(yytext,markPos);
return TK_LISTITEM;
}
}
<St_Para>{BLANK}*(\n|"\\ilinebr"){LISTITEM} { /* list item on next line */
lineCount(yytext,yyleng);
- QCString text=extractPartAfterNewLine(yytext);
- int dashPos = text.findRev('-');
+ QCString text=extractPartAfterNewLine(QCString(yytext));
+ size_t dashPos = static_cast<size_t>(text.findRev('-'));
+ assert(dashPos!=std::string::npos);
g_token->isEnumList = text.at(dashPos+1)=='#';
g_token->id = -1;
- g_token->indent = computeIndent(text,dashPos);
+ g_token->indent = computeIndent(text.data(),dashPos);
return TK_LISTITEM;
}
<St_Para>{BLANK}*(\n|"\\ilinebr"){MLISTITEM} { /* list item on next line */
@@ -559,11 +564,12 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
else
{
lineCount(yytext,yyleng);
- std::string text=extractPartAfterNewLine(yytext).str();
+ std::string text=extractPartAfterNewLine(QCString(yytext)).str();
static const reg::Ex re(R"([*+][^*+]*$)"); // find last + or *
reg::Match match;
reg::search(text,match,re);
size_t markPos = match.position();
+ assert(markPos!=std::string::npos);
g_token->isEnumList = FALSE;
g_token->id = -1;
g_token->indent = computeIndent(text.c_str(),markPos);
@@ -578,27 +584,30 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
else
{
lineCount(yytext,yyleng);
- std::string text=extractPartAfterNewLine(yytext).str();
+ std::string text=extractPartAfterNewLine(QCString(yytext)).str();
static const reg::Ex re(R"(\d+)");
reg::Match match;
reg::search(text,match,re);
+ size_t markPos = match.position();
+ assert(markPos!=std::string::npos);
g_token->isEnumList = true;
g_token->id = std::stoul(match.str());
- g_token->indent = computeIndent(text.c_str(),match.position());
+ g_token->indent = computeIndent(text.c_str(),markPos);
return TK_LISTITEM;
}
}
<St_Para>^{ENDLIST} { /* end list */
lineCount(yytext,yyleng);
int dotPos = QCString(yytext).findRev('.');
+ assert(dotPos!=-1);
g_token->indent = computeIndent(yytext,dotPos);
return TK_ENDLIST;
}
<St_Para>{BLANK}*(\n|"\\ilinebr"){ENDLIST} { /* end list on next line */
lineCount(yytext,yyleng);
- QCString text=extractPartAfterNewLine(yytext);
+ QCString text=extractPartAfterNewLine(QCString(yytext));
int dotPos = text.findRev('.');
- g_token->indent = computeIndent(text,dotPos);
+ g_token->indent = computeIndent(text.data(),dotPos);
return TK_ENDLIST;
}
<St_Para>"{"{BLANK}*"@link"/{BLANK}+ {
@@ -714,7 +723,7 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
}
<St_Para,St_HtmlOnly,St_ManOnly,St_LatexOnly,St_RtfOnly,St_XmlOnly,St_DbOnly>"$("{ID}")" | /* environment variable */
<St_Para,St_HtmlOnly,St_ManOnly,St_LatexOnly,St_RtfOnly,St_XmlOnly,St_DbOnly>"$("{ID}"("{ID}"))" { /* environment variable */
- QCString name = &yytext[2];
+ QCString name(&yytext[2]);
name = name.left(name.length()-1);
QCString value = Portable::getenv(name);
for (int i=value.length()-1;i>=0;i--) unput(value.at(i));
@@ -822,7 +831,7 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
}
else
{
- g_token->indent=computeIndent(yytext,(int)yyleng);
+ g_token->indent=computeIndent(yytext,yyleng);
int i;
// put back the indentation (needed for list items)
for (i=0;i<g_token->indent;i++)
@@ -1230,7 +1239,7 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
BEGIN(St_XRefItem2);
}
<St_XRefItem2>[0-9]+"." {
- QCString numStr=yytext;
+ QCString numStr(yytext);
numStr=numStr.left((int)yyleng-1);
g_token->id=numStr.toInt();
return RetVal_OK;
@@ -1246,7 +1255,7 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
}
<St_Param>({PHPTYPE}{BLANK}*("["{BLANK}*"]")*{BLANK}*"|"{BLANK}*)*{PHPTYPE}{BLANK}*("["{BLANK}*"]")*{WS}+("&")?"$"{LABELID} {
lineCount(yytext,yyleng);
- QCString params = yytext;
+ QCString params(yytext);
int j = params.find('&');
int i = params.find('$');
if (j<i && j!=-1) i=j;
@@ -1297,7 +1306,7 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
return TK_WORD;
}
<St_File>"\""[^\n\"]+"\"" {
- QCString text=yytext;
+ QCString text(yytext);
g_token->name = text.mid(1,text.length()-2);
return TK_WORD;
}
@@ -1340,7 +1349,7 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
<St_Sections>{CMD}("<"|{CMD})
<St_Sections>"<"{CAPTION}({WS}+{ATTRIB})*">" {
lineCount(yytext,yyleng);
- QCString tag=yytext;
+ QCString tag(yytext);
int s=tag.find("id=");
if (s!=-1) // command has id attribute
{
@@ -1426,13 +1435,13 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
BEGIN(St_SecSkip);
}
<St_SecSkip>{CMD}{ID} {
- if (qstrcmp(yytext+1,g_endMarker)==0)
+ if (g_endMarker==yytext+1)
{
BEGIN(St_Sections);
}
}
<St_SecSkip>"-->" {
- if (qstrcmp(yytext,g_endMarker)==0)
+ if (g_endMarker==yytext)
{
BEGIN(St_Sections);
}
@@ -1501,12 +1510,12 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
//--------------------------------------------------------------------------
-void doctokenizerYYFindSections(const char *input,const Definition *d,
- const char *fileName)
+void doctokenizerYYFindSections(const QCString &input,const Definition *d,
+ const QCString &fileName)
{
- if (input==0) return;
- printlex(yy_flex_debug, TRUE, __FILE__, fileName);
- g_inputString = input;
+ if (input.isEmpty()) return;
+ printlex(yy_flex_debug, TRUE, __FILE__, qPrint(fileName));
+ g_inputString = input.data();
//printf("parsing --->'%s'<---\n",input);
g_inputPos = 0;
g_definition = d;
@@ -1514,10 +1523,10 @@ void doctokenizerYYFindSections(const char *input,const Definition *d,
BEGIN(St_Sections);
g_yyLineNr = 1;
doctokenizerYYlex();
- printlex(yy_flex_debug, FALSE, __FILE__, fileName);
+ printlex(yy_flex_debug, FALSE, __FILE__, qPrint(fileName));
}
-void doctokenizerYYinit(const char *input,const char *fileName,bool markdownSupport)
+void doctokenizerYYinit(const char *input,const QCString &fileName,bool markdownSupport)
{
g_autoListLevel = 0;
g_inputString = input;
@@ -1720,7 +1729,7 @@ void doctokenizerYYsetInsidePre(bool b)
g_insidePre = b;
}
-void doctokenizerYYpushBackHtmlTag(const char *tag)
+void doctokenizerYYpushBackHtmlTag(const QCString &tag)
{
QCString tagName = tag;
int i,l = tagName.length();
diff --git a/src/docvisitor.cpp b/src/docvisitor.cpp
index 5356faf..506c9f8 100644
--- a/src/docvisitor.cpp
+++ b/src/docvisitor.cpp
@@ -38,9 +38,9 @@ DocVisitor::~DocVisitor()
{
}
-CodeParserInterface &DocVisitor::getCodeParser(const char *extension)
+CodeParserInterface &DocVisitor::getCodeParser(const QCString &extension)
{
- std::string ext(extension?extension:"");
+ std::string ext = extension.str();
// for each extension we create a code parser once per visitor, so that
// the context of the same parser object is reused throughout multiple passes for instance
// for code fragments shown via dontinclude.
diff --git a/src/docvisitor.h b/src/docvisitor.h
index baf5bef..b19e76e 100644
--- a/src/docvisitor.h
+++ b/src/docvisitor.h
@@ -18,6 +18,8 @@
#include <memory>
+#include "qcstring.h"
+
// ids
const int DocVisitor_Html = 0;
const int DocVisitor_Latex = 1;
@@ -95,7 +97,7 @@ class DocVisitor
DocVisitor(int id);
virtual ~DocVisitor();
int id() const;
- CodeParserInterface &getCodeParser(const char *langExt);
+ CodeParserInterface &getCodeParser(const QCString &langExt);
void pushHidden(bool hide);
bool popHidden();
diff --git a/src/dot.cpp b/src/dot.cpp
index ddabbc7..8aa30b7 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -15,8 +15,8 @@
#include <cstdlib>
#include <cassert>
-
-#include <qdir.h>
+#include <sstream>
+#include <algorithm>
#include "config.h"
#include "dot.h"
@@ -25,10 +25,10 @@
#include "util.h"
#include "portable.h"
#include "message.h"
-#include "ftextstream.h"
#include "doxygen.h"
#include "language.h"
#include "index.h"
+#include "dir.h"
#define MAP_CMD "cmapx"
@@ -36,17 +36,16 @@
static QCString g_dotFontPath;
-static void setDotFontPath(const char *path)
+static void setDotFontPath(const QCString &path)
{
ASSERT(g_dotFontPath.isEmpty());
g_dotFontPath = Portable::getenv("DOTFONTPATH");
QCString newFontPath = Config_getString(DOT_FONTPATH);
- QCString spath = path;
- if (!newFontPath.isEmpty() && !spath.isEmpty())
+ if (!newFontPath.isEmpty() && !path.isEmpty())
{
- newFontPath.prepend(spath+Portable::pathListSeparator());
+ newFontPath.prepend(path+Portable::pathListSeparator());
}
- else if (newFontPath.isEmpty() && !spath.isEmpty())
+ else if (newFontPath.isEmpty() && !path.isEmpty())
{
newFontPath=path;
}
@@ -118,22 +117,22 @@ DotManager::~DotManager()
delete m_queue;
}
-DotRunner* DotManager::createRunner(const std::string &absDotName, const std::string& md5Hash)
+DotRunner* DotManager::createRunner(const QCString &absDotName, const QCString& md5Hash)
{
DotRunner* rv = nullptr;
- auto const runit = m_runners.find(absDotName);
+ auto const runit = m_runners.find(absDotName.str());
if (runit == m_runners.end())
{
auto insobj = std::make_unique<DotRunner>(absDotName, md5Hash);
rv = insobj.get();
- m_runners.emplace(absDotName, std::move(insobj));
+ m_runners.emplace(absDotName.str(), std::move(insobj));
}
else
{
// we have a match
if (md5Hash != runit->second->getMd5Hash())
{
- err("md5 hash does not match for two different runs of %s !\n", absDotName.data());
+ err("md5 hash does not match for two different runs of %s !\n", qPrint(absDotName));
}
rv = runit->second.get();
}
@@ -141,13 +140,13 @@ DotRunner* DotManager::createRunner(const std::string &absDotName, const std::st
return rv;
}
-DotFilePatcher *DotManager::createFilePatcher(const std::string &fileName)
+DotFilePatcher *DotManager::createFilePatcher(const QCString &fileName)
{
- auto patcher = m_filePatchers.find(fileName);
+ auto patcher = m_filePatchers.find(fileName.str());
if (patcher != m_filePatchers.end()) return &(patcher->second);
- auto rv = m_filePatchers.emplace(fileName, fileName.c_str());
+ auto rv = m_filePatchers.emplace(fileName.str(), fileName.data());
assert(rv.second);
return &(rv.first->second);
}
@@ -164,7 +163,7 @@ bool DotManager::run() const
}
else
{
- msg("Generating dot graphs using %zu parallel threads...\n",QMIN(numDotRuns+numFilePatchers,m_workers.size()));
+ msg("Generating dot graphs using %zu parallel threads...\n",std::min(numDotRuns+numFilePatchers,m_workers.size()));
}
}
size_t i=1;
@@ -270,19 +269,19 @@ bool DotManager::run() const
//--------------------------------------------------------------------
-void writeDotGraphFromFile(const char *inFile,const char *outDir,
- const char *outFile,GraphOutputFormat format)
+void writeDotGraphFromFile(const QCString &inFile,const QCString &outDir,
+ const QCString &outFile,GraphOutputFormat format)
{
- QDir d(outDir);
+ Dir d(outDir.str());
if (!d.exists())
{
- term("Output dir %s does not exist!\n",outDir);
+ term("Output dir %s does not exist!\n",qPrint(outDir));
}
QCString imgExt = getDotImageExtension();
QCString imgName = (QCString)outFile+"."+imgExt;
- QCString absImgName = d.absPath().utf8()+"/"+imgName;
- QCString absOutFile = d.absPath().utf8()+"/"+outFile;
+ QCString absImgName = QCString(d.absPath())+"/"+imgName;
+ QCString absOutFile = QCString(d.absPath())+"/"+outFile;
DotRunner dotRun(inFile);
if (format==GOF_BITMAP)
@@ -320,24 +319,24 @@ void writeDotGraphFromFile(const char *inFile,const char *outDir,
* \param context the scope in which this graph is found (for resolving links)
* \param graphId a unique id for this graph, use for dynamic sections
*/
-void writeDotImageMapFromFile(FTextStream &t,
+void writeDotImageMapFromFile(TextStream &t,
const QCString &inFile, const QCString &outDir,
const QCString &relPath, const QCString &baseName,
const QCString &context,int graphId)
{
- QDir d(outDir);
+ Dir d(outDir.str());
if (!d.exists())
{
- term("Output dir %s does not exist!\n",outDir.data());
+ term("Output dir %s does not exist!\n",qPrint(outDir));
}
QCString mapName = baseName+".map";
QCString imgExt = getDotImageExtension();
QCString imgName = baseName+"."+imgExt;
- QCString absOutFile = d.absPath().utf8()+"/"+mapName;
+ QCString absOutFile = QCString(d.absPath())+"/"+mapName;
- DotRunner dotRun(inFile.data());
+ DotRunner dotRun(inFile);
dotRun.addJob(MAP_CMD,absOutFile);
dotRun.preventCleanUp();
if (!dotRun.run())
@@ -347,7 +346,7 @@ void writeDotImageMapFromFile(FTextStream &t,
if (imgExt=="svg") // vector graphics
{
- QCString svgName=outDir+"/"+baseName+".svg";
+ QCString svgName = outDir+"/"+baseName+".svg";
DotFilePatcher::writeSVGFigureLink(t,relPath,baseName,svgName);
DotFilePatcher patcher(svgName);
patcher.addSVGConversion("",TRUE,context,TRUE,graphId);
@@ -355,18 +354,16 @@ void writeDotImageMapFromFile(FTextStream &t,
}
else // bitmap graphics
{
- QGString result;
- FTextStream tt(&result);
-
+ TextStream tt;
t << "<img src=\"" << relPath << imgName << "\" alt=\""
- << imgName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>" << endl;
+ << imgName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>\n";
DotFilePatcher::convertMapFile(tt, absOutFile, relPath ,TRUE, context);
- if (!result.isEmpty())
+ if (!tt.empty())
{
t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">";
- t << result;
- t << "</map>" << endl;
+ t << tt.str();
+ t << "</map>\n";
}
}
- d.remove(absOutFile);
+ d.remove(absOutFile.str());
}
diff --git a/src/dot.h b/src/dot.h
index c2f9605..219d1d5 100644
--- a/src/dot.h
+++ b/src/dot.h
@@ -16,16 +16,16 @@
#ifndef DOT_H
#define DOT_H
-#include <qcstring.h>
#include <map>
+#include "qcstring.h"
#include "dotgraph.h" // only for GraphOutputFormat
#include "dotfilepatcher.h"
#include "dotrunner.h"
-class FTextStream;
class DotRunner;
class DotRunnerQueue;
+class TextStream;
/** Singleton that manages parallel dot invocations and patching files for embedding image maps */
class DotManager
@@ -33,8 +33,8 @@ class DotManager
public:
static DotManager *instance();
static void deleteInstance();
- DotRunner* createRunner(const std::string& absDotName, const std::string& md5Hash);
- DotFilePatcher *createFilePatcher(const std::string &fileName);
+ DotRunner* createRunner(const QCString& absDotName, const QCString& md5Hash);
+ DotFilePatcher *createFilePatcher(const QCString &fileName);
bool run() const;
private:
@@ -48,9 +48,9 @@ class DotManager
std::vector< std::unique_ptr<DotWorkerThread> > m_workers;
};
-void writeDotGraphFromFile(const char *inFile,const char *outDir,
- const char *outFile,GraphOutputFormat format);
-void writeDotImageMapFromFile(FTextStream &t,
+void writeDotGraphFromFile(const QCString &inFile,const QCString &outDir,
+ const QCString &outFile,GraphOutputFormat format);
+void writeDotImageMapFromFile(TextStream &t,
const QCString& inFile, const QCString& outDir,
const QCString& relPath,const QCString& baseName,
const QCString& context,int graphId=-1);
diff --git a/src/dotcallgraph.cpp b/src/dotcallgraph.cpp
index 78e9b9b..1f77e33 100644
--- a/src/dotcallgraph.cpp
+++ b/src/dotcallgraph.cpp
@@ -40,7 +40,7 @@ void DotCallGraph::buildGraph(DotNode *n,const MemberDef *md,int distance)
if (it!=m_usedNodes.end()) // file is already a node in the graph
{
DotNode *bn = it->second;
- n->addChild(bn,0,0,0);
+ n->addChild(bn,0,0);
bn->addParent(n);
bn->setDistance(distance);
}
@@ -64,7 +64,7 @@ void DotCallGraph::buildGraph(DotNode *n,const MemberDef *md,int distance)
uniqueId,
0 //distance
);
- n->addChild(bn,0,0,0);
+ n->addChild(bn,0,0);
bn->addParent(n);
bn->setDistance(distance);
m_usedNodes.insert(std::make_pair(uniqueId.str(),bn));
@@ -134,7 +134,7 @@ DotCallGraph::DotCallGraph(const MemberDef *md,bool inverse)
m_startNode = new DotNode(getNextNodeNumber(),
linkToText(md->getLanguage(),name,FALSE),
tooltip,
- uniqueId.data(),
+ uniqueId,
TRUE // root node
);
m_startNode->setDistance(0);
@@ -179,12 +179,12 @@ QCString DotCallGraph::getMapLabel() const
}
QCString DotCallGraph::writeGraph(
- FTextStream &out,
+ TextStream &out,
GraphOutputFormat graphFormat,
EmbeddedOutputFormat textFormat,
- const char *path,
- const char *fileName,
- const char *relPath,bool generateImageMap,
+ const QCString &path,
+ const QCString &fileName,
+ const QCString &relPath,bool generateImageMap,
int graphId)
{
return DotGraph::writeGraph(out, graphFormat, textFormat, path, fileName, relPath, generateImageMap, graphId);
diff --git a/src/dotcallgraph.h b/src/dotcallgraph.h
index 1bc8882..e8361a2 100644
--- a/src/dotcallgraph.h
+++ b/src/dotcallgraph.h
@@ -18,7 +18,6 @@
#include "dotnode.h"
#include "dotgraph.h"
-#include "ftextstream.h"
#include "memberdef.h"
/** Representation of an call graph */
@@ -30,9 +29,9 @@ class DotCallGraph : public DotGraph
bool isTrivial() const;
bool isTooBig() const;
int numNodes() const;
- QCString writeGraph(FTextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef,
- const char *path,const char *fileName,
- const char *relPath,bool writeImageMap=TRUE,
+ QCString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef,
+ const QCString &path,const QCString &fileName,
+ const QCString &relPath,bool writeImageMap=TRUE,
int graphId=-1);
protected:
diff --git a/src/dotclassgraph.cpp b/src/dotclassgraph.cpp
index 9146a25..1bbe4de 100644
--- a/src/dotclassgraph.cpp
+++ b/src/dotclassgraph.cpp
@@ -13,19 +13,22 @@
*
*/
+#include <algorithm>
+
#include "containers.h"
#include "dotclassgraph.h"
#include "dotnode.h"
+#include "textstream.h"
#include "config.h"
#include "util.h"
void DotClassGraph::addClass(const ClassDef *cd,DotNode *n,int prot,
- const char *label,const char *usedName,const char *templSpec,bool base,int distance)
+ const QCString &label,const QCString &usedName,const QCString &templSpec,bool base,int distance)
{
if (Config_getBool(HIDE_UNDOC_CLASSES) && !cd->isLinkable()) return;
- int edgeStyle = (label || prot==EdgeInfo::Orange || prot==EdgeInfo::Orange2) ? EdgeInfo::Dashed : EdgeInfo::Solid;
+ int edgeStyle = (!label.isEmpty() || prot==EdgeInfo::Orange || prot==EdgeInfo::Orange2) ? EdgeInfo::Dashed : EdgeInfo::Solid;
QCString className;
QCString fullName;
if (cd->isAnonymous())
@@ -34,12 +37,12 @@ void DotClassGraph::addClass(const ClassDef *cd,DotNode *n,int prot,
className+=label;
fullName = className;
}
- else if (usedName) // name is a typedef
+ else if (!usedName.isEmpty()) // name is a typedef
{
className=usedName;
fullName = className;
}
- else if (templSpec) // name has a template part
+ else if (!templSpec.isEmpty()) // name has a template part
{
className=insertTemplateSpecifierInScope(cd->displayName(),templSpec);
fullName =insertTemplateSpecifierInScope(cd->name(),templSpec);
@@ -50,7 +53,7 @@ void DotClassGraph::addClass(const ClassDef *cd,DotNode *n,int prot,
fullName = cd->name();
}
//printf("DotClassGraph::addClass(class='%s',parent=%s,prot=%d,label=%s,dist=%d,usedName=%s,templSpec=%s,base=%d)\n",
- // className.data(),n->label().data(),prot,label,distance,usedName,templSpec,base);
+ // qPrint(className),qPrint(n->label()),prot,label,distance,usedName,templSpec,base);
auto it = m_usedNodes.find(fullName.str());
if (it!=m_usedNodes.end()) // class already inserted
{
@@ -66,7 +69,7 @@ void DotClassGraph::addClass(const ClassDef *cd,DotNode *n,int prot,
n->addParent(bn);
}
bn->setDistance(distance);
- //printf(" add exiting node %s of %s\n",bn->label().data(),n->label().data());
+ //printf(" add exiting node %s of %s\n",qPrint(bn->label()),qPrint(n->label()));
}
else // new class
{
@@ -85,7 +88,7 @@ void DotClassGraph::addClass(const ClassDef *cd,DotNode *n,int prot,
DotNode *bn = new DotNode(getNextNodeNumber(),
displayName,
tooltip,
- tmp_url.data(),
+ tmp_url,
FALSE, // rootNode
cd
);
@@ -102,7 +105,7 @@ void DotClassGraph::addClass(const ClassDef *cd,DotNode *n,int prot,
bn->setDistance(distance);
m_usedNodes.insert(std::make_pair(fullName.str(),bn));
//printf(" add new child node '%s' to %s hidden=%d url=%s\n",
- // className.data(),n->label().data(),cd->isHidden(),tmp_url.data());
+ // qPrint(className),qPrint(n->label()),cd->isHidden(),qPrint(tmp_url));
buildGraph(cd,bn,base,distance+1);
}
@@ -164,7 +167,7 @@ bool DotClassGraph::determineVisibleNodes(DotNode *rootNode,
int oldSize=(int)childTreeWidth.size();
if (distance>oldSize)
{
- childTreeWidth.resize(QMAX(childTreeWidth.size(),(uint)distance));
+ childTreeWidth.resize(std::max(childTreeWidth.size(),(size_t)distance));
int i; for (i=oldSize;i<distance;i++) childTreeWidth[i]=0;
}
childTreeWidth[distance-1]+=n->label().length();
@@ -191,7 +194,7 @@ bool DotClassGraph::determineVisibleNodes(DotNode *rootNode,
int oldSize = (int)parentTreeWidth.size();
if (distance>oldSize)
{
- parentTreeWidth.resize(QMAX(parentTreeWidth.size(),(uint)distance));
+ parentTreeWidth.resize(std::max(parentTreeWidth.size(),(size_t)distance));
int i; for (i=oldSize;i<distance;i++) parentTreeWidth[i]=0;
}
parentTreeWidth[distance-1]+=n->label().length();
@@ -208,7 +211,7 @@ bool DotClassGraph::determineVisibleNodes(DotNode *rootNode,
}
if (Config_getBool(UML_LOOK)) return FALSE; // UML graph are always top to bottom
int maxWidth=0;
- int maxHeight=(int)QMAX(childTreeWidth.size(),parentTreeWidth.size());
+ int maxHeight=(int)std::max(childTreeWidth.size(),parentTreeWidth.size());
uint i;
for (i=0;i<childTreeWidth.size();i++)
{
@@ -247,7 +250,7 @@ static QCString joinLabels(const StringSet &ss)
void DotClassGraph::buildGraph(const ClassDef *cd,DotNode *n,bool base,int distance)
{
//printf("DocClassGraph::buildGraph(%s,distance=%d,base=%d)\n",
- // cd->name().data(),distance,base);
+ // qPrint(cd->name()),distance,base);
// ---- Add inheritance relations
if (m_graphType == Inheritance || m_graphType==Collaboration)
@@ -255,8 +258,8 @@ void DotClassGraph::buildGraph(const ClassDef *cd,DotNode *n,bool base,int dista
for (const auto &bcd : base ? cd->baseClasses() : cd->subClasses())
{
//printf("-------- inheritance relation %s->%s templ='%s'\n",
- // cd->name().data(),bcd->classDef->name().data(),bcd->templSpecifiers.data());
- addClass(bcd.classDef,n,bcd.prot,0,bcd.usedName,bcd.templSpecifiers,base,distance);
+ // qPrint(cd->name()),qPrint(bcd->classDef->name()),qPrint(bcd->templSpecifiers));
+ addClass(bcd.classDef,n,bcd.prot,QCString(),bcd.usedName,bcd.templSpecifiers,base,distance);
}
}
if (m_graphType == Collaboration)
@@ -267,8 +270,8 @@ void DotClassGraph::buildGraph(const ClassDef *cd,DotNode *n,bool base,int dista
cd->usedByImplementationClasses() ;
for (const auto &ucd : list)
{
- //printf("addClass: %s templSpec=%s\n",ucd.classDef->name().data(),ucd.templSpecifiers.data());
- addClass(ucd.classDef,n,EdgeInfo::Purple,joinLabels(ucd.accessors),0,
+ //printf("addClass: %s templSpec=%s\n",qPrint(ucd.classDef->name()),qPrint(ucd.templSpecifiers));
+ addClass(ucd.classDef,n,EdgeInfo::Purple,joinLabels(ucd.accessors),QCString(),
ucd.templSpecifiers,base,distance);
}
}
@@ -276,9 +279,9 @@ void DotClassGraph::buildGraph(const ClassDef *cd,DotNode *n,bool base,int dista
{
for (const auto &ccd : cd->templateTypeConstraints())
{
- //printf("addClass: %s\n",ccd.classDef->name().data());
- addClass(ccd.classDef,n,EdgeInfo::Orange2,joinLabels(ccd.accessors),0,
- 0,TRUE,distance);
+ //printf("addClass: %s\n",qPrint(ccd.classDef->name()));
+ addClass(ccd.classDef,n,EdgeInfo::Orange2,joinLabels(ccd.accessors),QCString(),
+ QCString(),TRUE,distance);
}
}
@@ -294,7 +297,7 @@ void DotClassGraph::buildGraph(const ClassDef *cd,DotNode *n,bool base,int dista
for (const auto &ti : templMaster->getTemplateInstances())
if (ti.classDef==cd)
{
- addClass(templMaster,n,EdgeInfo::Orange,ti.templSpec,0,0,TRUE,distance);
+ addClass(templMaster,n,EdgeInfo::Orange,ti.templSpec,QCString(),QCString(),TRUE,distance);
}
}
}
@@ -302,7 +305,7 @@ void DotClassGraph::buildGraph(const ClassDef *cd,DotNode *n,bool base,int dista
{
for (const auto &ti : cd->getTemplateInstances())
{
- addClass(ti.classDef,n,EdgeInfo::Orange,ti.templSpec,0,0,FALSE,distance);
+ addClass(ti.classDef,n,EdgeInfo::Orange,ti.templSpec,QCString(),QCString(),FALSE,distance);
}
}
}
@@ -310,7 +313,7 @@ void DotClassGraph::buildGraph(const ClassDef *cd,DotNode *n,bool base,int dista
DotClassGraph::DotClassGraph(const ClassDef *cd,GraphType t)
{
- //printf("--------------- DotClassGraph::DotClassGraph '%s'\n",cd->displayName().data());
+ //printf("--------------- DotClassGraph::DotClassGraph '%s'\n",qPrint(cd->displayName()));
m_graphType = t;
QCString tmp_url="";
if (cd->isLinkable() && !cd->isHidden())
@@ -326,7 +329,7 @@ DotClassGraph::DotClassGraph(const ClassDef *cd,GraphType t)
m_startNode = new DotNode(getNextNodeNumber(),
className,
tooltip,
- tmp_url.data(),
+ tmp_url,
TRUE, // is a root node
cd
);
@@ -441,12 +444,12 @@ QCString DotClassGraph::getImgAltText() const
return "";
}
-QCString DotClassGraph::writeGraph(FTextStream &out,
+QCString DotClassGraph::writeGraph(TextStream &out,
GraphOutputFormat graphFormat,
EmbeddedOutputFormat textFormat,
- const char *path,
- const char *fileName,
- const char *relPath,
+ const QCString &path,
+ const QCString &fileName,
+ const QCString &relPath,
bool /*isTBRank*/,
bool generateImageMap,
int graphId)
@@ -456,7 +459,7 @@ QCString DotClassGraph::writeGraph(FTextStream &out,
//--------------------------------------------------------------------
-void DotClassGraph::writeXML(FTextStream &t)
+void DotClassGraph::writeXML(TextStream &t)
{
for (const auto &kv : m_usedNodes)
{
@@ -464,7 +467,7 @@ void DotClassGraph::writeXML(FTextStream &t)
}
}
-void DotClassGraph::writeDocbook(FTextStream &t)
+void DotClassGraph::writeDocbook(TextStream &t)
{
for (const auto &kv : m_usedNodes)
{
@@ -472,7 +475,7 @@ void DotClassGraph::writeDocbook(FTextStream &t)
}
}
-void DotClassGraph::writeDEF(FTextStream &t)
+void DotClassGraph::writeDEF(TextStream &t)
{
for (const auto &kv : m_usedNodes)
{
diff --git a/src/dotclassgraph.h b/src/dotclassgraph.h
index 168d315..6ccba08 100644
--- a/src/dotclassgraph.h
+++ b/src/dotclassgraph.h
@@ -20,6 +20,8 @@
#include "dotnode.h"
#include "dotgraph.h"
+class TextStream;
+
/** Representation of a class inheritance or dependency graph */
class DotClassGraph : public DotGraph
{
@@ -29,13 +31,13 @@ public:
bool isTrivial() const;
bool isTooBig() const;
int numNodes() const;
- QCString writeGraph(FTextStream &t,GraphOutputFormat gf,EmbeddedOutputFormat ef,
- const char *path, const char *fileName, const char *relPath,
+ QCString writeGraph(TextStream &t,GraphOutputFormat gf,EmbeddedOutputFormat ef,
+ const QCString &path, const QCString &fileName, const QCString &relPath,
bool TBRank=TRUE,bool imageMap=TRUE,int graphId=-1);
- void writeXML(FTextStream &t);
- void writeDocbook(FTextStream &t);
- void writeDEF(FTextStream &t);
+ void writeXML(TextStream &t);
+ void writeDocbook(TextStream &t);
+ void writeDEF(TextStream &t);
protected:
virtual QCString getBaseName() const;
@@ -47,8 +49,8 @@ private:
void buildGraph(const ClassDef *cd,DotNode *n,bool base,int distance);
bool determineVisibleNodes(DotNode *rootNode,int maxNodes,bool includeParents);
void determineTruncatedNodes(DotNodeDeque &queue,bool includeParents);
- void addClass(const ClassDef *cd,DotNode *n,int prot,const char *label,
- const char *usedName,const char *templSpec,
+ void addClass(const ClassDef *cd,DotNode *n,int prot,const QCString &label,
+ const QCString &usedName,const QCString &templSpec,
bool base,int distance);
DotNode * m_startNode;
diff --git a/src/dotdirdeps.cpp b/src/dotdirdeps.cpp
index a4e556e..12236a0 100644
--- a/src/dotdirdeps.cpp
+++ b/src/dotdirdeps.cpp
@@ -13,9 +13,9 @@
*
*/
-#include "dotdirdeps.h"
+#include <sstream>
-#include "ftextstream.h"
+#include "dotdirdeps.h"
#include "util.h"
#include "doxygen.h"
#include "config.h"
@@ -29,7 +29,7 @@ using DirDefMap = std::map<std::string,const DirDef *>;
* @param[in] fillBackground if the node shall be explicitly filled
* @param[in,out] directoriesInGraph lists the directories which have been written to the output stream
*/
-static void drawDirectory(FTextStream &outStream, const DirDef *const directory, const bool fillBackground,
+static void drawDirectory(TextStream &outStream, const DirDef *const directory, const bool fillBackground,
DirDefMap &directoriesInGraph)
{
outStream << " " << directory->getOutputFileBase() << " [shape=box "
@@ -46,7 +46,7 @@ static void drawDirectory(FTextStream &outStream, const DirDef *const directory,
directoriesInGraph.insert(std::make_pair(directory->getOutputFileBase().str(), directory));
}
-void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
+void writeDotDirDepGraph(TextStream &t,const DirDef *dd,bool linkRelations)
{
int fontSize = Config_getInt(DOT_FONTSIZE);
QCString fontName = Config_getString(DOT_FONTNAME);
@@ -124,7 +124,7 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
// add nodes for other used directories
{
- //printf("*** For dir %s\n",shortName().data());
+ //printf("*** For dir %s\n",qPrint(shortName()));
for (const auto &usedDir : usedDirsNotDrawn)
// for each used dir (=directly used or a parent of a directly used dir)
{
@@ -132,10 +132,10 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
while (dir)
{
//printf("*** check relation %s->%s same_parent=%d !%s->isParentOf(%s)=%d\n",
- // dir->shortName().data(),usedDir->shortName().data(),
+ // qPrint(dir->shortName()),qPrint(usedDir->shortName()),
// dir->parent()==usedDir->parent(),
- // usedDir->shortName().data(),
- // shortName().data(),
+ // qPrint(usedDir->shortName()),
+ // qPrint(shortName()),
// !usedDir->isParentOf(this)
// );
if (dir!=usedDir && dir->parent()==usedDir->parent())
@@ -199,9 +199,9 @@ QCString DotDirDeps::getBaseName() const
void DotDirDeps::computeTheGraph()
{
// compute md5 checksum of the graph were are about to generate
- FTextStream md5stream(&m_theGraph);
- //m_dir->writeDepGraph(md5stream);
+ TextStream md5stream;
writeDotDirDepGraph(md5stream,m_dir,m_linkRelations);
+ m_theGraph = md5stream.str();
}
QCString DotDirDeps::getMapLabel() const
@@ -214,12 +214,12 @@ QCString DotDirDeps::getImgAltText() const
return convertToXML(m_dir->displayName());
}
-QCString DotDirDeps::writeGraph(FTextStream &out,
+QCString DotDirDeps::writeGraph(TextStream &out,
GraphOutputFormat graphFormat,
EmbeddedOutputFormat textFormat,
- const char *path,
- const char *fileName,
- const char *relPath,
+ const QCString &path,
+ const QCString &fileName,
+ const QCString &relPath,
bool generateImageMap,
int graphId,
bool linkRelations)
diff --git a/src/dotdirdeps.h b/src/dotdirdeps.h
index a71e8f1..4f915f9 100644
--- a/src/dotdirdeps.h
+++ b/src/dotdirdeps.h
@@ -26,12 +26,12 @@ class DotDirDeps : public DotGraph
DotDirDeps(const DirDef *dir);
~DotDirDeps();
bool isTrivial() const;
- QCString writeGraph(FTextStream &out,
+ QCString writeGraph(TextStream &out,
GraphOutputFormat gf,
EmbeddedOutputFormat ef,
- const char *path,
- const char *fileName,
- const char *relPath,
+ const QCString &path,
+ const QCString &fileName,
+ const QCString &relPath,
bool writeImageMap=TRUE,
int graphId=-1,
bool linkRelations=TRUE);
diff --git a/src/dotfilepatcher.cpp b/src/dotfilepatcher.cpp
index aafca34..326c1e1 100644
--- a/src/dotfilepatcher.cpp
+++ b/src/dotfilepatcher.cpp
@@ -13,18 +13,17 @@
*
*/
+#include <sstream>
+
#include "dotfilepatcher.h"
#include "dotrunner.h"
-
-#include "qstring.h"
#include "config.h"
-#include "qdir.h"
#include "message.h"
-#include "ftextstream.h"
#include "docparser.h"
#include "doxygen.h"
#include "util.h"
#include "dot.h"
+#include "dir.h"
static const char svgZoomHeader[] =
"<svg id=\"main\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xml:space=\"preserve\" onload=\"init(evt)\">\n"
@@ -124,7 +123,7 @@ static const char svgZoomFooter[] =
"</svg>\n"
;
-static QCString replaceRef(const QCString &buf,const QCString relPath,
+static QCString replaceRef(const QCString &buf,const QCString &relPath,
bool urlOnly,const QCString &context,const QCString &target=QCString())
{
// search for href="...", store ... part in link
@@ -153,7 +152,7 @@ static QCString replaceRef(const QCString &buf,const QCString relPath,
DocRef *df = new DocRef( (DocNode*) 0, link.mid(5), context );
result+=externalRef(relPath,df->ref(),TRUE);
if (!df->file().isEmpty())
- result += df->file().data() + Doxygen::htmlFileExtension;
+ result += df->file() + Doxygen::htmlFileExtension;
if (!df->anchor().isEmpty())
result += "#" + df->anchor();
delete df;
@@ -192,7 +191,7 @@ static QCString replaceRef(const QCString &buf,const QCString relPath,
QCString leftPart = buf.left(indexS);
QCString rightPart = buf.mid(indexE+1);
//printf("replaceRef(\n'%s'\n)->\n'%s+%s+%s'\n",
- // buf.data(),leftPart.data(),result.data(),rightPart.data());
+ // qPrint(buf),qPrint(leftPart),qPrint(result),qPrint(rightPart));
return leftPart + result + rightPart;
}
else
@@ -212,47 +211,41 @@ static QCString replaceRef(const QCString &buf,const QCString relPath,
* map file was found
* \returns TRUE if successful.
*/
-bool DotFilePatcher::convertMapFile(FTextStream &t,const char *mapName,
- const QCString relPath, bool urlOnly,
+bool DotFilePatcher::convertMapFile(TextStream &t,const QCString &mapName,
+ const QCString &relPath, bool urlOnly,
const QCString &context)
{
- QFile f(mapName);
- if (!f.open(IO_ReadOnly))
+ std::ifstream f(mapName.str(),std::ifstream::in);
+ if (!f.is_open())
{
err("problems opening map file %s for inclusion in the docs!\n"
"If you installed Graphviz/dot after a previous failing run, \n"
- "try deleting the output directory and rerun doxygen.\n",mapName);
+ "try deleting the output directory and rerun doxygen.\n",qPrint(mapName));
return FALSE;
}
- const int maxLineLen=10240;
- while (!f.atEnd()) // foreach line
+ std::string line;
+ while (getline(f,line)) // foreach line
{
- QCString buf(maxLineLen);
- int numBytes = f.readLine(buf.rawData(),maxLineLen);
- if (numBytes>0)
+ QCString buf = line+'\n';
+ if (buf.left(5)=="<area")
{
- buf.resize(numBytes+1);
-
- if (buf.left(5)=="<area")
+ QCString replBuf = replaceRef(buf,relPath,urlOnly,context);
+ // strip id="..." from replBuf since the id's are not needed and not unique.
+ int indexS = replBuf.find("id=\""), indexE;
+ if (indexS>0 && (indexE=replBuf.find('"',indexS+4))!=-1)
{
- QCString replBuf = replaceRef(buf,relPath,urlOnly,context);
- // strip id="..." from replBuf since the id's are not needed and not unique.
- int indexS = replBuf.find("id=\""), indexE;
- if (indexS>0 && (indexE=replBuf.find('"',indexS+4))!=-1)
- {
- t << replBuf.left(indexS-1) << replBuf.right(replBuf.length() - indexE - 1);
- }
- else
- {
- t << replBuf;
- }
+ t << replBuf.left(indexS-1) << replBuf.right(replBuf.length() - indexE - 1);
+ }
+ else
+ {
+ t << replBuf;
}
}
}
return TRUE;
}
-DotFilePatcher::DotFilePatcher(const char *patchFile)
+DotFilePatcher::DotFilePatcher(const QCString &patchFile)
: m_patchFile(patchFile)
{
}
@@ -298,7 +291,7 @@ int DotFilePatcher::addSVGObject(const QCString &baseName,
bool DotFilePatcher::run() const
{
- //printf("DotFilePatcher::run(): %s\n",m_patchFile.data());
+ //printf("DotFilePatcher::run(): %s\n",qPrint(m_patchFile));
bool interactiveSVG_local = Config_getBool(INTERACTIVE_SVG);
bool isSVGFile = m_patchFile.right(4)==".svg";
int graphId = -1;
@@ -310,49 +303,42 @@ bool DotFilePatcher::run() const
graphId = map.graphId;
relPath = map.relPath;
//printf("DotFilePatcher::addSVGConversion: file=%s zoomable=%d\n",
- // m_patchFile.data(),map->zoomable);
+ // qPrint(m_patchFile),map->zoomable);
}
- QCString tmpName = m_patchFile+".tmp";
- QCString patchFile = m_patchFile;
- if (!QDir::current().rename(patchFile,tmpName))
+ std::string tmpName = m_patchFile.str()+".tmp";
+ std::string patchFile = m_patchFile.str();
+ Dir thisDir;
+ if (!thisDir.rename(patchFile,tmpName))
{
- err("Failed to rename file %s to %s!\n",m_patchFile.data(),tmpName.data());
+ err("Failed to rename file %s to %s!\n",qPrint(m_patchFile),tmpName.c_str());
return FALSE;
}
- QFile fi(tmpName);
- QFile fo(patchFile);
- if (!fi.open(IO_ReadOnly))
+ std::ifstream fi(tmpName, std::ifstream::in);
+ std::ofstream fo(patchFile, std::ofstream::out | std::ofstream::binary);
+ if (!fi.is_open())
{
- err("problem opening file %s for patching!\n",tmpName.data());
- QDir::current().rename(tmpName,patchFile);
+ err("problem opening file %s for patching!\n",tmpName.c_str());
+ thisDir.rename(tmpName,patchFile);
return FALSE;
}
- if (!fo.open(IO_WriteOnly))
+ if (!fo.is_open())
{
- err("problem opening file %s for patching!\n",m_patchFile.data());
- QDir::current().rename(tmpName,patchFile);
+ err("problem opening file %s for patching!\n",qPrint(m_patchFile));
+ thisDir.rename(tmpName,patchFile);
return FALSE;
}
- FTextStream t(&fo);
- const int maxLineLen=100*1024;
- int lineNr=1;
+ TextStream t(&fo);
int width,height;
bool insideHeader=FALSE;
bool replacedHeader=FALSE;
bool foundSize=FALSE;
- while (!fi.atEnd()) // foreach line
+ int lineNr=1;
+ std::string lineStr;
+ while (getline(fi,lineStr))
{
- QCString line(maxLineLen);
- int numBytes = fi.readLine(line.rawData(),maxLineLen);
- if (numBytes<=0)
- {
- break;
- }
- line.resize(numBytes+1);
-
- //printf("line=[%s]\n",line.stripWhiteSpace().data());
+ QCString line = lineStr+'\n';
+ //printf("line=[%s]\n",qPrint(line.stripWhiteSpace()));
int i;
- ASSERT(numBytes<maxLineLen);
if (isSVGFile)
{
if (interactiveSVG_local)
@@ -403,19 +389,19 @@ bool DotFilePatcher::run() const
int n = sscanf(line.data()+i+1,"!-- SVG %d",&mapId);
if (n==1 && mapId>=0 && mapId<(int)m_maps.size())
{
- int e = QMAX(line.find("--]"),line.find("-->"));
+ int e = std::max(line.find("--]"),line.find("-->"));
const Map &map = m_maps.at(mapId);
//printf("DotFilePatcher::writeSVGFigure: file=%s zoomable=%d\n",
- // m_patchFile.data(),map.zoomable);
+ // qPrint(m_patchFile),map.zoomable);
if (!writeSVGFigureLink(t,map.relPath,map.label,map.mapFile))
{
- err("Problem extracting size from SVG file %s\n",map.mapFile.data());
+ err("Problem extracting size from SVG file %s\n",qPrint(map.mapFile));
}
if (e!=-1) t << line.mid(e+3);
}
else // error invalid map id!
{
- err("Found invalid SVG id in file %s!\n",m_patchFile.data());
+ err("Found invalid SVG id in file %s!\n",qPrint(m_patchFile));
t << line.mid(i);
}
}
@@ -426,22 +412,21 @@ bool DotFilePatcher::run() const
int n = sscanf(line.data()+i,"<!-- MAP %d",&mapId);
if (n==1 && mapId>=0 && mapId<(int)m_maps.size())
{
- QGString result;
- FTextStream tt(&result);
+ TextStream tt;
const Map &map = m_maps.at(mapId);
//printf("patching MAP %d in file %s with contents of %s\n",
- // mapId,m_patchFile.data(),map.mapFile.data());
+ // mapId,qPrint(m_patchFile),qPrint(map.mapFile));
convertMapFile(tt,map.mapFile,map.relPath,map.urlOnly,map.context);
- if (!result.isEmpty())
+ if (!tt.empty())
{
- t << "<map name=\"" << correctId(map.label) << "\" id=\"" << correctId(map.label) << "\">" << endl;
- t << result;
- t << "</map>" << endl;
+ t << "<map name=\"" << correctId(map.label) << "\" id=\"" << correctId(map.label) << "\">\n";
+ t << tt.str();
+ t << "</map>\n";
}
}
else // error invalid map id!
{
- err("Found invalid MAP id in file %s!\n",m_patchFile.data());
+ err("Found invalid MAP id in file %s!\n",qPrint(m_patchFile));
t << line.mid(i);
}
}
@@ -449,12 +434,12 @@ bool DotFilePatcher::run() const
{
int mapId=-1;
int n = sscanf(line.data()+i+2,"FIG %d",&mapId);
- //printf("line='%s' n=%d\n",line.data()+i,n);
+ //printf("line='%s' n=%d\n",qPrint(line)+i,n);
if (n==1 && mapId>=0 && mapId<(int)m_maps.size())
{
const Map &map = m_maps.at(mapId);
//printf("patching FIG %d in file %s with contents of %s\n",
- // mapId,m_patchFile.data(),map.mapFile.data());
+ // mapId,qPrint(m_patchFile),qPrint(map.mapFile));
if (!writeVecGfxFigure(t,map.label,map.mapFile))
{
err("problem writing FIG %d figure!\n",mapId);
@@ -463,7 +448,7 @@ bool DotFilePatcher::run() const
}
else // error invalid map id!
{
- err("Found invalid bounding FIG %d in file %s!\n",mapId,m_patchFile.data());
+ err("Found invalid bounding FIG %d in file %s!\n",mapId,qPrint(m_patchFile));
t << line;
}
}
@@ -478,39 +463,35 @@ bool DotFilePatcher::run() const
{
QCString orgName=m_patchFile.left(m_patchFile.length()-4)+"_org.svg";
t << substitute(svgZoomFooter,"$orgname",stripPath(orgName));
+ t.flush();
fo.close();
// keep original SVG file so we can refer to it, we do need to replace
// dummy link by real ones
- fi.setName(tmpName);
- fo.setName(orgName);
- if (!fi.open(IO_ReadOnly))
+ fi.open(tmpName,std::ifstream::in);
+ fo.open(orgName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!fi.is_open())
{
- err("problem opening file %s for reading!\n",tmpName.data());
+ err("problem opening file %s for reading!\n",tmpName.c_str());
return FALSE;
}
- if (!fo.open(IO_WriteOnly))
+ if (!fo.is_open())
{
- err("problem opening file %s for writing!\n",orgName.data());
+ err("problem opening file %s for writing!\n",qPrint(orgName));
return FALSE;
}
- FTextStream to(&fo);
- while (!fi.atEnd()) // foreach line
+ t.setStream(&fo);
+ while (getline(fi,lineStr)) // foreach line
{
- QCString line(maxLineLen);
- int numBytes = fi.readLine(line.rawData(),maxLineLen);
- if (numBytes<=0)
- {
- break;
- }
- line.resize(numBytes+1);
+ std::string line = lineStr+'\n';
const Map &map = m_maps.front(); // there is only one 'map' for a SVG file
- to << replaceRef(line,map.relPath,map.urlOnly,map.context,"_top");
+ t << replaceRef(line.c_str(),map.relPath,map.urlOnly,map.context,"_top");
}
+ t.flush();
fi.close();
fo.close();
}
// remove temporary file
- QDir::current().remove(tmpName);
+ thisDir.remove(tmpName);
return TRUE;
}
@@ -521,50 +502,37 @@ bool DotFilePatcher::run() const
static bool readSVGSize(const QCString &fileName,int *width,int *height)
{
bool found=FALSE;
- QFile f(fileName);
- if (!f.open(IO_ReadOnly))
+ std::ifstream f(fileName.str(),std::ifstream::in);
+ if (!f.is_open())
{
- return FALSE;
+ return false;
}
- const int maxLineLen=4096;
- char buf[maxLineLen];
- while (!f.atEnd() && !found)
+ std::string line;
+ while (getline(f,line) && !found)
{
- int numBytes = f.readLine(buf,maxLineLen-1); // read line
- if (numBytes>0)
+ if (qstrncmp(line.c_str(),"<!--zoomable ",13)==0)
{
- buf[numBytes]='\0';
- if (qstrncmp(buf,"<!--zoomable ",13)==0)
- {
- *width=-1;
- *height=-1;
- sscanf(buf,"<!--zoomable %d",height);
- //printf("Found zoomable for %s!\n",fileName.data());
- found=TRUE;
- }
- else if (sscanf(buf,"<svg width=\"%dpt\" height=\"%dpt\"",width,height)==2)
- {
- //printf("Found fixed size %dx%d for %s!\n",*width,*height,fileName.data());
- found=TRUE;
- }
+ *width=-1;
+ *height=-1;
+ sscanf(line.c_str(),"<!--zoomable %d",height);
+ found=true;
}
- else // read error!
+ else if (sscanf(line.c_str(),"<svg width=\"%dpt\" height=\"%dpt\"",width,height)==2)
{
- //printf("Read error %d!\n",numBytes);
- return FALSE;
+ found=true;
}
}
- return TRUE;
+ return true;
}
-static void writeSVGNotSupported(FTextStream &out)
+static void writeSVGNotSupported(TextStream &out)
{
out << "<p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p>";
}
/// Check if a reference to a SVG figure can be written and do so if possible.
/// Returns FALSE if not possible (for instance because the SVG file is not yet generated).
-bool DotFilePatcher::writeSVGFigureLink(FTextStream &out,const QCString &relPath,
+bool DotFilePatcher::writeSVGFigureLink(TextStream &out,const QCString &relPath,
const QCString &baseName,const QCString &absImgName)
{
int width=600,height=600;
@@ -603,7 +571,7 @@ bool DotFilePatcher::writeSVGFigureLink(FTextStream &out,const QCString &relPath
return TRUE;
}
-bool DotFilePatcher::writeVecGfxFigure(FTextStream &out,const QCString &baseName,
+bool DotFilePatcher::writeVecGfxFigure(TextStream &out,const QCString &baseName,
const QCString &figureName)
{
int width=400,height=550;
diff --git a/src/dotfilepatcher.h b/src/dotfilepatcher.h
index 1886e47..af2c855 100644
--- a/src/dotfilepatcher.h
+++ b/src/dotfilepatcher.h
@@ -20,14 +20,13 @@
#include "qcstring.h"
-class FTextStream;
+class TextStream;
/** Helper class to insert a set of map file into an output file */
class DotFilePatcher
{
public:
- DotFilePatcher(const char *patchFile);
-
+ DotFilePatcher(const QCString &patchFile);
int addMap(const QCString &mapFile,const QCString &relPath,
bool urlOnly,const QCString &context,const QCString &label);
@@ -42,14 +41,14 @@ class DotFilePatcher
bool run() const;
bool isSVGFile() const;
- static bool convertMapFile(FTextStream &t,const char *mapName,
- const QCString relPath, bool urlOnly=FALSE,
+ static bool convertMapFile(TextStream &t,const QCString &mapName,
+ const QCString &relPath, bool urlOnly=FALSE,
const QCString &context=QCString());
- static bool writeSVGFigureLink(FTextStream &out,const QCString &relPath,
+ static bool writeSVGFigureLink(TextStream &out,const QCString &relPath,
const QCString &baseName,const QCString &absImgName);
- static bool writeVecGfxFigure(FTextStream& out, const QCString& baseName,
+ static bool writeVecGfxFigure(TextStream& out, const QCString& baseName,
const QCString& figureName);
private:
diff --git a/src/dotgfxhierarchytable.cpp b/src/dotgfxhierarchytable.cpp
index 9f81e22..f7b95d9 100644
--- a/src/dotgfxhierarchytable.cpp
+++ b/src/dotgfxhierarchytable.cpp
@@ -13,13 +13,15 @@
*
*/
-#include "dotgfxhierarchytable.h"
+#include <sstream>
+#include "dotgfxhierarchytable.h"
#include "language.h"
#include "util.h"
#include "message.h"
#include "doxygen.h"
#include "classlist.h"
+#include "dir.h"
QCString DotGfxHierarchyTable::getBaseName() const
{
@@ -27,15 +29,15 @@ QCString DotGfxHierarchyTable::getBaseName() const
if (m_prefix.isEmpty())
baseName.sprintf("inherit_graph_%d", m_graphId);
else
- baseName.sprintf("%sinherit_graph_%d",m_prefix.data(), m_graphId);
+ baseName.sprintf("%sinherit_graph_%d",qPrint(m_prefix), m_graphId);
return baseName;
}
void DotGfxHierarchyTable::computeTheGraph()
{
- FTextStream md5stream(&m_theGraph);
+ TextStream md5stream;
writeGraphHeader(md5stream,theTranslator->trGraphicalHierarchy());
- md5stream << " rankdir=\"LR\";" << endl;
+ md5stream << " rankdir=\"LR\";\n";
for (auto node : m_rootNodes)
{
if (node->subgraphId()==m_rootSubgraphNode->subgraphId())
@@ -51,7 +53,7 @@ void DotGfxHierarchyTable::computeTheGraph()
}
}
writeGraphFooter(md5stream);
-
+ m_theGraph = md5stream.str();
}
QCString DotGfxHierarchyTable::getMapLabel() const
@@ -59,8 +61,8 @@ QCString DotGfxHierarchyTable::getMapLabel() const
return escapeCharsInString(m_rootSubgraphNode->label(),FALSE);
}
-void DotGfxHierarchyTable::createGraph(DotNode *n,FTextStream &out,
- const char *path,const char *fileName,int id)
+void DotGfxHierarchyTable::createGraph(DotNode *n,TextStream &out,
+ const QCString &path,const QCString &fileName,int id)
{
m_rootSubgraphNode = n;
m_graphId = id;
@@ -69,23 +71,23 @@ void DotGfxHierarchyTable::createGraph(DotNode *n,FTextStream &out,
DotGraph::writeGraph(out, GOF_BITMAP, EOF_Html, path, fileName, "", TRUE, 0);
}
-void DotGfxHierarchyTable::writeGraph(FTextStream &out,
- const char *path,const char *fileName)
+void DotGfxHierarchyTable::writeGraph(TextStream &out,
+ const QCString &path,const QCString &fileName)
{
//printf("DotGfxHierarchyTable::writeGraph(%s)\n",name);
//printf("m_rootNodes=%p count=%d\n",m_rootNodes,m_rootNodes->count());
if (m_rootSubgraphs.empty()) return;
- QDir d(path);
+ Dir d(path.str());
// store the original directory
if (!d.exists())
{
- term("Output dir %s does not exist!\n",path);
+ term("Output dir %s does not exist!\n",qPrint(path));
}
// put each connected subgraph of the hierarchy in a row of the HTML output
- out << "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\">" << endl;
+ out << "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\">\n";
int count=0;
std::sort(m_rootSubgraphs.begin(),m_rootSubgraphs.end(),
@@ -94,23 +96,23 @@ void DotGfxHierarchyTable::writeGraph(FTextStream &out,
{
out << "<tr><td>";
createGraph(n,out,path,fileName,count++);
- out << "</td></tr>" << endl;
+ out << "</td></tr>\n";
}
- out << "</table>" << endl;
+ out << "</table>\n";
}
void DotGfxHierarchyTable::addHierarchy(DotNode *n,const ClassDef *cd,ClassDefSet &visitedClasses)
{
- //printf("addHierarchy '%s' baseClasses=%d\n",cd->name().data(),cd->baseClasses()->count());
+ //printf("addHierarchy '%s' baseClasses=%d\n",qPrint(cd->name()),cd->baseClasses()->count());
for (const auto &bcd : cd->subClasses())
{
ClassDef *bClass=bcd.classDef;
- //printf(" Trying sub class='%s' usedNodes=%d\n",bClass->name().data(),m_usedNodes->count());
+ //printf(" Trying sub class='%s' usedNodes=%d\n",qPrint(bClass->name()),m_usedNodes->count());
if (bClass && bClass->isVisibleInHierarchy() && hasVisibleRoot(bClass->baseClasses()))
{
auto it = m_usedNodes.find(bClass->name().str());
- //printf(" Node '%s' Found visible class='%s'\n",n->label().data(),
- // bClass->name().data());
+ //printf(" Node '%s' Found visible class='%s'\n",qPrint(n->label()),
+ // qPrint(bClass->name()));
DotNode *root = 0;
if (it!=m_usedNodes.end()) // node already present
{
@@ -123,8 +125,8 @@ void DotGfxHierarchyTable::addHierarchy(DotNode *n,const ClassDef *cd,ClassDefSe
n->addChild(bn.get(),bcd.prot);
bn->addParent(n);
//printf(" Adding node %s to existing base node %s (c=%d,p=%d)\n",
- // n->label().data(),
- // bn->label().data(),
+ // qPrint(n->label()),
+ // qPrint(bn->label()),
// bn->children() ? bn->children()->count() : 0,
// bn->parents() ? bn->parents()->count() : 0
// );
@@ -149,18 +151,18 @@ void DotGfxHierarchyTable::addHierarchy(DotNode *n,const ClassDef *cd,ClassDefSe
auto bn = std::make_unique<DotNode>(getNextNodeNumber(),
bClass->displayName(),
tooltip,
- tmp_url.data()
+ tmp_url
);
n->addChild(bn.get(),bcd.prot);
bn->addParent(n);
root = bn.get();
//printf(" Adding node %s to new base node %s (c=%d,p=%d)\n",
- // n->label().data(),
- // bn->label().data(),
+ // qPrint(n->label()),
+ // qPrint(bn->label()),
// bn->children() ? bn->children()->count() : 0,
// bn->parents() ? bn->parents()->count() : 0
// );
- //printf(" inserting %s (%p)\n",bClass->name().data(),bn);
+ //printf(" inserting %s (%p)\n",qPrint(bClass->name()),bn);
m_usedNodes.insert(std::make_pair(bClass->name().str(),std::move(bn))); // add node to the used list
}
if (visitedClasses.find(bClass)==visitedClasses.end() && !bClass->subClasses().empty())
@@ -177,7 +179,7 @@ void DotGfxHierarchyTable::addClassList(const ClassLinkedMap &cl,ClassDefSet &vi
{
for (const auto &cd : cl)
{
- //printf("Trying %s subClasses=%d\n",cd->name().data(),cd->subClasses()->count());
+ //printf("Trying %s subClasses=%d\n",qPrint(cd->name()),cd->subClasses()->count());
if (cd->getLanguage()==SrcLangExt_VHDL &&
(VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS
)
@@ -201,12 +203,12 @@ void DotGfxHierarchyTable::addClassList(const ClassLinkedMap &cl,ClassDefSet &vi
tmp_url+="#"+cd->anchor();
}
}
- //printf("Inserting root class %s\n",cd->name().data());
+ //printf("Inserting root class %s\n",qPrint(cd->name()));
QCString tooltip = cd->briefDescriptionAsTooltip();
auto n = std::make_unique<DotNode>(getNextNodeNumber(),
cd->displayName(),
tooltip,
- tmp_url.data());
+ tmp_url);
DotNode *root = n.get();
m_usedNodes.insert(std::make_pair(cd->name().str(),std::move(n)));
@@ -220,7 +222,7 @@ void DotGfxHierarchyTable::addClassList(const ClassLinkedMap &cl,ClassDefSet &vi
}
}
-DotGfxHierarchyTable::DotGfxHierarchyTable(const char *prefix,ClassDef::CompoundType ct)
+DotGfxHierarchyTable::DotGfxHierarchyTable(const QCString &prefix,ClassDef::CompoundType ct)
: m_prefix(prefix)
, m_classType(ct)
{
@@ -241,7 +243,7 @@ DotGfxHierarchyTable::DotGfxHierarchyTable(const char *prefix,ClassDef::Compound
{
if (n->subgraphId()==-1) // not yet colored
{
- //printf("Starting at node %s (%p): %d\n",n->label().data(),n,curColor);
+ //printf("Starting at node %s (%p): %d\n",qPrint(n->label()),n,curColor);
done=FALSE; // still uncolored nodes
n->setSubgraphId(curColor);
n->markAsVisible();
@@ -260,7 +262,7 @@ DotGfxHierarchyTable::DotGfxHierarchyTable(const char *prefix,ClassDef::Compound
for (auto n : m_rootSubgraphs)
{
//printf("Node %s color=%d (c=%d,p=%d)\n",
- // n->label().data(),n->m_subgraphId,
+ // qPrint(n->label()),n->m_subgraphId,
// n->children()?n->children()->count():0,
// n->parents()?n->parents()->count():0);
int number=0;
diff --git a/src/dotgfxhierarchytable.h b/src/dotgfxhierarchytable.h
index 089ecd2..0d37881 100644
--- a/src/dotgfxhierarchytable.h
+++ b/src/dotgfxhierarchytable.h
@@ -22,8 +22,6 @@
#include <vector>
#include "classdef.h"
-#include "ftextstream.h"
-
#include "dotgraph.h"
#include "dotnode.h"
@@ -33,10 +31,10 @@ class ClassLinkedMap;
class DotGfxHierarchyTable : public DotGraph
{
public:
- DotGfxHierarchyTable(const char *prefix="",ClassDef::CompoundType ct=ClassDef::Class);
- void createGraph(DotNode *rootNode,FTextStream &t,const char *path,
- const char *fileName,int id);
- void writeGraph(FTextStream &t,const char *path, const char *fileName);
+ DotGfxHierarchyTable(const QCString &prefix="",ClassDef::CompoundType ct=ClassDef::Class);
+ void createGraph(DotNode *rootNode,TextStream &t,const QCString &path,
+ const QCString &fileName,int id);
+ void writeGraph(TextStream &t,const QCString &path, const QCString &fileName);
const std::vector<DotNode*> subGraphs() const { return m_rootSubgraphs; }
protected:
diff --git a/src/dotgraph.cpp b/src/dotgraph.cpp
index 0da1db9..6ab34c8 100644
--- a/src/dotgraph.cpp
+++ b/src/dotgraph.cpp
@@ -13,6 +13,8 @@
*
*/
+#include <sstream>
+
#include "config.h"
#include "doxygen.h"
#include "index.h"
@@ -25,6 +27,7 @@
#include "dotgraph.h"
#include "dotnode.h"
#include "dotfilepatcher.h"
+#include "fileinfo.h"
#define MAP_CMD "cmapx"
@@ -38,22 +41,21 @@
static bool checkMd5Signature(const QCString &baseName,
const QCString &md5)
{
- QFile f(baseName+".md5");
- if (f.open(IO_ReadOnly))
+ std::ifstream f(baseName.str()+".md5",std::ifstream::in | std::ifstream::binary);
+ if (f.is_open())
{
// read checksum
QCString md5stored(33);
- int bytesRead=f.readBlock(md5stored.rawData(),32);
+ f.read(md5stored.rawData(),32);
md5stored[32]='\0';
// compare checksum
- if (bytesRead==32 && md5==md5stored)
+ if (!f.fail() && md5==md5stored)
{
// bail out if equal
- return FALSE;
+ return false;
}
}
- f.close();
- return TRUE;
+ return true;
}
static bool checkDeliverables(const QCString &file1,
@@ -63,35 +65,34 @@ static bool checkDeliverables(const QCString &file1,
bool file2Ok = TRUE;
if (!file1.isEmpty())
{
- QFileInfo fi(file1);
+ FileInfo fi(file1.str());
file1Ok = (fi.exists() && fi.size()>0);
}
if (!file2.isEmpty())
{
- QFileInfo fi(file2);
+ FileInfo fi(file2.str());
file2Ok = (fi.exists() && fi.size()>0);
}
return file1Ok && file2Ok;
}
-static bool insertMapFile(FTextStream &out,const QCString &mapFile,
+static bool insertMapFile(TextStream &out,const QCString &mapFile,
const QCString &relPath,const QCString &mapLabel)
{
- QFileInfo fi(mapFile);
+ FileInfo fi(mapFile.str());
if (fi.exists() && fi.size()>0) // reuse existing map file
{
- QGString tmpstr;
- FTextStream tmpout(&tmpstr);
- DotFilePatcher::convertMapFile(tmpout,mapFile,relPath,FALSE);
- if (!tmpstr.isEmpty())
+ TextStream t;
+ DotFilePatcher::convertMapFile(t,mapFile,relPath,false);
+ if (!t.empty())
{
- out << "<map name=\"" << mapLabel << "\" id=\"" << mapLabel << "\">" << endl;
- out << tmpstr;
- out << "</map>" << endl;
+ out << "<map name=\"" << mapLabel << "\" id=\"" << mapLabel << "\">\n";
+ out << t.str();
+ out << "</map>\n";
}
- return TRUE;
+ return true;
}
- return FALSE; // no map file yet, need to generate it
+ return false; // no map file yet, need to generate it
}
//--------------------------------------------------------------------
@@ -103,24 +104,24 @@ QCString DotGraph::imgName() const
}
QCString DotGraph::writeGraph(
- FTextStream& t, // output stream for the code file (html, ...)
+ TextStream& t, // output stream for the code file (html, ...)
GraphOutputFormat gf, // bitmap(png/svg) or ps(eps/pdf)
EmbeddedOutputFormat ef, // html, latex, ...
- const char* path, // output folder
- const char* fileName, // name of the code file (for code patcher)
- const char* relPath, // output folder relative to code file
+ const QCString &path, // output folder
+ const QCString &fileName, // name of the code file (for code patcher)
+ const QCString &relPath, // output folder relative to code file
bool generateImageMap, // in case of bitmap, shall there be code generated?
int graphId) // number of this graph in the current code, used in svg code
{
m_graphFormat = gf;
m_textFormat = ef;
- m_dir = QDir(path);
+ m_dir = Dir(path.str());
m_fileName = fileName;
m_relPath = relPath;
m_generateImageMap = generateImageMap;
m_graphId = graphId;
- m_absPath = QCString(m_dir.absPath().data()) + "/";
+ m_absPath = m_dir.absPath() + "/";
m_baseName = getBaseName();
computeTheGraph();
@@ -138,7 +139,7 @@ bool DotGraph::prepareDotFile()
{
if (!m_dir.exists())
{
- term("Output dir %s does not exist!\n", m_dir.path().data());
+ term("Output dir %s does not exist!\n", m_dir.path().c_str());
}
QCString sigStr(33);
@@ -163,27 +164,26 @@ bool DotGraph::prepareDotFile()
// need to rebuild the image
// write .dot file because image was new or has changed
- QFile f(absDotName());
- if (!f.open(IO_WriteOnly))
+ std::ofstream f(absDotName().str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- err("Could not open file %s for writing\n",f.name().data());
+ err("Could not open file %s for writing\n",qPrint(absDotName()));
return TRUE;
}
- FTextStream t(&f);
- t << m_theGraph;
+ f << m_theGraph;
f.close();
if (m_graphFormat == GOF_BITMAP)
{
// run dot to create a bitmap image
- DotRunner * dotRun = DotManager::instance()->createRunner(absDotName().data(), sigStr.data());
+ DotRunner * dotRun = DotManager::instance()->createRunner(absDotName(), sigStr);
dotRun->addJob(Config_getEnum(DOT_IMAGE_FORMAT), absImgName());
if (m_generateImageMap) dotRun->addJob(MAP_CMD, absMapName());
}
else if (m_graphFormat == GOF_EPS)
{
// run dot to create a .eps image
- DotRunner *dotRun = DotManager::instance()->createRunner(absDotName().data(), sigStr.data());
+ DotRunner *dotRun = DotManager::instance()->createRunner(absDotName(), sigStr);
if (Config_getBool(USE_PDFLATEX))
{
dotRun->addJob("pdf",absImgName());
@@ -196,22 +196,22 @@ bool DotGraph::prepareDotFile()
return TRUE;
}
-void DotGraph::generateCode(FTextStream &t)
+void DotGraph::generateCode(TextStream &t)
{
QCString imgExt = getDotImageExtension();
if (m_graphFormat==GOF_BITMAP && m_textFormat==EOF_DocBook)
{
- t << "<para>" << endl;
- t << " <informalfigure>" << endl;
- t << " <mediaobject>" << endl;
- t << " <imageobject>" << endl;
+ t << "<para>\n";
+ t << " <informalfigure>\n";
+ t << " <mediaobject>\n";
+ t << " <imageobject>\n";
t << " <imagedata";
t << " width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << m_relPath << m_baseName << "." << imgExt << "\">";
- t << "</imagedata>" << endl;
- t << " </imageobject>" << endl;
- t << " </mediaobject>" << endl;
- t << " </informalfigure>" << endl;
- t << "</para>" << endl;
+ t << "</imagedata>\n";
+ t << " </imageobject>\n";
+ t << " </mediaobject>\n";
+ t << " </informalfigure>\n";
+ t << "</para>\n";
}
else if (m_graphFormat==GOF_BITMAP && m_generateImageMap) // produce HTML to include the image
{
@@ -223,28 +223,28 @@ void DotGraph::generateCode(FTextStream &t)
if (m_regenerate)
{
DotManager::instance()->
- createFilePatcher(absImgName().data())->
+ createFilePatcher(absImgName())->
addSVGConversion(m_relPath,FALSE,QCString(),m_zoomable,m_graphId);
}
int mapId = DotManager::instance()->
- createFilePatcher(m_fileName.data())->
+ createFilePatcher(m_fileName)->
addSVGObject(m_baseName,absImgName(),m_relPath);
- t << "<!-- SVG " << mapId << " -->" << endl;
+ t << "<!-- SVG " << mapId << " -->\n";
}
- if (!m_noDivTag) t << "</div>" << endl;
+ if (!m_noDivTag) t << "</div>\n";
}
else // add link to bitmap file with image map
{
if (!m_noDivTag) t << "<div class=\"center\">";
t << "<img src=\"" << relImgName() << "\" border=\"0\" usemap=\"#" << correctId(getMapLabel()) << "\" alt=\"" << getImgAltText() << "\"/>";
if (!m_noDivTag) t << "</div>";
- t << endl;
+ t << "\n";
if (m_regenerate || !insertMapFile(t, absMapName(), m_relPath, correctId(getMapLabel())))
{
int mapId = DotManager::instance()->
- createFilePatcher(m_fileName.data())->
+ createFilePatcher(m_fileName)->
addMap(absMapName(), m_relPath, m_urlOnly, QCString(), getMapLabel());
- t << "<!-- MAP " << mapId << " -->" << endl;
+ t << "<!-- MAP " << mapId << " -->\n";
}
}
}
@@ -253,14 +253,14 @@ void DotGraph::generateCode(FTextStream &t)
if (m_regenerate || !DotFilePatcher::writeVecGfxFigure(t,m_baseName,absBaseName()))
{
int figId = DotManager::instance()->
- createFilePatcher(m_fileName.data())->
+ createFilePatcher(m_fileName)->
addFigure(m_baseName,absBaseName(),FALSE /*TRUE*/);
- t << endl << "% FIG " << figId << endl;
+ t << "\n% FIG " << figId << "\n";
}
}
}
-void DotGraph::writeGraphHeader(FTextStream &t,const QCString &title)
+void DotGraph::writeGraphHeader(TextStream &t,const QCString &title)
{
int fontSize = Config_getInt(DOT_FONTSIZE);
QCString fontName = Config_getString(DOT_FONTNAME);
@@ -273,7 +273,7 @@ void DotGraph::writeGraphHeader(FTextStream &t,const QCString &title)
{
t << "\"" << convertToXML(title) << "\"";
}
- t << endl << "{" << endl;
+ t << "\n{\n";
if (Config_getBool(INTERACTIVE_SVG)) // insert a comment to force regeneration when this
// option is toggled
{
@@ -282,7 +282,7 @@ void DotGraph::writeGraphHeader(FTextStream &t,const QCString &title)
t << " // LATEX_PDF_SIZE\n"; // write placeholder for LaTeX PDF bounding box size replacement
if (Config_getBool(DOT_TRANSPARENT))
{
- t << " bgcolor=\"transparent\";" << endl;
+ t << " bgcolor=\"transparent\";\n";
}
t << " edge [fontname=\"" << fontName << "\","
"fontsize=\"" << fontSize << "\","
@@ -292,9 +292,9 @@ void DotGraph::writeGraphHeader(FTextStream &t,const QCString &title)
"fontsize=\"" << fontSize << "\",shape=record];\n";
}
-void DotGraph::writeGraphFooter(FTextStream &t)
+void DotGraph::writeGraphFooter(TextStream &t)
{
- t << "}" << endl;
+ t << "}\n";
}
void DotGraph::computeGraph(DotNode *root,
@@ -304,15 +304,14 @@ void DotGraph::computeGraph(DotNode *root,
bool renderParents,
bool backArrows,
const QCString &title,
- QGString &graphStr)
+ QCString &graphStr)
{
//printf("computeMd5Signature\n");
- QGString buf;
- FTextStream md5stream(&buf);
+ TextStream md5stream;
writeGraphHeader(md5stream,title);
if (!rank.isEmpty())
{
- md5stream << " rankdir=\"" << rank << "\";" << endl;
+ md5stream << " rankdir=\"" << rank << "\";\n";
}
root->clearWriteFlag();
root->write(md5stream, gt, format, gt!=CallGraph && gt!=Dependency, TRUE, backArrows);
@@ -324,7 +323,7 @@ void DotGraph::computeGraph(DotNode *root,
{
const auto &children = pn->children();
auto child_it = std::find(children.begin(),children.end(),root);
- int index = child_it - children.begin();
+ size_t index = child_it - children.begin();
root->writeArrow(md5stream, // stream
gt, // graph type
format, // output format
@@ -345,6 +344,6 @@ void DotGraph::computeGraph(DotNode *root,
}
writeGraphFooter(md5stream);
- graphStr=buf.data();
+ graphStr=md5stream.str();
}
diff --git a/src/dotgraph.h b/src/dotgraph.h
index b90d980..2a77504 100644
--- a/src/dotgraph.h
+++ b/src/dotgraph.h
@@ -16,12 +16,13 @@
#ifndef DOTGRAPH_H
#define DOTGRAPH_H
-#include <qcstring.h>
-#include <qgstring.h>
-#include <qdir.h>
+#include <iostream>
+
+#include "qcstring.h"
+#include "dir.h"
-class FTextStream;
class DotNode;
+class TextStream;
enum GraphOutputFormat { GOF_BITMAP, GOF_EPS };
enum EmbeddedOutputFormat { EOF_Html, EOF_LaTeX, EOF_Rtf, EOF_DocBook };
@@ -39,18 +40,18 @@ class DotGraph
/** returns node numbers. The Counter is reset by the constructor */
int getNextNodeNumber() { return ++m_curNodeNumber; }
- QCString writeGraph(FTextStream &t,
+ QCString writeGraph(TextStream &t,
GraphOutputFormat gf,
EmbeddedOutputFormat ef,
- const char *path,
- const char *fileName,
- const char *relPath,
+ const QCString &path,
+ const QCString &fileName,
+ const QCString &relPath,
bool writeImageMap=TRUE,
int graphId=-1
);
- static void writeGraphHeader(FTextStream& t, const QCString& title = QCString());
- static void writeGraphFooter(FTextStream& t);
+ static void writeGraphHeader(TextStream& t, const QCString& title = QCString());
+ static void writeGraphFooter(TextStream& t);
static void computeGraph(DotNode* root,
GraphType gt,
GraphOutputFormat format,
@@ -58,7 +59,7 @@ class DotGraph
bool renderParents,
bool backArrows,
const QCString& title,
- QGString& graphStr
+ QCString& graphStr
);
virtual QCString getBaseName() const = 0;
@@ -77,7 +78,7 @@ class DotGraph
// the following variables are used while writing the graph to a .dot file
GraphOutputFormat m_graphFormat = GOF_BITMAP;
EmbeddedOutputFormat m_textFormat = EOF_Html;
- QDir m_dir;
+ Dir m_dir;
QCString m_fileName;
QCString m_relPath;
bool m_generateImageMap = false;
@@ -85,7 +86,7 @@ class DotGraph
QCString m_absPath;
QCString m_baseName;
- QGString m_theGraph;
+ QCString m_theGraph;
bool m_regenerate = false;
bool m_doNotAddImageToIndex = false;
bool m_noDivTag = false;
@@ -97,7 +98,7 @@ class DotGraph
DotGraph &operator=(const DotGraph &);
bool prepareDotFile();
- void generateCode(FTextStream &t);
+ void generateCode(TextStream &t);
int m_curNodeNumber = 0;
};
diff --git a/src/dotgroupcollaboration.cpp b/src/dotgroupcollaboration.cpp
index 1dc1380..d409d50 100644
--- a/src/dotgroupcollaboration.cpp
+++ b/src/dotgroupcollaboration.cpp
@@ -20,6 +20,7 @@
#include "pagedef.h"
#include "util.h"
#include "config.h"
+#include "textstream.h"
DotGroupCollaboration::DotGroupCollaboration(const GroupDef* gd)
{
@@ -207,7 +208,7 @@ QCString DotGroupCollaboration::getBaseName() const
void DotGroupCollaboration::computeTheGraph()
{
- FTextStream md5stream(&m_theGraph);
+ TextStream md5stream;
writeGraphHeader(md5stream,m_rootNode->label());
// clean write flags
@@ -230,6 +231,7 @@ void DotGroupCollaboration::computeTheGraph()
writeGraphFooter(md5stream);
+ m_theGraph = md5stream.str();
}
QCString DotGroupCollaboration::getMapLabel() const
@@ -237,9 +239,9 @@ QCString DotGroupCollaboration::getMapLabel() const
return escapeCharsInString(m_baseName, FALSE);
}
-QCString DotGroupCollaboration::writeGraph( FTextStream &t,
+QCString DotGroupCollaboration::writeGraph( TextStream &t,
GraphOutputFormat graphFormat, EmbeddedOutputFormat textFormat,
- const char *path, const char *fileName, const char *relPath,
+ const QCString &path, const QCString &fileName, const QCString &relPath,
bool generateImageMap,int graphId)
{
m_doNotAddImageToIndex = TRUE;
@@ -247,7 +249,7 @@ QCString DotGroupCollaboration::writeGraph( FTextStream &t,
return DotGraph::writeGraph(t, graphFormat, textFormat, path, fileName, relPath, generateImageMap, graphId);
}
-void DotGroupCollaboration::Edge::write( FTextStream &t ) const
+void DotGroupCollaboration::Edge::write( TextStream &t ) const
{
const char* linkTypeColor[] = {
"darkorchid3"
@@ -304,7 +306,7 @@ void DotGroupCollaboration::Edge::write( FTextStream &t ) const
break;
}
t << ", " << arrowStyle;
- t << "];" << endl;
+ t << "];\n";
}
bool DotGroupCollaboration::isTrivial() const
@@ -312,7 +314,7 @@ bool DotGroupCollaboration::isTrivial() const
return m_usedNodes.size() <= 1;
}
-void DotGroupCollaboration::writeGraphHeader(FTextStream &t,const QCString &title) const
+void DotGroupCollaboration::writeGraphHeader(TextStream &t,const QCString &title) const
{
int fontSize = Config_getInt(DOT_FONTSIZE);
QCString fontName = Config_getString(DOT_FONTNAME);
@@ -325,11 +327,11 @@ void DotGroupCollaboration::writeGraphHeader(FTextStream &t,const QCString &titl
{
t << "\"" << convertToXML(title) << "\"";
}
- t << endl;
- t << "{" << endl;
+ t << "\n";
+ t << "{\n";
if (Config_getBool(DOT_TRANSPARENT))
{
- t << " bgcolor=\"transparent\";" << endl;
+ t << " bgcolor=\"transparent\";\n";
}
t << " edge [fontname=\"" << fontName << "\",fontsize=\"" << fontSize << "\","
"labelfontname=\"" << fontName << "\",labelfontsize=\"" << fontSize << "\"];\n";
diff --git a/src/dotgroupcollaboration.h b/src/dotgroupcollaboration.h
index ebfe6e7..872e7f7 100644
--- a/src/dotgroupcollaboration.h
+++ b/src/dotgroupcollaboration.h
@@ -20,14 +20,16 @@
#include "dotgraph.h"
#include "groupdef.h"
+class TextStream;
+
/** Representation of a group collaboration graph */
class DotGroupCollaboration : public DotGraph
{
public :
DotGroupCollaboration(const GroupDef* gd);
~DotGroupCollaboration();
- QCString writeGraph(FTextStream &t, GraphOutputFormat gf,EmbeddedOutputFormat ef,
- const char *path,const char *fileName,const char *relPath,
+ QCString writeGraph(TextStream &t, GraphOutputFormat gf,EmbeddedOutputFormat ef,
+ const QCString &path,const QCString &fileName,const QCString &relPath,
bool writeImageMap=TRUE,int graphId=-1);
bool isTrivial() const;
@@ -50,7 +52,7 @@ class DotGroupCollaboration : public DotGraph
struct Link
{
- Link(const QCString lab,const QCString &u) : label(lab), url(u) {}
+ Link(const QCString &lab,const QCString &u) : label(lab), url(u) {}
QCString label;
QCString url;
};
@@ -65,13 +67,13 @@ class DotGroupCollaboration : public DotGraph
EdgeType eType;
std::vector<Link> links;
- void write( FTextStream &t ) const;
+ void write( TextStream &t ) const;
};
void buildGraph(const GroupDef* gd);
void addCollaborationMember(const Definition* def, QCString& url, EdgeType eType );
void addMemberList( class MemberList* ml );
- void writeGraphHeader(FTextStream &t,const QCString &title) const;
+ void writeGraphHeader(TextStream &t,const QCString &title) const;
Edge* addEdge( DotNode* _pNStart, DotNode* _pNEnd, EdgeType _eType,
const QCString& _label, const QCString& _url );
diff --git a/src/dotincldepgraph.cpp b/src/dotincldepgraph.cpp
index 07b2139..5a2f7ca 100644
--- a/src/dotincldepgraph.cpp
+++ b/src/dotincldepgraph.cpp
@@ -17,6 +17,7 @@
#include "dotnode.h"
#include "util.h"
#include "config.h"
+#include "textstream.h"
void DotInclDepGraph::buildGraph(DotNode *n,const FileDef *fd,int distance)
{
@@ -25,7 +26,7 @@ void DotInclDepGraph::buildGraph(DotNode *n,const FileDef *fd,int distance)
{
const FileDef *bfd = ii.fileDef;
QCString in = ii.includeName;
- //printf(">>>> in='%s' bfd=%p\n",ii->includeName.data(),bfd);
+ //printf(">>>> in='%s' bfd=%p\n",qPrint(ii->includeName),bfd);
bool doc=TRUE,src=FALSE;
if (bfd)
{
@@ -36,7 +37,7 @@ void DotInclDepGraph::buildGraph(DotNode *n,const FileDef *fd,int distance)
if (doc || src || !Config_getBool(HIDE_UNDOC_RELATIONS))
{
QCString url="";
- if (bfd) url=bfd->getOutputFileBase().copy();
+ if (bfd) url=bfd->getOutputFileBase();
if (!doc && src)
{
url=bfd->getSourceFileBase();
@@ -45,7 +46,7 @@ void DotInclDepGraph::buildGraph(DotNode *n,const FileDef *fd,int distance)
if (it!=m_usedNodes.end()) // file is already a node in the graph
{
DotNode *bn = it->second;
- n->addChild(bn,0,0,0);
+ n->addChild(bn,0,0);
bn->addParent(n);
bn->setDistance(distance);
}
@@ -64,7 +65,7 @@ void DotInclDepGraph::buildGraph(DotNode *n,const FileDef *fd,int distance)
tmp_url, // url
FALSE, // rootNode
0); // cd
- n->addChild(bn,0,0,0);
+ n->addChild(bn,0,0);
bn->addParent(n);
m_usedNodes.insert(std::make_pair(in.str(),bn));
bn->setDistance(distance);
@@ -130,7 +131,7 @@ DotInclDepGraph::DotInclDepGraph(const FileDef *fd,bool inverse)
m_startNode = new DotNode(getNextNodeNumber(),
fd->docName(),
tooltip,
- tmp_url.data(),
+ tmp_url,
TRUE); // root node
m_startNode->setDistance(0);
m_usedNodes.insert(std::make_pair(fd->absFilePath().str(),m_startNode));
@@ -180,12 +181,12 @@ QCString DotInclDepGraph::getMapLabel() const
}
}
-QCString DotInclDepGraph::writeGraph(FTextStream &out,
+QCString DotInclDepGraph::writeGraph(TextStream &out,
GraphOutputFormat graphFormat,
EmbeddedOutputFormat textFormat,
- const char *path,
- const char *fileName,
- const char *relPath,
+ const QCString &path,
+ const QCString &fileName,
+ const QCString &relPath,
bool generateImageMap,
int graphId)
{
@@ -207,7 +208,7 @@ int DotInclDepGraph::numNodes() const
return (int)m_startNode->children().size();
}
-void DotInclDepGraph::writeXML(FTextStream &t)
+void DotInclDepGraph::writeXML(TextStream &t)
{
for (const auto &kv : m_usedNodes)
{
@@ -215,7 +216,7 @@ void DotInclDepGraph::writeXML(FTextStream &t)
}
}
-void DotInclDepGraph::writeDocbook(FTextStream &t)
+void DotInclDepGraph::writeDocbook(TextStream &t)
{
for (const auto &kv : m_usedNodes)
{
diff --git a/src/dotincldepgraph.h b/src/dotincldepgraph.h
index 0105489..a0e58bf 100644
--- a/src/dotincldepgraph.h
+++ b/src/dotincldepgraph.h
@@ -22,20 +22,22 @@
#include "dotnode.h"
#include "dotgraph.h"
+class TextStream;
+
/** Representation of an include dependency graph */
class DotInclDepGraph : public DotGraph
{
public:
DotInclDepGraph(const FileDef *fd,bool inverse);
~DotInclDepGraph();
- QCString writeGraph(FTextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef,
- const char *path,const char *fileName,const char *relPath,
+ QCString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef,
+ const QCString &path,const QCString &fileName,const QCString &relPath,
bool writeImageMap=TRUE,int graphId=-1);
bool isTrivial() const;
bool isTooBig() const;
int numNodes() const;
- void writeXML(FTextStream &t);
- void writeDocbook(FTextStream &t);
+ void writeXML(TextStream &t);
+ void writeDocbook(TextStream &t);
protected:
virtual QCString getBaseName() const;
diff --git a/src/dotlegendgraph.cpp b/src/dotlegendgraph.cpp
index b17a293..f512fa2 100644
--- a/src/dotlegendgraph.cpp
+++ b/src/dotlegendgraph.cpp
@@ -13,6 +13,8 @@
*
*/
+#include <sstream>
+
#include "dotlegendgraph.h"
#include "util.h"
#include "config.h"
@@ -21,15 +23,15 @@
#include "language.h"
#include "dotfilepatcher.h"
-void DotLegendGraph::writeGraph(const char *path)
+void DotLegendGraph::writeGraph(const QCString &path)
{
- FTextStream ts;
+ TextStream ts;
DotGraph::writeGraph(ts, GOF_BITMAP, EOF_Html, path, "", "", FALSE, 0);
if (getDotImageExtension()=="svg")
{
DotManager::instance()->
- createFilePatcher((absBaseName()+Config_getString(HTML_FILE_EXTENSION)).data())->
+ createFilePatcher(absBaseName()+Config_getString(HTML_FILE_EXTENSION))->
addSVGObject("graph_legend", absImgName(),QCString());
}
}
@@ -43,7 +45,7 @@ void DotLegendGraph::computeTheGraph()
{
int fontSize = Config_getInt(DOT_FONTSIZE);
QCString fontName = Config_getString(DOT_FONTNAME);
- FTextStream md5stream(&m_theGraph);
+ TextStream md5stream;
writeGraphHeader(md5stream,theTranslator->trLegendTitle());
md5stream << " Node9 [shape=\"box\",label=\"Inherited\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",fillcolor=\"grey75\",style=\"filled\" fontcolor=\"black\"];\n";
md5stream << " Node10 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << fontSize << "\",style=\"solid\",fontname=\"" << fontName << "\"];\n";
@@ -63,6 +65,7 @@ void DotLegendGraph::computeTheGraph()
md5stream << " Node18 -> Node9 [dir=\"back\",color=\"darkorchid3\",fontsize=\"" << fontSize << "\",style=\"dashed\",label=\"m_usedClass\",fontname=\"" << fontName << "\"];\n";
md5stream << " Node18 [shape=\"box\",label=\"Used\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"black\"];\n";
writeGraphFooter(md5stream);
+ m_theGraph = md5stream.str();
}
QCString DotLegendGraph::getMapLabel() const
diff --git a/src/dotlegendgraph.h b/src/dotlegendgraph.h
index 2d8eeec..2adf625 100644
--- a/src/dotlegendgraph.h
+++ b/src/dotlegendgraph.h
@@ -22,7 +22,7 @@
class DotLegendGraph : public DotGraph
{
public:
- void writeGraph(const char *path);
+ void writeGraph(const QCString &path);
private:
virtual QCString getBaseName() const;
diff --git a/src/dotnode.cpp b/src/dotnode.cpp
index 318878d..8dcfaaf 100644
--- a/src/dotnode.cpp
+++ b/src/dotnode.cpp
@@ -14,8 +14,6 @@
*/
#include "dotnode.h"
-
-#include "ftextstream.h"
#include "classdef.h"
#include "config.h"
#include "memberlist.h"
@@ -23,6 +21,7 @@
#include "language.h"
#include "doxygen.h"
#include "util.h"
+#include "textstream.h"
/** Helper struct holding the properties of a edge in a dot graph. */
struct EdgeProperties
@@ -123,9 +122,9 @@ static UmlDetailLevel getUmlDetailLevelFromConfig()
static QCString escapeTooltip(const QCString &tooltip)
{
+ if (tooltip.isEmpty()) return tooltip;
QCString result;
const char *p=tooltip.data();
- if (p==0) return result;
char c;
while ((c=*p++))
{
@@ -139,7 +138,7 @@ static QCString escapeTooltip(const QCString &tooltip)
return result;
}
-static void writeBoxMemberList(FTextStream &t,
+static void writeBoxMemberList(TextStream &t,
char prot,const MemberList *ml,const ClassDef *scope,
bool isStatic=FALSE,const StringUnorderedSet *skipNames=nullptr)
{
@@ -287,7 +286,7 @@ static QCString stripProtectionPrefix(const QCString &s)
}
}
-DotNode::DotNode(int n,const char *lab,const char *tip, const char *url,
+DotNode::DotNode(int n,const QCString &lab,const QCString &tip, const QCString &url,
bool isRoot,const ClassDef *cd)
: m_number(n)
, m_label(lab)
@@ -305,8 +304,8 @@ DotNode::~DotNode()
void DotNode::addChild(DotNode *n,
int edgeColor,
int edgeStyle,
- const char *edgeLab,
- const char *edgeURL,
+ const QCString &edgeLab,
+ const QCString &edgeURL,
int edgeLabCol
)
{
@@ -362,7 +361,7 @@ void DotNode::setDistance(int distance)
inline int DotNode::findParent( DotNode *n )
{
auto it = std::find(m_parents.begin(),m_parents.end(),n);
- return it!=m_parents.end() ? it-m_parents.begin() : -1;
+ return it!=m_parents.end() ? static_cast<int>(it-m_parents.begin()) : -1;
}
/*! helper function that deletes all nodes in a connected graph, given
@@ -378,7 +377,7 @@ void DotNode::deleteNodes(DotNode *node)
}
}
-void DotNode::writeBox(FTextStream &t,
+void DotNode::writeBox(TextStream &t,
GraphType gt,
GraphOutputFormat /*format*/,
bool hasNonReachableChildren) const
@@ -412,7 +411,7 @@ void DotNode::writeBox(FTextStream &t,
}
}
- //printf("DotNode::writeBox for %s\n",m_classDef->name().data());
+ //printf("DotNode::writeBox for %s\n",qPrint(m_classDef->name()));
t << "{" << convertLabel(m_label) << "\\n";
if (getUmlDetailLevelFromConfig()!=UmlDetailLevel::None)
{
@@ -500,10 +499,10 @@ void DotNode::writeBox(FTextStream &t,
{
t << ",tooltip=\" \""; // space in tooltip is required otherwise still something like 'Node0' is used
}
- t << "];" << endl;
+ t << "];\n";
}
-void DotNode::writeArrow(FTextStream &t,
+void DotNode::writeArrow(TextStream &t,
GraphType gt,
GraphOutputFormat format,
const DotNode *cn,
@@ -549,17 +548,17 @@ void DotNode::writeArrow(FTextStream &t,
}
if (format==GOF_BITMAP) t << ",fontname=\"" << Config_getString(DOT_FONTNAME) << "\"";
- t << "];" << endl;
+ t << "];\n";
}
-void DotNode::write(FTextStream &t,
+void DotNode::write(TextStream &t,
GraphType gt,
GraphOutputFormat format,
bool topDown,
bool toChildren,
bool backArrows) const
{
- //printf("DotNode::write(%d) name=%s this=%p written=%d visible=%d\n",m_distance,m_label.data(),this,m_written,m_visible);
+ //printf("DotNode::write(%d) name=%s this=%p written=%d visible=%d\n",m_distance,qPrint(m_label),this,m_written,m_visible);
if (m_written) return; // node already written to the output
if (!m_visible) return; // node is not visible
writeBox(t,gt,format,m_truncated==Truncated);
@@ -571,7 +570,7 @@ void DotNode::write(FTextStream &t,
{
if (cn->isVisible())
{
- //printf("write arrow %s%s%s\n",label().data(),backArrows?"<-":"->",cn->label().data());
+ //printf("write arrow %s%s%s\n",qPrint(label()),backArrows?"<-":"->",qPrint(cn->label()));
writeArrow(t,gt,format,cn,&(*it),topDown,backArrows);
}
cn->write(t,gt,format,topDown,toChildren,backArrows);
@@ -586,8 +585,8 @@ void DotNode::write(FTextStream &t,
{
const auto &children = pn->children();
auto child_it = std::find(children.begin(),children.end(),this);
- int index = child_it - children.begin();
- //printf("write arrow %s%s%s\n",label().data(),backArrows?"<-":"->",pn->label().data());
+ size_t index = child_it - children.begin();
+ //printf("write arrow %s%s%s\n",qPrint(label()),backArrows?"<-":"->",qPrint(pn->label()));
writeArrow(t,
gt,
format,
@@ -600,13 +599,13 @@ void DotNode::write(FTextStream &t,
pn->write(t,gt,format,TRUE,FALSE,backArrows);
}
}
- //printf("end DotNode::write(%d) name=%s\n",distance,m_label.data());
+ //printf("end DotNode::write(%d) name=%s\n",distance,qPrint(m_label));
}
-void DotNode::writeXML(FTextStream &t,bool isClassGraph) const
+void DotNode::writeXML(TextStream &t,bool isClassGraph) const
{
- t << " <node id=\"" << m_number << "\">" << endl;
- t << " <label>" << convertToXML(m_label) << "</label>" << endl;
+ t << " <node id=\"" << m_number << "\">\n";
+ t << " <label>" << convertToXML(m_label) << "</label>\n";
if (!m_url.isEmpty())
{
QCString url(m_url);
@@ -620,7 +619,7 @@ void DotNode::writeXML(FTextStream &t,bool isClassGraph) const
{
t << " external=\"" << convertToXML(refPtr) << "\"";
}
- t << "/>" << endl;
+ t << "/>\n";
}
}
auto it = m_edgeInfo.begin();
@@ -645,7 +644,7 @@ void DotNode::writeXML(FTextStream &t,bool isClassGraph) const
{
t << "include";
}
- t << "\">" << endl;
+ t << "\">\n";
if (!edgeInfo.label().isEmpty())
{
int p=0;
@@ -654,23 +653,23 @@ void DotNode::writeXML(FTextStream &t,bool isClassGraph) const
{
t << " <edgelabel>"
<< convertToXML(edgeInfo.label().mid(p,ni-p))
- << "</edgelabel>" << endl;
+ << "</edgelabel>\n";
p=ni+1;
}
t << " <edgelabel>"
<< convertToXML(edgeInfo.label().right(edgeInfo.label().length()-p))
- << "</edgelabel>" << endl;
+ << "</edgelabel>\n";
}
- t << " </childnode>" << endl;
+ t << " </childnode>\n";
++it;
}
- t << " </node>" << endl;
+ t << " </node>\n";
}
-void DotNode::writeDocbook(FTextStream &t,bool isClassGraph) const
+void DotNode::writeDocbook(TextStream &t,bool isClassGraph) const
{
- t << " <node id=\"" << m_number << "\">" << endl;
- t << " <label>" << convertToXML(m_label) << "</label>" << endl;
+ t << " <node id=\"" << m_number << "\">\n";
+ t << " <label>" << convertToXML(m_label) << "</label>\n";
if (!m_url.isEmpty())
{
QCString url(m_url);
@@ -684,7 +683,7 @@ void DotNode::writeDocbook(FTextStream &t,bool isClassGraph) const
{
t << " external=\"" << convertToXML(refPtr) << "\"";
}
- t << "/>" << endl;
+ t << "/>\n";
}
}
auto it = m_edgeInfo.begin();
@@ -709,7 +708,7 @@ void DotNode::writeDocbook(FTextStream &t,bool isClassGraph) const
{
t << "include";
}
- t << "\">" << endl;
+ t << "\">\n";
if (!edgeInfo.label().isEmpty())
{
int p=0;
@@ -718,27 +717,27 @@ void DotNode::writeDocbook(FTextStream &t,bool isClassGraph) const
{
t << " <edgelabel>"
<< convertToXML(edgeInfo.label().mid(p,ni-p))
- << "</edgelabel>" << endl;
+ << "</edgelabel>\n";
p=ni+1;
}
t << " <edgelabel>"
<< convertToXML(edgeInfo.label().right(edgeInfo.label().length()-p))
- << "</edgelabel>" << endl;
+ << "</edgelabel>\n";
}
- t << " </childnode>" << endl;
+ t << " </childnode>\n";
++it;
}
- t << " </node>" << endl;
+ t << " </node>\n";
}
-void DotNode::writeDEF(FTextStream &t) const
+void DotNode::writeDEF(TextStream &t) const
{
const char* nodePrefix = " node-";
- t << " node = {" << endl;
- t << nodePrefix << "id = " << m_number << ';' << endl;
- t << nodePrefix << "label = '" << m_label << "';" << endl;
+ t << " node = {\n";
+ t << nodePrefix << "id = " << m_number << ";\n";
+ t << nodePrefix << "label = '" << m_label << "';\n";
if (!m_url.isEmpty())
{
@@ -748,23 +747,23 @@ void DotNode::writeDEF(FTextStream &t) const
if (urlPtr)
{
*urlPtr++='\0';
- t << nodePrefix << "link = {" << endl << " "
- << nodePrefix << "link-id = '" << urlPtr << "';" << endl;
+ t << nodePrefix << "link = {\n" << " "
+ << nodePrefix << "link-id = '" << urlPtr << "';\n";
if (*refPtr!='\0')
{
t << " " << nodePrefix << "link-external = '"
- << refPtr << "';" << endl;
+ << refPtr << "';\n";
}
- t << " };" << endl;
+ t << " };\n";
}
}
auto it = m_edgeInfo.begin();
for (const auto &childNode : m_children)
{
const EdgeInfo &edgeInfo = *it;
- t << " node-child = {" << endl;
- t << " child-id = '" << childNode->number() << "';" << endl;
+ t << " node-child = {\n";
+ t << " child-id = '" << childNode->number() << "';\n";
t << " relation = ";
switch (edgeInfo.color())
@@ -777,18 +776,18 @@ void DotNode::writeDEF(FTextStream &t) const
case EdgeInfo::Orange2: t << "type-constraint"; break;
case EdgeInfo::Grey: ASSERT(0); break;
}
- t << ';' << endl;
+ t << ";\n";
if (!edgeInfo.label().isEmpty())
{
- t << " edgelabel = <<_EnD_oF_dEf_TeXt_" << endl
- << edgeInfo.label() << endl
- << "_EnD_oF_dEf_TeXt_;" << endl;
+ t << " edgelabel = <<_EnD_oF_dEf_TeXt_\n"
+ << edgeInfo.label() << "\n"
+ << "_EnD_oF_dEf_TeXt_;\n";
}
- t << " }; /* node-child */" << endl;
+ t << " }; /* node-child */\n";
++it;
}
- t << " }; /* node */" << endl;
+ t << " }; /* node */\n";
}
@@ -808,7 +807,7 @@ void DotNode::colorConnectedNodes(int curColor)
cn->setSubgraphId(curColor);
cn->markAsVisible();
cn->colorConnectedNodes(curColor);
- //printf("coloring node %s (%p): %d\n",cn->label().data(),cn,cn->subgraphId());
+ //printf("coloring node %s (%p): %d\n",qPrint(cn->label()),cn,cn->subgraphId());
}
}
@@ -819,7 +818,7 @@ void DotNode::colorConnectedNodes(int curColor)
pn->setSubgraphId(curColor);
pn->markAsVisible();
pn->colorConnectedNodes(curColor);
- //printf("coloring node %s (%p): %d\n",pn->label().data(),pn,pn->subgraphId());
+ //printf("coloring node %s (%p): %d\n",qPrint(pn->label()),pn,pn->subgraphId());
}
}
}
@@ -840,7 +839,7 @@ void DotNode::renumberNodes(int &number)
const DotNode *DotNode::findDocNode() const
{
if (!m_url.isEmpty()) return this;
- //printf("findDocNode(): '%s'\n",m_label.data());
+ //printf("findDocNode(): '%s'\n",qPrint(m_label));
for (const auto &pn : m_parents)
{
if (!pn->hasDocumentation())
diff --git a/src/dotnode.h b/src/dotnode.h
index 2eb3f7d..cd1e75b 100644
--- a/src/dotnode.h
+++ b/src/dotnode.h
@@ -19,12 +19,13 @@
#include <vector>
#include <map>
#include <deque>
+#include <iostream>
#include "dotgraph.h"
class ClassDef;
class DotNode;
-class FTextStream;
+class TextStream;
/** Attributes of an edge of a dot graph */
class EdgeInfo
@@ -57,7 +58,7 @@ class DotNode
public:
static void deleteNodes(DotNode* node);
static QCString convertLabel(const QCString& l);
- DotNode(int n,const char *lab,const char *tip,const char *url,
+ DotNode(int n,const QCString &lab,const QCString &tip,const QCString &url,
bool rootNode=FALSE,const ClassDef *cd=0);
~DotNode();
@@ -66,8 +67,8 @@ class DotNode
void addChild(DotNode *n,
int edgeColor=EdgeInfo::Purple,
int edgeStyle=EdgeInfo::Solid,
- const char *edgeLab=0,
- const char *edgeURL=0,
+ const QCString &edgeLab=QCString(),
+ const QCString &edgeURL=QCString(),
int edgeLabCol=-1);
void addParent(DotNode *n);
void deleteNode(DotNodeRefVector &deletedList);
@@ -75,14 +76,14 @@ class DotNode
void removeParent(DotNode *n);
int findParent( DotNode *n );
- void write(FTextStream &t,GraphType gt,GraphOutputFormat f,
+ void write(TextStream &t,GraphType gt,GraphOutputFormat f,
bool topDown,bool toChildren,bool backArrows) const;
- void writeXML(FTextStream &t,bool isClassGraph) const;
- void writeDocbook(FTextStream &t,bool isClassGraph) const;
- void writeDEF(FTextStream &t) const;
- void writeBox(FTextStream &t,GraphType gt,GraphOutputFormat f,
+ void writeXML(TextStream &t,bool isClassGraph) const;
+ void writeDocbook(TextStream &t,bool isClassGraph) const;
+ void writeDEF(TextStream &t) const;
+ void writeBox(TextStream &t,GraphType gt,GraphOutputFormat f,
bool hasNonReachableChildren) const;
- void writeArrow(FTextStream &t,GraphType gt,GraphOutputFormat f,const DotNode *cn,
+ void writeArrow(TextStream &t,GraphType gt,GraphOutputFormat f,const DotNode *cn,
const EdgeInfo *ei,bool topDown, bool pointBack=TRUE) const;
QCString label() const { return m_label; }
diff --git a/src/dotrunner.cpp b/src/dotrunner.cpp
index a1bbc52..f9f077d 100644
--- a/src/dotrunner.cpp
+++ b/src/dotrunner.cpp
@@ -16,14 +16,12 @@
#include <cassert>
#include "dotrunner.h"
-
-#include "qstring.h"
#include "util.h"
#include "portable.h"
#include "dot.h"
#include "message.h"
-#include "ftextstream.h"
#include "config.h"
+#include "dir.h"
// the graphicx LaTeX has a limitation of maximum size of 16384
// To be on the save side we take it a little bit smaller i.e. 150 inch * 72 dpi
@@ -35,7 +33,7 @@
// since dot silently reproduces the input file when it does not
// support the PNG format, we need to check the result.
-static void checkPngResult(const char *imgName)
+static void checkPngResult(const QCString &imgName)
{
FILE *f = Portable::fopen(imgName,"rb");
if (f)
@@ -48,73 +46,65 @@ static void checkPngResult(const char *imgName)
err("Image '%s' produced by dot is not a valid PNG!\n"
"You should either select a different format "
"(DOT_IMAGE_FORMAT in the config file) or install a more "
- "recent version of graphviz (1.7+)\n",imgName
+ "recent version of graphviz (1.7+)\n",qPrint(imgName)
);
}
}
else
{
- err("Could not read image '%s' generated by dot!\n",imgName);
+ err("Could not read image '%s' generated by dot!\n",qPrint(imgName));
}
fclose(f);
}
else
{
- err("Could not open image '%s' generated by dot!\n",imgName);
+ err("Could not open image '%s' generated by dot!\n",qPrint(imgName));
}
}
-static bool resetPDFSize(const int width,const int height, const char *base)
+static bool resetPDFSize(const int width,const int height, const QCString &base)
{
- QCString tmpName = QCString(base)+".tmp";
- QCString patchFile = QCString(base)+".dot";
- if (!QDir::current().rename(patchFile,tmpName))
+ std::string tmpName = base.str()+".tmp";
+ std::string patchFile = base.str()+".dot";
+ Dir thisDir;
+ if (!thisDir.rename(patchFile,tmpName))
{
- err("Failed to rename file %s to %s!\n",patchFile.data(),tmpName.data());
+ err("Failed to rename file %s to %s!\n",qPrint(patchFile),qPrint(tmpName));
return FALSE;
}
- QFile fi(tmpName);
- QFile fo(patchFile);
- if (!fi.open(IO_ReadOnly))
+ std::ifstream fi(tmpName,std::ifstream::in);
+ std::ofstream t(patchFile,std::ofstream::out | std::ofstream::binary);
+ if (!fi.is_open())
{
- err("problem opening file %s for patching!\n",tmpName.data());
- QDir::current().rename(tmpName,patchFile);
+ err("problem opening file %s for patching!\n",qPrint(tmpName));
+ thisDir.rename(tmpName,patchFile);
return FALSE;
}
- if (!fo.open(IO_WriteOnly))
+ if (!t.is_open())
{
- err("problem opening file %s for patching!\n",patchFile.data());
- QDir::current().rename(tmpName,patchFile);
- fi.close();
+ err("problem opening file %s for patching!\n",qPrint(patchFile));
+ thisDir.rename(tmpName,patchFile);
return FALSE;
}
- FTextStream t(&fo);
- const int maxLineLen=100*1024;
- while (!fi.atEnd()) // foreach line
+ std::string line;
+ while (getline(fi,line)) // foreach line
{
- QCString line(maxLineLen);
- int numBytes = fi.readLine(line.rawData(),maxLineLen);
- if (numBytes<=0)
- {
- break;
- }
- line.resize(numBytes+1);
- if (line.find("LATEX_PDF_SIZE") != -1)
+ if (line.find("LATEX_PDF_SIZE") != std::string::npos)
{
double scale = (width > height ? width : height)/double(MAX_LATEX_GRAPH_INCH);
- t << " size=\""<<width/scale << "," <<height/scale <<"\";\n";
+ t << " size=\""<<width/scale << "," <<height/scale << "\";\n";
}
else
- t << line;
+ t << line << "\n";
}
fi.close();
- fo.close();
+ t.close();
// remove temporary file
- QDir::current().remove(tmpName);
+ thisDir.remove(tmpName);
return TRUE;
}
-bool DotRunner::readBoundingBox(const char *fileName,int *width,int *height,bool isEps)
+bool DotRunner::readBoundingBox(const QCString &fileName,int *width,int *height,bool isEps)
{
const char *bb = isEps ? "%%PageBoundingBox:" : "/MediaBox [";
int bblen = (int)strlen(bb);
@@ -141,23 +131,23 @@ bool DotRunner::readBoundingBox(const char *fileName,int *width,int *height,bool
return TRUE;
}
}
- err("Failed to extract bounding box from generated diagram file %s\n",fileName);
+ err("Failed to extract bounding box from generated diagram file %s\n",qPrint(fileName));
fclose(f);
return FALSE;
}
//---------------------------------------------------------------------------------
-DotRunner::DotRunner(const std::string& absDotName, const std::string& md5Hash)
- : m_file(absDotName.data())
- , m_md5Hash(md5Hash.data())
+DotRunner::DotRunner(const QCString& absDotName, const QCString& md5Hash)
+ : m_file(absDotName)
+ , m_md5Hash(md5Hash)
, m_dotExe(Config_getString(DOT_PATH)+"dot")
, m_cleanUp(Config_getBool(DOT_CLEANUP))
{
}
-void DotRunner::addJob(const char *format, const char *output)
+void DotRunner::addJob(const QCString &format, const QCString &output)
{
for (auto& s: m_jobs)
@@ -167,8 +157,8 @@ void DotRunner::addJob(const char *format, const char *output)
// we have this job already
return;
}
- auto args = std::string ("-T") + format + " -o \"" + output + "\"";
- m_jobs.emplace_back(format, output, args);
+ auto args = QCString("-T") + format + " -o \"" + output + "\"";
+ m_jobs.emplace_back(format.str(), output, args);
}
QCString getBaseNameOfOutput(const QCString &output)
@@ -187,20 +177,20 @@ bool DotRunner::run()
// create output
if (Config_getBool(DOT_MULTI_TARGETS))
{
- dotArgs=QCString("\"")+m_file.data()+"\"";
+ dotArgs=QCString("\"")+m_file+"\"";
for (auto& s: m_jobs)
{
dotArgs+=' ';
- dotArgs+=s.args.data();
+ dotArgs+=s.args;
}
- if ((exitCode=Portable::system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error;
+ if ((exitCode=Portable::system(m_dotExe,dotArgs,FALSE))!=0) goto error;
}
else
{
for (auto& s : m_jobs)
{
- dotArgs=QCString("\"")+m_file.data()+"\" "+s.args.data();
- if ((exitCode=Portable::system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error;
+ dotArgs=QCString("\"")+m_file+"\" "+s.args;
+ if ((exitCode=Portable::system(m_dotExe,dotArgs,FALSE))!=0) goto error;
}
}
@@ -208,35 +198,35 @@ bool DotRunner::run()
// As there should be only one pdf file be generated, we don't need code for regenerating multiple pdf files in one call
for (auto& s : m_jobs)
{
- if (s.format.compare(0, 3, "pdf") == 0)
+ if (s.format.left(3)=="pdf")
{
int width=0,height=0;
- if (!readBoundingBox(s.output.data(),&width,&height,FALSE)) goto error;
+ if (!readBoundingBox(s.output,&width,&height,FALSE)) goto error;
if ((width > MAX_LATEX_GRAPH_SIZE) || (height > MAX_LATEX_GRAPH_SIZE))
{
- if (!resetPDFSize(width,height,getBaseNameOfOutput(s.output.data()))) goto error;
- dotArgs=QCString("\"")+m_file.data()+"\" "+s.args.data();
- if ((exitCode=Portable::system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error;
+ if (!resetPDFSize(width,height,getBaseNameOfOutput(s.output))) goto error;
+ dotArgs=QCString("\"")+m_file+"\" "+s.args;
+ if ((exitCode=Portable::system(m_dotExe,dotArgs,FALSE))!=0) goto error;
}
}
- if (s.format.compare(0, 3, "png") == 0)
+ if (s.format.left(3)=="png")
{
- checkPngResult(s.output.data());
+ checkPngResult(s.output);
}
}
// remove .dot files
if (m_cleanUp)
{
- //printf("removing dot file %s\n",m_file.data());
- Portable::unlink(m_file.data());
+ //printf("removing dot file %s\n",qPrint(m_file));
+ Portable::unlink(m_file);
}
// create checksum file
- if (!m_md5Hash.empty())
+ if (!m_md5Hash.isEmpty())
{
- QCString md5Name = getBaseNameOfOutput(m_file.data()) + ".md5";
+ QCString md5Name = getBaseNameOfOutput(m_file) + ".md5";
FILE *f = Portable::fopen(md5Name,"w");
if (f)
{
@@ -247,7 +237,7 @@ bool DotRunner::run()
return TRUE;
error:
err("Problems running dot: exit code=%d, command='%s', arguments='%s'\n",
- exitCode,m_dotExe.data(),dotArgs.data());
+ exitCode,qPrint(m_dotExe),qPrint(dotArgs));
return FALSE;
}
diff --git a/src/dotrunner.h b/src/dotrunner.h
index 1b54617..19bdc79 100644
--- a/src/dotrunner.h
+++ b/src/dotrunner.h
@@ -24,26 +24,28 @@
#include <condition_variable>
#include <memory>
+#include "qcstring.h"
+
/** Helper class to run dot from doxygen from multiple threads. */
class DotRunner
{
struct DotJob
{
- DotJob(std::string f, std::string o, std::string a)
+ DotJob(const QCString &f, const QCString &o, const QCString &a)
: format(f), output(o), args(a) {}
- std::string format;
- std::string output;
- std::string args;
+ QCString format;
+ QCString output;
+ QCString args;
};
public:
/** Creates a runner for a dot \a file. */
- DotRunner(const std::string& absDotName, const std::string& md5Hash = std::string());
+ DotRunner(const QCString & absDotName, const QCString& md5Hash = QCString());
/** Adds an additional job to the run.
* Performing multiple jobs one file can be faster.
*/
- void addJob(const char *format,const char *output);
+ void addJob(const QCString &format,const QCString &output);
/** Prevent cleanup of the dot file (for user provided dot files) */
void preventCleanUp() { m_cleanUp = false; }
@@ -51,16 +53,15 @@ class DotRunner
/** Runs dot for all jobs added. */
bool run();
- // DotConstString const& getFileName() { return m_file; }
- std::string const & getMd5Hash() { return m_md5Hash; }
+ QCString getMd5Hash() { return m_md5Hash; }
- static bool readBoundingBox(const char* fileName, int* width, int* height, bool isEps);
+ static bool readBoundingBox(const QCString &fileName, int* width, int* height, bool isEps);
private:
- std::string m_file;
- std::string m_md5Hash;
- std::string m_dotExe;
- bool m_cleanUp;
+ QCString m_file;
+ QCString m_md5Hash;
+ QCString m_dotExe;
+ bool m_cleanUp;
std::vector<DotJob> m_jobs;
};
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 6257eb8..3850448 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -13,10 +13,6 @@
*
*/
-#include <qfileinfo.h>
-#include <qfile.h>
-#include <qdir.h>
-
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
@@ -106,6 +102,9 @@
#include "clangparser.h"
#include "symbolresolver.h"
#include "regex.h"
+#include "fileinfo.h"
+#include "dir.h"
+#include "conceptdef.h"
#if USE_SQLITE3
#include <sqlite3.h>
@@ -126,6 +125,7 @@ extern void initResources();
// globally accessible variables
ClassLinkedMap *Doxygen::classLinkedMap = 0;
ClassLinkedMap *Doxygen::hiddenClassLinkedMap = 0;
+ConceptLinkedMap *Doxygen::conceptLinkedMap = 0;
NamespaceLinkedMap *Doxygen::namespaceLinkedMap = 0;
MemberNameLinkedMap *Doxygen::memberNameLinkedMap = 0;
MemberNameLinkedMap *Doxygen::functionNameLinkedMap = 0;
@@ -186,6 +186,7 @@ void clearAll()
Doxygen::classLinkedMap->clear();
Doxygen::hiddenClassLinkedMap->clear();
+ Doxygen::conceptLinkedMap->clear();
Doxygen::namespaceLinkedMap->clear();
Doxygen::pageLinkedMap->clear();
Doxygen::exampleLinkedMap->clear();
@@ -247,7 +248,7 @@ class Statistics
} g_s;
-static void addMemberDocs(const Entry *root,MemberDefMutable *md, const char *funcDecl,
+static void addMemberDocs(const Entry *root,MemberDefMutable *md, const QCString &funcDecl,
const ArgumentList *al,bool over_load,uint64 spec);
static void findMember(const Entry *root,
const QCString &relates,
@@ -308,7 +309,7 @@ static void addRelatedPage(Entry *root)
{
if (!g.groupname.isEmpty() && (gd=Doxygen::groupLinkedMap->find(g.groupname))) break;
}
- //printf("---> addRelatedPage() %s gd=%p\n",root->name.data(),gd);
+ //printf("---> addRelatedPage() %s gd=%p\n",qPrint(root->name),gd);
QCString doc;
if (root->brief.isEmpty())
{
@@ -349,7 +350,7 @@ static void buildGroupListFiltered(const Entry *root,bool additional, bool inclu
{
GroupDef *gd = Doxygen::groupLinkedMap->find(root->name);
//printf("Processing group '%s':'%s' add=%d ext=%d gd=%p\n",
- // root->type.data(),root->name.data(),additional,includeExternal,gd);
+ // qPrint(root->type),qPrint(root->name),additional,includeExternal,gd);
if (gd)
{
@@ -448,7 +449,7 @@ static void organizeSubGroupsFiltered(const Entry *root,bool additional)
GroupDef *gd;
if ((gd=Doxygen::groupLinkedMap->find(root->name)))
{
- //printf("adding %s to group %s\n",root->name.data(),gd->name().data());
+ //printf("adding %s to group %s\n",qPrint(root->name),qPrint(gd->name()));
addGroupToGroups(root,gd);
}
}
@@ -487,7 +488,7 @@ static void buildFileList(const Entry *root)
fd=findFileDef(Doxygen::inputNameLinkedMap,fn.left(newIndex) + "/" + root->name,ambig);
if (!fd) ambig = save_ambig;
}
- //printf("**************** root->name=%s fd=%p\n",root->name.data(),fd);
+ //printf("**************** root->name=%s fd=%p\n",qPrint(root->name),fd);
if (fd && !ambig)
{
//printf("Adding documentation!\n");
@@ -505,13 +506,12 @@ static void buildFileList(const Entry *root)
{
gd->addFile(fd);
fd->makePartOfGroup(gd);
- //printf("File %s: in group %s\n",fd->name().data(),s->data());
+ //printf("File %s: in group %s\n",qPrint(fd->name()),qPrint(gd->name()));
}
}
}
else
{
- const char *fn = root->fileName.data();
QCString text(4096);
text.sprintf("the name '%s' supplied as "
"the argument in the \\file statement ",
@@ -527,13 +527,14 @@ static void buildFileList(const Entry *root)
{
text+="is not an input file";
}
- warn(fn,root->startLine,"%s", text.data());
+ warn(root->fileName,root->startLine,"%s", qPrint(text));
}
}
for (const auto &e : root->children()) buildFileList(e.get());
}
-static void addIncludeFile(ClassDefMutable *cd,FileDef *ifd,const Entry *root)
+template<class DefMutable>
+static void addIncludeFile(DefMutable *cd,FileDef *ifd,const Entry *root)
{
if (
(!root->doc.stripWhiteSpace().isEmpty() ||
@@ -542,7 +543,7 @@ static void addIncludeFile(ClassDefMutable *cd,FileDef *ifd,const Entry *root)
) && root->protection!=Private
)
{
- //printf(">>>>>> includeFile=%s\n",root->includeFile.data());
+ //printf(">>>>>> includeFile=%s\n",qPrint(root->includeFile));
bool local=Config_getBool(FORCE_LOCAL_INCLUDES);
QCString includeFile = root->includeFile;
@@ -560,7 +561,7 @@ static void addIncludeFile(ClassDefMutable *cd,FileDef *ifd,const Entry *root)
bool ambig;
FileDef *fd=0;
// see if we need to include a verbatim copy of the header file
- //printf("root->includeFile=%s\n",root->includeFile.data());
+ //printf("root->includeFile=%s\n",qPrint(root->includeFile));
if (!includeFile.isEmpty() &&
(fd=findFileDef(Doxygen::inputNameLinkedMap,includeFile,ambig))==0
)
@@ -581,7 +582,7 @@ static void addIncludeFile(ClassDefMutable *cd,FileDef *ifd,const Entry *root)
{
text+="is not an input file";
}
- warn(root->fileName,root->startLine, "%s", text.data());
+ warn(root->fileName,root->startLine, "%s", qPrint(text));
}
else if (includeFile.isEmpty() && ifd &&
// see if the file extension makes sense
@@ -641,7 +642,7 @@ static bool addNamespace(Entry *root,ClassDef *cd)
{
NamespaceDef *nd=0;
QCString nsName = stripAnonymousNamespaceScope(e->name);
- //printf("addNameSpace() trying: %s\n",nsName.data());
+ //printf("addNameSpace() trying: %s\n",qPrint(nsName));
if (!nsName.isEmpty() && nsName.at(0)!='@' &&
(nd=getResolvedNamespace(nsName))
)
@@ -663,14 +664,14 @@ static bool addNamespace(Entry *root,ClassDef *cd)
static Definition *findScope(Entry *root,int level=0)
{
if (root==0) return 0;
- //printf("start findScope name=%s\n",root->name.data());
+ //printf("start findScope name=%s\n",qPrint(root->name));
Definition *result=0;
if (root->section&Entry::SCOPE_MASK)
{
result = findScope(root->parent,level+1); // traverse to the root of the tree
if (result)
{
- //printf("Found %s inside %s at level %d\n",root->name.data(),result->name().data(),level);
+ //printf("Found %s inside %s at level %d\n",qPrint(root->name),qPrint(result->name()),level);
// TODO: look at template arguments
result = result->findInnerCompound(root->name);
}
@@ -678,11 +679,11 @@ static Definition *findScope(Entry *root,int level=0)
{
// TODO: look at template arguments
result = Doxygen::globalScope->findInnerCompound(root->name);
- //printf("Found in globalScope %s at level %d\n",result->name().data(),level);
+ //printf("Found in globalScope %s at level %d\n",qPrint(result->name()),level);
}
}
- //printf("end findScope(%s,%d)=%s\n",root->name.data(),
- // level,result==0 ? "<none>" : result->name().data());
+ //printf("end findScope(%s,%d)=%s\n",qPrint(root->name),
+ // level,result==0 ? "<none>" : qPrint(result->name()));
return result;
}
#endif
@@ -705,7 +706,7 @@ QCString stripTemplateSpecifiers(const QCString &s)
}
if (c=='>' && round==0 && count>0) count--;
}
- //printf("stripTemplateSpecifiers(%s)=%s\n",s.data(),result.data());
+ //printf("stripTemplateSpecifiers(%s)=%s\n",qPrint(s),qPrint(result));
return result;
}
@@ -713,11 +714,11 @@ QCString stripTemplateSpecifiers(const QCString &s)
* full qualified name \a name. Creates an artificial scope if the scope is
* not found and set the parent/child scope relation if the scope is found.
*/
-static Definition *buildScopeFromQualifiedName(const QCString name_,SrcLangExt lang,const TagInfo *tagInfo)
+static Definition *buildScopeFromQualifiedName(const QCString &name_,SrcLangExt lang,const TagInfo *tagInfo)
{
QCString name = stripTemplateSpecifiers(name_);
int level = name.contains("::");
- //printf("buildScopeFromQualifiedName(%s) level=%d\n",name.data(),level);
+ //printf("buildScopeFromQualifiedName(%s) level=%d\n",qPrint(name),level);
int i=0;
int p=0,l;
Definition *prevScope=Doxygen::globalScope;
@@ -741,7 +742,7 @@ static Definition *buildScopeFromQualifiedName(const QCString name_,SrcLangExt l
else if (nd==0 && cd==0 && fullScope.find('<')==-1) // scope is not known and could be a namespace!
{
// introduce bogus namespace
- //printf("++ adding dummy namespace %s to %s tagInfo=%p\n",nsName.data(),prevScope->name().data(),tagInfo);
+ //printf("++ adding dummy namespace %s to %s tagInfo=%p\n",qPrint(nsName),qPrint(prevScope->name()),tagInfo);
NamespaceDefMutable *newNd=
toNamespaceDefMutable(
Doxygen::namespaceLinkedMap->add(fullScope,
@@ -786,7 +787,7 @@ static Definition *buildScopeFromQualifiedName(const QCString name_,SrcLangExt l
static Definition *findScopeFromQualifiedName(NamespaceDefMutable *startScope,const QCString &n,
FileDef *fileScope,const TagInfo *tagInfo)
{
- //printf("<findScopeFromQualifiedName(%s,%s)\n",startScope ? startScope->name().data() : 0, n.data());
+ //printf("<findScopeFromQualifiedName(%s,%s)\n",startScope ? qPrint(startScope->name()) : 0, qPrint(n));
Definition *resultScope=toDefinition(startScope);
if (resultScope==0) resultScope=Doxygen::globalScope;
QCString scope=stripTemplateSpecifiersFromScope(n,FALSE);
@@ -802,7 +803,7 @@ static Definition *findScopeFromQualifiedName(NamespaceDefMutable *startScope,co
{
QCString nestedNameSpecifier = scope.mid(i1,l1);
Definition *orgScope = resultScope;
- //printf(" nestedNameSpecifier=%s\n",nestedNameSpecifier.data());
+ //printf(" nestedNameSpecifier=%s\n",qPrint(nestedNameSpecifier));
resultScope = const_cast<Definition*>(resultScope->findInnerCompound(nestedNameSpecifier));
//printf(" resultScope=%p\n",resultScope);
if (resultScope==0)
@@ -820,7 +821,7 @@ static Definition *findScopeFromQualifiedName(NamespaceDefMutable *startScope,co
// for a nested class A::I in used namespace N, we get
// N::A::I while looking for A, so we should compare
// resultScope->name() against scope.left(i2+l2)
- //printf(" -> result=%s scope=%s\n",resultScope->name().data(),scope.data());
+ //printf(" -> result=%s scope=%s\n",qPrint(resultScope->name()),qPrint(scope));
if (rightScopeMatch(resultScope->name(),scope.left(i2+l2)))
{
break;
@@ -843,16 +844,16 @@ static Definition *findScopeFromQualifiedName(NamespaceDefMutable *startScope,co
// so use this instead.
QCString fqn = QCString(usedName) + scope.right(scope.length()-p);
resultScope = buildScopeFromQualifiedName(fqn,startScope->getLanguage(),0);
- //printf("Creating scope from fqn=%s result %p\n",fqn.data(),resultScope);
+ //printf("Creating scope from fqn=%s result %p\n",qPrint(fqn),resultScope);
if (resultScope)
{
- //printf("> Match! resultScope=%s\n",resultScope->name().data());
+ //printf("> Match! resultScope=%s\n",qPrint(resultScope->name()));
return resultScope;
}
}
}
- //printf("> name %s not found in scope %s\n",nestedNameSpecifier.data(),orgScope->name().data());
+ //printf("> name %s not found in scope %s\n",qPrint(nestedNameSpecifier),qPrint(orgScope->name()));
return 0;
}
nextFragment:
@@ -860,7 +861,7 @@ static Definition *findScopeFromQualifiedName(NamespaceDefMutable *startScope,co
l1=l2;
p=i2+l2;
}
- //printf(">findScopeFromQualifiedName scope %s\n",resultScope->name().data());
+ //printf(">findScopeFromQualifiedName scope %s\n",qPrint(resultScope->name()));
return resultScope;
}
@@ -985,7 +986,7 @@ static void addClassToContext(const Entry *root)
Debug::print(Debug::Classes,0," Existing class %s!\n",qPrint(cd->name()));
//if (cd->templateArguments()==0)
//{
- // //printf("existing ClassDef tempArgList=%p specScope=%s\n",root->tArgList,root->scopeSpec.data());
+ // //printf("existing ClassDef tempArgList=%p specScope=%s\n",root->tArgList,qPrint(root->scopeSpec));
// cd->setTemplateArguments(tArgList);
//}
@@ -1013,6 +1014,10 @@ static void addClassToContext(const Entry *root)
cd->setTemplateArguments(*tArgList);
}
}
+ if (cd->requiresClause().isEmpty() && !root->req.isEmpty())
+ {
+ cd->setRequiresClause(root->req);
+ }
cd->setCompoundType(convertToCompoundType(root->section,root->spec));
@@ -1027,7 +1032,7 @@ static void addClassToContext(const Entry *root)
extractNamespaceName(fullName,className,namespaceName);
//printf("New class: fullname %s namespace '%s' name='%s' brief='%s' docs='%s'\n",
- // fullName.data(),namespaceName.data(),className.data(),root->brief.data(),root->doc.data());
+ // qPrint(fullName),qPrint(namespaceName),qPrint(className),qPrint(root->brief),qPrint(root->doc));
QCString tagName;
QCString refFileName;
@@ -1057,7 +1062,7 @@ static void addClassToContext(const Entry *root)
tArgList = getTemplateArgumentsFromName(fullName,root->tArgLists);
}
// add class to the list
- //printf("ClassDict.insert(%s)\n",fullName.data());
+ //printf("ClassDict.insert(%s)\n",qPrint(fullName));
cd = toClassDefMutable(
Doxygen::classLinkedMap->add(fullName,
std::unique_ptr<ClassDef>(
@@ -1075,14 +1080,15 @@ static void addClassToContext(const Entry *root)
cd->setArtificial(root->artificial);
cd->setClassSpecifier(root->spec);
cd->setTypeConstraints(root->typeConstr);
- //printf("new ClassDef %s tempArgList=%p specScope=%s\n",fullName.data(),root->tArgList,root->scopeSpec.data());
+ //printf("new ClassDef %s tempArgList=%p specScope=%s\n",qPrint(fullName),root->tArgList,qPrint(root->scopeSpec));
- //printf("class %s template args=%s\n",fullName.data(),
- // tArgList ? tempArgListToString(tArgList,root->lang).data() : "<none>");
+ //printf("class %s template args=%s\n",qPrint(fullName),
+ // tArgList ? tempArgListToString(tArgList,qPrint(root->lang)) : "<none>");
if (tArgList)
{
cd->setTemplateArguments(*tArgList);
}
+ cd->setRequiresClause(root->req);
cd->setProtection(root->protection);
cd->setIsStatic(root->stat);
@@ -1116,9 +1122,9 @@ static void addClassToContext(const Entry *root)
if (fd && (root->section & Entry::COMPOUND_MASK))
{
//printf(">> Inserting class '%s' in file '%s' (root->fileName='%s')\n",
- // cd->name().data(),
- // fd->name().data(),
- // root->fileName.data()
+ // qPrint(cd->name()),
+ // qPrint(fd->name()),
+ // qPrint(root->fileName)
// );
cd->setFileDef(fd);
fd->insertClass(cd);
@@ -1155,6 +1161,148 @@ static void buildClassDocList(const Entry *root)
for (const auto &e : root->children()) buildClassDocList(e.get());
}
+//----------------------------------------------------------------------
+// build a list of all classes mentioned in the documentation
+// and all classes that have a documentation block before their definition.
+
+static void addConceptToContext(const Entry *root)
+{
+ FileDef *fd = root->fileDef();
+
+ QCString scName;
+ if (root->parent()->section&Entry::SCOPE_MASK)
+ {
+ scName=root->parent()->name;
+ }
+
+ // name with scope (if not present already)
+ QCString qualifiedName = root->name;
+ if (!scName.isEmpty() && !leftScopeMatch(qualifiedName,scName))
+ {
+ qualifiedName.prepend(scName+"::");
+ }
+
+ // see if we already found the concept before
+ ConceptDefMutable *cd = getConceptMutable(qualifiedName);
+
+ Debug::print(Debug::Classes,0, " Found concept with name %s (qualifiedName=%s -> cd=%p)\n",
+ cd ? qPrint(cd->name()) : qPrint(root->name), qPrint(qualifiedName),cd);
+
+ if (cd)
+ {
+ qualifiedName=cd->name();
+ Debug::print(Debug::Classes,0," Existing concept %s!\n",qPrint(cd->name()));
+
+ cd->setDocumentation(root->doc,root->docFile,root->docLine);
+ cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
+
+ addIncludeFile(cd,fd,root);
+ }
+ else // new concept
+ {
+ QCString className;
+ QCString namespaceName;
+ extractNamespaceName(qualifiedName,className,namespaceName);
+
+ //printf("New concept: fullname %s namespace '%s' name='%s' brief='%s' docs='%s'\n",
+ // qPrint(qualifiedName),qPrint(namespaceName),qPrint(className),qPrint(root->brief),qPrint(root->doc));
+
+ QCString tagName;
+ QCString refFileName;
+ const TagInfo *tagInfo = root->tagInfo();
+ if (tagInfo)
+ {
+ tagName = tagInfo->tagName;
+ refFileName = tagInfo->fileName;
+ if (qualifiedName.find("::")!=-1)
+ // symbols imported via tag files may come without the parent scope,
+ // so we artificially create it here
+ {
+ buildScopeFromQualifiedName(qualifiedName,root->lang,tagInfo);
+ }
+ }
+ std::unique_ptr<ArgumentList> tArgList = getTemplateArgumentsFromName(qualifiedName,root->tArgLists);
+ // add concept to the list
+ //printf("ClassDict.insert(%s)\n",qPrint(fullName));
+ cd = toConceptDefMutable(
+ Doxygen::conceptLinkedMap->add(qualifiedName,
+ std::unique_ptr<ConceptDef>(
+ createConceptDef(tagInfo?tagName:root->fileName,root->startLine,root->startColumn,
+ qualifiedName,tagName,refFileName))));
+ if (cd)
+ {
+ Debug::print(Debug::Classes,0," New concept '%s' #tArgLists=%d tagInfo=%p\n",
+ qPrint(qualifiedName),root->tArgLists.size(),tagInfo);
+ cd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
+ cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
+ cd->setLanguage(root->lang);
+ cd->setId(root->id);
+ cd->setHidden(root->hidden);
+ cd->setInitializer(root->initializer.str().c_str());
+ if (tArgList)
+ {
+ cd->setTemplateArguments(*tArgList);
+ }
+ // file definition containing the class cd
+ cd->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
+ cd->setBodyDef(fd);
+ addIncludeFile(cd,fd,root);
+
+ // also add namespace to the correct structural context
+ Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,qualifiedName,0,tagInfo);
+ if (d && d->definitionType()==Definition::TypeNamespace)
+ {
+ DefinitionMutable *dm = toDefinitionMutable(d);
+ if (dm)
+ {
+ dm->addInnerCompound(cd);
+ }
+ cd->setOuterScope(d);
+ }
+ }
+ else
+ {
+ Debug::print(Debug::Classes,0," Not added concept '%s', already exists (as alias)\n", qPrint(qualifiedName));
+ }
+ }
+
+ if (cd)
+ {
+ cd->addSectionsToDefinition(root->anchors);
+ if (fd)
+ {
+ //printf(">> Inserting concept '%s' in file '%s' (root->fileName='%s')\n",
+ // qPrint(cd->name()),
+ // qPrint(fd->name()),
+ // qPrint(root->fileName)
+ // );
+ cd->setFileDef(fd);
+ fd->insertConcept(cd);
+ }
+ addConceptToGroups(root,cd);
+ cd->setRefItems(root->sli);
+ }
+}
+static void buildConceptList(const Entry *root)
+{
+ if (root->section & Entry::CONCEPT_SEC)
+ {
+ addConceptToContext(root);
+ }
+ for (const auto &e : root->children()) buildConceptList(e.get());
+}
+
+static void buildConceptDocList(const Entry *root)
+{
+ if (root->section & Entry::CONCEPTDOC_SEC)
+ {
+ addConceptToContext(root);
+ }
+ for (const auto &e : root->children()) buildConceptDocList(e.get());
+}
+
+//----------------------------------------------------------------------
+
static void resolveClassNestingRelations()
{
ClassDefSet visitedClasses;
@@ -1169,7 +1317,7 @@ static void resolveClassNestingRelations()
{
ClassAlias(const QCString &name,std::unique_ptr<ClassDef> cd,DefinitionMutable *ctx) :
aliasFullName(name),aliasCd(std::move(cd)), aliasContext(ctx) {}
- const QCString aliasFullName;
+ QCString aliasFullName;
std::unique_ptr<ClassDef> aliasCd;
DefinitionMutable *aliasContext;
};
@@ -1180,13 +1328,13 @@ static void resolveClassNestingRelations()
if (cd && visitedClasses.find(icd.get())==visitedClasses.end())
{
QCString name = stripAnonymousNamespaceScope(icd->name());
- //printf("processing=%s, iteration=%d\n",cd->name().data(),iteration);
+ //printf("processing=%s, iteration=%d\n",qPrint(cd->name()),iteration);
// also add class to the correct structural context
Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,
name,icd->getFileDef(),0);
if (d)
{
- //printf("****** adding %s to scope %s in iteration %d\n",cd->name().data(),d->name().data(),iteration);
+ //printf("****** adding %s to scope %s in iteration %d\n",qPrint(cd->name()),qPrint(d->name()),iteration);
DefinitionMutable *dm = toDefinitionMutable(d);
if (dm)
{
@@ -1225,7 +1373,7 @@ static void resolveClassNestingRelations()
}
//else
//{
- // printf("****** ignoring %s: scope not (yet) found in iteration %d\n",cd->name().data(),iteration);
+ // printf("****** ignoring %s: scope not (yet) found in iteration %d\n",qPrint(cd->name()),iteration);
//}
}
}
@@ -1247,7 +1395,7 @@ static void resolveClassNestingRelations()
if (cd && visitedClasses.find(icd.get())==visitedClasses.end())
{
QCString name = stripAnonymousNamespaceScope(cd->name());
- //printf("processing unresolved=%s, iteration=%d\n",cd->name().data(),iteration);
+ //printf("processing unresolved=%s, iteration=%d\n",qPrint(cd->name()),iteration);
/// create the scope artificially
// anyway, so we can at least relate scopes properly.
Definition *d = buildScopeFromQualifiedName(name,cd->getLanguage(),0);
@@ -1264,7 +1412,7 @@ static void resolveClassNestingRelations()
cd->setOuterScope(d);
warn(cd->getDefFileName(),cd->getDefLine(),
"Internal inconsistency: scope for class %s not "
- "found!",name.data()
+ "found!",qPrint(name)
);
}
}
@@ -1280,7 +1428,7 @@ void distributeClassGroupRelations()
ClassDefSet visitedClasses;
for (const auto &cd : *Doxygen::classLinkedMap)
{
- //printf("Checking %s\n",cd->name().data());
+ //printf("Checking %s\n",qPrint(cd->name()));
// distribute the group to nested classes as well
if (visitedClasses.find(cd.get())==visitedClasses.end() && !cd->partOfGroups().empty())
{
@@ -1291,7 +1439,7 @@ void distributeClassGroupRelations()
ClassDefMutable *ncdm = toClassDefMutable(ncd);
if (ncdm && ncdm->partOfGroups().empty())
{
- //printf(" Adding %s to group '%s'\n",ncd->name().data(),
+ //printf(" Adding %s to group '%s'\n",qPrint(ncd->name()),
// gd->groupTitle());
ncdm->makePartOfGroup(gd);
const_cast<GroupDef*>(gd)->addClass(ncdm);
@@ -1310,7 +1458,7 @@ static ClassDefMutable *createTagLessInstance(const ClassDef *rootCd,const Class
if (fullName.right(2)=="::") fullName=fullName.left(fullName.length()-2);
fullName+="."+fieldName;
- //printf("** adding class %s based on %s\n",fullName.data(),templ->name().data());
+ //printf("** adding class %s based on %s\n",qPrint(fullName),qPrint(templ->name()));
ClassDefMutable *cd = toClassDefMutable(
Doxygen::classLinkedMap->add(fullName,
std::unique_ptr<ClassDef>(
@@ -1354,7 +1502,7 @@ static ClassDefMutable *createTagLessInstance(const ClassDef *rootCd,const Class
{
for (const auto &md : *ml)
{
- //printf(" Member %s type=%s\n",md->name().data(),md->typeString());
+ //printf(" Member %s type=%s\n",qPrint(md->name()),md->typeString());
MemberDefMutable *imd = createMemberDef(md->getDefFileName(),md->getDefLine(),md->getDefColumn(),
md->typeString(),md->name(),md->argsString(),md->excpString(),
md->protection(),md->virtualness(),md->isStatic(),Member,
@@ -1367,6 +1515,7 @@ static ClassDefMutable *createTagLessInstance(const ClassDef *rootCd,const Class
imd->setMemberSpecifiers(md->getMemberSpecifiers());
imd->setMemberGroupId(md->getMemberGroupId());
imd->setInitializer(md->initializer());
+ imd->setRequiresClause(md->requiresClause());
imd->setMaxInitLines(md->initializerLines());
imd->setBitfields(md->bitfieldString());
imd->setLanguage(md->getLanguage());
@@ -1391,8 +1540,8 @@ static void processTagLessClasses(const ClassDef *rootCd,
ClassDefMutable *tagParentCd,
const QCString &prefix,int count)
{
- //printf("%d: processTagLessClasses %s\n",count,cd->name().data());
- //printf("checking members for %s\n",cd->name().data());
+ //printf("%d: processTagLessClasses %s\n",count,qPrint(cd->name()));
+ //printf("checking members for %s\n",qPrint(cd->name()));
if (tagParentCd && !cd->getClasses().empty())
{
MemberList *ml = cd->getMemberList(MemberListType_pubAttribs);
@@ -1405,19 +1554,19 @@ static void processTagLessClasses(const ClassDef *rootCd,
{
for (const auto &icd : cd->getClasses())
{
- //printf(" member %s: type='%s'\n",md->name().data(),type.data());
- //printf(" comparing '%s'<->'%s'\n",type.data(),icd->name().data());
+ //printf(" member %s: type='%s'\n",qPrint(md->name()),qPrint(type));
+ //printf(" comparing '%s'<->'%s'\n",qPrint(type),qPrint(icd->name()));
if (type.find(icd->name())!=-1) // matching tag less struct/union
{
QCString name = md->name();
if (md->isAnonymous()) name = "__unnamed" + name.right(name.length()-1)+"__";
if (!prefix.isEmpty()) name.prepend(prefix+".");
- //printf(" found %s for class %s\n",name.data(),cd->name().data());
+ //printf(" found %s for class %s\n",qPrint(name),qPrint(cd->name()));
ClassDefMutable *ncd = createTagLessInstance(rootCd,icd,name);
if (ncd)
{
processTagLessClasses(rootCd,icd,ncd,name,count+1);
- //printf(" addTagged %s to %s\n",ncd->name().data(),tagParentCd->name().data());
+ //printf(" addTagged %s to %s\n",qPrint(ncd->name()),qPrint(tagParentCd->name()));
ncd->setTagLessReference(icd);
// replace tag-less type for generated/original member
@@ -1500,7 +1649,7 @@ static void buildNamespaceList(const Entry *root)
!root->name.isEmpty()
)
{
- //printf("** buildNamespaceList(%s)\n",root->name.data());
+ //printf("** buildNamespaceList(%s)\n",qPrint(root->name));
QCString fName = root->name;
if (root->section==Entry::PACKAGEDOC_SEC)
@@ -1511,8 +1660,8 @@ static void buildNamespaceList(const Entry *root)
QCString fullName = stripAnonymousNamespaceScope(fName);
if (!fullName.isEmpty())
{
- //printf("Found namespace %s in %s at line %d\n",root->name.data(),
- // root->fileName.data(), root->startLine);
+ //printf("Found namespace %s in %s at line %d\n",qPrint(root->name),
+ // qPrint(root->fileName), root->startLine);
NamespaceDef *ndi = Doxygen::namespaceLinkedMap->find(fullName);
if (ndi) // existing namespace
{
@@ -1554,7 +1703,7 @@ static void buildNamespaceList(const Entry *root)
tagName = tagInfo->tagName;
tagFileName = tagInfo->fileName;
}
- //printf("++ new namespace %s lang=%s tagName=%s\n",fullName.data(),langToString(root->lang).data(),tagName.data());
+ //printf("++ new namespace %s lang=%s tagName=%s\n",qPrint(fullName),qPrint(langToString(root->lang)),qPrint(tagName));
// add namespace to the list
NamespaceDefMutable *nd = toNamespaceDefMutable(
Doxygen::namespaceLinkedMap->add(fullName,
@@ -1591,7 +1740,7 @@ static void buildNamespaceList(const Entry *root)
// also add namespace to the correct structural context
Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,fullName,0,tagInfo);
- //printf("adding namespace %s to context %s\n",nd->name().data(),d?d->name().data():"<none>");
+ //printf("adding namespace %s to context %s\n",qPrint(nd->name()),d?qPrint(d->name()):"<none>");
if (d==0) // we didn't find anything, create the scope artificially
// anyway, so we can at least relate scopes properly.
{
@@ -1671,7 +1820,7 @@ static void findUsingDirectives(const Entry *root)
if (root->section==Entry::USINGDIR_SEC)
{
//printf("Found using directive %s at line %d of %s\n",
- // root->name.data(),root->startLine,root->fileName.data());
+ // qPrint(root->name),root->startLine,qPrint(root->fileName));
QCString name=substitute(root->name,".","::");
if (name.right(2)=="::")
{
@@ -1707,7 +1856,7 @@ static void findUsingDirectives(const Entry *root)
QCString scope=scopeOffset>0 ?
nsName.left(scopeOffset)+"::" : QCString();
usingNd = getResolvedNamespace(scope+name);
- //printf("Trying with scope='%s' usingNd=%p\n",(scope+name).data(),usingNd);
+ //printf("Trying with scope='%s' usingNd=%p\n",(scope+qPrint(name)),usingNd);
if (scopeOffset==0)
{
scopeOffset=-1;
@@ -1745,7 +1894,7 @@ static void findUsingDirectives(const Entry *root)
usingNd = findUsedNamespace(fd->getUsedNamespaces(),name);
}
- //printf("%s -> %s\n",name.data(),usingNd?usingNd->name().data():"<none>");
+ //printf("%s -> %s\n",qPrint(name),usingNd?qPrint(usingNd->name()):"<none>");
// add the namespace the correct scope
if (usingNd)
@@ -1753,18 +1902,18 @@ static void findUsingDirectives(const Entry *root)
//printf("using fd=%p nd=%p\n",fd,nd);
if (nd)
{
- //printf("Inside namespace %s\n",nd->name().data());
+ //printf("Inside namespace %s\n",qPrint(nd->name()));
nd->addUsingDirective(usingNd);
}
else if (fd)
{
- //printf("Inside file %s\n",fd->name().data());
+ //printf("Inside file %s\n",qPrint(fd->name()));
fd->addUsingDirective(usingNd);
}
}
else // unknown namespace, but add it anyway.
{
- //printf("++ new unknown namespace %s lang=%s\n",name.data(),langToString(root->lang).data());
+ //printf("++ new unknown namespace %s lang=%s\n",qPrint(name),qPrint(langToString(root->lang)));
// add namespace to the list
nd = toNamespaceDefMutable(
Doxygen::namespaceLinkedMap->add(name,
@@ -1775,7 +1924,7 @@ static void findUsingDirectives(const Entry *root)
nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
nd->addSectionsToDefinition(root->anchors);
- //printf("** Adding namespace %s hidden=%d\n",name.data(),root->hidden);
+ //printf("** Adding namespace %s hidden=%d\n",qPrint(name),root->hidden);
nd->setHidden(root->hidden);
nd->setArtificial(TRUE);
nd->setLanguage(root->lang);
@@ -1830,7 +1979,7 @@ static void findUsingDeclarations(const Entry *root)
)
{
//printf("Found using declaration %s at line %d of %s inside section %x\n",
- // root->name.data(),root->startLine,root->fileName.data(),
+ // qPrint(root->name),root->startLine,qPrint(root->fileName),
// rootNav->parent()->section());
if (!root->name.isEmpty())
{
@@ -1870,7 +2019,7 @@ static void findUsingDeclarations(const Entry *root)
usingCd = toClassDefMutable(Doxygen::hiddenClassLinkedMap->find(name)); // check if it is already hidden
}
- //printf("%s -> %p\n",root->name.data(),usingCd);
+ //printf("%s -> %p\n",qPrint(root->name),usingCd);
if (usingCd==0) // definition not in the input => add an artificial class
{
Debug::print(Debug::Classes,0," New using class '%s' (sec=0x%08x)! #tArgLists=%d\n",
@@ -1896,12 +2045,12 @@ static void findUsingDeclarations(const Entry *root)
if (nd)
{
- //printf("Inside namespace %s\n",nd->name().data());
+ //printf("Inside namespace %s\n",qPrint(nd->name()));
nd->addUsingDeclaration(usingCd);
}
else if (fd)
{
- //printf("Inside file %s\n",fd->name().data());
+ //printf("Inside file %s\n",qPrint(fd->name()));
fd->addUsingDeclaration(usingCd);
}
}
@@ -1918,14 +2067,14 @@ static void findUsingDeclImports(const Entry *root)
)
{
//printf("Found using declaration %s inside section %x\n",
- // root->name.data(), root->parent()->section);
+ // qPrint(root->name), root->parent()->section);
QCString fullName=removeRedundantWhiteSpace(root->parent()->name);
fullName=stripAnonymousNamespaceScope(fullName);
fullName=stripTemplateSpecifiersFromScope(fullName);
ClassDefMutable *cd = getClassMutable(fullName);
if (cd)
{
- //printf("found class %s\n",cd->name().data());
+ //printf("found class %s\n",qPrint(cd->name()));
int i=root->name.find("::");
if (i!=-1)
{
@@ -1935,7 +2084,7 @@ static void findUsingDeclImports(const Entry *root)
const ClassDef *bcd = resolver.resolveClass(cd,scope); // todo: file in fileScope parameter
if (bcd && bcd!=cd)
{
- //printf("found class %s memName=%s\n",bcd->name().data(),memName.data());
+ //printf("found class %s memName=%s\n",qPrint(bcd->name()),qPrint(memName));
const MemberNameInfoLinkedMap &mnlm=bcd->memberNameInfoLinkedMap();
const MemberNameInfo *mni = mnlm.find(memName);
if (mni)
@@ -1984,6 +2133,7 @@ static void findUsingDeclImports(const Entry *root)
newMd->setBodySegment(md->getDefLine(),md->getStartBodyLine(),md->getEndBodyLine());
newMd->setBodyDef(md->getBodyDef());
newMd->setInitializer(md->initializer());
+ newMd->setRequiresClause(md->requiresClause());
newMd->setMaxInitLines(md->initializerLines());
newMd->setMemberGroupId(root->mGrpId);
newMd->setMemberSpecifiers(md->getMemberSpecifiers());
@@ -2013,7 +2163,7 @@ static void findIncludedUsingDirectives()
{
for (const auto &fd : *fn)
{
- //printf("----- adding using directives for file %s\n",fd->name().data());
+ //printf("----- adding using directives for file %s\n",qPrint(fd->name()));
fd->addIncludedUsingDirectives(visitedFiles);
}
}
@@ -2050,7 +2200,7 @@ static MemberDef *addVariableToClass(
qPrint(args),
root->protection,
fromAnnScope,
- qPrint(root->initializer)
+ qPrint(root->initializer.str())
);
QCString def;
@@ -2101,7 +2251,7 @@ static MemberDef *addVariableToClass(
for (const auto &imd : *mn)
{
//printf("md->getClassDef()=%p cd=%p type=[%s] md->typeString()=[%s]\n",
- // md->getClassDef(),cd,type.data(),md->typeString());
+ // md->getClassDef(),cd,qPrint(type),md->typeString());
MemberDefMutable *md = toMemberDefMutable(imd.get());
if (md &&
md->getClassDef()==cd &&
@@ -2149,7 +2299,8 @@ static MemberDef *addVariableToClass(
md->setFromAnonymousMember(fromAnnMemb);
//md->setIndentDepth(indentDepth);
md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
- md->setInitializer(root->initializer);
+ std::string init = root->initializer.str();
+ md->setInitializer(init.c_str());
md->setMaxInitLines(root->initLines);
md->setMemberGroupId(root->mGrpId);
md->setMemberSpecifiers(root->spec);
@@ -2166,7 +2317,7 @@ static MemberDef *addVariableToClass(
addMemberToGroups(root,md.get());
md->setBodyDef(root->fileDef());
- //printf(" New member adding to %s (%p)!\n",cd->name().data(),cd);
+ //printf(" New member adding to %s (%p)!\n",qPrint(cd->name()),cd);
cd->insertMember(md.get());
md->setRefItems(root->sli);
@@ -2174,7 +2325,7 @@ static MemberDef *addVariableToClass(
cd->insertUsedFile(root->fileDef());
root->markAsProcessed();
- //printf(" Adding member=%s\n",md->name().data());
+ //printf(" Adding member=%s\n",qPrint(md->name()));
// add the member to the global list
MemberDef *result = md.get();
mn = Doxygen::memberNameLinkedMap->add(name);
@@ -2372,7 +2523,7 @@ static MemberDef *addVariableToFile(
// new global variable, enum value or typedef
std::unique_ptr<MemberDefMutable> md { createMemberDef(
fileName,root->startLine,root->startColumn,
- type,name,args,0,
+ type,name,args,QCString(),
root->protection, Normal,root->stat,Member,
mtype,!root->tArgLists.empty() ? root->tArgLists.back() : ArgumentList(),
root->argList, root->metaData) };
@@ -2384,7 +2535,8 @@ static MemberDef *addVariableToFile(
md->addSectionsToDefinition(root->anchors);
md->setFromAnonymousScope(fromAnnScope);
md->setFromAnonymousMember(fromAnnMemb);
- md->setInitializer(root->initializer);
+ std::string init = root->initializer.str();
+ md->setInitializer(init.c_str());
md->setMaxInitLines(root->initLines);
md->setMemberGroupId(root->mGrpId);
md->setDefinition(def);
@@ -2485,7 +2637,7 @@ static bool isVarWithConstructor(const Entry *root)
int ti;
SymbolResolver resolver(fd);
- //printf("isVarWithConstructor(%s)\n",rootNav->name().data());
+ //printf("isVarWithConstructor(%s)\n",qPrint(rootNav->name()));
if (root->parent()->section & Entry::COMPOUND_MASK)
{ // inside a class
result=FALSE;
@@ -2578,7 +2730,7 @@ static bool isVarWithConstructor(const Entry *root)
if (reg::search(resType,match,idChars) && match.position()==0) // resType starts with identifier
{
resType=match.str();
- //printf("resType=%s\n",resType.data());
+ //printf("resType=%s\n",qPrint(resType));
if (resType=="int" || resType=="long" || resType=="float" ||
resType=="double" || resType=="char" || resType=="signed" ||
resType=="const" || resType=="unsigned" || resType=="void")
@@ -2592,8 +2744,8 @@ static bool isVarWithConstructor(const Entry *root)
}
done:
- //printf("isVarWithConstructor(%s,%s)=%d\n",rootNav->parent()->name().data(),
- // root->type.data(),result);
+ //printf("isVarWithConstructor(%s,%s)=%d\n",qPrint(rootNav->parent()->name()),
+ // qPrint(root->type),result);
return result;
}
@@ -2611,7 +2763,7 @@ static void addVariable(const Entry *root,int isFuncPtr=-1)
root->mGrpId,
qPrint(root->relates)
);
- //printf("root->parent->name=%s\n",root->parent->name.data());
+ //printf("root->parent->name=%s\n",qPrint(root->parent->name));
QCString type = root->type;
QCString name = root->name;
@@ -2635,7 +2787,7 @@ static void addVariable(const Entry *root,int isFuncPtr=-1)
if (j!=std::string::npos) args=sargs.substr(0,j); // extract, e.g '[10]' from '[10])'
}
//printf("new: type='%s' name='%s' args='%s'\n",
- // type.data(),name.data(),args.data());
+ // qPrint(type),qPrint(name),qPrint(args));
}
else
{
@@ -2654,7 +2806,7 @@ static void addVariable(const Entry *root,int isFuncPtr=-1)
{
type=type.left(type.length()-1);
args.prepend(") ");
- //printf("type=%s args=%s\n",type.data(),args.data());
+ //printf("type=%s args=%s\n",qPrint(type),qPrint(args));
}
}
}
@@ -2761,7 +2913,7 @@ static void addVariable(const Entry *root,int isFuncPtr=-1)
{
QCString pScope;
ClassDefMutable *pcd=0;
- pScope = scope.left(QMAX(si-2,0)); // scope without tag less parts
+ pScope = scope.left(std::max(si-2,0)); // scope without tag less parts
if (!pScope.isEmpty())
pScope.prepend(annScopePrefix);
else if (annScopePrefix.length()>2)
@@ -2795,8 +2947,8 @@ static void addVariable(const Entry *root,int isFuncPtr=-1)
}
//printf("name='%s' scope=%s scope.right=%s\n",
- // name.data(),scope.data(),
- // scope.right(scope.length()-si).data());
+ // qPrint(name),qPrint(scope),
+ // qPrint(scope.right(scope.length()-si)));
addVariableToClass(root, // entry
cd, // class to add member to
mtype, // member type
@@ -2810,7 +2962,7 @@ static void addVariable(const Entry *root,int isFuncPtr=-1)
}
else if (!name.isEmpty()) // global variable
{
- //printf("Inserting member in global scope %s!\n",scope.data());
+ //printf("Inserting member in global scope %s!\n",qPrint(scope));
addVariableToFile(root,mtype,scope,type,name,args,FALSE,/*0,*/0);
}
@@ -2821,7 +2973,7 @@ static void addVariable(const Entry *root,int isFuncPtr=-1)
// If found they are stored in their class or in the global list.
static void buildTypedefList(const Entry *root)
{
- //printf("buildVarList(%s)\n",rootNav->name().data());
+ //printf("buildVarList(%s)\n",qPrint(rootNav->name()));
if (!root->name.isEmpty() &&
root->section==Entry::VARIABLE_SEC &&
root->type.find("typedef ")!=-1 // its a typedef
@@ -2874,7 +3026,7 @@ static void buildDictionaryList(const Entry *root)
static void buildVarList(const Entry *root)
{
- //printf("buildVarList(%s) section=%08x\n",rootNav->name().data(),rootNav->section());
+ //printf("buildVarList(%s) section=%08x\n",qPrint(rootNav->name()),rootNav->section());
int isFuncPtr=-1;
if (!root->name.isEmpty() &&
(root->type.isEmpty() || g_compoundKeywords.find(root->type.str())==g_compoundKeywords.end()) &&
@@ -3080,7 +3232,7 @@ static void addMethodToClass(const Entry *root,ClassDefMutable *cd,
}
//printf("root->name='%s; args='%s' root->argList='%s'\n",
- // root->name.data(),args.data(),argListToString(root->argList).data()
+ // qPrint(root->name),qPrint(args),qPrint(argListToString(root->argList))
// );
// adding class member
@@ -3104,6 +3256,7 @@ static void addMethodToClass(const Entry *root,ClassDefMutable *cd,
md->setMemberGroupId(root->mGrpId);
md->setTypeConstraints(root->typeConstr);
md->setLanguage(root->lang);
+ md->setRequiresClause(root->req);
md->setId(root->id);
md->setBodyDef(fd);
md->setFileDef(fd);
@@ -3173,7 +3326,7 @@ static void addMethodToClass(const Entry *root,ClassDefMutable *cd,
md->setRefItems(root->sli);
// add member to the global list of all members
- //printf("Adding member=%s class=%s\n",md->name().data(),cd->name().data());
+ //printf("Adding member=%s class=%s\n",qPrint(md->name()),qPrint(cd->name()));
MemberName *mn = Doxygen::memberNameLinkedMap->add(name);
mn->push_back(std::move(md));
}
@@ -3185,7 +3338,7 @@ static void addGlobalFunction(const Entry *root,const QCString &rname,const QCSt
QCString scope = sc;
Debug::print(Debug::Functions,0," --> new function %s found!\n",qPrint(rname));
//printf("New function type='%s' name='%s' args='%s' bodyLine=%d\n",
- // root->type.data(),rname.data(),root->args.data(),root->bodyLine);
+ // qPrint(root->type),qPrint(rname),qPrint(root->args),root->bodyLine);
// new global function
QCString name=removeRedundantWhiteSpace(rname);
@@ -3213,6 +3366,7 @@ static void addGlobalFunction(const Entry *root,const QCString &rname,const QCSt
md->addSectionsToDefinition(root->anchors);
md->setMemberSpecifiers(root->spec);
md->setMemberGroupId(root->mGrpId);
+ md->setRequiresClause(root->req);
NamespaceDefMutable *nd = 0;
// see if the function is inside a namespace that was not part of
@@ -3291,7 +3445,7 @@ static void addGlobalFunction(const Entry *root,const QCString &rname,const QCSt
}
// add member to the list of file members
- //printf("Adding member=%s\n",md->name().data());
+ //printf("Adding member=%s\n",qPrint(md->name()));
MemberName *mn = Doxygen::functionNameLinkedMap->add(name);
mn->push_back(std::move(md));
}
@@ -3323,7 +3477,7 @@ static void buildFunctionList(const Entry *root)
bool isFriend=root->type.find("friend ")!=-1;
QCString rname = removeRedundantWhiteSpace(root->name);
- //printf("rname=%s\n",rname.data());
+ //printf("rname=%s\n",qPrint(rname));
QCString scope=root->parent()->name; //stripAnonymousNamespaceScope(root->parent->name);
if (!rname.isEmpty() && scope.find('@')==-1)
@@ -3405,7 +3559,7 @@ static void buildFunctionList(const Entry *root)
{
const NamespaceDef *mnd = md->getNamespaceDef();
NamespaceDef *rnd = 0;
- //printf("root namespace=%s\n",rootNav->parent()->name().data());
+ //printf("root namespace=%s\n",qPrint(rootNav->parent()->name()));
QCString fullScope = scope;
QCString parentScope = root->parent()->name;
if (!parentScope.isEmpty() && !leftScopeMatch(parentScope,scope))
@@ -3413,14 +3567,14 @@ static void buildFunctionList(const Entry *root)
if (!scope.isEmpty()) fullScope.prepend("::");
fullScope.prepend(parentScope);
}
- //printf("fullScope=%s\n",fullScope.data());
+ //printf("fullScope=%s\n",qPrint(fullScope));
rnd = getResolvedNamespace(fullScope);
const FileDef *mfd = md->getFileDef();
QCString nsName,rnsName;
- if (mnd) nsName = mnd->name().copy();
- if (rnd) rnsName = rnd->name().copy();
+ if (mnd) nsName = mnd->name();
+ if (rnd) rnsName = rnd->name();
//printf("matching arguments for %s%s %s%s\n",
- // md->name().data(),md->argsString(),rname.data(),argListToString(root->argList).data());
+ // qPrint(md->name()),md->argsString(),qPrint(rname),qPrint(argListToString(root->argList)));
const ArgumentList &mdAl = md->argumentList();
const ArgumentList &mdTempl = md->templateArguments();
@@ -3428,6 +3582,7 @@ static void buildFunctionList(const Entry *root)
// functions have the same number of template parameters
bool sameNumTemplateArgs = TRUE;
bool matchingReturnTypes = TRUE;
+ bool sameRequiresClause = TRUE;
if (!mdTempl.empty() && !root->tArgLists.empty())
{
if (mdTempl.size()!=root->tArgLists.back().size())
@@ -3438,6 +3593,10 @@ static void buildFunctionList(const Entry *root)
{
matchingReturnTypes = FALSE;
}
+ if (md->requiresClause()!=root->req)
+ {
+ sameRequiresClause = FALSE;
+ }
}
bool staticsInDifferentFiles =
@@ -3449,6 +3608,7 @@ static void buildFunctionList(const Entry *root)
FALSE) &&
sameNumTemplateArgs &&
matchingReturnTypes &&
+ sameRequiresClause &&
!staticsInDifferentFiles
)
{
@@ -3458,7 +3618,7 @@ static void buildFunctionList(const Entry *root)
gd = Doxygen::groupLinkedMap->find(root->groups.front().groupname);
}
//printf("match!\n");
- //printf("mnd=%p rnd=%p nsName=%s rnsName=%s\n",mnd,rnd,nsName.data(),rnsName.data());
+ //printf("mnd=%p rnd=%p nsName=%s rnsName=%s\n",mnd,rnd,qPrint(nsName),qPrint(rnsName));
// see if we need to create a new member
found=(mnd && rnd && nsName==rnsName) || // members are in the same namespace
((mnd==0 && rnd==0 && mfd!=0 && // no external reference and
@@ -3473,7 +3633,7 @@ static void buildFunctionList(const Entry *root)
}
//printf("combining function with prototype found=%d in namespace %s\n",
- // found,nsName.data());
+ // found,qPrint(nsName));
if (found)
{
@@ -3568,7 +3728,7 @@ static void buildFunctionList(const Entry *root)
}
//printf("unrelated function %d '%s' '%s' '%s'\n",
- // root->parent->section,root->type.data(),rname.data(),root->args.data());
+ // root->parent->section,qPrint(root->type),qPrint(rname),qPrint(root->args));
}
else
{
@@ -3770,7 +3930,7 @@ static void transferRelatedFunctionDocumentation()
MemberDefMutable *md = toMemberDefMutable(imd.get());
if (md)
{
- //printf(" Function '%s'\n",md->name().data());
+ //printf(" Function '%s'\n",qPrint(md->name()));
MemberName *rmn;
if ((rmn=Doxygen::memberNameLinkedMap->find(md->name()))) // check if there is a member with the same name
{
@@ -3788,7 +3948,7 @@ static void transferRelatedFunctionDocumentation()
)
)
{
- //printf(" Found related member '%s'\n",md->name().data());
+ //printf(" Found related member '%s'\n",qPrint(md->name()));
if (rmd->relatedAlso())
md->setRelatedAlso(rmd->relatedAlso());
else if (rmd->isForeign())
@@ -3823,7 +3983,7 @@ static TemplateNameMap getTemplateArgumentsInName(const ArgumentList &templateAr
{
const auto &match = *it;
std::string n = match.str();
- if (n==arg.name)
+ if (n==arg.name.str())
{
if (templateNames.find(n)==templateNames.end())
{
@@ -3863,10 +4023,10 @@ static ClassDef *findClassWithinClassContext(Definition *context,ClassDef *cd,co
}
//printf("3. result=%p\n",result);
//printf("** Trying to find %s within context %s class %s result=%s lookup=%p\n",
- // name.data(),
- // context ? context->name().data() : "<none>",
- // cd ? cd->name().data() : "<none>",
- // result ? result->name().data() : "<none>",
+ // qPrint(name),
+ // context ? qPrint(context->name()) : "<none>",
+ // cd ? qPrint(cd->name()) : "<none>",
+ // result ? qPrint(result->name()) : "<none>",
// Doxygen::classLinkedMap->find(name)
// );
return result;
@@ -3890,7 +4050,7 @@ static void findUsedClassesForClass(const Entry *root,
const MemberDef *md=mi->memberDef();
if (md->isVariable() || md->isObjCProperty()) // for each member variable in this class
{
- //printf(" Found variable %s in class %s\n",md->name().data(),masterCd->name().data());
+ //printf(" Found variable %s in class %s\n",qPrint(md->name()),qPrint(masterCd->name()));
QCString type = normalizeNonTemplateArgumentsInString(md->typeString(),masterCd,formalArgs);
QCString typedefValue = resolveTypeDef(masterCd,type);
if (!typedefValue.isEmpty())
@@ -3902,16 +4062,16 @@ static void findUsedClassesForClass(const Entry *root,
QCString templSpec;
bool found=FALSE;
// the type can contain template variables, replace them if present
- type = substituteTemplateArgumentsInString(type.str(),formalArgs,actualArgs);
+ type = substituteTemplateArgumentsInString(type,formalArgs,actualArgs);
- //printf(" template substitution gives=%s\n",type.data());
+ //printf(" template substitution gives=%s\n",qPrint(type));
while (!found && extractClassNameFromType(type,pos,usedClassName,templSpec,root->lang)!=-1)
{
// find the type (if any) that matches usedClassName
SymbolResolver resolver(masterCd->getFileDef());
const ClassDefMutable *typeCd = resolver.resolveClassMutable(masterCd,usedClassName,false,true);
//printf("====> usedClassName=%s -> typeCd=%s\n",
- // usedClassName.data(),typeCd?typeCd->name().data():"<none>");
+ // qPrint(usedClassName),typeCd?qPrint(typeCd->name()):"<none>");
if (typeCd)
{
usedClassName = typeCd->name();
@@ -3927,7 +4087,7 @@ static void findUsedClassesForClass(const Entry *root,
}
// add any template arguments to the class
QCString usedName = removeRedundantWhiteSpace(usedClassName+templSpec);
- //printf(" usedName=%s\n",usedName.data());
+ //printf(" usedName=%s\n",qPrint(usedName));
TemplateNameMap formTemplateNames;
if (templateNames.empty())
@@ -3957,7 +4117,7 @@ static void findUsedClassesForClass(const Entry *root,
ClassDef::Class))));
if (usedCdm)
{
- //printf("making %s a template argument!!!\n",usedCd->name().data());
+ //printf("making %s a template argument!!!\n",qPrint(usedCd->name()));
usedCdm->makeTemplateArgument();
usedCdm->setUsedOnly(TRUE);
usedCdm->setLanguage(masterCd->getLanguage());
@@ -3982,7 +4142,7 @@ static void findUsedClassesForClass(const Entry *root,
{
ClassDef *usedCd=findClassWithinClassContext(context,masterCd,usedName);
//printf("Looking for used class %s: result=%s master=%s\n",
- // usedName.data(),usedCd?usedCd->name().data():"<none>",masterCd?masterCd->name().data():"<none>");
+ // qPrint(usedName),usedCd?qPrint(usedCd->name()):"<none>",masterCd?qPrint(masterCd->name()):"<none>");
if (usedCd)
{
@@ -4054,15 +4214,15 @@ static void findBaseClassesForClass(
for (const BaseInfo &bi : root->extends)
{
//printf("masterCd=%s bi.name='%s' #actualArgs=%d\n",
- // masterCd->localName().data(),bi.name.data(),actualArgs ? (int)actualArgs->size() : -1);
+ // qPrint(masterCd->localName()),qPrint(bi.name),actualArgs ? (int)actualArgs->size() : -1);
TemplateNameMap formTemplateNames;
if (templateNames.empty())
{
formTemplateNames = getTemplateArgumentsInName(formalArgs,bi.name.str());
}
BaseInfo tbi = bi;
- tbi.name = substituteTemplateArgumentsInString(bi.name.str(),formalArgs,actualArgs);
- //printf("bi->name=%s tbi.name=%s\n",bi->name.data(),tbi.name.data());
+ tbi.name = substituteTemplateArgumentsInString(bi.name,formalArgs,actualArgs);
+ //printf("bi->name=%s tbi.name=%s\n",qPrint(bi->name),qPrint(tbi.name));
if (mode==DocumentedOnly)
{
@@ -4097,7 +4257,7 @@ static void findTemplateInstanceRelation(const Entry *root,
Debug::print(Debug::Classes,0," derived from template %s with parameters %s isArtificial=%d\n",
qPrint(templateClass->name()),qPrint(templSpec),isArtificial);
//printf("findTemplateInstanceRelation(base=%s templSpec=%s templateNames=",
- // templateClass->name().data(),templSpec.data());
+ // qPrint(templateClass->name()),qPrint(templSpec));
//for (const auto &kv : templNames)
//{
// printf("(%s->%d) ",kv.first.c_str(),kv.second);
@@ -4125,7 +4285,7 @@ static void findTemplateInstanceRelation(const Entry *root,
// search for new template instances caused by base classes of
// instanceClass
- auto it_pair = g_classEntries.equal_range(templateClass->name().data());
+ auto it_pair = g_classEntries.equal_range(templateClass->name().str());
for (auto it=it_pair.first ; it!=it_pair.second ; ++it)
{
const Entry *templateRoot = it->second;
@@ -4139,7 +4299,7 @@ static void findTemplateInstanceRelation(const Entry *root,
isArtificial,templArgs,templateNames);
}
- //Debug::print(Debug::Classes,0," Template instance %s : \n",instanceClass->name().data());
+ //Debug::print(Debug::Classes,0," Template instance %s : \n",qPrint(instanceClass->name()));
//ArgumentList *tl = templateClass->templateArguments();
}
else
@@ -4240,10 +4400,10 @@ static int findEndOfTemplate(const QCString &s,int startPos)
return brCount==0 ? e : -1;
}
-static int findTemplateSpecializationPosition(const char *name)
+static int findTemplateSpecializationPosition(const QCString &name)
{
- if (name==0 || name[0]=='\0') return 0;
- int l = static_cast<int>(strlen(name));
+ if (name.isEmpty()) return 0;
+ int l = static_cast<int>(name.length());
if (name[l-1]=='>') // search backward to find the matching <, allowing nested <...> and strings.
{
int count=1;
@@ -4281,7 +4441,7 @@ static bool findClassRelation(
)
{
//printf("findClassRelation(class=%s base=%s templateNames=",
- // cd->name().data(),bi->name.data());
+ // qPrint(cd->name()),qPrint(bi->name));
//for (const auto &kv : templateNames)
//{
// printf("(%s->%d) ",kv.first.c_str(),kv.second);
@@ -4290,7 +4450,7 @@ static bool findClassRelation(
QCString biName=bi->name;
bool explicitGlobalScope=FALSE;
- //printf("findClassRelation: biName='%s'\n",biName.data());
+ //printf("findClassRelation: biName='%s'\n",qPrint(biName));
if (biName.left(2)=="::") // explicit global scope
{
biName=biName.right(biName.length()-2);
@@ -4302,12 +4462,12 @@ static bool findClassRelation(
do // for each parent scope, starting with the largest scope
// (in case of nested classes)
{
- QCString scopeName= parentNode ? parentNode->name.data() : "";
+ QCString scopeName= parentNode ? parentNode->name : QCString();
int scopeOffset=explicitGlobalScope ? 0 : scopeName.length();
do // try all parent scope prefixes, starting with the largest scope
{
//printf("scopePrefix='%s' biName='%s'\n",
- // scopeName.left(scopeOffset).data(),biName.data());
+ // qPrint(scopeName.left(scopeOffset)),qPrint(biName));
QCString baseClassName=biName;
if (scopeOffset>0)
@@ -4327,12 +4487,12 @@ static bool findClassRelation(
const MemberDef *baseClassTypeDef = resolver.getTypedef();
QCString templSpec = resolver.getTemplateSpec();
//printf("baseClassName=%s baseClass=%p cd=%p explicitGlobalScope=%d\n",
- // baseClassName.data(),baseClass,cd,explicitGlobalScope);
+ // qPrint(baseClassName),baseClass,cd,explicitGlobalScope);
//printf(" scope='%s' baseClassName='%s' baseClass=%s templSpec=%s\n",
- // cd ? cd->name().data():"<none>",
- // baseClassName.data(),
- // baseClass?baseClass->name().data():"<none>",
- // templSpec.data()
+ // cd ? qPrint(cd->name()):"<none>",
+ // qPrint(baseClassName),
+ // baseClass?qPrint(baseClass->name()):"<none>",
+ // qPrint(templSpec)
// );
//if (baseClassName.left(root->name.length())!=root->name ||
// baseClassName.at(root->name.length())!='<'
@@ -4377,7 +4537,7 @@ static bool findClassRelation(
);
baseClassTypeDef = resolver.getTypedef();
//printf("baseClass=%p -> baseClass=%s templSpec=%s\n",
- // baseClass,baseClassName.data(),templSpec.data());
+ // baseClass,qPrint(baseClassName),qPrint(templSpec));
}
}
else if (baseClass && !templSpec.isEmpty()) // we have a known class, but also
@@ -4386,7 +4546,7 @@ static bool findClassRelation(
// instance (for instance if a class
// derived from a template argument)
{
- //printf("baseClass=%s templSpec=%s\n",baseClass->name().data(),templSpec.data());
+ //printf("baseClass=%s templSpec=%s\n",qPrint(baseClass->name()),qPrint(templSpec));
ClassDefMutable *templClass=getClassMutable(baseClass->name()+templSpec);
if (templClass)
{
@@ -4419,7 +4579,7 @@ static bool findClassRelation(
{
baseClass=toClassDefMutable(findClassWithinClassContext(context,cd,baseClassName));
//printf("findClassWithinClassContext(%s,%s)=%p\n",
- // cd->name().data(),baseClassName.data(),baseClass);
+ // qPrint(cd->name()),qPrint(baseClassName),baseClass);
found = baseClass!=0 && baseClass!=cd;
}
@@ -4428,7 +4588,7 @@ static bool findClassRelation(
{
// for PHP the "use A\B as C" construct map class C to A::B, so we lookup
// the class name also in the alias mapping.
- auto it = Doxygen::namespaceAliasMap.find(baseClassName.data());
+ auto it = Doxygen::namespaceAliasMap.find(baseClassName.str());
if (it!=Doxygen::namespaceAliasMap.end()) // see if it is indeed a class.
{
baseClass=getClassMutable(it->second.c_str());
@@ -4474,7 +4634,7 @@ static bool findClassRelation(
if (baseClassTypeDef || cd->isCSharp())
{
usedName=biName;
- //printf("***** usedName=%s templSpec=%s\n",usedName.data(),templSpec.data());
+ //printf("***** usedName=%s templSpec=%s\n",qPrint(usedName),qPrint(templSpec));
}
Protection prot = bi->prot;
if (Config_getBool(SIP_SUPPORT)) prot=Public;
@@ -4489,7 +4649,7 @@ static bool findClassRelation(
warn(root->fileName,root->startLine,
"Detected potential recursive class relation "
"between class %s and base class %s!",
- cd->name().data(),baseClass->name().data()
+ qPrint(cd->name()),qPrint(baseClass->name())
);
}
}
@@ -4524,7 +4684,7 @@ static bool findClassRelation(
{
baseClass = toClassDefMutable(Doxygen::classLinkedMap->find(baseClassName));
//printf("*** classDDict->find(%s)=%p biName=%s templSpec=%s\n",
- // baseClassName.data(),baseClass,biName.data(),templSpec.data());
+ // qPrint(baseClassName),baseClass,qPrint(biName),qPrint(templSpec));
if (baseClass==0) // not found (or alias)
{
baseClass = toClassDefMutable(
@@ -4591,7 +4751,7 @@ static bool findClassRelation(
warn(root->fileName,root->startLine,
"Detected potential recursive class relation "
"between class %s and base class %s!\n",
- root->name.data(),baseClassName.data()
+ qPrint(root->name),qPrint(baseClassName)
);
}
// for mode==TemplateInstance this case is quite common and
@@ -4691,7 +4851,7 @@ static void findInheritedTemplateInstances()
ClassDefMutable *cdm = toClassDefMutable(cd);
if (cdm)
{
- //printf("Class %s %zu\n",cd->name().data(),root->extends.size());
+ //printf("Class %s %zu\n",qPrint(cd->name()),root->extends.size());
findBaseClassesForClass(root,cd,cdm,cdm,TemplateInstances,FALSE);
}
}
@@ -4744,7 +4904,7 @@ static void computeClassRelations()
warn_undoc(
root->fileName,root->startLine,
"Compound %s is not documented.",
- root->name.data()
+ qPrint(root->name)
);
}
}
@@ -4801,7 +4961,7 @@ static void computeTemplateClassRelations()
}
}
- tbi.name = substituteTemplateArgumentsInString(bi.name.str(),tl,templArgs);
+ tbi.name = substituteTemplateArgumentsInString(bi.name,tl,templArgs);
// find a documented base class in the correct scope
if (!findClassRelation(root,cd,tcd,&tbi,actualTemplateNames,DocumentedOnly,FALSE))
{
@@ -4897,7 +5057,7 @@ static void addListReferences()
addRefItem(xrefItems,
name,
theTranslator->trPage(TRUE,TRUE),
- name,pd->title(),0,0);
+ name,pd->title(),QCString(),0);
}
}
@@ -4912,7 +5072,7 @@ static void addListReferences()
addRefItem(xrefItems,
name,
theTranslator->trDir(TRUE,TRUE),
- name,dd->displayName(),0,0);
+ name,dd->displayName(),QCString(),0);
}
}
@@ -4932,7 +5092,7 @@ static void generateXRefPages()
// over_load is set the standard overload text is added.
static void addMemberDocs(const Entry *root,
- MemberDefMutable *md, const char *funcDecl,
+ MemberDefMutable *md, const QCString &funcDecl,
const ArgumentList *al,
bool over_load,
uint64 spec
@@ -4940,7 +5100,7 @@ static void addMemberDocs(const Entry *root,
{
if (md==0) return;
//printf("addMemberDocs: '%s'::'%s' '%s' funcDecl='%s' mSpec=%lld\n",
- // root->parent()->name.data(),md->name().data(),md->argsString(),funcDecl,spec);
+ // qPrint(root->parent()->name),qPrint(md->name()),md->argsString(),funcDecl,spec);
QCString fDecl=funcDecl;
// strip extern specifier
fDecl.stripPrefix("extern ");
@@ -5017,13 +5177,18 @@ static void addMemberDocs(const Entry *root,
}
//printf("initializer: '%s'(isEmpty=%d) '%s'(isEmpty=%d)\n",
- // md->initializer().data(),md->initializer().isEmpty(),
- // root->initializer.data(),root->initializer.isEmpty()
+ // qPrint(md->initializer()),md->initializer().isEmpty(),
+ // qPrint(root->initializer),root->initializer.isEmpty()
// );
- if (md->initializer().isEmpty() && !root->initializer.isEmpty())
+ std::string rootInit = root->initializer.str();
+ if (md->initializer().isEmpty() && !rootInit.empty())
{
//printf("setInitializer\n");
- md->setInitializer(root->initializer);
+ md->setInitializer(rootInit.c_str());
+ }
+ if (md->requiresClause().isEmpty() && !root->req.isEmpty())
+ {
+ md->setRequiresClause(root->req);
}
md->setMaxInitLines(root->initLines);
@@ -5061,13 +5226,13 @@ static void addMemberDocs(const Entry *root,
root->fileName,root->startLine,
"member %s belongs to two different groups. The second "
"one found here will be ignored.",
- md->name().data()
+ qPrint(md->name())
);
}
}
else // set group id
{
- //printf("setMemberGroupId=%d md=%s\n",root->mGrpId,md->name().data());
+ //printf("setMemberGroupId=%d md=%s\n",root->mGrpId,qPrint(md->name()));
md->setMemberGroupId(root->mGrpId);
}
}
@@ -5078,7 +5243,7 @@ static void addMemberDocs(const Entry *root,
// template list specifier
static const ClassDef *findClassDefinition(FileDef *fd,NamespaceDef *nd,
- const char *scopeName)
+ const QCString &scopeName)
{
SymbolResolver resolver(fd);
const ClassDef *tcd = resolver.resolveClass(nd,scopeName,true,true);
@@ -5093,11 +5258,11 @@ static const ClassDef *findClassDefinition(FileDef *fd,NamespaceDef *nd,
static bool findGlobalMember(const Entry *root,
const QCString &namespaceName,
- const char *type,
- const char *name,
- const char *tempArg,
- const char *,
- const char *decl,
+ const QCString &type,
+ const QCString &name,
+ const QCString &tempArg,
+ const QCString &,
+ const QCString &decl,
uint64 spec)
{
Debug::print(Debug::FindMembers,0,
@@ -5173,7 +5338,7 @@ static bool findGlobalMember(const Entry *root,
}
const FileDef *fd=root->fileDef();
- //printf("File %s\n",fd ? fd->name().data() : "<none>");
+ //printf("File %s\n",fd ? qPrint(fd->name()) : "<none>");
LinkedRefMap<const NamespaceDef> nl;
if (fd)
{
@@ -5217,8 +5382,8 @@ static bool findGlobalMember(const Entry *root,
}
//printf("%s<->%s\n",
- // argListToString(md->argumentList()).data(),
- // argListToString(root->argList).data());
+ // qPrint(argListToString(md->argumentList())),
+ // qPrint(argListToString(root->argList)));
// for static members we also check if the comment block was found in
// the same file. This is needed because static members with the same
@@ -5231,13 +5396,14 @@ static bool findGlobalMember(const Entry *root,
matching = FALSE;
}
- // for template member we also need to check the return type
+ // for template member we also need to check the return type and requires
if (!md->templateArguments().empty() && !root->tArgLists.empty())
{
//printf("Comparing return types '%s'<->'%s'\n",
// md->typeString(),type);
if (md->templateArguments().size()!=root->tArgLists.back().size() ||
- qstrcmp(md->typeString(),type)!=0)
+ md->typeString()!=type ||
+ md->requiresClause()!=root->req)
{
//printf(" ---> no matching\n");
matching = FALSE;
@@ -5270,7 +5436,7 @@ static bool findGlobalMember(const Entry *root,
" of file "+md->getDefFileName()+"\n";
}
}
- warn(root->fileName,root->startLine, "%s", warnMsg.data());
+ warn(root->fileName,root->startLine, "%s", qPrint(warnMsg));
}
}
else // got docs for an undefined member!
@@ -5284,7 +5450,7 @@ static bool findGlobalMember(const Entry *root,
)
{
warn(root->fileName,root->startLine,
- "documented symbol '%s' was not declared or defined.",decl
+ "documented symbol '%s' was not declared or defined.",qPrint(decl)
);
}
}
@@ -5328,7 +5494,7 @@ static QCString substituteTemplatesInString(
static const reg::Ex re(R"(\a\w*)");
reg::Iterator it(src,re);
reg::Iterator end;
- //printf("type=%s\n",sa->type.data());
+ //printf("type=%s\n",qPrint(sa->type));
size_t p=0;
for (; it!=end ; ++it) // for each word in srcType
{
@@ -5363,9 +5529,9 @@ static QCString substituteTemplatesInString(
++tdaIt;
}
//if (tda) printf("tsa=%s|%s tda=%s|%s\n",
- // tsa.type.data(),tsa.name.data(),
- // tda->type.data(),tda->name.data());
- if (name==tsa.name)
+ // qPrint(tsa.type),qPrint(tsa.name),
+ // qPrint(tda->type),qPrint(tda->name));
+ if (name==tsa.name.str())
{
if (tda && tda->name.isEmpty())
{
@@ -5388,9 +5554,9 @@ static QCString substituteTemplatesInString(
}
//printf(" srcList='%s' dstList='%s faList='%s'\n",
- // argListToString(srclali.current()).data(),
- // argListToString(dstlali.current()).data(),
- // funcTempArgList ? argListToString(funcTempArgList).data() : "<none>");
+ // qPrint(argListToString(srclali.current())),
+ // qPrint(argListToString(dstlali.current())),
+ // funcTempArgList ? qPrint(argListToString(funcTempArgList)) : "<none>");
++srcIt;
}
dst+=name;
@@ -5398,7 +5564,7 @@ static QCString substituteTemplatesInString(
}
dst+=src.substr(p);
//printf(" substituteTemplatesInString(%s)=%s\n",
- // src.data(),dst.data());
+ // qPrint(src),qPrint(dst));
return dst;
}
@@ -5437,7 +5603,7 @@ static void substituteTemplatesInArgList(
srcTempArgLists,dstTempArgLists,
src.trailingReturnType().str()));
//printf("substituteTemplatesInArgList: replacing %s with %s\n",
- // argListToString(src).data(),argListToString(dst).data()
+ // qPrint(argListToString(src)),qPrint(argListToString(dst))
// );
}
@@ -5449,13 +5615,13 @@ static void addLocalObjCMethod(const Entry *root,
const QCString &exceptions,const QCString &funcDecl,
uint64 spec)
{
- //printf("scopeName='%s' className='%s'\n",scopeName.data(),className.data());
+ //printf("scopeName='%s' className='%s'\n",qPrint(scopeName),qPrint(className));
ClassDefMutable *cd=0;
if (Config_getBool(EXTRACT_LOCAL_METHODS) && (cd=getClassMutable(scopeName)))
{
Debug::print(Debug::FindMembers,0,"4. Local objective C method %s\n"
" scopeName=%s\n",qPrint(root->name),qPrint(scopeName));
- //printf("Local objective C method '%s' of class '%s' found\n",root->name.data(),cd->name().data());
+ //printf("Local objective C method '%s' of class '%s' found\n",qPrint(root->name),qPrint(cd->name()));
std::unique_ptr<MemberDefMutable> md { createMemberDef(
root->fileName,root->startLine,root->startColumn,
funcType,funcName,funcArgs,exceptions,
@@ -5533,13 +5699,13 @@ static void addMemberFunction(const Entry *root,
qPrint(md->argsString()),
qPrint(root->fileName));
//printf("Member %s (member scopeName=%s) (this scopeName=%s) isEnumValue()=%d\n",
- // md->name().data(),cd->name().data(),scopeName.data(),md->isEnumValue());
+ // qPrint(md->name()),qPrint(cd->name()),qPrint(scopeName),md->isEnumValue());
FileDef *fd=root->fileDef();
NamespaceDef *nd=0;
if (!namespaceName.isEmpty()) nd=getResolvedNamespace(namespaceName);
- //printf("scopeName %s->%s\n",scopeName.data(),
- // stripTemplateSpecifiersFromScope(scopeName,FALSE).data());
+ //printf("scopeName %s->%s\n",qPrint(scopeName),
+ // qPrint(stripTemplateSpecifiersFromScope(scopeName,FALSE)));
// if the member we are searching for is an enum value that is part of
// a "strong" enum, we need to look into the fields of the enum for a match
@@ -5550,7 +5716,7 @@ static void addMemberFunction(const Entry *root,
if (className.left(enumNamePos)==cd->name())
{
MemberName *enumMn=Doxygen::memberNameLinkedMap->find(enumName);
- //printf("enumMn(%s)=%p\n",className.data(),enumMn);
+ //printf("enumMn(%s)=%p\n",qPrint(className),enumMn);
if (enumMn)
{
for (const auto &emd : *enumMn)
@@ -5575,12 +5741,12 @@ static void addMemberFunction(const Entry *root,
tcd=cd;
}
//printf("Looking for %s inside nd=%s result=%p (%s) cd=%p\n",
- // scopeName.data(),nd?nd->name().data():"<none>",tcd,tcd?tcd->name().data():"",cd);
+ // qPrint(scopeName),nd?qPrint(nd->name()):"<none>",tcd,tcd?qPrint(tcd->name()):"",cd);
if (cd && tcd==cd) // member's classes match
{
Debug::print(Debug::FindMembers,0,
- "4. class definition %s found\n",cd->name().data());
+ "4. class definition %s found\n",qPrint(cd->name()));
// get the template parameter lists found at the member declaration
ArgumentLists declTemplArgs = cd->getTemplateParameterLists();
@@ -5649,8 +5815,7 @@ static void addMemberFunction(const Entry *root,
"5b. Comparing return types '%s'<->'%s' #args %d<->%d\n",
qPrint(md->typeString()),qPrint(funcType),
md->templateArguments().size(),root->tArgLists.back().size());
- if (md->templateArguments().size()!=root->tArgLists.back().size() ||
- qstrcmp(memType,funcType))
+ if (md->templateArguments().size()!=root->tArgLists.back().size() || memType!=funcType)
{
//printf(" ---> no matching\n");
matching = FALSE;
@@ -5731,7 +5896,7 @@ static void addMemberFunction(const Entry *root,
{
ClassDefMutable *ccd=md->getClassDefMutable();
MemberDef *cmd=md.get();
- //printf("ccd->name()==%s className=%s\n",ccd->name().data(),className.data());
+ //printf("ccd->name()==%s className=%s\n",qPrint(ccd->name()),qPrint(className));
if (ccd!=0 && rightScopeMatch(ccd->name(),className))
{
const ArgumentList &templAl = md->templateArguments();
@@ -5793,7 +5958,7 @@ static void addMemberFunction(const Entry *root,
warnMsg+='\n';
}
- QCString fullFuncDecl=funcDecl.copy();
+ QCString fullFuncDecl=funcDecl;
if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE);
warnMsg+=" ";
@@ -5817,7 +5982,7 @@ static void addMemberFunction(const Entry *root,
warnMsg+='\n';
warnMsg+=" ";
}
- if (md->typeString())
+ if (!md->typeString().isEmpty())
{
warnMsg+=md->typeString();
warnMsg+=' ';
@@ -5825,8 +5990,7 @@ static void addMemberFunction(const Entry *root,
QCString qScope = cd->qualifiedNameWithTemplateParameters();
if (!qScope.isEmpty())
warnMsg+=qScope+"::"+md->name();
- if (md->argsString())
- warnMsg+=md->argsString();
+ warnMsg+=md->argsString();
if (noMatchCount>1)
{
warnMsg+="' at line "+QCString().setNum(md->getDefLine()) +
@@ -5839,7 +6003,7 @@ static void addMemberFunction(const Entry *root,
}
}
}
- warn_simple(root->fileName,root->startLine,warnMsg);
+ warn_simple(root->fileName,root->startLine,qPrint(warnMsg));
}
}
@@ -5875,7 +6039,7 @@ static void addMemberSpecialization(const Entry *root,
declMd ? declMd->protection() : root->protection,
root->virt,root->stat,Member,
mtype,tArgList,root->argList,root->metaData) };
- //printf("new specialized member %s args='%s'\n",md->name().data(),funcArgs.data());
+ //printf("new specialized member %s args='%s'\n",qPrint(md->name()),qPrint(funcArgs));
md->setTagInfo(root->tagInfo());
md->setLanguage(root->lang);
md->setId(root->id);
@@ -5933,7 +6097,7 @@ static void addOverloaded(const Entry *root,MemberName *mn,
// new overloaded member function
std::unique_ptr<ArgumentList> tArgList =
getTemplateArgumentsFromName(cd->name()+"::"+funcName,root->tArgLists);
- //printf("new related member %s args='%s'\n",md->name().data(),funcArgs.data());
+ //printf("new related member %s args='%s'\n",qPrint(md->name()),qPrint(funcArgs));
std::unique_ptr<MemberDefMutable> md { createMemberDef(
root->fileName,root->startLine,root->startColumn,
funcType,funcName,funcArgs,exceptions,
@@ -6062,17 +6226,17 @@ static void findMember(const Entry *root,
" ::","::"
).stripWhiteSpace();
- //printf("funcDecl='%s'\n",funcDecl.data());
+ //printf("funcDecl='%s'\n",qPrint(funcDecl));
if (isFriend && funcDecl.left(6)=="class ")
{
//printf("friend class\n");
funcDecl=funcDecl.right(funcDecl.length()-6);
- funcName = funcDecl.copy();
+ funcName = funcDecl;
}
else if (isFriend && funcDecl.left(7)=="struct ")
{
funcDecl=funcDecl.right(funcDecl.length()-7);
- funcName = funcDecl.copy();
+ funcName = funcDecl;
}
else
{
@@ -6082,14 +6246,14 @@ static void findMember(const Entry *root,
);
}
//printf("scopeName='%s' funcType='%s' funcName='%s' funcArgs='%s'\n",
- // scopeName.data(),funcType.data(),funcName.data(),funcArgs.data());
+ // qPrint(scopeName),qPrint(funcType),qPrint(funcName),qPrint(funcArgs));
// the class name can also be a namespace name, we decide this later.
// if a related class name is specified and the class name could
// not be derived from the function declaration, then use the
// related field.
//printf("scopeName='%s' className='%s' namespaceName='%s'\n",
- // scopeName.data(),className.data(),namespaceName.data());
+ // qPrint(scopeName),qPrint(className),qPrint(namespaceName));
if (!relates.isEmpty())
{ // related member, prefix user specified scope
isRelated=TRUE;
@@ -6157,12 +6321,12 @@ static void findMember(const Entry *root,
// split scope into a namespace and a class part
extractNamespaceName(scopeName,className,namespaceName,TRUE);
//printf("scopeName='%s' className='%s' namespaceName='%s'\n",
- // scopeName.data(),className.data(),namespaceName.data());
+ // qPrint(scopeName),qPrint(className),qPrint(namespaceName));
//namespaceName=removeAnonymousScopes(namespaceName);
if (namespaceName.find('@')!=-1) return; // skip stuff in anonymous namespace...
- //printf("namespaceName='%s' className='%s'\n",namespaceName.data(),className.data());
+ //printf("namespaceName='%s' className='%s'\n",qPrint(namespaceName),qPrint(className));
// merge class and namespace scopes again
scopeName.resize(0);
if (!namespaceName.isEmpty())
@@ -6185,7 +6349,7 @@ static void findMember(const Entry *root,
{
scopeName=className;
}
- //printf("new scope='%s'\n",scopeName.data());
+ //printf("new scope='%s'\n",qPrint(scopeName));
QCString tempScopeName=scopeName;
ClassDefMutable *cd=getClassMutable(scopeName);
@@ -6202,9 +6366,9 @@ static void findMember(const Entry *root,
}
}
//printf("scopeName=%s cd=%p root->tArgLists=%p result=%s\n",
- // scopeName.data(),cd,root->tArgLists,tempScopeName.data());
+ // qPrint(scopeName),cd,root->tArgLists,qPrint(tempScopeName));
- //printf("scopeName='%s' className='%s'\n",scopeName.data(),className.data());
+ //printf("scopeName='%s' className='%s'\n",qPrint(scopeName),qPrint(className));
// rebuild the function declaration (needed to get the scope right).
if (!scopeName.isEmpty() && !isRelated && !isFriend && !Config_getBool(HIDE_SCOPE_NAMES))
{
@@ -6285,7 +6449,7 @@ static void findMember(const Entry *root,
if (!funcName.isEmpty()) // function name is valid
{
Debug::print(Debug::FindMembers,0,
- "1. funcName='%s'\n",funcName.data());
+ "1. funcName='%s'\n",qPrint(funcName));
// check if 'className' is actually a scoped enum, in which case we need to
// process it as a global, see issue #6471
@@ -6345,7 +6509,7 @@ static void findMember(const Entry *root,
else
{
//printf("*** Specialized member %s of unknown scope %s%s found!\n",
- // scopeName.data(),funcName.data(),funcArgs.data());
+ // qPrint(scopeName),qPrint(funcName),qPrint(funcArgs));
}
}
else if (overloaded) // check if the function belongs to only one class
@@ -6356,11 +6520,11 @@ static void findMember(const Entry *root,
{
if (!findGlobalMember(root,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl,spec))
{
- QCString fullFuncDecl=funcDecl.copy();
+ QCString fullFuncDecl=funcDecl;
if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE);
warn(root->fileName,root->startLine,
"Cannot determine class for function\n%s",
- fullFuncDecl.data()
+ qPrint(fullFuncDecl)
);
}
}
@@ -6370,7 +6534,7 @@ static void findMember(const Entry *root,
Debug::print(Debug::FindMembers,0,"2. related function\n"
" scopeName=%s className=%s\n",qPrint(scopeName),qPrint(className));
if (className.isEmpty()) className=relates;
- //printf("scopeName='%s' className='%s'\n",scopeName.data(),className.data());
+ //printf("scopeName='%s' className='%s'\n",qPrint(scopeName),qPrint(className));
if ((cd=getClassMutable(scopeName)))
{
bool newMember=TRUE; // assume we have a new member
@@ -6421,7 +6585,7 @@ static void findMember(const Entry *root,
}
if (rmd_found) // member already exists as rmd -> add docs
{
- //printf("addMemberDocs for related member %s\n",root->name.data());
+ //printf("addMemberDocs for related member %s\n",qPrint(root->name));
//rmd->setMemberDefTemplateArguments(root->mtArgList);
addMemberDocs(root,rmd_found,funcDecl,0,overloaded,spec);
}
@@ -6449,7 +6613,7 @@ static void findMember(const Entry *root,
funcDecl=funcType + " " + funcName;
}
- //printf("New related name '%s' '%d'\n",funcName.data(),
+ //printf("New related name '%s' '%d'\n",qPrint(funcName),
// root->argList ? (int)root->argList->count() : -1);
// first note that we pass:
@@ -6490,7 +6654,7 @@ static void findMember(const Entry *root,
md->setTagInfo(root->tagInfo());
//printf("Related member name='%s' decl='%s' bodyLine='%d'\n",
- // funcName.data(),funcDecl.data(),root->bodyLine);
+ // qPrint(funcName),qPrint(funcDecl),root->bodyLine);
// try to find the matching line number of the body from the
// global function list
@@ -6564,18 +6728,18 @@ static void findMember(const Entry *root,
{
addMemberToGroups(root,md.get());
}
- //printf("Adding member=%s\n",md->name().data());
+ //printf("Adding member=%s\n",qPrint(md->name()));
mn->push_back(std::move(md));
}
if (root->relatesType == Duplicate)
{
if (!findGlobalMember(root,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl,spec))
{
- QCString fullFuncDecl=funcDecl.copy();
+ QCString fullFuncDecl=funcDecl;
if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE);
warn(root->fileName,root->startLine,
"Cannot determine file/namespace for relatedalso function\n%s",
- fullFuncDecl.data()
+ qPrint(fullFuncDecl)
);
}
}
@@ -6585,7 +6749,7 @@ static void findMember(const Entry *root,
warn_undoc(root->fileName,root->startLine,
"class '%s' for related function '%s' is not "
"documented.",
- className.data(),funcName.data()
+ qPrint(className),qPrint(funcName)
);
}
}
@@ -6600,14 +6764,14 @@ static void findMember(const Entry *root,
{
warn(root->fileName,root->startLine,
"class for member '%s' cannot "
- "be found.", funcName.data()
+ "be found.", qPrint(funcName)
);
}
else if (!className.isEmpty() && !globMem)
{
warn(root->fileName,root->startLine,
"member '%s' of class '%s' cannot be found",
- funcName.data(),className.data());
+ qPrint(funcName),qPrint(className));
}
}
}
@@ -6624,14 +6788,14 @@ static void findMember(const Entry *root,
// find the members corresponding to the different documentation blocks
// that are extracted from the sources.
-static void filterMemberDocumentation(const Entry *root,const QCString relates)
+static void filterMemberDocumentation(const Entry *root,const QCString &relates)
{
int i=-1,l;
Debug::print(Debug::FindMembers,0,
"findMemberDocumentation(): root->type='%s' root->inside='%s' root->name='%s' root->args='%s' section=%x root->spec=%lld root->mGrpId=%d\n",
qPrint(root->type),qPrint(root->inside),qPrint(root->name),qPrint(root->args),root->section,root->spec,root->mGrpId
);
- //printf("root->parent()->name=%s\n",root->parent()->name.data());
+ //printf("root->parent()->name=%s\n",qPrint(root->parent()->name));
bool isFunc=TRUE;
QCString type = root->type;
@@ -6644,7 +6808,7 @@ static void filterMemberDocumentation(const Entry *root,const QCString relates)
// fix type and argument
args.prepend(type.right(type.length()-i-l));
type=type.left(i+l);
- //printf("Results type=%s,name=%s,args=%s\n",type.data(),root->name.data(),args.data());
+ //printf("Results type=%s,name=%s,args=%s\n",qPrint(type),qPrint(root->name),qPrint(args));
isFunc=FALSE;
}
else if ((type.left(8)=="typedef " && args.find('(')!=-1))
@@ -6653,12 +6817,12 @@ static void filterMemberDocumentation(const Entry *root,const QCString relates)
isFunc=FALSE;
}
- //printf("Member %s isFunc=%d\n",root->name.data(),isFunc);
+ //printf("Member %s isFunc=%d\n",qPrint(root->name),isFunc);
if (root->section==Entry::MEMBERDOC_SEC)
{
//printf("Documentation for inline member '%s' found args='%s'\n",
- // root->name.data(),args.data());
- //if (relates.length()) printf(" Relates %s\n",relates.data());
+ // qPrint(root->name),qPrint(args));
+ //if (relates.length()) printf(" Relates %s\n",qPrint(relates));
if (type.isEmpty())
{
findMember(root,
@@ -6682,7 +6846,7 @@ static void filterMemberDocumentation(const Entry *root,const QCString relates)
}
else if (root->section==Entry::OVERLOADDOC_SEC)
{
- //printf("Overloaded member %s found\n",root->name.data());
+ //printf("Overloaded member %s found\n",qPrint(root->name));
findMember(root,
relates,
type,
@@ -6703,9 +6867,9 @@ static void filterMemberDocumentation(const Entry *root,const QCString relates)
)
{
//printf("Documentation for member '%s' found args='%s' excp='%s'\n",
- // root->name.data(),args.data(),root->exception.data());
- //if (relates.length()) printf(" Relates %s\n",relates.data());
- //printf("Inside=%s\n Relates=%s\n",root->inside.data(),relates.data());
+ // qPrint(root->name),qPrint(args),qPrint(root->exception));
+ //if (relates.length()) printf(" Relates %s\n",qPrint(relates));
+ //printf("Inside=%s\n Relates=%s\n",qPrint(root->inside),qPrint(relates));
if (type=="friend class" || type=="friend struct" ||
type=="friend union")
{
@@ -6748,8 +6912,8 @@ static void filterMemberDocumentation(const Entry *root,const QCString relates)
}
else if (root->section==Entry::VARIABLEDOC_SEC)
{
- //printf("Documentation for variable %s found\n",root->name.data());
- //if (!relates.isEmpty()) printf(" Relates %s\n",relates.data());
+ //printf("Documentation for variable %s found\n",qPrint(root->name));
+ //if (!relates.isEmpty()) printf(" Relates %s\n",qPrint(relates));
findMember(root,
relates,
type,
@@ -6815,7 +6979,7 @@ static void findObjCMethodDefinitions(const Entry *root)
{
if (objCMethod->section==Entry::FUNCTION_SEC)
{
- //Printf(" Found ObjC method definition %s\n",objCMethod->name.data());
+ //Printf(" Found ObjC method definition %s\n",qPrint(objCMethod->name));
findMember(objCMethod.get(),
objCMethod->relates,
objCMethod->type,
@@ -6843,7 +7007,7 @@ static void findEnums(const Entry *root)
bool isGlobal;
bool isRelated=FALSE;
bool isMemberOf=FALSE;
- //printf("Found enum with name '%s' relates=%s\n",root->name.data(),root->relates.data());
+ //printf("Found enum with name '%s' relates=%s\n",qPrint(root->name),qPrint(root->relates));
int i;
QCString name;
@@ -6874,13 +7038,13 @@ static void findEnums(const Entry *root)
if (getClass(root->relates)==0 && !scope.isEmpty())
scope=mergeScopes(scope,root->relates);
else
- scope=root->relates.copy();
+ scope=root->relates;
if ((cd=getClassMutable(scope))==0) nd=getResolvedNamespaceMutable(scope);
}
if (cd && !name.isEmpty()) // found a enum inside a compound
{
- //printf("Enum '%s'::'%s'\n",cd->name().data(),name.data());
+ //printf("Enum '%s'::'%s'\n",qPrint(cd->name()),qPrint(name));
fd=0;
mnsd=Doxygen::memberNameLinkedMap;
isGlobal=FALSE;
@@ -6902,7 +7066,7 @@ static void findEnums(const Entry *root)
// new enum type
std::unique_ptr<MemberDefMutable> md { createMemberDef(
root->fileName,root->startLine,root->startColumn,
- 0,name,0,0,
+ QCString(),name,QCString(),QCString(),
root->protection,Normal,FALSE,
isMemberOf ? Foreign : isRelated ? Related : Member,
MemberType_Enumeration,
@@ -6916,16 +7080,16 @@ static void findEnums(const Entry *root)
md->setMemberSpecifiers(root->spec);
md->setEnumBaseType(root->args);
//printf("Enum %s definition at line %d of %s: protection=%d scope=%s\n",
- // root->name.data(),root->bodyLine,root->fileName.data(),root->protection,cd?cd->name().data():"<none>");
+ // qPrint(root->name),root->bodyLine,qPrint(root->fileName),root->protection,cd?qPrint(cd->name()):"<none>");
md->addSectionsToDefinition(root->anchors);
md->setMemberGroupId(root->mGrpId);
md->enableCallGraph(root->callGraph);
md->enableCallerGraph(root->callerGraph);
md->enableReferencedByRelation(root->referencedByRelation);
md->enableReferencesRelation(root->referencesRelation);
- //printf("%s::setRefItems(%zu)\n",md->name().data(),root->sli.size());
+ //printf("%s::setRefItems(%zu)\n",qPrint(md->name()),root->sli.size());
md->setRefItems(root->sli);
- //printf("found enum %s nd=%p\n",md->name().data(),nd);
+ //printf("found enum %s nd=%p\n",qPrint(md->name()),nd);
bool defSet=FALSE;
QCString baseType = root->args;
@@ -6984,7 +7148,7 @@ static void findEnums(const Entry *root)
md->setBriefDescription(root->brief,root->briefFile,root->briefLine);
md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine);
- //printf("Adding member=%s\n",md->name().data());
+ //printf("Adding member=%s\n",qPrint(md->name()));
addMemberToGroups(root,md.get());
MemberName *mn = mnsd->add(name);
@@ -7010,7 +7174,7 @@ static void addEnumValuesToEnums(const Entry *root)
MemberNameLinkedMap *mnsd=0;
bool isGlobal;
bool isRelated=FALSE;
- //printf("Found enum with name '%s' relates=%s\n",root->name.data(),root->relates.data());
+ //printf("Found enum with name '%s' relates=%s\n",qPrint(root->name),qPrint(root->relates));
int i;
QCString name;
@@ -7040,34 +7204,34 @@ static void addEnumValuesToEnums(const Entry *root)
if (getClassMutable(root->relates)==0 && !scope.isEmpty())
scope=mergeScopes(scope,root->relates);
else
- scope=root->relates.copy();
+ scope=root->relates;
if ((cd=getClassMutable(scope))==0) nd=getResolvedNamespaceMutable(scope);
}
if (cd && !name.isEmpty()) // found a enum inside a compound
{
- //printf("Enum in class '%s'::'%s'\n",cd->name().data(),name.data());
+ //printf("Enum in class '%s'::'%s'\n",qPrint(cd->name()),qPrint(name));
fd=0;
mnsd=Doxygen::memberNameLinkedMap;
isGlobal=FALSE;
}
else if (nd && !nd->isAnonymous()) // found enum inside namespace
{
- //printf("Enum in namespace '%s'::'%s'\n",nd->name().data(),name.data());
+ //printf("Enum in namespace '%s'::'%s'\n",qPrint(nd->name()),qPrint(name));
mnsd=Doxygen::functionNameLinkedMap;
isGlobal=TRUE;
}
else // found a global enum
{
fd=root->fileDef();
- //printf("Enum in file '%s': '%s'\n",fd->name().data(),name.data());
+ //printf("Enum in file '%s': '%s'\n",qPrint(fd->name()),qPrint(name));
mnsd=Doxygen::functionNameLinkedMap;
isGlobal=TRUE;
}
if (!name.isEmpty())
{
- //printf("** name=%s\n",name.data());
+ //printf("** name=%s\n",qPrint(name));
MemberName *mn = mnsd->find(name); // for all members with this name
if (mn)
{
@@ -7101,7 +7265,7 @@ static void addEnumValuesToEnums(const Entry *root)
// values are only visible inside the enum scope, so we must create
// them here and only add them to the enum
//printf("md->qualifiedName()=%s e->name=%s tagInfo=%p name=%s\n",
- // md->qualifiedName().data(),e->name.data(),e->tagInfo,e->name.data());
+ // qPrint(md->qualifiedName()),qPrint(e->name),e->tagInfo,qPrint(e->name));
QCString qualifiedName = substitute(root->name,"::",".");
if (!scope.isEmpty() && root->tagInfo())
{
@@ -7118,7 +7282,7 @@ static void addEnumValuesToEnums(const Entry *root)
}
std::unique_ptr<MemberDefMutable> fmd { createMemberDef(
fileName,e->startLine,e->startColumn,
- e->type,e->name,e->args,0,
+ e->type,e->name,e->args,QCString(),
e->protection, Normal,e->stat,Member,
MemberType_EnumValue,ArgumentList(),ArgumentList(),e->metaData) };
const NamespaceDef *mnd = md->getNamespaceDef();
@@ -7135,7 +7299,8 @@ static void addEnumValuesToEnums(const Entry *root)
fmd->setDocumentation(e->doc,e->docFile,e->docLine);
fmd->setBriefDescription(e->brief,e->briefFile,e->briefLine);
fmd->addSectionsToDefinition(e->anchors);
- fmd->setInitializer(e->initializer);
+ std::string init = e->initializer.str();
+ fmd->setInitializer(init.c_str());
fmd->setMaxInitLines(e->initLines);
fmd->setMemberGroupId(e->mGrpId);
fmd->setExplicitExternal(e->explicitExternal,fileName,e->startLine,e->startColumn);
@@ -7148,7 +7313,7 @@ static void addEnumValuesToEnums(const Entry *root)
}
else
{
- //printf("e->name=%s isRelated=%d\n",e->name.data(),isRelated);
+ //printf("e->name=%s isRelated=%d\n",qPrint(e->name),isRelated);
MemberName *fmn=0;
MemberNameLinkedMap *emnsd = isRelated ? Doxygen::functionNameLinkedMap : mnsd;
if (!e->name.isEmpty() && (fmn=emnsd->find(e->name)))
@@ -7160,7 +7325,7 @@ static void addEnumValuesToEnums(const Entry *root)
if (fmd && fmd->isEnumValue() && fmd->getOuterScope()==md->getOuterScope()) // in same scope
{
//printf("found enum value with same name %s in scope %s\n",
- // fmd->name().data(),fmd->getOuterScope()->name().data());
+ // qPrint(fmd->name()),qPrint(fmd->getOuterScope()->name()));
if (nd && !nd->isAnonymous())
{
const NamespaceDef *fnd=fmd->getNamespaceDef();
@@ -7195,7 +7360,7 @@ static void addEnumValuesToEnums(const Entry *root)
if (fcd==cd) // enum value is inside a class
{
//printf("Inserting enum field %s in enum scope %s\n",
- // fmd->name().data(),md->name().data());
+ // qPrint(fmd->name()),qPrint(md->name()));
md->insertEnumField(fmd); // add field def to list
fmd->setEnumScope(md); // cross ref with enum name
}
@@ -7238,7 +7403,7 @@ static void addEnumDocs(const Entry *root,MemberDefMutable *md)
md->setBriefDescription(root->brief,root->briefFile,root->briefLine);
}
- if (!md->inbodyDocumentation() || !root->parent()->name.isEmpty())
+ if (md->inbodyDocumentation().isEmpty() || !root->parent()->name.isEmpty())
{
md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine);
}
@@ -7276,7 +7441,7 @@ static void findEnumDocumentation(const Entry *root)
{
name=root->name.right(root->name.length()-i-2); // extract name
scope=root->name.left(i); // extract scope
- //printf("Scope='%s' Name='%s'\n",scope.data(),name.data());
+ //printf("Scope='%s' Name='%s'\n",qPrint(scope),qPrint(name));
}
else // just the name
{
@@ -7293,10 +7458,10 @@ static void findEnumDocumentation(const Entry *root)
const NamespaceDef *nd=Doxygen::namespaceLinkedMap->find(scope);
const FileDef *fd = root->fileDef();
Debug::print(Debug::FindMembers,0,"1. Found docs for enum with name '%s' and scope '%s' in context %s cd=%s, nd=%s fd=%s\n",
- name.data(),scope.data(),root->parent()->name.data(),
- cd?cd->name().data():"<none>",
- nd?nd->name().data():"<none>",
- fd?fd->name().data():"<none>");
+ qPrint(name),qPrint(scope),qPrint(root->parent()->name),
+ cd?qPrint(cd->name()):"<none>",
+ nd?qPrint(nd->name()):"<none>",
+ fd?qPrint(fd->name()):"<none>");
if (!name.isEmpty())
{
@@ -7348,7 +7513,7 @@ static void findEnumDocumentation(const Entry *root)
{
warn(root->fileName,root->startLine,
"Documentation for undefined enum '%s' found.",
- name.data()
+ qPrint(name)
);
}
}
@@ -7481,8 +7646,8 @@ static void computeMemberRelations()
{
const ClassDef *bmcd = bmd->getClassDef();
//printf("Check relation between '%s'::'%s' (%p) and '%s'::'%s' (%p)\n",
- // mcd->name().data(),md->name().data(),md.get(),
- // bmcd->name().data(),bmd->name().data(),bmd.get()
+ // qPrint(mcd->name()),qPrint(md->name()),md.get(),
+ // qPrint(bmcd->name()),qPrint(bmd->name()),bmd.get()
// );
if (bmcd && mcd && bmcd!=mcd &&
(bmd->virtualness()!=Normal ||
@@ -7498,8 +7663,8 @@ static void computeMemberRelations()
const ArgumentList &bmdAl = bmd->argumentList();
const ArgumentList &mdAl = md->argumentList();
//printf(" Base argList='%s'\n Super argList='%s'\n",
- // argListToString(bmdAl).data(),
- // argListToString(mdAl).data()
+ // qPrint(argListToString(bmdAl)),
+ // qPrint(argListToString(mdAl))
// );
if (
matchArguments2(bmd->getOuterScope(),bmd->getFileDef(),&bmdAl,
@@ -7515,7 +7680,7 @@ static void computeMemberRelations()
//printf("setting (new) reimplements member\n");
md->setReimplements(bmd);
}
- //printf("%s: add reimplementedBy member %s\n",bmcd->name().data(),mcd->name().data());
+ //printf("%s: add reimplementedBy member %s\n",qPrint(bmcd->name()),qPrint(mcd->name()));
bmd->insertReimplementedBy(md);
}
else
@@ -7565,7 +7730,7 @@ static void mergeCategories()
if (baseClass)
{
//printf("*** merging members of category %s into %s\n",
- // cd->name().data(),baseClass->name().data());
+ // qPrint(cd->name()),qPrint(baseClass->name()));
baseClass->mergeCategory(cd.get());
}
}
@@ -7586,7 +7751,7 @@ static void buildCompleteMemberLists()
ClassDefMutable *cdm = toClassDefMutable(cd.get());
if (cdm)
{
- //printf("*** merging members for %s\n",cd->name().data());
+ //printf("*** merging members for %s\n",qPrint(cd->name()));
cdm->mergeMembers();
}
}
@@ -7637,7 +7802,7 @@ static void generateFileSources()
auto clangParser = ClangParser::instance()->createTUParser(fd.get());
if (fd->generateSourceFile() && !g_useOutputTemplate) // sources need to be shown in the output
{
- msg("Generating code for file %s...\n",fd->docName().data());
+ msg("Generating code for file %s...\n",qPrint(fd->docName()));
clangParser->parse();
fd->writeSourceHeader(*g_outputList);
fd->writeSourceBody(*g_outputList,clangParser.get());
@@ -7646,7 +7811,7 @@ static void generateFileSources()
else if (!fd->isReference() && Doxygen::parseSourcesNeeded)
// we needed to parse the sources even if we do not show them
{
- msg("Parsing code for file %s...\n",fd->docName().data());
+ msg("Parsing code for file %s...\n",qPrint(fd->docName()));
clangParser->parse();
fd->parseSource(clangParser.get());
}
@@ -7654,7 +7819,7 @@ static void generateFileSources()
for (auto incFile : clangParser->filesInSameTU())
{
if (filesToProcess.find(incFile)!=filesToProcess.end() && // part of input
- fd->absFilePath()!=incFile && // not same file
+ fd->absFilePath()!=QCString(incFile) && // not same file
processedFiles.find(incFile)==processedFiles.end()) // not yet marked as processed
{
StringVector moreFiles;
@@ -7664,7 +7829,7 @@ static void generateFileSources()
{
if (ifd->generateSourceFile() && !g_useOutputTemplate) // sources need to be shown in the output
{
- msg(" Generating code for file %s...\n",ifd->docName().data());
+ msg(" Generating code for file %s...\n",qPrint(ifd->docName()));
ifd->writeSourceHeader(*g_outputList);
ifd->writeSourceBody(*g_outputList,clangParser.get());
ifd->writeSourceFooter(*g_outputList);
@@ -7672,7 +7837,7 @@ static void generateFileSources()
else if (!ifd->isReference() && Doxygen::parseSourcesNeeded)
// we needed to parse the sources even if we do not show them
{
- msg(" Parsing code for file %s...\n",ifd->docName().data());
+ msg(" Parsing code for file %s...\n",qPrint(ifd->docName()));
ifd->parseSource(clangParser.get());
}
processedFiles.insert(incFile);
@@ -7693,7 +7858,7 @@ static void generateFileSources()
if (fd->generateSourceFile() && !Htags::useHtags && !g_useOutputTemplate) // sources need to be shown in the output
{
auto clangParser = ClangParser::instance()->createTUParser(fd.get());
- msg("Generating code for file %s...\n",fd->docName().data());
+ msg("Generating code for file %s...\n",qPrint(fd->docName()));
clangParser->parse();
fd->writeSourceHeader(*g_outputList);
fd->writeSourceBody(*g_outputList,clangParser.get());
@@ -7703,7 +7868,7 @@ static void generateFileSources()
// we needed to parse the sources even if we do not show them
{
auto clangParser = ClangParser::instance()->createTUParser(fd.get());
- msg("Parsing code for file %s...\n",fd->docName().data());
+ msg("Parsing code for file %s...\n",qPrint(fd->docName()));
clangParser->parse();
fd->writeSourceHeader(*g_outputList);
fd->writeSourceBody(*g_outputList,clangParser.get());
@@ -7742,12 +7907,12 @@ static void generateFileSources()
auto ctx = std::make_shared<SourceContext>(fd.get(),generateSourceFile,*g_outputList);
if (generateSourceFile)
{
- msg("Generating code for file %s...\n",fd->docName().data());
+ msg("Generating code for file %s...\n",qPrint(fd->docName()));
fd->writeSourceHeader(ctx->ol);
}
else
{
- msg("Parsing code for file %s...\n",fd->docName().data());
+ msg("Parsing code for file %s...\n",qPrint(fd->docName()));
}
auto processFile = [ctx]() {
StringVector filesInSameTu;
@@ -7783,7 +7948,7 @@ static void generateFileSources()
fd->getAllIncludeFilesRecursively(filesInSameTu);
if (fd->generateSourceFile() && !Htags::useHtags && !g_useOutputTemplate) // sources need to be shown in the output
{
- msg("Generating code for file %s...\n",fd->docName().data());
+ msg("Generating code for file %s...\n",qPrint(fd->docName()));
fd->writeSourceHeader(*g_outputList);
fd->writeSourceBody(*g_outputList,nullptr);
fd->writeSourceFooter(*g_outputList);
@@ -7791,7 +7956,7 @@ static void generateFileSources()
else if (!fd->isReference() && Doxygen::parseSourcesNeeded)
// we needed to parse the sources even if we do not show them
{
- msg("Parsing code for file %s...\n",fd->docName().data());
+ msg("Parsing code for file %s...\n",qPrint(fd->docName()));
fd->parseSource(nullptr);
}
}
@@ -7816,7 +7981,7 @@ static void generateFileDocs()
bool doc = fd->isLinkableInProject();
if (doc)
{
- msg("Generating docs for file %s...\n",fd->docName().data());
+ msg("Generating docs for file %s...\n",qPrint(fd->docName()));
fd->writeDocumentation(*g_outputList);
}
}
@@ -7837,6 +8002,15 @@ static void addSourceReferences()
fd->addSourceRef(cd->getStartDefLine(),cd.get(),0);
}
}
+ // add source references for concept definitions
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ FileDef *fd=cd->getBodyDef();
+ if (fd && cd->isLinkableInProject() && cd->getStartDefLine()!=-1)
+ {
+ fd->addSourceRef(cd->getStartDefLine(),cd.get(),0);
+ }
+ }
// add source references for namespace definitions
for (const auto &nd : *Doxygen::namespaceLinkedMap)
{
@@ -7853,8 +8027,8 @@ static void addSourceReferences()
for (const auto &md : *mn)
{
//printf("class member %s: def=%s body=%d link?=%d\n",
- // md->name().data(),
- // md->getBodyDef()?md->getBodyDef()->name().data():"<none>",
+ // qPrint(md->name()),
+ // md->getBodyDef()?qPrint(md->getBodyDef()->name()):"<none>",
// md->getStartBodyLine(),md->isLinkableInProject());
FileDef *fd=md->getBodyDef();
if (fd &&
@@ -7864,7 +8038,7 @@ static void addSourceReferences()
)
{
//printf("Found member '%s' in file '%s' at line '%d' def=%s\n",
- // md->name().data(),fd->name().data(),md->getStartBodyLine(),md->getOuterScope()->name().data());
+ // qPrint(md->name()),qPrint(fd->name()),md->getStartBodyLine(),qPrint(md->getOuterScope()->name()));
fd->addSourceRef(md->getStartDefLine(),md->getOuterScope(),md.get());
}
}
@@ -7875,7 +8049,7 @@ static void addSourceReferences()
{
FileDef *fd=md->getBodyDef();
//printf("member %s body=[%d,%d] fd=%p link=%d parseSources=%d\n",
- // md->name().data(),
+ // qPrint(md->name()),
// md->getStartBodyLine(),md->getEndBodyLine(),fd,
// md->isLinkableInProject(),
// Doxygen::parseSourcesNeeded);
@@ -7886,7 +8060,7 @@ static void addSourceReferences()
)
{
//printf("Found member '%s' in file '%s' at line '%d' def=%s\n",
- // md->name().data(),fd->name().data(),md->getStartBodyLine(),md->getOuterScope()->name().data());
+ // qPrint(md->name()),qPrint(fd->name()),md->getStartBodyLine(),qPrint(md->getOuterScope()->name()));
fd->addSourceRef(md->getStartDefLine(),md->getOuterScope(),md.get());
}
}
@@ -7907,7 +8081,7 @@ static void buildDefineList()
{
std::unique_ptr<MemberDefMutable> md { createMemberDef(
def.fileName,def.lineNr,def.columnNr,
- "#define",def.name,def.args,0,
+ "#define",def.name,def.args,QCString(),
Public,Normal,FALSE,Member,MemberType_Define,
ArgumentList(),ArgumentList(),"") };
@@ -8051,7 +8225,7 @@ static void generateClassList(const ClassLinkedMap &classList)
{
ClassDefMutable *cd=toClassDefMutable(cdi.get());
- //printf("cd=%s getOuterScope=%p global=%p\n",cd->name().data(),cd->getOuterScope(),Doxygen::globalScope);
+ //printf("cd=%s getOuterScope=%p global=%p\n",qPrint(cd->name()),cd->getOuterScope(),Doxygen::globalScope);
if (cd &&
(cd->getOuterScope()==0 || // <-- should not happen, but can if we read an old tag file
cd->getOuterScope()==Doxygen::globalScope // only look at global classes
@@ -8062,7 +8236,7 @@ static void generateClassList(const ClassLinkedMap &classList)
// template instances
if ( cd->isLinkableInProject() && cd->templateMaster()==0)
{
- msg("Generating docs for compound %s...\n",cd->name().data());
+ msg("Generating docs for compound %s...\n",qPrint(cd->name()));
cd->writeDocumentation(*g_outputList);
cd->writeMemberList(*g_outputList);
@@ -8081,6 +8255,27 @@ static void generateClassDocs()
//----------------------------------------------------------------------------
+static void generateConceptDocs()
+{
+ for (const auto &cdi : *Doxygen::conceptLinkedMap)
+ {
+ ConceptDefMutable *cd=toConceptDefMutable(cdi.get());
+
+ //printf("cd=%s getOuterScope=%p global=%p\n",qPrint(cd->name()),cd->getOuterScope(),Doxygen::globalScope);
+ if (cd &&
+ (cd->getOuterScope()==0 || // <-- should not happen, but can if we read an old tag file
+ cd->getOuterScope()==Doxygen::globalScope // only look at global concepts
+ ) && !cd->isHidden() && cd->isLinkableInProject()
+ )
+ {
+ msg("Generating docs for concept %s...\n",qPrint(cd->name()));
+ cd->writeDocumentation(*g_outputList);
+ }
+ }
+}
+
+//----------------------------------------------------------------------------
+
static void inheritDocumentation()
{
for (const auto &mn : *Doxygen::memberNameLinkedMap)
@@ -8089,7 +8284,7 @@ static void inheritDocumentation()
{
MemberDefMutable *md = toMemberDefMutable(imd.get());
//static int count=0;
- //printf("%04d Member '%s'\n",count++,md->qualifiedName().data());
+ //printf("%04d Member '%s'\n",count++,qPrint(md->qualifiedName()));
if (md && md->documentation().isEmpty() && md->briefDescription().isEmpty())
{ // no documentation yet
const MemberDef *bmd = md->reimplements();
@@ -8097,7 +8292,7 @@ static void inheritDocumentation()
bmd->briefDescription().isEmpty()
)
{ // search up the inheritance tree for a documentation member
- //printf("bmd=%s class=%s\n",bmd->name().data(),bmd->getClassDef()->name().data());
+ //printf("bmd=%s class=%s\n",qPrint(bmd->name()),qPrint(bmd->getClassDef()->name()));
bmd = bmd->reimplements();
}
if (bmd) // copy the documentation from the reimplemented member
@@ -8226,6 +8421,15 @@ static void findSectionsInDocumentation()
cdm->findSectionsInDocumentation();
}
}
+ // for each concept
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ ConceptDefMutable *cdm = toConceptDefMutable(cd.get());
+ if (cdm)
+ {
+ cdm->findSectionsInDocumentation();
+ }
+ }
// for each file
for (const auto &fn : *Doxygen::inputNameLinkedMap)
{
@@ -8374,19 +8578,19 @@ static void findDefineDocumentation(Entry *root)
)
{
//printf("found define '%s' '%s' brief='%s' doc='%s'\n",
- // root->name.data(),root->args.data(),root->brief.data(),root->doc.data());
+ // qPrint(root->name),qPrint(root->args),qPrint(root->brief),qPrint(root->doc));
if (root->tagInfo() && !root->name.isEmpty()) // define read from a tag file
{
std::unique_ptr<MemberDefMutable> md { createMemberDef(root->tagInfo()->tagName,1,1,
- "#define",root->name,root->args,0,
+ "#define",root->name,root->args,QCString(),
Public,Normal,FALSE,Member,MemberType_Define,
ArgumentList(),ArgumentList(),"") };
md->setTagInfo(root->tagInfo());
md->setLanguage(root->lang);
- //printf("Searching for '%s' fd=%p\n",filePathName.data(),fd);
+ //printf("Searching for '%s' fd=%p\n",qPrint(filePathName),fd);
md->setFileDef(root->parent()->fileDef());
- //printf("Adding member=%s\n",md->name().data());
+ //printf("Adding member=%s\n",qPrint(md->name()));
MemberName *mn = Doxygen::functionNameLinkedMap->add(root->name);
mn->push_back(std::move(md));
}
@@ -8457,10 +8661,10 @@ static void findDefineDocumentation(Entry *root)
}
}
}
- //warn("define %s found in the following files:\n",root->name.data());
+ //warn("define %s found in the following files:\n",qPrint(root->name));
//warn("Cannot determine where to add the documentation found "
// "at line %d of file %s. \n",
- // root->startLine,root->fileName.data());
+ // root->startLine,qPrint(root->fileName));
}
}
else if (!root->doc.isEmpty() || !root->brief.isEmpty()) // define not found
@@ -8470,7 +8674,7 @@ static void findDefineDocumentation(Entry *root)
{
warn(root->fileName,root->startLine,
"documentation for unknown define %s found.\n",
- root->name.data()
+ qPrint(root->name)
);
}
else
@@ -8478,7 +8682,7 @@ static void findDefineDocumentation(Entry *root)
warn(root->fileName,root->startLine,
"found documented #define %s but ignoring it because "
"ENABLE_PREPROCESSING is NO.\n",
- root->name.data()
+ qPrint(root->name)
);
}
}
@@ -8495,7 +8699,7 @@ static void findDirDocumentation(const Entry *root)
QCString normalizedName = root->name;
normalizedName = substitute(normalizedName,"\\","/");
//printf("root->docFile=%s normalizedName=%s\n",
- // root->docFile.data(),normalizedName.data());
+ // qPrint(root->docFile),qPrint(normalizedName));
if (root->docFile==normalizedName) // current dir?
{
int lastSlashPos=normalizedName.findRev('/');
@@ -8511,7 +8715,7 @@ static void findDirDocumentation(const Entry *root)
DirDef *matchingDir=0;
for (const auto &dir : *Doxygen::dirLinkedMap)
{
- //printf("Dir: %s<->%s\n",dir->name().data(),normalizedName.data());
+ //printf("Dir: %s<->%s\n",qPrint(dir->name()),qPrint(normalizedName));
if (dir->name().right(normalizedName.length())==normalizedName)
{
if (matchingDir)
@@ -8520,7 +8724,7 @@ static void findDirDocumentation(const Entry *root)
"\\dir command matches multiple directories.\n"
" Applying the command for directory %s\n"
" Ignoring the command for directory %s\n",
- matchingDir->name().data(),dir->name().data()
+ qPrint(matchingDir->name()),qPrint(dir->name())
);
}
else
@@ -8531,7 +8735,7 @@ static void findDirDocumentation(const Entry *root)
}
if (matchingDir)
{
- //printf("Match for with dir %s\n",matchingDir->name().data());
+ //printf("Match for with dir %s\n",qPrint(matchingDir->name()));
matchingDir->setBriefDescription(root->brief,root->briefFile,root->briefLine);
matchingDir->setDocumentation(root->doc,root->docFile,root->docLine);
matchingDir->setRefItems(root->sli);
@@ -8540,7 +8744,7 @@ static void findDirDocumentation(const Entry *root)
else
{
warn(root->fileName,root->startLine,"No matching "
- "directory found for command \\dir %s\n",normalizedName.data());
+ "directory found for command \\dir %s\n",qPrint(normalizedName));
}
}
for (const auto &e : root->children()) findDirDocumentation(e.get());
@@ -8570,7 +8774,7 @@ static void buildPageList(Entry *root)
"page",
name,
title,
- 0,0
+ QCString(),0
);
}
for (const auto &e : root->children()) buildPageList(e.get());
@@ -8584,7 +8788,7 @@ static void findMainPage(Entry *root)
if (Doxygen::mainPage==0 && root->tagInfo()==0)
{
//printf("mainpage: docLine=%d startLine=%d\n",root->docLine,root->startLine);
- //printf("Found main page! \n======\n%s\n=======\n",root->doc.data());
+ //printf("Found main page! \n======\n%s\n=======\n",qPrint(root->doc));
QCString title=root->args.stripWhiteSpace();
if (title.isEmpty()) title = Config_getString(PROJECT_NAME);
//QCString indexName=Config_getBool(GENERATE_TREEVIEW)?"main":"index";
@@ -8604,12 +8808,12 @@ static void findMainPage(Entry *root)
if (si->lineNr() != -1)
{
warn(root->fileName,root->startLine,"multiple use of section label '%s' for main page, (first occurrence: %s, line %d)",
- Doxygen::mainPage->name().data(),si->fileName().data(),si->lineNr());
+ qPrint(Doxygen::mainPage->name()),qPrint(si->fileName()),si->lineNr());
}
else
{
warn(root->fileName,root->startLine,"multiple use of section label '%s' for main page, (first occurrence: %s)",
- Doxygen::mainPage->name().data(),si->fileName().data());
+ qPrint(Doxygen::mainPage->name()),qPrint(si->fileName()));
}
}
else
@@ -8629,7 +8833,7 @@ static void findMainPage(Entry *root)
{
warn(root->fileName,root->startLine,
"found more than one \\mainpage comment block! (first occurrence: %s, line %d), Skipping current block!",
- Doxygen::mainPage->docFile().data(),Doxygen::mainPage->getStartBodyLine());
+ qPrint(Doxygen::mainPage->docFile()),Doxygen::mainPage->getStartBodyLine());
}
}
for (const auto &e : root->children()) findMainPage(e.get());
@@ -8668,13 +8872,13 @@ static void computePageRelations(Entry *root)
{
term("page defined at line %d of file %s with label %s is a direct "
"subpage of itself! Please remove this cyclic dependency.\n",
- pd->docLine(),pd->docFile().data(),pd->name().data());
+ pd->docLine(),qPrint(pd->docFile()),qPrint(pd->name()));
}
else if (subPd)
{
pd->addInnerCompound(subPd);
//printf("*** Added subpage relation: %s->%s\n",
- // pd->name().data(),subPd->name().data());
+ // qPrint(pd->name()),qPrint(subPd->name()));
}
}
}
@@ -8693,7 +8897,7 @@ static void checkPageRelations()
{
term("page defined at line %d of file %s with label %s is a subpage "
"of itself! Please remove this cyclic dependency.\n",
- pd->docLine(),pd->docFile().data(),pd->name().data());
+ pd->docLine(),qPrint(pd->docFile()),qPrint(pd->name()));
}
ppd=ppd->getOuterScope();
}
@@ -8707,8 +8911,8 @@ static void resolveUserReferences()
for (const auto &si : SectionManager::instance())
{
//printf("si->label='%s' si->definition=%s si->fileName='%s'\n",
- // si->label.data(),si->definition?si->definition->name().data():"<none>",
- // si->fileName.data());
+ // qPrint(si->label),si->definition?qPrint(si->definition->name()):"<none>",
+ // qPrint(si->fileName));
PageDef *pd=0;
// hack: the items of a todo/test/bug/deprecated list are all fragments from
@@ -8727,7 +8931,7 @@ static void resolveUserReferences()
}
}
- //printf("start: si->label=%s si->fileName=%s\n",si->label.data(),si->fileName.data());
+ //printf("start: si->label=%s si->fileName=%s\n",qPrint(si->label),qPrint(si->fileName));
if (!si->generated())
{
// if this section is in a page and the page is in a group, then we
@@ -8755,12 +8959,12 @@ static void resolveUserReferences()
}
else
{
- //si->fileName=si->definition->getOutputFileBase().copy();
- //printf("Setting si->fileName to %s\n",si->fileName.data());
+ //si->fileName=si->definition->getOutputFileBase();
+ //printf("Setting si->fileName to %s\n",qPrint(si->fileName));
}
}
}
- //printf("end: si->label=%s si->fileName=%s\n",si->label.data(),si->fileName.data());
+ //printf("end: si->label=%s si->fileName=%s\n",qPrint(si->label),qPrint(si->fileName));
}
}
@@ -8778,7 +8982,7 @@ static void generatePageDocs()
{
if (!pd->getGroupDef() && !pd->isReference())
{
- msg("Generating docs for page %s...\n",pd->name().data());
+ msg("Generating docs for page %s...\n",qPrint(pd->name()));
Doxygen::insideMainPage=TRUE;
pd->writeDocumentation(*g_outputList);
Doxygen::insideMainPage=FALSE;
@@ -8798,7 +9002,7 @@ static void buildExampleList(Entry *root)
warn(root->fileName,root->startLine,
"Example %s was already documented. Ignoring "
"documentation found here.",
- root->name.data()
+ qPrint(root->name)
);
}
else
@@ -8828,8 +9032,8 @@ void printNavTree(Entry *root,int indent)
QCString indentStr;
indentStr.fill(' ',indent);
msg("%s%s (sec=0x%x)\n",
- indentStr.isEmpty()?"":indentStr.data(),
- root->name.isEmpty()?"<empty>":root->name.data(),
+ indentStr.isEmpty()?"":qPrint(indentStr),
+ root->name.isEmpty()?"<empty>":qPrint(root->name),
root->section);
for (const auto &e : root->children())
{
@@ -8846,14 +9050,14 @@ static void generateExampleDocs()
g_outputList->disable(OutputGenerator::Man);
for (const auto &pd : *Doxygen::exampleLinkedMap)
{
- msg("Generating docs for example %s...\n",pd->name().data());
+ msg("Generating docs for example %s...\n",qPrint(pd->name()));
auto intf = Doxygen::parserManager->getCodeParser(".c"); // TODO: do this on code type
intf->resetCodeParserState();
QCString n=pd->getOutputFileBase();
startFile(*g_outputList,n,n,pd->name());
startTitle(*g_outputList,n);
g_outputList->docify(pd->name());
- endTitle(*g_outputList,n,0);
+ endTitle(*g_outputList,n,QCString());
g_outputList->startContents();
QCString lineNoOptStr;
if (pd->showLineNo())
@@ -8909,7 +9113,7 @@ static void generateNamespaceClassDocs(const ClassLinkedRefMap &classList)
&& !cd->isHidden() && !cd->isEmbeddedInOuterScope()
)
{
- msg("Generating docs for compound %s...\n",cd->name().data());
+ msg("Generating docs for compound %s...\n",qPrint(cd->name()));
cdm->writeDocumentation(*g_outputList);
cdm->writeMemberList(*g_outputList);
@@ -8919,6 +9123,20 @@ static void generateNamespaceClassDocs(const ClassLinkedRefMap &classList)
}
}
+static void generateNamespaceConceptDocs(const ConceptLinkedRefMap &conceptList)
+{
+ // for each concept in the namespace...
+ for (const auto &cd : conceptList)
+ {
+ ConceptDefMutable *cdm = toConceptDefMutable(cd);
+ if ( cdm && cd->isLinkableInProject() && !cd->isHidden())
+ {
+ msg("Generating docs for concept %s...\n",qPrint(cd->name()));
+ cdm->writeDocumentation(*g_outputList);
+ }
+ }
+}
+
static void generateNamespaceDocs()
{
static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
@@ -8933,7 +9151,7 @@ static void generateNamespaceDocs()
NamespaceDefMutable *ndm = toNamespaceDefMutable(nd.get());
if (ndm)
{
- msg("Generating docs for namespace %s\n",nd->name().data());
+ msg("Generating docs for namespace %s\n",qPrint(nd->name()));
ndm->writeDocumentation(*g_outputList);
}
}
@@ -8945,6 +9163,7 @@ static void generateNamespaceDocs()
generateNamespaceClassDocs(nd->getStructs());
generateNamespaceClassDocs(nd->getExceptions());
}
+ generateNamespaceConceptDocs(nd->getConcepts());
}
}
@@ -8976,72 +9195,60 @@ static QCString fixSlashes(QCString &s)
* If the \a shortList parameter is TRUE a configuration file without
* comments will be generated.
*/
-static void generateConfigFile(const char *configFile,bool shortList,
+static void generateConfigFile(const QCString &configFile,bool shortList,
bool updateOnly=FALSE)
{
- QFile f;
+ std::ofstream f;
bool fileOpened=openOutputFile(configFile,f);
- bool writeToStdout=(configFile[0]=='-' && configFile[1]=='\0');
+ bool writeToStdout=configFile=="-";
if (fileOpened)
{
- FTextStream t(&f);
+ TextStream t(&f);
Config::writeTemplate(t,shortList,updateOnly);
if (!writeToStdout)
{
if (!updateOnly)
{
- msg("\n\nConfiguration file '%s' created.\n\n",configFile);
+ msg("\n\nConfiguration file '%s' created.\n\n",qPrint(configFile));
msg("Now edit the configuration file and enter\n\n");
- if (qstrcmp(configFile,"Doxyfile") || qstrcmp(configFile,"doxyfile"))
- msg(" doxygen %s\n\n",configFile);
+ if (configFile!="Doxyfile" && configFile!="doxyfile")
+ msg(" doxygen %s\n\n",qPrint(configFile));
else
msg(" doxygen\n\n");
msg("to generate the documentation for your project\n\n");
}
else
{
- msg("\n\nConfiguration file '%s' updated.\n\n",configFile);
+ msg("\n\nConfiguration file '%s' updated.\n\n",qPrint(configFile));
}
}
}
else
{
- term("Cannot open file %s for writing\n",configFile);
+ term("Cannot open file %s for writing\n",qPrint(configFile));
}
}
+
static void compareDoxyfile()
{
- QFile f;
- char configFile[2];
- configFile[0] = '-';
- configFile[1] = '\0';
- bool fileOpened=openOutputFile(configFile,f);
+ std::ofstream f;
+ bool fileOpened=openOutputFile("-",f);
if (fileOpened)
{
- FTextStream t(&f);
+ TextStream t(&f);
Config::compareDoxyfile(t);
}
else
{
- term("Cannot open file %s for writing\n",configFile);
+ term("Cannot open stdout for writing\n");
}
}
-//----------------------------------------------------------------------------
-// read and parse a tag file
-
-//static bool readLineFromFile(QFile &f,QCString &s)
-//{
-// char c=0;
-// s.resize(0);
-// while (!f.atEnd() && (c=f.getch())!='\n') s+=c;
-// return f.atEnd();
-//}
//----------------------------------------------------------------------------
+// read and parse a tag file
-static void readTagFile(const std::shared_ptr<Entry> &root,const char *tl)
+static void readTagFile(const std::shared_ptr<Entry> &root,const QCString &tagLine)
{
- QCString tagLine = tl;
QCString fileName;
QCString destName;
int eqPos = tagLine.find('=');
@@ -9050,30 +9257,30 @@ static void readTagFile(const std::shared_ptr<Entry> &root,const char *tl)
fileName = tagLine.left(eqPos).stripWhiteSpace();
destName = tagLine.right(tagLine.length()-eqPos-1).stripWhiteSpace();
if (fileName.isEmpty() || destName.isEmpty()) return;
- QFileInfo fi(fileName);
+ FileInfo fi(fileName.str());
Doxygen::tagDestinationMap.insert(
- std::make_pair(fi.absFilePath().utf8().str(), destName.str()));
- //printf("insert tagDestination %s->%s\n",fi.fileName().data(),destName.data());
+ std::make_pair(fi.absFilePath(), destName.str()));
+ //printf("insert tagDestination %s->%s\n",qPrint(fi.fileName()),qPrint(destName));
}
else
{
fileName = tagLine;
}
- QFileInfo fi(fileName);
+ FileInfo fi(fileName.str());
if (!fi.exists() || !fi.isFile())
{
err("Tag file '%s' does not exist or is not a file. Skipping it...\n",
- fileName.data());
+ qPrint(fileName));
return;
}
if (!destName.isEmpty())
- msg("Reading tag file '%s', location '%s'...\n",fileName.data(),destName.data());
+ msg("Reading tag file '%s', location '%s'...\n",qPrint(fileName),qPrint(destName));
else
- msg("Reading tag file '%s'...\n",fileName.data());
+ msg("Reading tag file '%s'...\n",qPrint(fileName));
- parseTagFile(root,fi.absFilePath().utf8());
+ parseTagFile(root,fi.absFilePath().c_str());
}
//----------------------------------------------------------------------------
@@ -9082,22 +9289,22 @@ static void copyLatexStyleSheet()
const StringVector &latexExtraStyleSheet = Config_getList(LATEX_EXTRA_STYLESHEET);
for (const auto &sheet : latexExtraStyleSheet)
{
- QCString fileName = sheet.c_str();
- if (!fileName.isEmpty())
+ std::string fileName = sheet;
+ if (!fileName.empty())
{
- QFileInfo fi(fileName);
+ FileInfo fi(fileName);
if (!fi.exists())
{
- err("Style sheet '%s' specified by LATEX_EXTRA_STYLESHEET does not exist!\n",fileName.data());
+ err("Style sheet '%s' specified by LATEX_EXTRA_STYLESHEET does not exist!\n",qPrint(fileName));
}
else
{
- QCString destFileName = Config_getString(LATEX_OUTPUT)+"/"+fi.fileName().data();
- if (!checkExtension(fi.fileName().data(), LATEX_STYLE_EXTENSION))
+ QCString destFileName = Config_getString(LATEX_OUTPUT)+"/"+fi.fileName();
+ if (!checkExtension(fi.fileName().c_str(), LATEX_STYLE_EXTENSION))
{
destFileName += LATEX_STYLE_EXTENSION;
}
- copyFile(fileName, destFileName);
+ copyFile(QCString(fileName), destFileName);
}
}
}
@@ -9109,37 +9316,37 @@ static void copyStyleSheet()
QCString htmlStyleSheet = Config_getString(HTML_STYLESHEET);
if (!htmlStyleSheet.isEmpty())
{
- QFileInfo fi(htmlStyleSheet);
+ FileInfo fi(htmlStyleSheet.str());
if (!fi.exists())
{
- err("Style sheet '%s' specified by HTML_STYLESHEET does not exist!\n",htmlStyleSheet.data());
+ err("Style sheet '%s' specified by HTML_STYLESHEET does not exist!\n",qPrint(htmlStyleSheet));
htmlStyleSheet = Config_updateString(HTML_STYLESHEET,""); // revert to the default
}
else
{
- QCString destFileName = Config_getString(HTML_OUTPUT)+"/"+fi.fileName().data();
+ QCString destFileName = Config_getString(HTML_OUTPUT)+"/"+fi.fileName();
copyFile(htmlStyleSheet,destFileName);
}
}
const StringVector &htmlExtraStyleSheet = Config_getList(HTML_EXTRA_STYLESHEET);
for (const auto &sheet : htmlExtraStyleSheet)
{
- QCString fileName = sheet.c_str();
- if (!fileName.isEmpty())
+ std::string fileName = sheet;
+ if (!fileName.empty())
{
- QFileInfo fi(fileName);
+ FileInfo fi(fileName);
if (!fi.exists())
{
- err("Style sheet '%s' specified by HTML_EXTRA_STYLESHEET does not exist!\n",fileName.data());
+ err("Style sheet '%s' specified by HTML_EXTRA_STYLESHEET does not exist!\n",fileName.c_str());
}
else if (fi.fileName()=="doxygen.css" || fi.fileName()=="tabs.css" || fi.fileName()=="navtree.css")
{
- err("Style sheet %s specified by HTML_EXTRA_STYLESHEET is already a built-in stylesheet. Please use a different name\n",fi.fileName().data());
+ err("Style sheet %s specified by HTML_EXTRA_STYLESHEET is already a built-in stylesheet. Please use a different name\n",qPrint(fi.fileName()));
}
else
{
- QCString destFileName = Config_getString(HTML_OUTPUT)+"/"+fi.fileName().data();
- copyFile(fileName, destFileName);
+ QCString destFileName = Config_getString(HTML_OUTPUT)+"/"+fi.fileName();
+ copyFile(QCString(fileName), destFileName);
}
}
}
@@ -9150,38 +9357,37 @@ static void copyLogo(const QCString &outputOption)
QCString projectLogo = Config_getString(PROJECT_LOGO);
if (!projectLogo.isEmpty())
{
- QFileInfo fi(projectLogo);
+ FileInfo fi(projectLogo.str());
if (!fi.exists())
{
- err("Project logo '%s' specified by PROJECT_LOGO does not exist!\n",projectLogo.data());
+ err("Project logo '%s' specified by PROJECT_LOGO does not exist!\n",qPrint(projectLogo));
projectLogo = Config_updateString(PROJECT_LOGO,""); // revert to the default
}
else
{
- QCString destFileName = outputOption+"/"+fi.fileName().data();
+ QCString destFileName = outputOption+"/"+fi.fileName();
copyFile(projectLogo,destFileName);
- Doxygen::indexList->addImageFile(fi.fileName().data());
+ Doxygen::indexList->addImageFile(fi.fileName().c_str());
}
}
}
static void copyExtraFiles(const StringVector &files,const QCString &filesOption,const QCString &outputOption)
{
- for (const auto &file : files)
+ for (const auto &fileName : files)
{
- QCString fileName = file.c_str();
- if (!fileName.isEmpty())
+ if (!fileName.empty())
{
- QFileInfo fi(fileName);
+ FileInfo fi(fileName);
if (!fi.exists())
{
- err("Extra file '%s' specified in %s does not exist!\n", fileName.data(),filesOption.data());
+ err("Extra file '%s' specified in %s does not exist!\n", fileName.c_str(),qPrint(filesOption));
}
else
{
- QCString destFileName = outputOption+"/"+fi.fileName().data();
- Doxygen::indexList->addImageFile(fi.fileName().utf8());
- copyFile(fileName, destFileName);
+ QCString destFileName = outputOption+"/"+fi.fileName();
+ Doxygen::indexList->addImageFile(fi.fileName().c_str());
+ copyFile(QCString(fileName), destFileName);
}
}
}
@@ -9223,7 +9429,7 @@ static void generateDiskNames()
std::sort(fileEntries.begin(),
fileEntries.end(),
[](const FileEntry &fe1,const FileEntry &fe2)
- { return qstrcmp(fe1.path.data(),fe2.path.data())<0; }
+ { return fe1.path < fe2.path; }
);
// since the entries are sorted, the common prefix of the whole array is same
@@ -9255,7 +9461,7 @@ static void generateDiskNames()
{
QCString prefix = fileEntry.path.right(fileEntry.path.length()-j-1);
fileEntry.fileDef->setName(prefix+fn->fileName());
- //printf("!!!!!!!! non unique disk name=%s:%s\n",prefix.data(),fn->fileName());
+ //printf("!!!!!!!! non unique disk name=%s:%s\n",qPrint(prefix),fn->fileName());
fileEntry.fileDef->setDiskName(prefix+fn->fileName());
}
}
@@ -9266,7 +9472,7 @@ static void generateDiskNames()
//----------------------------------------------------------------------------
-static std::unique_ptr<OutlineParserInterface> getParserForFile(const char *fn)
+static std::unique_ptr<OutlineParserInterface> getParserForFile(const QCString &fn)
{
QCString fileName=fn;
QCString extension;
@@ -9285,7 +9491,7 @@ static std::unique_ptr<OutlineParserInterface> getParserForFile(const char *fn)
}
static std::shared_ptr<Entry> parseFile(OutlineParserInterface &parser,
- FileDef *fd,const char *fn,
+ FileDef *fd,const QCString &fn,
ClangTUParser *clangParser,bool newTU)
{
QCString fileName=fn;
@@ -9300,8 +9506,8 @@ static std::shared_ptr<Entry> parseFile(OutlineParserInterface &parser,
extension = ".no_extension";
}
- QFileInfo fi(fileName);
- BufStr preBuf(fi.size()+4096);
+ FileInfo fi(fileName.str());
+ BufStr preBuf((uint)fi.size()+4096);
if (Config_getBool(ENABLE_PREPROCESSING) &&
parser.needsPreprocessing(extension))
@@ -9310,16 +9516,17 @@ static std::shared_ptr<Entry> parseFile(OutlineParserInterface &parser,
const StringVector &includePath = Config_getList(INCLUDE_PATH);
for (const auto &s : includePath)
{
- preprocessor.addSearchDir(QFileInfo(s.c_str()).absFilePath().utf8());
+ std::string absPath = FileInfo(s).absFilePath();
+ preprocessor.addSearchDir(absPath.c_str());
}
- BufStr inBuf(fi.size()+4096);
- msg("Preprocessing %s...\n",fn);
+ BufStr inBuf((uint)fi.size()+4096);
+ msg("Preprocessing %s...\n",qPrint(fn));
readInputFile(fileName,inBuf);
preprocessor.processFile(fileName,inBuf,preBuf);
}
else // no preprocessing
{
- msg("Reading %s...\n",fn);
+ msg("Reading %s...\n",qPrint(fn));
readInputFile(fileName,preBuf);
}
if (preBuf.data() && preBuf.curPos()>0 && *(preBuf.data()+preBuf.curPos()-1)!='\n')
@@ -9569,14 +9776,13 @@ static void parseFilesSingleThreading(const std::shared_ptr<Entry> &root)
// resolves a path that may include symlinks, if a recursive symlink is
// found an empty string is returned.
-static QCString resolveSymlink(QCString path)
+static std::string resolveSymlink(const std::string &path)
{
int sepPos=0;
int oldPos=0;
- QFileInfo fi;
StringSet nonSymlinks;
StringSet known;
- QCString result = path;
+ QCString result(path);
QCString oldPrefix = "/";
do
{
@@ -9592,14 +9798,14 @@ static QCString resolveSymlink(QCString path)
QCString prefix = sepPos==-1 ? result : result.left(sepPos);
if (nonSymlinks.find(prefix.str())==nonSymlinks.end())
{
- fi.setFile(prefix);
+ FileInfo fi(prefix.str());
if (fi.isSymLink())
{
- QString target = fi.readLink();
- bool isRelative = QFileInfo(target).isRelative();
+ QCString target = fi.readLink();
+ bool isRelative = FileInfo(target.str()).isRelative();
if (isRelative)
{
- target = QDir::cleanDirPath(oldPrefix+"/"+target.data());
+ target = Dir::cleanDirPath(oldPrefix.str()+"/"+target.str());
}
if (sepPos!=-1)
{
@@ -9609,9 +9815,9 @@ static QCString resolveSymlink(QCString path)
}
target+=result.mid(sepPos);
}
- result = QDir::cleanDirPath(target).data();
+ result = Dir::cleanDirPath(target.str());
sepPos = 0;
- if (known.find(result.str())!=known.end()) return QCString(); // recursive symlink!
+ if (known.find(result.str())!=known.end()) return std::string(); // recursive symlink!
known.insert(result.str());
if (isRelative)
{
@@ -9632,7 +9838,7 @@ static QCString resolveSymlink(QCString path)
}
}
while (sepPos!=-1);
- return QDir::cleanDirPath(result).data();
+ return Dir::cleanDirPath(result.str());
}
static std::mutex g_pathsVisitedMutex;
@@ -9644,7 +9850,7 @@ static StringUnorderedSet g_pathsVisited(1009);
// The directory is read iff the recursiveFlag is set.
// The contents of all files is append to the input string
-static int readDir(QFileInfo *fi,
+static void readDir(FileInfo *fi,
FileNameLinkedMap *fnMap,
StringUnorderedSet *exclSet,
const StringVector *patList,
@@ -9657,84 +9863,72 @@ static int readDir(QFileInfo *fi,
StringSet *paths
)
{
- QCString dirName = fi->absFilePath().utf8();
- if (paths && !dirName.isEmpty())
+ std::string dirName = fi->absFilePath();
+ if (paths && !dirName.empty())
{
- paths->insert(dirName.data());
+ paths->insert(dirName);
}
if (fi->isSymLink())
{
- dirName = resolveSymlink(dirName.data());
- if (dirName.isEmpty()) return 0; // recursive symlink
+ dirName = resolveSymlink(dirName);
+ if (dirName.empty()) return; // recursive symlink
std::lock_guard<std::mutex> lock(g_pathsVisitedMutex);
- if (g_pathsVisited.find(dirName.str())!=g_pathsVisited.end()) return 0; // already visited path
- g_pathsVisited.insert(dirName.str());
+ if (g_pathsVisited.find(dirName)!=g_pathsVisited.end()) return; // already visited path
+ g_pathsVisited.insert(dirName);
}
- QDir dir(dirName);
- dir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden );
- int totalSize=0;
- msg("Searching for files in directory %s\n", fi->absFilePath().data());
+ Dir dir(dirName);
+ msg("Searching for files in directory %s\n", qPrint(fi->absFilePath()));
//printf("killSet=%p count=%d\n",killSet,killSet ? (int)killSet->count() : -1);
- const QFileInfoList *list = dir.entryInfoList();
- if (list)
+ for (const auto &dirEntry : dir.iterator())
{
- QFileInfoListIterator it( *list );
- QFileInfo *cfi;
-
- while ((cfi=it.current()))
- {
- if (exclSet==0 || exclSet->find(cfi->absFilePath().utf8().data())==exclSet->end())
- { // file should not be excluded
- //printf("killSet->find(%s)\n",cfi->absFilePath().data());
- if (!cfi->exists() || !cfi->isReadable())
+ FileInfo cfi(dirEntry.path());
+ if (exclSet==0 || exclSet->find(cfi.absFilePath())==exclSet->end())
+ { // file should not be excluded
+ //printf("killSet->find(%s)\n",qPrint(cfi->absFilePath()));
+ if (!cfi.exists() || !cfi.isReadable())
+ {
+ if (errorIfNotExist)
{
- if (errorIfNotExist)
- {
- warn_uncond("source '%s' is not a readable file or directory... skipping.\n",cfi->absFilePath().data());
- }
+ warn_uncond("source '%s' is not a readable file or directory... skipping.\n",cfi.absFilePath().c_str());
}
- else if (cfi->isFile() &&
- (!Config_getBool(EXCLUDE_SYMLINKS) || !cfi->isSymLink()) &&
- (patList==0 || patternMatch(*cfi,*patList)) &&
- (exclPatList==0 || !patternMatch(*cfi,*exclPatList)) &&
- (killSet==0 || killSet->find(cfi->absFilePath().utf8().data())==killSet->end())
- )
+ }
+ else if (cfi.isFile() &&
+ (!Config_getBool(EXCLUDE_SYMLINKS) || !cfi.isSymLink()) &&
+ (patList==0 || patternMatch(cfi,*patList)) &&
+ (exclPatList==0 || !patternMatch(cfi,*exclPatList)) &&
+ (killSet==0 || killSet->find(cfi.absFilePath())==killSet->end())
+ )
+ {
+ std::string name=cfi.fileName();
+ if (fnMap)
{
- totalSize+=cfi->size()+cfi->absFilePath().length()+4;
- QCString name=cfi->fileName().utf8();
- //printf("New file %s\n",name.data());
- if (fnMap)
+ std::unique_ptr<FileDef> fd { createFileDef(QCString(cfi.dirPath()+"/"),QCString(name)) };
+ FileName *fn=0;
+ if (!name.empty())
{
- std::unique_ptr<FileDef> fd { createFileDef(cfi->dirPath().utf8()+"/",name) };
- FileName *fn=0;
- if (!name.isEmpty())
- {
- fn = fnMap->add(name,cfi->absFilePath().utf8());
- fn->push_back(std::move(fd));
- }
+ fn = fnMap->add(QCString(name),QCString(cfi.absFilePath()));
+ fn->push_back(std::move(fd));
}
- if (resultList) resultList->push_back(cfi->absFilePath().utf8().data());
- if (resultSet) resultSet->insert(cfi->absFilePath().utf8().data());
- if (killSet) killSet->insert(cfi->absFilePath().utf8().data());
- }
- else if (recursive &&
- (!Config_getBool(EXCLUDE_SYMLINKS) || !cfi->isSymLink()) &&
- cfi->isDir() &&
- (exclPatList==0 || !patternMatch(*cfi,*exclPatList)) &&
- cfi->fileName().at(0)!='.') // skip "." ".." and ".dir"
- {
- cfi->setFile(cfi->absFilePath());
- totalSize+=readDir(cfi,fnMap,exclSet,
- patList,exclPatList,resultList,resultSet,errorIfNotExist,
- recursive,killSet,paths);
}
+ if (resultList) resultList->push_back(cfi.absFilePath());
+ if (resultSet) resultSet->insert(cfi.absFilePath());
+ if (killSet) killSet->insert(cfi.absFilePath());
+ }
+ else if (recursive &&
+ (!Config_getBool(EXCLUDE_SYMLINKS) || !cfi.isSymLink()) &&
+ cfi.isDir() &&
+ (exclPatList==0 || !patternMatch(cfi,*exclPatList)) &&
+ cfi.fileName().at(0)!='.') // skip "." ".." and ".dir"
+ {
+ FileInfo acfi(cfi.absFilePath());
+ readDir(&acfi,fnMap,exclSet,
+ patList,exclPatList,resultList,resultSet,errorIfNotExist,
+ recursive,killSet,paths);
}
- ++it;
}
}
- return totalSize;
}
@@ -9742,7 +9936,7 @@ static int readDir(QFileInfo *fi,
// read a file or all files in a directory and append their contents to the
// input string. The names of the files are appended to the 'fiList' list.
-int readFileOrDirectory(const char *s,
+void readFileOrDirectory(const QCString &s,
FileNameLinkedMap *fnMap,
StringUnorderedSet *exclSet,
const StringVector *patList,
@@ -9757,69 +9951,61 @@ int readFileOrDirectory(const char *s,
{
//printf("killSet count=%d\n",killSet ? (int)killSet->size() : -1);
// strip trailing slashes
- if (s==0) return 0;
- QCString fs = s;
- char lc = fs.at(fs.length()-1);
- if (lc=='/' || lc=='\\') fs = fs.left(fs.length()-1);
+ if (s.isEmpty()) return;
- QFileInfo fi(fs);
+ FileInfo fi(s.str());
//printf("readFileOrDirectory(%s)\n",s);
- int totalSize=0;
{
- if (exclSet==0 || exclSet->find(fi.absFilePath().utf8().data())==exclSet->end())
+ if (exclSet==0 || exclSet->find(fi.absFilePath())==exclSet->end())
{
if (!fi.exists() || !fi.isReadable())
{
if (errorIfNotExist)
{
- warn_uncond("source '%s' is not a readable file or directory... skipping.\n",s);
+ warn_uncond("source '%s' is not a readable file or directory... skipping.\n",qPrint(s));
}
}
else if (!Config_getBool(EXCLUDE_SYMLINKS) || !fi.isSymLink())
{
if (fi.isFile())
{
- QCString dirPath = fi.dirPath(TRUE).utf8();
- QCString filePath = fi.absFilePath().utf8();
- if (paths && !dirPath.isEmpty())
+ std::string dirPath = fi.dirPath(true);
+ std::string filePath = fi.absFilePath();
+ if (paths && !dirPath.empty())
{
- paths->insert(dirPath.data());
+ paths->insert(dirPath);
}
- //printf("killSet.find(%s)=%d\n",fi.absFilePath().data(),killSet.find(fi.absFilePath())!=killSet.end());
- if (killSet==0 || killSet->find(filePath.data())==killSet->end())
+ //printf("killSet.find(%s)=%d\n",qPrint(fi.absFilePath()),killSet.find(fi.absFilePath())!=killSet.end());
+ if (killSet==0 || killSet->find(filePath)==killSet->end())
{
- totalSize+=fi.size()+fi.absFilePath().length()+4; //readFile(&fi,fiList,input);
- //fiList->inSort(new FileInfo(fi));
- QCString name=fi.fileName().utf8();
- //printf("New file %s\n",name.data());
+ std::string name=fi.fileName();
if (fnMap)
{
- std::unique_ptr<FileDef> fd { createFileDef(dirPath+"/",name) };
- if (!name.isEmpty())
+ std::unique_ptr<FileDef> fd { createFileDef(QCString(dirPath+"/"),QCString(name)) };
+ if (!name.empty())
{
- FileName *fn = fnMap->add(name,filePath);
+ FileName *fn = fnMap->add(QCString(name),QCString(filePath));
fn->push_back(std::move(fd));
}
}
if (resultList || resultSet)
{
- if (resultList) resultList->push_back(filePath.data());
- if (resultSet) resultSet->insert(filePath.data());
+ if (resultList) resultList->push_back(filePath);
+ if (resultSet) resultSet->insert(filePath);
}
- if (killSet) killSet->insert(fi.absFilePath().utf8().data());
+ if (killSet) killSet->insert(fi.absFilePath());
}
}
else if (fi.isDir()) // readable dir
{
- totalSize+=readDir(&fi,fnMap,exclSet,patList,
+ readDir(&fi,fnMap,exclSet,patList,
exclPatList,resultList,resultSet,errorIfNotExist,
recursive,killSet,paths);
}
}
}
}
- return totalSize;
}
//----------------------------------------------------------------------------
@@ -9838,7 +10024,7 @@ static void escapeAliases()
{
for (auto &kv : Doxygen::aliasMap)
{
- QCString value=kv.second;
+ QCString value(kv.second);
QCString newValue;
int in,p=0;
// for each \n in the alias command value
@@ -9872,7 +10058,7 @@ static void escapeAliases()
}
newValue+=value.mid(p,value.length()-p);
kv.second=newValue.str();
- //printf("Alias %s has value %s\n",adi.currentKey().data(),s->data());
+ //printf("Alias %s has value %s\n",kv.first.c_str(),qPrint(newValue));
}
}
@@ -9884,13 +10070,13 @@ void readAliases()
const StringVector &aliasList = Config_getList(ALIASES);
for (const auto &al : aliasList)
{
- QCString alias = al;
+ QCString alias(al);
int i=alias.find('=');
if (i>0)
{
QCString name=alias.left(i).stripWhiteSpace();
QCString value=alias.right(alias.length()-i-1);
- //printf("Alias: found name='%s' value='%s'\n",name.data(),value.data());
+ //printf("Alias: found name='%s' value='%s'\n",qPrint(name),qPrint(value));
if (!name.isEmpty())
{
auto it = Doxygen::aliasMap.find(name.str());
@@ -9911,7 +10097,7 @@ void readAliases()
//----------------------------------------------------------------------------
-static void dumpSymbol(FTextStream &t,Definition *d)
+static void dumpSymbol(TextStream &t,Definition *d)
{
QCString anchor;
if (d->definitionType()==Definition::TypeMember)
@@ -9930,15 +10116,15 @@ static void dumpSymbol(FTextStream &t,Definition *d)
<< d->name() << "','"
<< d->getDefFileName() << "','"
<< d->getDefLine()
- << "');" << endl;
+ << "');\n";
}
static void dumpSymbolMap()
{
- QFile f("symbols.sql");
- if (f.open(IO_WriteOnly))
+ std::ofstream f("symbols.sql",std::ofstream::out | std::ofstream::binary);
+ if (f.is_open())
{
- FTextStream t(&f);
+ TextStream t(&f);
for (const auto &kv : Doxygen::symbolMap)
{
dumpSymbol(t,kv.second);
@@ -9964,7 +10150,7 @@ static void devUsage()
static void version(const bool extended)
{
QCString versionString = getFullVersion();
- msg("%s\n",versionString.data());
+ msg("%s\n",qPrint(versionString));
if (extended)
{
QCString extVers;
@@ -9986,7 +10172,7 @@ static void version(const bool extended)
{
int lastComma = extVers.findRev(',');
if (lastComma != -1) extVers = extVers.replace(lastComma,1," and");
- msg(" with %s.\n",extVers.data());
+ msg(" with %s.\n",qPrint(extVers));
}
}
}
@@ -9994,33 +10180,33 @@ static void version(const bool extended)
//----------------------------------------------------------------------------
// print the usage of doxygen
-static void usage(const char *name,const char *versionString)
+static void usage(const QCString &name,const QCString &versionString)
{
- msg("Doxygen version %s\nCopyright Dimitri van Heesch 1997-2021\n\n",versionString);
+ msg("Doxygen version %s\nCopyright Dimitri van Heesch 1997-2021\n\n",qPrint(versionString));
msg("You can use doxygen in a number of ways:\n\n");
msg("1) Use doxygen to generate a template configuration file:\n");
- msg(" %s [-s] -g [configName]\n\n",name);
+ msg(" %s [-s] -g [configName]\n\n",qPrint(name));
msg("2) Use doxygen to update an old configuration file:\n");
- msg(" %s [-s] -u [configName]\n\n",name);
+ msg(" %s [-s] -u [configName]\n\n",qPrint(name));
msg("3) Use doxygen to generate documentation using an existing ");
msg("configuration file:\n");
- msg(" %s [configName]\n\n",name);
+ msg(" %s [configName]\n\n",qPrint(name));
msg("4) Use doxygen to generate a template file controlling the layout of the\n");
msg(" generated documentation:\n");
- msg(" %s -l [layoutFileName]\n\n",name);
+ msg(" %s -l [layoutFileName]\n\n",qPrint(name));
msg(" In case layoutFileName is omitted layoutFileName.xml will be used as filename.\n");
msg(" If - is used for layoutFileName doxygen will write to standard output.\n\n");
msg("5) Use doxygen to generate a template style sheet file for RTF, HTML or Latex.\n");
- msg(" RTF: %s -w rtf styleSheetFile\n",name);
- msg(" HTML: %s -w html headerFile footerFile styleSheetFile [configFile]\n",name);
- msg(" LaTeX: %s -w latex headerFile footerFile styleSheetFile [configFile]\n\n",name);
+ msg(" RTF: %s -w rtf styleSheetFile\n",qPrint(name));
+ msg(" HTML: %s -w html headerFile footerFile styleSheetFile [configFile]\n",qPrint(name));
+ msg(" LaTeX: %s -w latex headerFile footerFile styleSheetFile [configFile]\n\n",qPrint(name));
msg("6) Use doxygen to generate a rtf extensions file\n");
- msg(" RTF: %s -e rtf extensionsFile\n\n",name);
+ msg(" RTF: %s -e rtf extensionsFile\n\n",qPrint(name));
msg(" If - is used for extensionsFile doxygen will write to standard output.\n\n");
msg("7) Use doxygen to compare the used configuration file with the template configuration file\n");
- msg(" %s -x [configFile]\n\n",name);
+ msg(" %s -x [configFile]\n\n",qPrint(name));
msg("8) Use doxygen to show a list of built-in emojis.\n");
- msg(" %s -f emoji outputFileName\n\n",name);
+ msg(" %s -f emoji outputFileName\n\n",qPrint(name));
msg(" If - is used for outputFileName doxygen will write to standard output.\n\n");
msg("If -s is specified the comments of the configuration items in the config file will be omitted.\n");
msg("If configName is omitted 'Doxyfile' will be used as a default.\n");
@@ -10048,9 +10234,9 @@ static const char *getArg(int argc,char **argv,int &optind)
class NullOutlineParser : public OutlineParserInterface
{
public:
- void parseInput(const char *, const char *,const std::shared_ptr<Entry> &, ClangTUParser*) {}
+ void parseInput(const QCString &file, const char *buf,const std::shared_ptr<Entry> &, ClangTUParser*) {}
bool needsPreprocessing(const QCString &) const { return FALSE; }
- void parsePrototype(const char *) {}
+ void parsePrototype(const QCString &) {}
};
@@ -10062,8 +10248,8 @@ template<class T> std::function< std::unique_ptr<T>() > make_parser_factory()
void initDoxygen()
{
initResources();
- const char *lang = Portable::getenv("LC_ALL");
- if (lang) Portable::setenv("LANG",lang);
+ QCString lang = Portable::getenv("LC_ALL");
+ if (!lang.isEmpty()) Portable::setenv("LANG",lang);
std::setlocale(LC_ALL,"");
std::setlocale(LC_CTYPE,"C"); // to get isspace(0xA0)==0, needed for UTF-8
std::setlocale(LC_NUMERIC,"C");
@@ -10110,6 +10296,7 @@ void initDoxygen()
Doxygen::namespaceLinkedMap = new NamespaceLinkedMap;
Doxygen::classLinkedMap = new ClassLinkedMap;
Doxygen::hiddenClassLinkedMap = new ClassLinkedMap;
+ Doxygen::conceptLinkedMap = new ConceptLinkedMap;
Doxygen::dirLinkedMap = new DirLinkedMap;
Doxygen::pageLinkedMap = new PageLinkedMap; // all doc pages
Doxygen::exampleLinkedMap = new PageLinkedMap; // all examples
@@ -10171,7 +10358,7 @@ void cleanUpDoxygen()
DotManager::deleteInstance();
}
-static int computeIdealCacheParam(uint v)
+static int computeIdealCacheParam(size_t v)
{
//printf("computeIdealCacheParam(v=%u)\n",v);
@@ -10180,7 +10367,7 @@ static int computeIdealCacheParam(uint v)
// r = log2(v)
// convert to a valid cache size value
- return QMAX(0,QMIN(r-16,9));
+ return std::max(0,std::min(r-16,9));
}
void readConfiguration(int argc, char **argv)
@@ -10192,11 +10379,11 @@ void readConfiguration(int argc, char **argv)
**************************************************************************/
int optind=1;
- const char *configName=0;
- const char *layoutName=0;
- const char *debugLabel;
- const char *formatName;
- const char *listName;
+ QCString configName;
+ QCString layoutName;
+ QCString debugLabel;
+ QCString formatName;
+ QCString listName;
bool genConfig=FALSE;
bool shortList=FALSE;
bool diffList=FALSE;
@@ -10227,7 +10414,7 @@ void readConfiguration(int argc, char **argv)
break;
case 'd':
debugLabel=getArg(argc,argv,optind);
- if (!debugLabel)
+ if (debugLabel.isEmpty())
{
devUsage();
cleanUpDoxygen();
@@ -10236,7 +10423,7 @@ void readConfiguration(int argc, char **argv)
retVal = Debug::setFlag(debugLabel);
if (!retVal)
{
- err("option \"-d\" has unknown debug specifier: \"%s\".\n",debugLabel);
+ err("option \"-d\" has unknown debug specifier: \"%s\".\n",qPrint(debugLabel));
devUsage();
cleanUpDoxygen();
exit(1);
@@ -10253,13 +10440,13 @@ void readConfiguration(int argc, char **argv)
break;
case 'e':
formatName=getArg(argc,argv,optind);
- if (!formatName)
+ if (formatName.isEmpty())
{
err("option \"-e\" is missing format specifier rtf.\n");
cleanUpDoxygen();
exit(1);
}
- if (qstricmp(formatName,"rtf")==0)
+ if (qstricmp(formatName.data(),"rtf")==0)
{
if (optind+1>=argc)
{
@@ -10267,10 +10454,11 @@ void readConfiguration(int argc, char **argv)
cleanUpDoxygen();
exit(1);
}
- QFile f;
+ std::ofstream f;
if (openOutputFile(argv[optind+1],f))
{
- RTFGenerator::writeExtensionsFile(f);
+ TextStream t(&f);
+ RTFGenerator::writeExtensionsFile(t);
}
cleanUpDoxygen();
exit(0);
@@ -10281,13 +10469,13 @@ void readConfiguration(int argc, char **argv)
break;
case 'f':
listName=getArg(argc,argv,optind);
- if (!listName)
+ if (listName.isEmpty())
{
err("option \"-f\" is missing list specifier.\n");
cleanUpDoxygen();
exit(1);
}
- if (qstricmp(listName,"emoji")==0)
+ if (qstricmp(listName.data(),"emoji")==0)
{
if (optind+1>=argc)
{
@@ -10295,10 +10483,11 @@ void readConfiguration(int argc, char **argv)
cleanUpDoxygen();
exit(1);
}
- QFile f;
+ std::ofstream f;
if (openOutputFile(argv[optind+1],f))
{
- EmojiEntityMapper::instance()->writeEmojiFile(f);
+ TextStream t(&f);
+ EmojiEntityMapper::instance()->writeEmojiFile(t);
}
cleanUpDoxygen();
exit(0);
@@ -10309,13 +10498,13 @@ void readConfiguration(int argc, char **argv)
break;
case 'w':
formatName=getArg(argc,argv,optind);
- if (!formatName)
+ if (formatName.isEmpty())
{
err("option \"-w\" is missing format specifier rtf, html or latex\n");
cleanUpDoxygen();
exit(1);
}
- if (qstricmp(formatName,"rtf")==0)
+ if (qstricmp(formatName.data(),"rtf")==0)
{
if (optind+1>=argc)
{
@@ -10323,18 +10512,19 @@ void readConfiguration(int argc, char **argv)
cleanUpDoxygen();
exit(1);
}
- QFile f;
+ std::ofstream f;
if (openOutputFile(argv[optind+1],f))
{
- RTFGenerator::writeStyleSheetFile(f);
+ TextStream t(&f);
+ RTFGenerator::writeStyleSheetFile(t);
}
cleanUpDoxygen();
exit(1);
}
- else if (qstricmp(formatName,"html")==0)
+ else if (qstricmp(formatName.data(),"html")==0)
{
Config::init();
- if (optind+4<argc || QFileInfo("Doxyfile").exists())
+ if (optind+4<argc || FileInfo("Doxyfile").exists())
// explicit config file mentioned or default found on disk
{
QCString df = optind+4<argc ? argv[optind+4] : QCString("Doxyfile");
@@ -10357,31 +10547,34 @@ void readConfiguration(int argc, char **argv)
QCString outputLanguage=Config_getEnum(OUTPUT_LANGUAGE);
if (!setTranslator(outputLanguage))
{
- warn_uncond("Output language %s not supported! Using English instead.\n", outputLanguage.data());
+ warn_uncond("Output language %s not supported! Using English instead.\n", qPrint(outputLanguage));
}
- QFile f;
+ std::ofstream f;
if (openOutputFile(argv[optind+1],f))
{
- HtmlGenerator::writeHeaderFile(f, argv[optind+3]);
+ TextStream t(&f);
+ HtmlGenerator::writeHeaderFile(t, argv[optind+3]);
}
f.close();
if (openOutputFile(argv[optind+2],f))
{
- HtmlGenerator::writeFooterFile(f);
+ TextStream t(&f);
+ HtmlGenerator::writeFooterFile(t);
}
f.close();
if (openOutputFile(argv[optind+3],f))
{
- HtmlGenerator::writeStyleSheetFile(f);
+ TextStream t(&f);
+ HtmlGenerator::writeStyleSheetFile(t);
}
cleanUpDoxygen();
exit(0);
}
- else if (qstricmp(formatName,"latex")==0)
+ else if (qstricmp(formatName.data(),"latex")==0)
{
Config::init();
- if (optind+4<argc || QFileInfo("Doxyfile").exists())
+ if (optind+4<argc || FileInfo("Doxyfile").exists())
{
QCString df = optind+4<argc ? argv[optind+4] : QCString("Doxyfile");
if (!Config::parse(df))
@@ -10403,30 +10596,33 @@ void readConfiguration(int argc, char **argv)
QCString outputLanguage=Config_getEnum(OUTPUT_LANGUAGE);
if (!setTranslator(outputLanguage))
{
- warn_uncond("Output language %s not supported! Using English instead.\n", outputLanguage.data());
+ warn_uncond("Output language %s not supported! Using English instead.\n", qPrint(outputLanguage));
}
- QFile f;
+ std::ofstream f;
if (openOutputFile(argv[optind+1],f))
{
- LatexGenerator::writeHeaderFile(f);
+ TextStream t(&f);
+ LatexGenerator::writeHeaderFile(t);
}
f.close();
if (openOutputFile(argv[optind+2],f))
{
- LatexGenerator::writeFooterFile(f);
+ TextStream t(&f);
+ LatexGenerator::writeFooterFile(t);
}
f.close();
if (openOutputFile(argv[optind+3],f))
{
- LatexGenerator::writeStyleSheetFile(f);
+ TextStream t(&f);
+ LatexGenerator::writeStyleSheetFile(t);
}
cleanUpDoxygen();
exit(0);
}
else
{
- err("Illegal format specifier \"%s\": should be one of rtf, html or latex\n",formatName);
+ err("Illegal format specifier \"%s\": should be one of rtf, html or latex\n",qPrint(formatName));
cleanUpDoxygen();
exit(1);
}
@@ -10499,7 +10695,7 @@ void readConfiguration(int argc, char **argv)
Config::init();
- QFileInfo configFileInfo1("Doxyfile"),configFileInfo2("doxyfile");
+ FileInfo configFileInfo1("Doxyfile"),configFileInfo2("doxyfile");
if (optind>=argc)
{
if (configFileInfo1.exists())
@@ -10523,7 +10719,7 @@ void readConfiguration(int argc, char **argv)
}
else
{
- QFileInfo fi(argv[optind]);
+ FileInfo fi(argv[optind]);
if (fi.exists() || qstrcmp(argv[optind],"-")==0 || genConfig)
{
configName=argv[optind];
@@ -10552,7 +10748,7 @@ void readConfiguration(int argc, char **argv)
if (!Config::parse(configName,updateConfig))
{
- err("could not open or read configuration file %s!\n",configName);
+ err("could not open or read configuration file %s!\n",qPrint(configName));
cleanUpDoxygen();
exit(1);
}
@@ -10572,8 +10768,8 @@ void readConfiguration(int argc, char **argv)
}
/* Perlmod wants to know the path to the config file.*/
- QFileInfo configFileInfo(configName);
- setPerlModDoxyfile(configFileInfo.absFilePath().data());
+ FileInfo configFileInfo(configName.str());
+ setPerlModDoxyfile(configFileInfo.absFilePath());
}
@@ -10602,7 +10798,7 @@ void adjustConfiguration()
if (!setTranslator(outputLanguage))
{
warn_uncond("Output language %s not supported! Using English instead.\n",
- outputLanguage.data());
+ qPrint(outputLanguage));
}
/* Set the global html file extension. */
@@ -10640,12 +10836,12 @@ void adjustConfiguration()
{
err("Failed to map file extension '%s' to unsupported language '%s'.\n"
"Check the EXTENSION_MAPPING setting in the config file.\n",
- ext.data(),language.data());
+ qPrint(ext),qPrint(language));
}
else
{
msg("Adding custom extension mapping: '%s' will be treated as language '%s'\n",
- ext.data(),language.data());
+ qPrint(ext),qPrint(language));
}
}
}
@@ -10670,11 +10866,11 @@ void adjustConfiguration()
#ifdef HAS_SIGNALS
static void stopDoxygen(int)
{
- QDir thisDir;
+ Dir thisDir;
msg("Cleaning up...\n");
if (!Doxygen::filterDBFileName.isEmpty())
{
- thisDir.remove(Doxygen::filterDBFileName);
+ thisDir.remove(Doxygen::filterDBFileName.str());
}
killpg(0,SIGINT);
exit(1);
@@ -10686,22 +10882,22 @@ static void writeTagFile()
QCString generateTagFile = Config_getString(GENERATE_TAGFILE);
if (generateTagFile.isEmpty()) return;
- QFile tag(generateTagFile);
- if (!tag.open(IO_WriteOnly))
+ std::ofstream f(generateTagFile.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
err("cannot open tag file %s for writing\n",
- generateTagFile.data()
+ qPrint(generateTagFile)
);
return;
}
- FTextStream tagFile(&tag);
- tagFile << "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>" << endl;
+ TextStream tagFile(&f);
+ tagFile << "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\n";
tagFile << "<tagfile doxygen_version=\"" << getDoxygenVersion() << "\"";
if (strlen(getGitVersion())>0)
{
tagFile << " doxygen_gitid=\"" << getGitVersion() << "\"";
}
- tagFile << ">" << endl;
+ tagFile << ">\n";
// for each file
for (const auto &fn : *Doxygen::inputNameLinkedMap)
@@ -10720,6 +10916,15 @@ static void writeTagFile()
cdm->writeTagFile(tagFile);
}
}
+ // for each concept
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ ConceptDefMutable *cdm = toConceptDefMutable(cd.get());
+ if (cdm && cdm->isLinkableInProject())
+ {
+ cdm->writeTagFile(tagFile);
+ }
+ }
// for each namespace
for (const auto &nd : *Doxygen::namespaceLinkedMap)
{
@@ -10741,38 +10946,18 @@ static void writeTagFile()
}
if (Doxygen::mainPage) Doxygen::mainPage->writeTagFile(tagFile);
- /*
- if (Doxygen::mainPage && !Config_getString(GENERATE_TAGFILE).isEmpty())
- {
- tagFile << " <compound kind=\"page\">" << endl
- << " <name>"
- << convertToXML(Doxygen::mainPage->name())
- << "</name>" << endl
- << " <title>"
- << convertToXML(Doxygen::mainPage->title())
- << "</title>" << endl
- << " <filename>"
- << convertToXML(Doxygen::mainPage->getOutputFileBase())
- << Doxygen::htmlFileExtension
- << "</filename>" << endl;
-
- mainPage->writeDocAnchorsToTagFile();
- tagFile << " </compound>" << endl;
- }
- */
-
- tagFile << "</tagfile>" << endl;
+ tagFile << "</tagfile>\n";
}
static void exitDoxygen()
{
if (!g_successfulRun) // premature exit
{
- QDir thisDir;
+ Dir thisDir;
msg("Exiting...\n");
if (!Doxygen::filterDBFileName.isEmpty())
{
- thisDir.remove(Doxygen::filterDBFileName);
+ thisDir.remove(Doxygen::filterDBFileName.str());
}
}
}
@@ -10788,12 +10973,12 @@ static QCString createOutputDirectory(const QCString &baseDirName,
}
else if (formatDirName[0]!='/' && (formatDirName.length()==1 || formatDirName[1]!=':'))
{
- result.prepend(baseDirName+'/');
+ result.prepend(baseDirName+"/");
}
- QDir formatDir(result);
- if (!formatDir.exists() && !formatDir.mkdir(result))
+ Dir formatDir(result.str());
+ if (!formatDir.exists() && !formatDir.mkdir(result.str()))
{
- err("Could not create output directory %s\n", result.data());
+ err("Could not create output directory %s\n", qPrint(result));
cleanUpDoxygen();
exit(1);
}
@@ -11007,7 +11192,7 @@ void parseInput()
// we would like to show the versionString earlier, but we first have to handle the configuration file
// to know the value of the QUIET setting.
QCString versionString = getFullVersion();
- msg("Doxygen version used: %s\n",versionString.data());
+ msg("Doxygen version used: %s\n",qPrint(versionString));
/**************************************************************************
* Make sure the output directory exists
@@ -11015,29 +11200,29 @@ void parseInput()
QCString outputDirectory = Config_getString(OUTPUT_DIRECTORY);
if (outputDirectory.isEmpty())
{
- outputDirectory = Config_updateString(OUTPUT_DIRECTORY,QDir::currentDirPath().utf8());
+ outputDirectory = Config_updateString(OUTPUT_DIRECTORY,Dir::currentDirPath().c_str());
}
else
{
- QDir dir(outputDirectory);
+ Dir dir(outputDirectory.str());
if (!dir.exists())
{
- dir.setPath(QDir::currentDirPath());
- if (!dir.mkdir(outputDirectory))
+ dir.setPath(Dir::currentDirPath());
+ if (!dir.mkdir(outputDirectory.str()))
{
err("tag OUTPUT_DIRECTORY: Output directory '%s' does not "
- "exist and cannot be created\n",outputDirectory.data());
+ "exist and cannot be created\n",qPrint(outputDirectory));
cleanUpDoxygen();
exit(1);
}
else
{
msg("Notice: Output directory '%s' does not exist. "
- "I have created it for you.\n", outputDirectory.data());
+ "I have created it for you.\n", qPrint(outputDirectory));
}
- dir.cd(outputDirectory);
+ dir.setPath(outputDirectory.str());
}
- outputDirectory = Config_updateString(OUTPUT_DIRECTORY,dir.absPath().utf8());
+ outputDirectory = Config_updateString(OUTPUT_DIRECTORY,dir.absPath().c_str());
}
/**************************************************************************
@@ -11133,11 +11318,11 @@ void parseInput()
newFontPath+=Portable::pathListSeparator();
newFontPath+=curFontPath;
}
- Portable::setenv("DOTFONTPATH",newFontPath);
+ Portable::setenv("DOTFONTPATH",qPrint(newFontPath));
}
else
{
- Portable::setenv("DOTFONTPATH",curFontPath);
+ Portable::setenv("DOTFONTPATH",qPrint(curFontPath));
}
}
@@ -11156,15 +11341,15 @@ void parseInput()
defaultLayoutUsed = TRUE;
}
- QFile layoutFile(layoutFileName);
- if (layoutFile.open(IO_ReadOnly))
+ FileInfo fi(layoutFileName.str());
+ if (fi.exists())
{
- msg("Parsing layout file %s...\n",layoutFileName.data());
+ msg("Parsing layout file %s...\n",qPrint(layoutFileName));
LayoutDocManager::instance().parse(layoutFileName);
}
else if (!defaultLayoutUsed)
{
- warn_uncond("failed to open layout file '%s' for reading!\n",layoutFileName.data());
+ warn_uncond("failed to open layout file '%s' for reading!\n",qPrint(layoutFileName));
}
/**************************************************************************
@@ -11173,12 +11358,12 @@ void parseInput()
// prevent search in the output directories
StringVector exclPatterns = Config_getList(EXCLUDE_PATTERNS);
- if (generateHtml) exclPatterns.push_back(htmlOutput.data());
- if (generateDocbook) exclPatterns.push_back(docbookOutput.data());
- if (generateXml) exclPatterns.push_back(xmlOutput.data());
- if (generateLatex) exclPatterns.push_back(latexOutput.data());
- if (generateRtf) exclPatterns.push_back(rtfOutput.data());
- if (generateMan) exclPatterns.push_back(manOutput.data());
+ if (generateHtml) exclPatterns.push_back(htmlOutput.str());
+ if (generateDocbook) exclPatterns.push_back(docbookOutput.str());
+ if (generateXml) exclPatterns.push_back(xmlOutput.str());
+ if (generateLatex) exclPatterns.push_back(latexOutput.str());
+ if (generateRtf) exclPatterns.push_back(rtfOutput.str());
+ if (generateMan) exclPatterns.push_back(manOutput.str());
Config_updateList(EXCLUDE_PATTERNS,exclPatterns);
searchInputFiles();
@@ -11266,6 +11451,10 @@ void parseInput()
buildClassList(root.get());
g_s.end();
+ g_s.begin("Building concept list...\n");
+ buildConceptList(root.get());
+ g_s.end();
+
// build list of using declarations here (global list)
buildListOfUsingDecls(root.get());
g_s.end();
@@ -11285,6 +11474,11 @@ void parseInput()
g_s.begin("Associating documentation with classes...\n");
buildClassDocList(root.get());
+ g_s.end();
+
+ g_s.begin("Associating documentation with concepts...\n");
+ buildConceptDocList(root.get());
+ g_s.end();
g_s.begin("Building example list...\n");
buildExampleList(root.get());
@@ -11413,8 +11607,8 @@ void parseInput()
auto memberNameComp = [](const MemberNameLinkedMap::Ptr &n1,const MemberNameLinkedMap::Ptr &n2)
{
- return qstricmp(n1->memberName()+getPrefixIndex(n1->memberName()),
- n2->memberName()+getPrefixIndex(n2->memberName())
+ return qstricmp(n1->memberName().data()+getPrefixIndex(n1->memberName()),
+ n2->memberName().data()+getPrefixIndex(n2->memberName())
)<0;
};
@@ -11436,6 +11630,11 @@ void parseInput()
return qstricmp(n1->name(),n2->name())<0;
};
+ auto conceptComp = [](const ConceptLinkedMap::Ptr &c1,const ConceptLinkedMap::Ptr &c2)
+ {
+ return qstricmp(c1->name(),c2->name())<0;
+ };
+
g_s.begin("Sorting lists...\n");
std::sort(Doxygen::memberNameLinkedMap->begin(),
Doxygen::memberNameLinkedMap->end(),
@@ -11449,13 +11648,14 @@ void parseInput()
std::sort(Doxygen::classLinkedMap->begin(),
Doxygen::classLinkedMap->end(),
classComp);
+ std::sort(Doxygen::conceptLinkedMap->begin(),
+ Doxygen::conceptLinkedMap->end(),
+ conceptComp);
std::sort(Doxygen::namespaceLinkedMap->begin(),
Doxygen::namespaceLinkedMap->end(),
namespaceComp);
g_s.end();
- QDir thisDir;
-
g_s.begin("Determining which enums are documented\n");
findDocumentedEnumValues();
g_s.end();
@@ -11566,7 +11766,7 @@ void parseInput()
std::sort(Doxygen::groupLinkedMap->begin(),
Doxygen::groupLinkedMap->end(),
[](const auto &g1,const auto &g2)
- { return qstrcmp(g1->groupTitle(),g2->groupTitle())<0; });
+ { return g1->groupTitle() < g2->groupTitle(); });
for (const auto &gd : *Doxygen::groupLinkedMap)
{
@@ -11675,11 +11875,11 @@ void generateOutput()
if (generateHtml && searchEngine)
{
QCString searchDirName = Config_getString(HTML_OUTPUT)+"/search";
- QDir searchDir(searchDirName);
- if (!searchDir.exists() && !searchDir.mkdir(searchDirName))
+ Dir searchDir(searchDirName.str());
+ if (!searchDir.exists() && !searchDir.mkdir(searchDirName.str()))
{
term("Could not create search results directory '%s' $PWD='%s'\n",
- searchDirName.data(),QDir::currentDirPath().data());
+ qPrint(searchDirName),Dir::currentDirPath().c_str());
}
HtmlGenerator::writeSearchData(searchDirName);
if (!serverBasedSearch) // client side search index
@@ -11738,6 +11938,10 @@ void generateOutput()
generateClassDocs();
g_s.end();
+ g_s.begin("Generating concept documentation...\n");
+ generateConceptDocs();
+ g_s.end();
+
g_s.begin("Generating namespace index...\n");
generateNamespaceDocs();
g_s.end();
@@ -11811,7 +12015,7 @@ void generateOutput()
{
searchDataFile="searchdata.xml";
}
- if (!Portable::isAbsolutePath(searchDataFile))
+ if (!Portable::isAbsolutePath(searchDataFile.data()))
{
searchDataFile.prepend(Config_getString(OUTPUT_DIRECTORY)+"/");
}
@@ -11877,16 +12081,16 @@ void generateOutput()
!Config_getString(HHC_LOCATION).isEmpty())
{
g_s.begin("Running html help compiler...\n");
- QString oldDir = QDir::currentDirPath();
- QDir::setCurrent(Config_getString(HTML_OUTPUT));
+ std::string oldDir = Dir::currentDirPath();
+ Dir::setCurrent(Config_getString(HTML_OUTPUT).str());
Portable::setShortDir();
Portable::sysTimerStart();
- if (Portable::system(Config_getString(HHC_LOCATION), "index.hhp", Debug::isFlagSet(Debug::ExtCmd))!=1)
+ if (Portable::system(Config_getString(HHC_LOCATION).data(), "index.hhp", Debug::isFlagSet(Debug::ExtCmd))!=1)
{
err("failed to run html help compiler on index.hhp\n");
}
Portable::sysTimerStop();
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
g_s.end();
}
@@ -11897,19 +12101,19 @@ void generateOutput()
!Config_getString(QHG_LOCATION).isEmpty())
{
g_s.begin("Running qhelpgenerator...\n");
- QCString const qhpFileName = Qhp::getQhpFileName();
- QCString const qchFileName = getQchFileName();
+ QCString qhpFileName = Qhp::getQhpFileName();
+ QCString qchFileName = getQchFileName();
- QCString const args = QCString().sprintf("%s -o \"%s\"", qhpFileName.data(), qchFileName.data());
- QString const oldDir = QDir::currentDirPath();
- QDir::setCurrent(Config_getString(HTML_OUTPUT));
+ QCString args = QCString().sprintf("%s -o \"%s\"", qPrint(qhpFileName), qPrint(qchFileName));
+ std::string oldDir = Dir::currentDirPath();
+ Dir::setCurrent(Config_getString(HTML_OUTPUT).str());
Portable::sysTimerStart();
- if (Portable::system(Config_getString(QHG_LOCATION), args.data(), FALSE))
+ if (Portable::system(Config_getString(QHG_LOCATION).data(), args.data(), FALSE))
{
err("failed to run qhelpgenerator on index.qhp\n");
}
Portable::sysTimerStop();
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
g_s.end();
}
@@ -11919,7 +12123,7 @@ void generateOutput()
Doxygen::lookupCache->capacity(),
Doxygen::lookupCache->hits(),
Doxygen::lookupCache->misses());
- cacheParam = computeIdealCacheParam(Doxygen::lookupCache->misses()*2/3); // part of the cache is flushed, hence the 2/3 correction factor
+ cacheParam = computeIdealCacheParam(static_cast<size_t>(Doxygen::lookupCache->misses()*2/3)); // part of the cache is flushed, hence the 2/3 correction factor
if (cacheParam>Config_getInt(LOOKUP_CACHE_SIZE))
{
msg("Note: based on cache misses the ideal setting for LOOKUP_CACHE_SIZE is %d at the cost of higher memory usage.\n",cacheParam);
@@ -11946,8 +12150,8 @@ void generateOutput()
cleanUpDoxygen();
finalizeSearchIndexer();
- QDir thisDir;
- thisDir.remove(Doxygen::filterDBFileName);
+ Dir thisDir;
+ thisDir.remove(Doxygen::filterDBFileName.str());
finishWarnExit();
Config::deinit();
delete Doxygen::clangUsrMap;
diff --git a/src/doxygen.h b/src/doxygen.h
index 227efcc..3cc6934 100644
--- a/src/doxygen.h
+++ b/src/doxygen.h
@@ -17,7 +17,6 @@
#define DOXYGEN_H
#include "containers.h"
-#include "ftextstream.h"
#include "membergroup.h"
#include "dirdef.h"
#include "memberlist.h"
@@ -34,7 +33,6 @@ class PageLinkedMap;
class PageDef;
class SearchIndexIntf;
class ParserManager;
-class QFileInfo;
class BufStr;
class CiteDict;
class MemberDef;
@@ -43,6 +41,7 @@ class GroupLinkedMap;
class FileDef;
class ClassDef;
class ClassLinkedMap;
+class ConceptLinkedMap;
class MemberNameLinkedMap;
class FileNameLinkedMap;
class NamespaceLinkedMap;
@@ -78,6 +77,7 @@ class Doxygen
public:
static ClassLinkedMap *classLinkedMap;
static ClassLinkedMap *hiddenClassLinkedMap;
+ static ConceptLinkedMap *conceptLinkedMap;
static PageLinkedMap *exampleLinkedMap;
static PageLinkedMap *pageLinkedMap;
static std::unique_ptr<PageDef> mainPage;
@@ -130,7 +130,7 @@ void generateOutput();
void readAliases();
void readFormulaRepository(QCString dir, bool cmp = FALSE);
void cleanUpDoxygen();
-int readFileOrDirectory(const char *s,
+void readFileOrDirectory(const QCString &s,
FileNameLinkedMap *fnDict,
StringUnorderedSet *exclSet,
const StringVector *patList,
diff --git a/src/eclipsehelp.cpp b/src/eclipsehelp.cpp
index bbb3b01..b2f8193 100644
--- a/src/eclipsehelp.cpp
+++ b/src/eclipsehelp.cpp
@@ -3,8 +3,8 @@
* Copyright (C) 1997-2015 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
+ * 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.
*
@@ -17,13 +17,12 @@
#include "config.h"
#include "message.h"
#include "doxygen.h"
-#include <qfile.h>
-EclipseHelp::EclipseHelp() : m_depth(0), m_endtag(FALSE), m_openTags(0), m_tocfile(0)
+EclipseHelp::EclipseHelp() : m_depth(0), m_endtag(FALSE), m_openTags(0)
{
}
-EclipseHelp::~EclipseHelp()
+EclipseHelp::~EclipseHelp()
{
}
@@ -38,18 +37,18 @@ void EclipseHelp::indent()
void EclipseHelp::closedTag()
{
- if (m_endtag)
+ if (m_endtag)
{
- m_tocstream << "/>" << endl;
+ m_tocstream << "/>\n";
m_endtag = FALSE;
}
}
void EclipseHelp::openedTag()
{
- if (m_endtag)
+ if (m_endtag)
{
- m_tocstream << ">" << endl;
+ m_tocstream << ">\n";
m_endtag = FALSE;
++m_openTags;
}
@@ -61,33 +60,29 @@ void EclipseHelp::openedTag()
* This method opens the XML TOC file and writes headers of the files.
* \sa finalize()
*/
-void EclipseHelp::initialize()
+void EclipseHelp::initialize()
{
// -- read path prefix from the configuration
//m_pathprefix = Config_getString(ECLIPSE_PATHPREFIX);
//if (m_pathprefix.isEmpty()) m_pathprefix = "html/";
- // -- open the contents file
+ // -- open the contents file
QCString name = Config_getString(HTML_OUTPUT) + "/toc.xml";
- m_tocfile = new QFile(name);
- if (!m_tocfile->open(IO_WriteOnly))
+ m_tocstream.open(name.str(), std::ofstream::out | std::ofstream::binary);
+ if (!m_tocstream.is_open())
{
- term("Could not open file %s for writing\n", name.data());
+ term("Could not open file %s for writing\n", qPrint(name));
}
- // -- initialize its text stream
- m_tocstream.setDevice(m_tocfile);
- //m_tocstream.setEncoding(FTextStream::UnicodeUTF8);
-
// -- write the opening tag
QCString title = Config_getString(PROJECT_NAME);
if (title.isEmpty())
{
title = "Doxygen generated documentation";
}
- m_tocstream << "<toc label=\"" << convertToXML(title)
- << "\" topic=\"" << convertToXML(m_pathprefix)
- << "index" << Doxygen::htmlFileExtension << "\">" << endl;
+ m_tocstream << "<toc label=\"" << convertToXML(title)
+ << "\" topic=\"" << convertToXML(m_pathprefix)
+ << "index" << Doxygen::htmlFileExtension << "\">\n";
++ m_depth;
}
@@ -97,38 +92,35 @@ void EclipseHelp::initialize()
* This method writes footers of the files and closes them.
* \sa initialize()
*/
-void EclipseHelp::finalize()
+void EclipseHelp::finalize()
{
closedTag(); // -- close previous tag
- // -- write ending tag
+ // -- write ending tag
--m_depth;
- m_tocstream << "</toc>" << endl;
+ m_tocstream << "</toc>\n";
// -- close the content file
- m_tocstream.unsetDevice();
- m_tocfile->close();
- delete m_tocfile; m_tocfile = 0;
+ m_tocstream.close();
QCString name = Config_getString(HTML_OUTPUT) + "/plugin.xml";
- QFile pluginFile(name);
- if (pluginFile.open(IO_WriteOnly))
+ std::ofstream t(name.str(),std::ofstream::out | std::ofstream::binary);
+ if (t.is_open())
{
QCString docId = Config_getString(ECLIPSE_DOC_ID);
- FTextStream t(&pluginFile);
- t << "<plugin name=\"" << docId << "\" id=\"" << docId << "\"" << endl;
- t << " version=\"1.0.0\" provider-name=\"Doxygen\">" << endl;
- t << " <extension point=\"org.eclipse.help.toc\">" << endl;
- t << " <toc file=\"toc.xml\" primary=\"true\" />" << endl;
- t << " </extension>" << endl;
- t << "</plugin>" << endl;
+ t << "<plugin name=\"" << docId << "\" id=\"" << docId << "\"\n";
+ t << " version=\"1.0.0\" provider-name=\"Doxygen\">\n";
+ t << " <extension point=\"org.eclipse.help.toc\">\n";
+ t << " <toc file=\"toc.xml\" primary=\"true\" />\n";
+ t << " </extension>\n";
+ t << "</plugin>\n";
}
}
/*!
* \brief Increase the level of content hierarchy
*/
-void EclipseHelp::incContentsDepth()
+void EclipseHelp::incContentsDepth()
{
openedTag();
++m_depth;
@@ -139,7 +131,7 @@ void EclipseHelp::incContentsDepth()
*
* It closes currently opened topic tag.
*/
-void EclipseHelp::decContentsDepth()
+void EclipseHelp::decContentsDepth()
{
// -- end of the opened topic
closedTag();
@@ -149,7 +141,7 @@ void EclipseHelp::decContentsDepth()
{
--m_openTags;
indent();
- m_tocstream << "</topic>" << endl;
+ m_tocstream << "</topic>\n";
}
}
@@ -167,18 +159,18 @@ void EclipseHelp::decContentsDepth()
*/
void EclipseHelp::addContentsItem(
bool /* isDir */,
- const char *name,
- const char * /* ref */,
- const char *file,
- const char *anchor,
+ const QCString &name,
+ const QCString & /* ref */,
+ const QCString &file,
+ const QCString &anchor,
bool /* separateIndex */,
bool /* addToNavIndex */,
- const Definition * /*def*/)
+ const Definition * /*def*/)
{
- // -- write the topic tag
+ // -- write the topic tag
closedTag();
- if (file)
- {
+ if (!file.isEmpty())
+ {
switch (file[0]) // check for special markers (user defined URLs)
{
case '^':
@@ -195,9 +187,9 @@ void EclipseHelp::addContentsItem(
default:
indent();
m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
- m_tocstream << " href=\"" << convertToXML(m_pathprefix)
+ m_tocstream << " href=\"" << convertToXML(m_pathprefix)
<< file << Doxygen::htmlFileExtension;
- if (anchor)
+ if (!anchor.isEmpty())
{
m_tocstream << "#" << anchor;
}
@@ -217,20 +209,20 @@ void EclipseHelp::addContentsItem(
void EclipseHelp::addIndexItem(
const Definition * /* context */,
const MemberDef * /* md */,
- const char * /* sectionAnchor */,
- const char * /* title */)
+ const QCString & /* sectionAnchor */,
+ const QCString & /* title */)
{
}
-void EclipseHelp::addIndexFile(const char * /* name */)
+void EclipseHelp::addIndexFile(const QCString & /* name */)
{
}
-void EclipseHelp::addImageFile(const char * /* name */)
+void EclipseHelp::addImageFile(const QCString & /* name */)
{
}
-void EclipseHelp::addStyleSheetFile(const char * /* name */)
+void EclipseHelp::addStyleSheetFile(const QCString & /* name */)
{
}
diff --git a/src/eclipsehelp.h b/src/eclipsehelp.h
index 5d63768..1ba4df4 100644
--- a/src/eclipsehelp.h
+++ b/src/eclipsehelp.h
@@ -1,12 +1,12 @@
/******************************************************************************
*
- *
+ *
*
* Copyright (C) 1997-2015 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
+ * 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.
*
@@ -24,11 +24,11 @@
#ifndef ECLIPSEHELP_H
#define ECLIPSEHELP_H
+#include <fstream>
+
#include "index.h"
-#include "ftextstream.h"
/* -- forward declarations */
-class QFile;
class Definition;
/** Generator for Eclipse help files.
@@ -37,7 +37,7 @@ class Definition;
* These files can be used to generate a help plugin readable
* by the Eclipse IDE.
*/
-class EclipseHelp : public IndexIntf
+class EclipseHelp : public IndexIntf
{
public:
EclipseHelp();
@@ -48,22 +48,21 @@ class EclipseHelp : public IndexIntf
virtual void finalize();
virtual void incContentsDepth();
virtual void decContentsDepth();
- virtual void addContentsItem(bool isDir, const char *name, const char *ref,
- const char *file, const char *anchor,bool separateIndex,bool addToNavIndex,
+ virtual void addContentsItem(bool isDir, const QCString &name, const QCString &ref,
+ const QCString &file, const QCString &anchor,bool separateIndex,bool addToNavIndex,
const Definition *def);
virtual void addIndexItem(const Definition *context,const MemberDef *md,
- const char *sectionAnchor,const char *title);
- virtual void addIndexFile(const char *name);
- virtual void addImageFile(const char *name);
- virtual void addStyleSheetFile(const char *name);
+ const QCString &sectionAnchor,const QCString &title);
+ virtual void addIndexFile(const QCString &name);
+ virtual void addImageFile(const QCString &name);
+ virtual void addStyleSheetFile(const QCString &name);
private:
int m_depth;
bool m_endtag;
int m_openTags;
- QFile * m_tocfile;
- FTextStream m_tocstream;
+ std::ofstream m_tocstream;
QCString m_pathprefix;
/* -- avoid copying */
diff --git a/src/emoji.cpp b/src/emoji.cpp
index a8a2bb8..d723f64 100644
--- a/src/emoji.cpp
+++ b/src/emoji.cpp
@@ -15,8 +15,8 @@
#include "emoji.h"
#include "message.h"
-#include "ftextstream.h"
#include "util.h"
+#include "textstream.h"
static struct emojiEntityInfo
{
@@ -1555,21 +1555,20 @@ void EmojiEntityMapper::deleteInstance()
* @return the code for the requested Emoji entity name,
* in case the requested Emoji item does not exist `-1` is returned.
*/
-int EmojiEntityMapper::symbol2index(const QCString &symName) const
+int EmojiEntityMapper::symbol2index(const std::string &symName) const
{
- auto it = m_name2symGh.find(symName.str());
+ auto it = m_name2symGh.find(symName);
return it!=m_name2symGh.end() ? it->second : -1;
}
/*!
* @brief Writes the list of supported emojis to the given file.
*/
-void EmojiEntityMapper::writeEmojiFile(QFile &file)
+void EmojiEntityMapper::writeEmojiFile(TextStream &t)
{
- FTextStream t(&file);
for (int i = 0; i < g_numEmojiEntities; i++)
{
- t << g_emojiEntities[i].name << endl;
+ t << g_emojiEntities[i].name << "\n";
}
}
diff --git a/src/emoji.h b/src/emoji.h
index b27b761..7ec2519 100644
--- a/src/emoji.h
+++ b/src/emoji.h
@@ -18,9 +18,7 @@
#include <map>
#include <string>
-#include <qfile.h>
-
-class FTextStream;
+class TextStream;
/** @brief Singleton helper class to map emoji entities to other formats */
class EmojiEntityMapper
@@ -30,8 +28,8 @@ class EmojiEntityMapper
static void deleteInstance();
const char *name(int index) const;
const char *unicode(int index) const;
- void writeEmojiFile(QFile &file);
- int symbol2index(const QCString &symName) const;
+ void writeEmojiFile(TextStream &t);
+ int symbol2index(const std::string &symName) const;
private:
EmojiEntityMapper();
diff --git a/src/entry.cpp b/src/entry.cpp
index 6e343b0..84d1844 100644
--- a/src/entry.cpp
+++ b/src/entry.cpp
@@ -16,8 +16,9 @@
*/
#include <algorithm>
+#include <atomic>
#include <stdlib.h>
-#include <qfile.h>
+
#include "entry.h"
#include "util.h"
#include "section.h"
@@ -71,8 +72,8 @@ Entry::Entry(const Entry &e)
bitfields = e.bitfields;
argList = e.argList;
tArgLists = e.tArgLists;
- program = e.program;
- initializer = e.initializer;
+ program.str(e.program.str());
+ initializer.str(e.initializer.str());
includeFile = e.includeFile;
includeName = e.includeName;
doc = e.doc;
@@ -107,6 +108,7 @@ Entry::Entry(const Entry &e)
id = e.id;
extends = e.extends;
groups = e.groups;
+ req = e.req;
m_fileDef = e.m_fileDef;
m_parent = e.m_parent;
@@ -122,7 +124,7 @@ Entry::~Entry()
{
//printf("Entry::~Entry(%p) num=%d\n",this,g_num);
//printf("Deleting entry %d name %s type %x children %d\n",
- // num,name.data(),section,sublist->count());
+ // num,qPrint(name),section,sublist->count());
g_num--;
}
@@ -190,7 +192,7 @@ void Entry::reset()
args.resize(0);
bitfields.resize(0);
exception.resize(0);
- program.resize(0);
+ program.str(std::string());
includeFile.resize(0);
includeName.resize(0);
doc.resize(0);
@@ -206,7 +208,7 @@ void Entry::reset()
inbodyLine=-1;
inside.resize(0);
fileName.resize(0);
- initializer.resize(0);
+ initializer.str(std::string());
initLines = -1;
startLine = 1;
startColumn = 1;
@@ -241,6 +243,7 @@ void Entry::reset()
tArgLists.clear();
typeConstr.reset();
sli.clear();
+ req.resize(0);
m_fileDef = 0;
}
diff --git a/src/entry.h b/src/entry.h
index d6c0936..831501c 100644
--- a/src/entry.h
+++ b/src/entry.h
@@ -18,17 +18,16 @@
#ifndef ENTRY_H
#define ENTRY_H
-#include <qgstring.h>
-
#include <vector>
#include <memory>
+#include <sstream>
#include "types.h"
#include "arguments.h"
#include "reflist.h"
+#include "textstream.h"
class SectionInfo;
-class QFile;
class FileDef;
/** This class stores information about an inheritance relation
@@ -36,7 +35,7 @@ class FileDef;
struct BaseInfo
{
/*! Creates an object representing an inheritance relation */
- BaseInfo(const char *n,Protection p,Specifier v) :
+ BaseInfo(const QCString &n,Protection p,Specifier v) :
name(n),prot(p),virt(v) {}
QCString name; //!< the name of the base class
Protection prot; //!< inheritance type
@@ -67,6 +66,7 @@ class Entry
enum Sections {
CLASS_SEC = 0x00000001,
NAMESPACE_SEC = 0x00000010,
+ CONCEPT_SEC = 0x00000020,
COMPOUND_MASK = CLASS_SEC,
SCOPE_MASK = COMPOUND_MASK | NAMESPACE_SEC,
@@ -80,6 +80,7 @@ class Entry
CATEGORYDOC_SEC = 0x00040000,
SERVICEDOC_SEC = 0x00080000,
SINGLETONDOC_SEC = 0x00100000,
+ CONCEPTDOC_SEC = 0x00200000,
COMPOUNDDOC_MASK = CLASSDOC_SEC | STRUCTDOC_SEC | UNIONDOC_SEC |
INTERFACEDOC_SEC | EXCEPTIONDOC_SEC | PROTOCOLDOC_SEC |
CATEGORYDOC_SEC | SERVICEDOC_SEC | SINGLETONDOC_SEC,
@@ -257,9 +258,9 @@ class Entry
QCString args; //!< member argument string
QCString bitfields; //!< member's bit fields
ArgumentList argList; //!< member arguments as a list
- ArgumentLists tArgLists; //!< template argument declarations
- QGString program; //!< the program text
- QGString initializer; //!< initial value (for variables)
+ ArgumentLists tArgLists; //!< template argument declarations
+ TextStream program; //!< the program text
+ TextStream initializer; //!< initial value (for variables)
QCString includeFile; //!< include file (2 arg of \\class, must be unique)
QCString includeName; //!< include name (3 arg of \\class)
QCString doc; //!< documentation block (partly parsed)
@@ -296,6 +297,7 @@ class Entry
QCString id; //!< libclang id
LocalToc localToc;
QCString metaData; //!< Slice metadata
+ QCString req; //!< C++20 requires clause
/// return the command name used to define GROUPDOC_SEC
const char *groupDocCmd() const
diff --git a/src/example.h b/src/example.h
index 7929c24..190b894 100644
--- a/src/example.h
+++ b/src/example.h
@@ -19,7 +19,7 @@
#include <algorithm>
#include <vector>
-#include <qcstring.h>
+#include "qcstring.h"
class ClassDef;
class MemberName;
diff --git a/src/filedef.cpp b/src/filedef.cpp
index 7adb1a1..8686636 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -45,6 +45,7 @@
#include "clangparser.h"
#include "settings.h"
#include "definitionimpl.h"
+#include "conceptdef.h"
//---------------------------------------------------------------------------
@@ -55,7 +56,7 @@ using IncludeInfoMap = std::unordered_map<std::string, const IncludeInfo *>;
class FileDefImpl : public DefinitionMixin<FileDef>
{
public:
- FileDefImpl(const char *p,const char *n,const char *ref=0,const char *dn=0);
+ FileDefImpl(const QCString &p,const QCString &n,const QCString &ref=QCString(),const QCString &dn=QCString());
virtual ~FileDefImpl();
virtual DefType definitionType() const { return TypeFile; }
@@ -90,8 +91,9 @@ class FileDefImpl : public DefinitionMixin<FileDef>
virtual MemberList *getMemberList(MemberListType lt) const;
virtual const MemberLists &getMemberLists() const { return m_memberLists; }
virtual const MemberGroupList &getMemberGroups() const { return m_memberGroups; }
- virtual NamespaceLinkedRefMap getNamespaces() const { return m_namespaces; }
- virtual ClassLinkedRefMap getClasses() const { return m_classes; }
+ virtual const NamespaceLinkedRefMap &getNamespaces() const { return m_namespaces; }
+ virtual const ConceptLinkedRefMap &getConcepts() const { return m_concepts; }
+ virtual const ClassLinkedRefMap &getClasses() const { return m_classes; }
virtual QCString title() const;
virtual bool hasDetailedDescription() const;
virtual QCString fileVersion() const;
@@ -104,7 +106,7 @@ class FileDefImpl : public DefinitionMixin<FileDef>
virtual void writeMemberPages(OutputList &ol);
virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const;
virtual void writeSummaryLinks(OutputList &ol) const;
- virtual void writeTagFile(FTextStream &t);
+ virtual void writeTagFile(TextStream &t);
virtual void writeSourceHeader(OutputList &ol);
virtual void writeSourceBody(OutputList &ol,ClangTUParser *clangParser);
virtual void writeSourceFooter(OutputList &ol);
@@ -112,6 +114,7 @@ class FileDefImpl : public DefinitionMixin<FileDef>
virtual void setDiskName(const QCString &name);
virtual void insertMember(MemberDef *md);
virtual void insertClass(const ClassDef *cd);
+ virtual void insertConcept(const ConceptDef *cd);
virtual void insertNamespace(const NamespaceDef *nd);
virtual void computeAnchors();
virtual void setPackageDef(PackageDef *pd) { m_package=pd; }
@@ -121,8 +124,8 @@ class FileDefImpl : public DefinitionMixin<FileDef>
virtual void combineUsingRelations();
virtual bool generateSourceFile() const;
virtual void sortMemberLists();
- virtual void addIncludeDependency(const FileDef *fd,const char *incName,bool local,bool imported);
- virtual void addIncludedByDependency(const FileDef *fd,const char *incName,bool local,bool imported);
+ virtual void addIncludeDependency(const FileDef *fd,const QCString &incName,bool local,bool imported);
+ virtual void addIncludedByDependency(const FileDef *fd,const QCString &incName,bool local,bool imported);
virtual void addMembersToMemberGroup();
virtual void distributeMemberGroupDocumentation();
virtual void findSectionsInDocumentation();
@@ -143,6 +146,7 @@ class FileDefImpl : public DefinitionMixin<FileDef>
void writeNamespaceDeclarations(OutputList &ol,const QCString &title,
bool isConstantGroup);
void writeClassDeclarations(OutputList &ol,const QCString &title,const ClassLinkedRefMap &list);
+ void writeConcepts(OutputList &ol,const QCString &title);
void writeInlineClasses(OutputList &ol);
void startMemberDeclarations(OutputList &ol);
void endMemberDeclarations(OutputList &ol);
@@ -150,7 +154,7 @@ class FileDefImpl : public DefinitionMixin<FileDef>
void endMemberDocumentation(OutputList &ol);
void writeDetailedDescription(OutputList &ol,const QCString &title);
void writeBriefDescription(OutputList &ol);
- void writeClassesToTagFile(FTextStream &t,const ClassLinkedRefMap &list);
+ void writeClassesToTagFile(TextStream &t,const ClassLinkedRefMap &list);
IncludeInfoMap m_includeMap;
IncludeInfoList m_includeList;
@@ -178,10 +182,11 @@ class FileDefImpl : public DefinitionMixin<FileDef>
ClassLinkedRefMap m_interfaces;
ClassLinkedRefMap m_structs;
ClassLinkedRefMap m_exceptions;
+ ConceptLinkedRefMap m_concepts;
bool m_subGrouping;
};
-FileDef *createFileDef(const char *p,const char *n,const char *ref,const char *dn)
+FileDef *createFileDef(const QCString &p,const QCString &n,const QCString &ref,const QCString &dn)
{
return new FileDefImpl(p,n,ref,dn);
}
@@ -193,25 +198,24 @@ FileDef *createFileDef(const char *p,const char *n,const char *ref,const char *d
class DevNullCodeDocInterface : public CodeOutputInterface
{
public:
- virtual void codify(const char *) {}
- virtual void writeCodeLink(const char *,const char *,
- const char *,const char *,
- const char *) {}
- virtual void writeTooltip(const char *, const DocLinkInfo &, const char *,
- const char *, const SourceLinkInfo &, const SourceLinkInfo &
- ) {}
- virtual void writeLineNumber(const char *,const char *,
- const char *,int) {}
- virtual void startCodeLine(bool) {}
- virtual void endCodeLine() {}
- virtual void startFontClass(const char *) {}
- virtual void endFontClass() {}
- virtual void writeCodeAnchor(const char *) {}
- virtual void linkableSymbol(int, const char *,Definition *,Definition *) {}
- virtual void setCurrentDoc(const Definition *,const char *,bool) {}
- virtual void addWord(const char *,bool) {}
- virtual void startCodeFragment(const char *) {}
- virtual void endCodeFragment(const char *) {}
+ virtual void codify(const QCString &) override {}
+ virtual void writeCodeLink(const QCString &,const QCString &,
+ const QCString &,const QCString &,
+ const QCString &) override {}
+ virtual void writeTooltip(const QCString &, const DocLinkInfo &, const QCString &,
+ const QCString &, const SourceLinkInfo &, const SourceLinkInfo &
+ ) override {}
+ virtual void writeLineNumber(const QCString &,const QCString &,
+ const QCString &,int) override {}
+ virtual void startCodeLine(bool) override {}
+ virtual void endCodeLine() override {}
+ virtual void startFontClass(const QCString &) override {}
+ virtual void endFontClass() override {}
+ virtual void writeCodeAnchor(const QCString &) override {}
+ virtual void setCurrentDoc(const Definition *,const QCString &,bool) override {}
+ virtual void addWord(const QCString &,bool) override {}
+ virtual void startCodeFragment(const QCString &) override {}
+ virtual void endCodeFragment(const QCString &) override {}
};
//---------------------------------------------------------------------------
@@ -220,22 +224,22 @@ class DevNullCodeDocInterface : public CodeOutputInterface
\a nm the file name, and \a lref is an HTML anchor name if the
file was read from a tag file or 0 otherwise
*/
-FileDefImpl::FileDefImpl(const char *p,const char *nm,
- const char *lref,const char *dn)
+FileDefImpl::FileDefImpl(const QCString &p,const QCString &nm,
+ const QCString &lref,const QCString &dn)
: DefinitionMixin((QCString)p+nm,1,1,nm)
{
m_path=p;
m_filePath=m_path+nm;
m_fileName=nm;
setReference(lref);
- setDiskName(dn?dn:nm);
+ setDiskName(!dn.isEmpty() ? dn : nm);
m_package = 0;
m_isSource = guessSection(nm)==Entry::SOURCE_SEC;
m_docname = nm;
m_dir = 0;
if (Config_getBool(FULL_PATH_NAMES))
{
- m_docname.prepend(stripFromPath(m_path.copy()));
+ m_docname.prepend(stripFromPath(m_path));
}
setLanguage(getLanguageFromFileName(name()));
acquireFileVersion();
@@ -307,12 +311,12 @@ bool FileDefImpl::hasDetailedDescription() const
);
}
-void FileDefImpl::writeTagFile(FTextStream &tagFile)
+void FileDefImpl::writeTagFile(TextStream &tagFile)
{
- tagFile << " <compound kind=\"file\">" << endl;
- tagFile << " <name>" << convertToXML(name()) << "</name>" << endl;
- tagFile << " <path>" << convertToXML(getPath()) << "</path>" << endl;
- tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>" << endl;
+ tagFile << " <compound kind=\"file\">\n";
+ tagFile << " <name>" << convertToXML(name()) << "</name>\n";
+ tagFile << " <path>" << convertToXML(getPath()) << "</path>\n";
+ tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>\n";
for (const auto &ii : m_includeList)
{
const FileDef *fd=ii.fileDef;
@@ -329,8 +333,7 @@ void FileDefImpl::writeTagFile(FTextStream &tagFile)
<< "local=\"" << locStr << "\" "
<< "imported=\"" << impStr << "\">"
<< convertToXML(ii.includeName)
- << "</includes>"
- << endl;
+ << "</includes>\n";
}
}
for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File))
@@ -357,13 +360,24 @@ void FileDefImpl::writeTagFile(FTextStream &tagFile)
writeClassesToTagFile(tagFile, m_exceptions);
}
break;
+ case LayoutDocEntry::FileConcepts:
+ {
+ for (const auto *nd : m_concepts)
+ {
+ if (nd->isLinkableInProject())
+ {
+ tagFile << " <concept>" << convertToXML(nd->name()) << "</concept>\n";
+ }
+ }
+ }
+ break;
case LayoutDocEntry::FileNamespaces:
{
for (const auto *nd : m_namespaces)
{
if (nd->isLinkableInProject())
{
- tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>" << endl;
+ tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>\n";
}
}
}
@@ -392,7 +406,7 @@ void FileDefImpl::writeTagFile(FTextStream &tagFile)
}
writeDocAnchorsToTagFile(tagFile);
- tagFile << " </compound>" << endl;
+ tagFile << " </compound>\n";
}
void FileDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
@@ -405,7 +419,7 @@ void FileDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
ol.popGeneratorState();
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- ol.writeAnchor(0,"details");
+ ol.writeAnchor(QCString(),"details");
ol.popGeneratorState();
ol.startGroupHeader();
ol.parseText(title);
@@ -415,7 +429,7 @@ void FileDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF))
{
ol.generateDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF) &&
!documentation().isEmpty())
@@ -433,9 +447,9 @@ void FileDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
if (!documentation().isEmpty())
{
ol.generateDoc(docFile(),docLine(),this,0,documentation()+"\n",TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
- //printf("Writing source ref for file %s\n",name().data());
+ //printf("Writing source ref for file %s\n",qPrint(name()));
if (Config_getBool(SOURCE_BROWSER))
{
//if Latex enabled and LATEX_SOURCE_CODE isn't -> skip, bug_738548
@@ -459,8 +473,7 @@ void FileDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
if (fileMarkerPos!=-1) // should always pass this.
{
ol.parseText(refText.left(fileMarkerPos)); //text left from marker 1
- ol.writeObjectLink(0,getSourceFileBase(),
- 0,name());
+ ol.writeObjectLink(QCString(),getSourceFileBase(),QCString(),name());
ol.parseText(refText.right(
refText.length()-fileMarkerPos-2)); // text right from marker 2
}
@@ -482,7 +495,7 @@ void FileDefImpl::writeBriefDescription(OutputList &ol)
{
DocRoot *rootNode = validatingParseDoc(briefFile(),briefLine(),this,0,
briefDescription(),TRUE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
if (rootNode && !rootNode->isEmpty())
{
@@ -502,7 +515,7 @@ void FileDefImpl::writeBriefDescription(OutputList &ol)
)
{
ol.disableAllBut(OutputGenerator::Html);
- ol.startTextLink(0,"details");
+ ol.startTextLink(QCString(),"details");
ol.parseText(theTranslator->trMore());
ol.endTextLink();
}
@@ -514,14 +527,14 @@ void FileDefImpl::writeBriefDescription(OutputList &ol)
ol.writeSynopsis();
}
-void FileDefImpl::writeClassesToTagFile(FTextStream &tagFile, const ClassLinkedRefMap &list)
+void FileDefImpl::writeClassesToTagFile(TextStream &tagFile, const ClassLinkedRefMap &list)
{
for (const auto &cd : list)
{
if (cd->isLinkableInProject())
{
tagFile << " <class kind=\"" << cd->compoundTypeString() <<
- "\">" << convertToXML(cd->name()) << "</class>" << endl;
+ "\">" << convertToXML(cd->name()) << "</class>\n";
}
}
}
@@ -569,7 +582,7 @@ void FileDefImpl::writeIncludeFiles(OutputList &ol)
{
ol.writeObjectLink(fd->getReference(),
fd->generateSourceFile() ? fd->includeName() : fd->getOutputFileBase(),
- 0,ii.includeName);
+ QCString(),ii.includeName);
}
else
{
@@ -594,12 +607,12 @@ void FileDefImpl::writeIncludeGraph(OutputList &ol)
{
if (Config_getBool(HAVE_DOT) /*&& Config_getBool(INCLUDE_GRAPH)*/)
{
- //printf("Graph for file %s\n",name().data());
+ //printf("Graph for file %s\n",qPrint(name()));
DotInclDepGraph incDepGraph(this,FALSE);
if (incDepGraph.isTooBig())
{
warn_uncond("Include graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
- name().data(), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
+ qPrint(name()), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
}
else if (!incDepGraph.isTrivial())
{
@@ -619,12 +632,12 @@ void FileDefImpl::writeIncludedByGraph(OutputList &ol)
{
if (Config_getBool(HAVE_DOT) /*&& Config_getBool(INCLUDED_BY_GRAPH)*/)
{
- //printf("Graph for file %s\n",name().data());
+ //printf("Graph for file %s\n",qPrint(name()));
DotInclDepGraph incDepGraph(this,TRUE);
if (incDepGraph.isTooBig())
{
warn_uncond("Included by graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
- name().data(), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
+ qPrint(name()), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
}
else if (!incDepGraph.isTrivial())
{
@@ -643,12 +656,12 @@ void FileDefImpl::writeIncludedByGraph(OutputList &ol)
void FileDefImpl::writeSourceLink(OutputList &ol)
{
- //printf("%s: generateSourceFile()=%d\n",name().data(),generateSourceFile());
+ //printf("%s: generateSourceFile()=%d\n",qPrint(name()),generateSourceFile());
if (generateSourceFile())
{
ol.disableAllBut(OutputGenerator::Html);
ol.startParagraph();
- ol.startTextLink(includeName(),0);
+ ol.startTextLink(includeName(),QCString());
ol.parseText(theTranslator->trGotoSourceCode());
ol.endTextLink();
ol.endParagraph();
@@ -669,6 +682,12 @@ void FileDefImpl::writeClassDeclarations(OutputList &ol,const QCString &title,co
list.writeDeclaration(ol,0,title,FALSE);
}
+void FileDefImpl::writeConcepts(OutputList &ol,const QCString &title)
+{
+ // write list of classes
+ m_concepts.writeDeclaration(ol,title,FALSE);
+}
+
void FileDefImpl::writeInlineClasses(OutputList &ol)
{
// temporarily undo the disabling could be done by startMemberDocumentation()
@@ -747,35 +766,42 @@ void FileDefImpl::writeSummaryLinks(OutputList &ol) const
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
QCString label = "nested-classes";
- ol.writeSummaryLink(0,label,ls->title(lang),first);
+ ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
first=FALSE;
}
else if (lde->kind()==LayoutDocEntry::FileInterfaces && m_interfaces.declVisible())
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
QCString label = "interfaces";
- ol.writeSummaryLink(0,label,ls->title(lang),first);
+ ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
first=FALSE;
}
else if (lde->kind()==LayoutDocEntry::FileStructs && m_structs.declVisible())
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
QCString label = "structs";
- ol.writeSummaryLink(0,label,ls->title(lang),first);
+ ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
first=FALSE;
}
else if (lde->kind()==LayoutDocEntry::FileExceptions && m_exceptions.declVisible())
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
QCString label = "exceptions";
- ol.writeSummaryLink(0,label,ls->title(lang),first);
+ ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
first=FALSE;
}
else if (lde->kind()==LayoutDocEntry::FileNamespaces && m_namespaces.declVisible())
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
QCString label = "namespaces";
- ol.writeSummaryLink(0,label,ls->title(lang),first);
+ ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
+ first=FALSE;
+ }
+ else if (lde->kind()==LayoutDocEntry::FileConcepts && m_concepts.declVisible())
+ {
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
+ QCString label = "concepts";
+ ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
first=FALSE;
}
else if (lde->kind()==LayoutDocEntry::MemberDecl)
@@ -784,7 +810,7 @@ void FileDefImpl::writeSummaryLinks(OutputList &ol) const
MemberList * ml = getMemberList(lmd->type);
if (ml && ml->declVisible())
{
- ol.writeSummaryLink(0,MemberList::listTypeAsString(ml->listType()),lmd->title(lang),first);
+ ol.writeSummaryLink(QCString(),MemberList::listTypeAsString(ml->listType()),lmd->title(lang),first);
first=FALSE;
}
}
@@ -807,10 +833,10 @@ void FileDefImpl::writeDocumentation(OutputList &ol)
//QCString fn = name();
//if (Config_getBool(FULL_PATH_NAMES))
//{
- // fn.prepend(stripFromPath(getPath().copy()));
+ // fn.prepend(stripFromPath(getPath()));
//}
- //printf("WriteDocumentation diskname=%s\n",diskname.data());
+ //printf("WriteDocumentation diskname=%s\n",qPrint(diskname));
QCString versionTitle;
if (!m_fileVersion.isEmpty())
@@ -920,6 +946,12 @@ void FileDefImpl::writeDocumentation(OutputList &ol)
writeClassDeclarations(ol,ls->title(lang),m_exceptions);
}
break;
+ case LayoutDocEntry::FileConcepts:
+ {
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
+ writeConcepts(ol,ls->title(lang));
+ }
+ break;
case LayoutDocEntry::FileNamespaces:
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
@@ -978,11 +1010,14 @@ void FileDefImpl::writeDocumentation(OutputList &ol)
case LayoutDocEntry::NamespaceNestedNamespaces:
case LayoutDocEntry::NamespaceNestedConstantGroups:
case LayoutDocEntry::NamespaceClasses:
+ case LayoutDocEntry::NamespaceConcepts:
case LayoutDocEntry::NamespaceInterfaces:
case LayoutDocEntry::NamespaceStructs:
case LayoutDocEntry::NamespaceExceptions:
case LayoutDocEntry::NamespaceInlineClasses:
+ case LayoutDocEntry::ConceptDefinition:
case LayoutDocEntry::GroupClasses:
+ case LayoutDocEntry::GroupConcepts:
case LayoutDocEntry::GroupInlineClasses:
case LayoutDocEntry::GroupNamespaces:
case LayoutDocEntry::GroupDirs:
@@ -1092,7 +1127,7 @@ void FileDefImpl::writeSourceHeader(OutputList &ol)
bool genSourceFile = !isDocFile && generateSourceFile();
if (getDirDef())
{
- startFile(ol,getSourceFileBase(),0,pageTitle,HLI_FileVisible,
+ startFile(ol,getSourceFileBase(),QCString(),pageTitle,HLI_FileVisible,
!generateTreeView,
!isDocFile && genSourceFile ? QCString() : getOutputFileBase());
if (!generateTreeView)
@@ -1106,11 +1141,11 @@ void FileDefImpl::writeSourceHeader(OutputList &ol)
}
else
{
- startFile(ol,getSourceFileBase(),0,pageTitle,HLI_FileVisible,FALSE,
+ startFile(ol,getSourceFileBase(),QCString(),pageTitle,HLI_FileVisible,FALSE,
!isDocFile && genSourceFile ? QCString() : getOutputFileBase());
startTitle(ol,getSourceFileBase());
ol.parseText(title);
- endTitle(ol,getSourceFileBase(),0);
+ endTitle(ol,getSourceFileBase(),QCString());
}
ol.startContents();
@@ -1121,7 +1156,7 @@ void FileDefImpl::writeSourceHeader(OutputList &ol)
if (latexSourceCode) ol.disable(OutputGenerator::Latex);
if (rtfSourceCode) ol.disable(OutputGenerator::RTF);
if (docbookSourceCode) ol.disable(OutputGenerator::Docbook);
- ol.startTextLink(getOutputFileBase(),0);
+ ol.startTextLink(getOutputFileBase(),QCString());
ol.parseText(theTranslator->trGotoDocumentation());
ol.endTextLink();
ol.popGeneratorState();
@@ -1155,17 +1190,17 @@ void FileDefImpl::writeSourceBody(OutputList &ol,ClangTUParser *clangParser)
if (needs2PassParsing)
{
// parse code for cross-references only (see bug707641)
- intf->parseCode(devNullIntf,0,
+ intf->parseCode(devNullIntf,QCString(),
fileToString(absFilePath(),TRUE,TRUE),
getLanguage(),
- FALSE,0,this
+ FALSE,QCString(),this
);
}
- intf->parseCode(ol,0,
+ intf->parseCode(ol,QCString(),
fileToString(absFilePath(),filterSourceFiles,TRUE),
getLanguage(), // lang
FALSE, // isExampleBlock
- 0, // exampleName
+ QCString(), // exampleName
this, // fileDef
-1, // startLine
-1, // endLine
@@ -1203,10 +1238,10 @@ void FileDefImpl::parseSource(ClangTUParser *clangParser)
auto intf = Doxygen::parserManager->getCodeParser(getDefFileExtension());
intf->resetCodeParserState();
intf->parseCode(
- devNullIntf,0,
+ devNullIntf,QCString(),
fileToString(absFilePath(),filterSourceFiles,TRUE),
getLanguage(),
- FALSE,0,this
+ FALSE,QCString(),this
);
}
}
@@ -1226,7 +1261,7 @@ void FileDefImpl::addMembersToMemberGroup()
{
if (mg->allMembersInSameSection() && m_subGrouping)
{
- //printf("----> addToDeclarationSection(%s)\n",mg->header().data());
+ //printf("----> addToDeclarationSection(%s)\n",qPrint(mg->header()));
mg->addToDeclarationSection();
}
}
@@ -1237,7 +1272,7 @@ void FileDefImpl::insertMember(MemberDef *md)
{
if (md->isHidden()) return;
//printf("%s:FileDefImpl::insertMember(%s (=%p) list has %d elements)\n",
- // name().data(),md->name().data(),md,allMemberList.count());
+ // qPrint(name()),qPrint(md->name()),md,allMemberList.count());
MemberList *allMemberList = getMemberList(MemberListType_allMembersList);
if (allMemberList && allMemberList->contains(md))
{
@@ -1287,9 +1322,9 @@ void FileDefImpl::insertMember(MemberDef *md)
default:
err("FileDefImpl::insertMembers(): "
"member '%s' with class scope '%s' inserted in file scope '%s'!\n",
- md->name().data(),
- md->getClassDef() ? md->getClassDef()->name().data() : "<global>",
- name().data());
+ qPrint(md->name()),
+ md->getClassDef() ? qPrint(md->getClassDef()->name()) : "<global>",
+ qPrint(name()));
}
//addMemberToGroup(md,groupId);
}
@@ -1320,6 +1355,12 @@ void FileDefImpl::insertClass(const ClassDef *cd)
list.add(cd->name(),cd);
}
+void FileDefImpl::insertConcept(const ConceptDef *cd)
+{
+ if (cd->isHidden()) return;
+ m_concepts.add(cd->name(),cd);
+}
+
/*! Adds namespace definition \a nd to the list of all compounds of this file */
void FileDefImpl::insertNamespace(const NamespaceDef *nd)
{
@@ -1343,21 +1384,21 @@ void FileDefImpl::addSourceRef(int line,const Definition *d,const MemberDef *md)
m_srcDefMap.insert(std::make_pair(line,d));
if (md) m_srcMemberMap.insert(std::make_pair(line,md));
//printf("Adding member %s with anchor %s at line %d to file %s\n",
- // md?md->name().data():"<none>",md?md->anchor().data():"<none>",line,name().data());
+ // md?qPrint(md->name()):"<none>",md?qPrint(md->anchor()):"<none>",line,qPrint(name()));
}
}
const Definition *FileDefImpl::getSourceDefinition(int lineNr) const
{
auto it = m_srcDefMap.find(lineNr);
- //printf("%s::getSourceDefinition(%d)=%s\n",name().data(),lineNr,it!=m_srcDefMap.end()?it->second->name().data():"none");
+ //printf("%s::getSourceDefinition(%d)=%s\n",qPrint(name()),lineNr,it!=m_srcDefMap.end()?qPrint(it->second->name()):"none");
return it!=m_srcDefMap.end() ? it->second : 0;
}
const MemberDef *FileDefImpl::getSourceMember(int lineNr) const
{
auto it = m_srcMemberMap.find(lineNr);
- //printf("%s::getSourceMember(%d)=%s\n",name().data(),lineNr,it!=m_srcMemberMap.end()?it->second->name().data():"none");
+ //printf("%s::getSourceMember(%d)=%s\n",qPrint(name()),lineNr,it!=m_srcMemberMap.end()?qPrint(it->second->name()):"none");
return it!=m_srcMemberMap.end() ? it->second : 0;
}
@@ -1365,12 +1406,12 @@ const MemberDef *FileDefImpl::getSourceMember(int lineNr) const
void FileDefImpl::addUsingDirective(const NamespaceDef *nd)
{
m_usingDirList.add(nd->qualifiedName(),nd);
- //printf("%p: FileDefImpl::addUsingDirective: %s:%d\n",this,name().data(),usingDirList->count());
+ //printf("%p: FileDefImpl::addUsingDirective: %s:%d\n",this,qPrint(name()),usingDirList->count());
}
LinkedRefMap<const NamespaceDef> FileDefImpl::getUsedNamespaces() const
{
- //printf("%p: FileDefImpl::getUsedNamespace: %s:%d\n",this,name().data(),usingDirList?usingDirList->count():0);
+ //printf("%p: FileDefImpl::getUsedNamespace: %s:%d\n",this,qPrint(name()),usingDirList?usingDirList->count():0);
return m_usingDirList;
}
@@ -1379,10 +1420,10 @@ void FileDefImpl::addUsingDeclaration(const ClassDef *cd)
m_usingDeclList.add(cd->qualifiedName(),cd);
}
-void FileDefImpl::addIncludeDependency(const FileDef *fd,const char *incName,bool local,bool imported)
+void FileDefImpl::addIncludeDependency(const FileDef *fd,const QCString &incName,bool local,bool imported)
{
//printf("FileDefImpl::addIncludeDependency(%p,%s,%d)\n",fd,incName,local);
- QCString iName = fd ? fd->absFilePath().data() : incName;
+ QCString iName = fd ? fd->absFilePath() : incName;
if (!iName.isEmpty() && m_includeMap.find(iName.str())==m_includeMap.end())
{
m_includeList.emplace_back(fd,incName,local,imported);
@@ -1394,7 +1435,7 @@ void FileDefImpl::addIncludedUsingDirectives(FileDefSet &visitedFiles)
{
if (visitedFiles.find(this)!=visitedFiles.end()) return; // file already processed
visitedFiles.insert(this);
- //printf("( FileDefImpl::addIncludedUsingDirectives for file %s\n",name().data());
+ //printf("( FileDefImpl::addIncludedUsingDirectives for file %s\n",qPrint(name()));
if (!m_includeList.empty()) // file contains #includes
{
@@ -1433,15 +1474,15 @@ void FileDefImpl::addIncludedUsingDirectives(FileDefSet &visitedFiles)
}
}
}
- //printf(") end FileDefImpl::addIncludedUsingDirectives for file %s\n",name().data());
+ //printf(") end FileDefImpl::addIncludedUsingDirectives for file %s\n",qPrint(name()));
}
-void FileDefImpl::addIncludedByDependency(const FileDef *fd,const char *incName,
+void FileDefImpl::addIncludedByDependency(const FileDef *fd,const QCString &incName,
bool local,bool imported)
{
//printf("FileDefImpl::addIncludedByDependency(%p,%s,%d)\n",fd,incName,local);
- QCString iName = fd ? fd->absFilePath().data() : incName;
+ QCString iName = fd ? fd->absFilePath() : incName;
if (!iName.isEmpty() && m_includedByMap.find(iName.str())==m_includedByMap.end())
{
m_includedByList.emplace_back(fd,incName,local,imported);
@@ -1475,7 +1516,7 @@ void FileDefImpl::addListReferences()
getOutputFileBase(),
theTranslator->trFile(TRUE,TRUE),
getOutputFileBase(),name(),
- 0,
+ QCString(),
0
);
}
@@ -1538,13 +1579,13 @@ void FileDefImpl::acquireFileVersion()
if (!vercmd.isEmpty() && !m_filePath.isEmpty() &&
m_filePath!="generated" && m_filePath!="graph_legend")
{
- msg("Version of %s : ",m_filePath.data());
+ msg("Version of %s : ",qPrint(m_filePath));
QCString cmd = vercmd+" \""+m_filePath+"\"";
Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",qPrint(cmd));
FILE *f=Portable::popen(cmd,"r");
if (!f)
{
- err("could not execute %s\n",vercmd.data());
+ err("could not execute %s\n",qPrint(vercmd));
return;
}
const int bufSize=1024;
@@ -1557,7 +1598,7 @@ void FileDefImpl::acquireFileVersion()
m_fileVersion=QCString(buf,numRead).stripWhiteSpace();
if (!m_fileVersion.isEmpty())
{
- msg("%s\n",m_fileVersion.data());
+ msg("%s\n",qPrint(m_fileVersion));
return;
}
}
@@ -1673,7 +1714,7 @@ void FileDefImpl::writeMemberDeclarations(OutputList &ol,MemberListType lt,const
}
else
{
- ml->writeDeclarations(ol,0,0,this,0,title,0);
+ ml->writeDeclarations(ol,0,0,this,0,title,QCString());
}
}
}
@@ -1698,7 +1739,7 @@ static void getAllIncludeFilesRecursively(
if (ii.fileDef && !ii.fileDef->isReference() &&
filesVisited.find(ii.fileDef->absFilePath().str())==filesVisited.end())
{
- //printf("FileDefImpl::addIncludeDependency(%s)\n",ii->fileDef->absFilePath().data());
+ //printf("FileDefImpl::addIncludeDependency(%s)\n",qPrint(ii->fileDef->absFilePath()));
incFiles.push_back(ii.fileDef->absFilePath().str());
filesVisited.insert(ii.fileDef->absFilePath().str());
getAllIncludeFilesRecursively(filesVisited,ii.fileDef,incFiles);
diff --git a/src/filedef.h b/src/filedef.h
index 9655f38..7019485 100644
--- a/src/filedef.h
+++ b/src/filedef.h
@@ -24,19 +24,20 @@
#include "definition.h"
#include "memberlist.h"
#include "containers.h"
-#include "classlist.h"
class MemberList;
class FileDef;
class FileList;
class ClassDef;
+class ConceptDef;
class MemberDef;
class OutputList;
class NamespaceDef;
class NamespaceLinkedRefMap;
+class ConceptLinkedRefMap;
+class ClassLinkedRefMap;
class PackageDef;
class DirDef;
-class FTextStream;
class ClangTUParser;
// --- Set of files
@@ -134,8 +135,9 @@ class FileDef : public DefinitionMutable, public Definition
/* user defined member groups */
virtual const MemberGroupList &getMemberGroups() const = 0;
- virtual NamespaceLinkedRefMap getNamespaces() const = 0;
- virtual ClassLinkedRefMap getClasses() const = 0;
+ virtual const NamespaceLinkedRefMap &getNamespaces() const = 0;
+ virtual const ConceptLinkedRefMap &getConcepts() const = 0;
+ virtual const ClassLinkedRefMap &getClasses() const = 0;
virtual QCString title() const = 0;
virtual bool hasDetailedDescription() const = 0;
@@ -155,7 +157,7 @@ class FileDef : public DefinitionMutable, public Definition
virtual void writeMemberPages(OutputList &ol) = 0;
virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const = 0;
virtual void writeSummaryLinks(OutputList &ol) const = 0;
- virtual void writeTagFile(FTextStream &t) = 0;
+ virtual void writeTagFile(TextStream &t) = 0;
virtual void writeSourceHeader(OutputList &ol) = 0;
virtual void writeSourceBody(OutputList &ol,ClangTUParser *clangParser) = 0;
@@ -165,6 +167,7 @@ class FileDef : public DefinitionMutable, public Definition
virtual void insertMember(MemberDef *md) = 0;
virtual void insertClass(const ClassDef *cd) = 0;
+ virtual void insertConcept(const ConceptDef *cd) = 0;
virtual void insertNamespace(const NamespaceDef *nd) = 0;
virtual void computeAnchors() = 0;
@@ -178,8 +181,8 @@ class FileDef : public DefinitionMutable, public Definition
virtual bool generateSourceFile() const = 0;
virtual void sortMemberLists() = 0;
- virtual void addIncludeDependency(const FileDef *fd,const char *incName,bool local,bool imported) = 0;
- virtual void addIncludedByDependency(const FileDef *fd,const char *incName,bool local,bool imported) = 0;
+ virtual void addIncludeDependency(const FileDef *fd,const QCString &incName,bool local,bool imported) = 0;
+ virtual void addIncludedByDependency(const FileDef *fd,const QCString &incName,bool local,bool imported) = 0;
virtual void addMembersToMemberGroup() = 0;
virtual void distributeMemberGroupDocumentation() = 0;
@@ -189,7 +192,7 @@ class FileDef : public DefinitionMutable, public Definition
virtual void addListReferences() = 0;
};
-FileDef *createFileDef(const char *p,const char *n,const char *ref=0,const char *dn=0);
+FileDef *createFileDef(const QCString &p,const QCString &n,const QCString &ref=QCString(),const QCString &dn=QCString());
// --- Cast functions
diff --git a/src/fileinfo.cpp b/src/fileinfo.cpp
new file mode 100644
index 0000000..8d0a332
--- /dev/null
+++ b/src/fileinfo.cpp
@@ -0,0 +1,161 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2021 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.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#include "filesystem.hpp"
+#include "fileinfo.h"
+
+namespace fs = ghc::filesystem;
+
+size_t FileInfo::size() const
+{
+ std::error_code ec;
+ size_t result = static_cast<size_t>(fs::file_size(fs::path(m_name),ec));
+ return ec ? 0 : result;
+}
+
+bool FileInfo::exists() const
+{
+ std::error_code ec;
+ bool result = fs::exists(fs::path(m_name),ec);
+ return !ec && result;
+}
+
+bool FileInfo::isWritable() const
+{
+ std::error_code ec;
+ fs::file_status status = fs::status(m_name,ec);
+ return !ec && (status.permissions() & fs::perms::owner_write)!=fs::perms::none;
+}
+
+bool FileInfo::isReadable() const
+{
+ std::error_code ec;
+ fs::file_status status = fs::status(m_name,ec);
+ return !ec && (status.permissions() & fs::perms::owner_read)!=fs::perms::none;
+}
+
+bool FileInfo::isExecutable() const
+{
+ std::error_code ec;
+ fs::file_status status = fs::status(m_name,ec);
+ return !ec && (status.permissions() & fs::perms::owner_exec)!=fs::perms::none;
+}
+
+bool FileInfo::isRelative() const
+{
+ return fs::path(m_name).is_relative();
+}
+
+bool FileInfo::isFile() const
+{
+ std::error_code ec;
+ fs::file_status status = fs::status(m_name,ec);
+ return !ec && fs::is_regular_file(status);
+}
+
+bool FileInfo::isDir() const
+{
+ std::error_code ec;
+ fs::file_status status = fs::status(m_name,ec);
+ return !ec && fs::is_directory(status);
+}
+
+bool FileInfo::isSymLink() const
+{
+ std::error_code ec;
+ fs::file_status status = fs::status(m_name,ec);
+ return !ec && fs::is_symlink(status);
+}
+
+std::string FileInfo::readLink() const
+{
+ std::error_code ec;
+ fs::path targetPath = fs::read_symlink(fs::path(m_name));
+ return !ec ? targetPath.string() : std::string();
+}
+
+std::string FileInfo::filePath() const
+{
+ return m_name;
+}
+
+void FileInfo::correctPath(std::string &s)
+{
+ std::replace( s.begin(), s.end(), '\\', '/' );
+}
+
+std::string FileInfo::absFilePath() const
+{
+ std::string result;
+ std::error_code ec;
+ fs::path path(m_name);
+ if (fs::exists(path,ec))
+ {
+ result = fs::canonical(path,ec).string();
+ }
+ else
+ {
+ result = (fs::current_path(ec) / m_name).string();
+ }
+ correctPath(result);
+ return result;
+}
+
+std::string FileInfo::fileName() const
+{
+ return fs::path(m_name).filename().string();
+}
+
+std::string FileInfo::baseName() const
+{
+ std::string s = fileName();
+ size_t pos = s.find('.');
+ return pos!=std::string::npos ? s.substr(0,pos) : s;
+}
+
+std::string FileInfo::extension(bool complete) const
+{
+ std::string fn = fileName();
+ size_t pos = complete ? fn.find('.') : fn.rfind('.');
+ return pos!=std::string::npos ? fn.substr(pos+1) : std::string();
+}
+
+std::string FileInfo::dirPath(bool absPath) const
+{
+ std::string result;
+ if (absPath)
+ {
+ result = absFilePath();
+ }
+ else
+ {
+ result = m_name;
+ correctPath(result);
+ }
+ size_t pos = result.rfind('/');
+ if (pos==std::string::npos)
+ {
+ return ".";
+ }
+ else if (pos==0)
+ {
+ return "/";
+ }
+ else
+ {
+ return result.substr(0,pos);
+ }
+}
+
diff --git a/src/fileinfo.h b/src/fileinfo.h
new file mode 100644
index 0000000..3ab684f
--- /dev/null
+++ b/src/fileinfo.h
@@ -0,0 +1,47 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2021 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.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#ifndef FILEINFO_H
+#define FILEINFO_H
+
+#include <string>
+
+/** @brief Minimal replacement for QFileInfo. */
+class FileInfo
+{
+ public:
+ explicit FileInfo(const std::string &name) : m_name(name) {}
+ bool exists() const;
+ size_t size() const;
+ bool isWritable() const;
+ bool isReadable() const;
+ bool isExecutable() const;
+ bool isRelative() const;
+ bool isFile() const;
+ bool isDir() const;
+ bool isSymLink() const;
+ std::string readLink() const;
+ std::string filePath() const;
+ std::string absFilePath() const;
+ std::string fileName() const;
+ std::string baseName() const;
+ std::string extension(bool complete) const;
+ std::string dirPath(bool absPath = true) const;
+ private:
+ static void correctPath(std::string &s);
+ std::string m_name;
+};
+
+#endif
diff --git a/src/filename.h b/src/filename.h
index d236046..f2eb304 100644
--- a/src/filename.h
+++ b/src/filename.h
@@ -28,10 +28,10 @@ class FileDef;
class FileName : public std::vector< std::unique_ptr<FileDef> >
{
public:
- FileName(const char *nm,const char *fn) : m_name(nm), m_fName(fn), m_pathName("tmp") {}
- const char *fileName() const { return m_name; }
- const char *fullName() const { return m_fName; }
- const char *path() const { return m_pathName; }
+ FileName(const QCString &nm,const QCString &fn) : m_name(nm), m_fName(fn), m_pathName("tmp") {}
+ QCString fileName() const { return m_name; }
+ QCString fullName() const { return m_fName; }
+ QCString path() const { return m_pathName; }
private:
QCString m_name;
diff --git a/src/fileparser.cpp b/src/fileparser.cpp
index 34085dc..33491fc 100644
--- a/src/fileparser.cpp
+++ b/src/fileparser.cpp
@@ -17,19 +17,19 @@
#include "outputgen.h"
void FileCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
- const char *, // scopeName
+ const QCString &, // scopeName
const QCString & input,
- SrcLangExt, // lang
- bool, // isExampleBlock
- const char *, // exampleName
+ SrcLangExt, // lang
+ bool, // isExampleBlock
+ const QCString &, // exampleName
FileDef * fileDef,
int startLine,
int endLine,
- bool, // inlineFragment
- const MemberDef *, // memberDef
+ bool, // inlineFragment
+ const MemberDef *, // memberDef
bool showLineNumbers,
- const Definition *, // searchCtx,
- bool // collectXRefs
+ const Definition *, // searchCtx,
+ bool // collectXRefs
)
{
int lineNr = startLine!=-1 ? startLine : 1;
@@ -41,8 +41,11 @@ void FileCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
while (j<length && input[j]!='\n') j++;
QCString lineStr = input.mid(i,j-i);
codeOutIntf.startCodeLine(fileDef != 0 && showLineNumbers);
- if (fileDef != 0 && showLineNumbers) codeOutIntf.writeLineNumber(0,0,0,lineNr);
- if (!lineStr.isEmpty()) codeOutIntf.codify(lineStr);
+ if (fileDef != 0 && showLineNumbers)
+ {
+ codeOutIntf.writeLineNumber(QCString(),QCString(),QCString(),lineNr);
+ }
+ if (!lineStr.isEmpty()) codeOutIntf.codify(lineStr.data());
codeOutIntf.endCodeLine();
lineNr++;
i=j+1;
diff --git a/src/fileparser.h b/src/fileparser.h
index 3245878..c7c07aa 100644
--- a/src/fileparser.h
+++ b/src/fileparser.h
@@ -3,8 +3,8 @@
* Copyright (C) 1997-2015 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
+ * 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.
*
@@ -24,11 +24,11 @@ class FileCodeParser : public CodeParserInterface
public:
virtual ~FileCodeParser() {}
void parseCode(CodeOutputInterface &codeOutIntf,
- const char *scopeName,
+ const QCString &scopeName,
const QCString &input,
SrcLangExt lang,
bool isExampleBlock,
- const char *exampleName=0,
+ const QCString &exampleName=QCString(),
FileDef *fileDef=0,
int startLine=-1,
int endLine=-1,
diff --git a/src/formula.cpp b/src/formula.cpp
index 629af45..2e5aef9 100644
--- a/src/formula.cpp
+++ b/src/formula.cpp
@@ -16,13 +16,11 @@
#include "formula.h"
#include "message.h"
#include "config.h"
-#include "ftextstream.h"
#include "util.h"
#include "portable.h"
#include "image.h"
-
-#include <qfile.h>
-#include <qdir.h>
+#include "fileinfo.h"
+#include "dir.h"
#include <map>
#include <vector>
@@ -34,7 +32,7 @@
#include "doxygen.h" // for Doxygen::indexList
#include "index.h" // for Doxygen::indexList
-static int determineInkscapeVersion(QDir &thisDir);
+static int determineInkscapeVersion(Dir &thisDir);
// Remove the temporary files
#define RM_TMP_FILES (true)
@@ -70,9 +68,9 @@ FormulaManager &FormulaManager::instance()
return fm;
}
-void FormulaManager::readFormulas(const char *dir,bool doCompare)
+void FormulaManager::readFormulas(const QCString &dir,bool doCompare)
{
- std::ifstream f(std::string(dir)+"/formula.repository");
+ std::ifstream f(dir.str()+"/formula.repository",std::ifstream::in);
if (f.is_open())
{
uint formulaCount=0;
@@ -87,7 +85,7 @@ void FormulaManager::readFormulas(const char *dir,bool doCompare)
size_t se=line.find(':'); // find name and text separator.
if (ei==std::string::npos || hi==std::string::npos || se==std::string::npos || hi>se || ei<hi || ei>se)
{
- warn_uncond("%s/formula.repository is corrupted at line %d!\n",dir,lineNr);
+ warn_uncond("%s/formula.repository is corrupted at line %d!\n",qPrint(dir),lineNr);
break;
}
else
@@ -104,7 +102,7 @@ void FormulaManager::readFormulas(const char *dir,bool doCompare)
formName = formName.substr(0,ei); // keep only the '\_form#<digits>' part
if (doCompare)
{
- int formId = stoi(formName.substr(hi+1));
+ int formId = std::stoi(formName.substr(hi+1));
std::string storedFormText = FormulaManager::instance().findFormula(formId);
if (storedFormText!=formText)
{
@@ -129,63 +127,64 @@ void FormulaManager::readFormulas(const char *dir,bool doCompare)
}
}
-void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) const
+void FormulaManager::generateImages(const QCString &path,Format format,HighDPI hd) const
{
- QDir d(path);
+ Dir d(path.str());
// store the original directory
if (!d.exists())
{
- term("Output directory '%s' does not exist!\n",path);
+ term("Output directory '%s' does not exist!\n",qPrint(path));
}
- QCString oldDir = QDir::currentDirPath().utf8();
+ std::string oldDir = Dir::currentDirPath();
QCString macroFile = Config_getString(FORMULA_MACROFILE);
QCString stripMacroFile;
if (!macroFile.isEmpty())
{
- QFileInfo fi(macroFile);
- macroFile=fi.absFilePath().utf8();
- stripMacroFile = fi.fileName().data();
+ FileInfo fi(macroFile.str());
+ macroFile=fi.absFilePath();
+ stripMacroFile = fi.fileName();
}
// go to the html output directory (i.e. path)
- QDir::setCurrent(d.absPath());
- QDir thisDir;
+ Dir::setCurrent(d.absPath());
+ Dir thisDir;
// generate a latex file containing one formula per page.
QCString texName="_formulas.tex";
IntVector formulasToGenerate;
- QFile f(texName);
- if (f.open(IO_WriteOnly))
+ std::ofstream f(texName.str(),std::ofstream::out | std::ofstream::binary);
+ if (f.is_open())
{
- 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
- t << "\\usepackage[utf8]{inputenc}" << endl; // looks like some older distributions with newunicode package 1.1 need this option.
+ TextStream t(&f);
+ if (Config_getBool(LATEX_BATCHMODE)) t << "\\batchmode\n";
+ t << "\\documentclass{article}\n";
+ t << "\\usepackage{ifthen}\n";
+ t << "\\usepackage{epsfig}\n"; // for those who want to include images
+ t << "\\usepackage[utf8]{inputenc}\n"; // looks like some older distributions with newunicode package 1.1 need this option.
writeExtraLatexPackages(t);
writeLatexSpecialFormulaChars(t);
if (!macroFile.isEmpty())
{
copyFile(macroFile,stripMacroFile);
- t << "\\input{" << stripMacroFile << "}" << endl;
+ t << "\\input{" << stripMacroFile << "}\n";
}
- t << "\\pagestyle{empty}" << endl;
- t << "\\begin{document}" << endl;
+ t << "\\pagestyle{empty}\n";
+ t << "\\begin{document}\n";
for (int i=0; i<(int)p->formulas.size(); i++)
{
QCString resultName;
resultName.sprintf("form_%d.%s",i,format==Format::Vector?"svg":"png");
// only formulas for which no image exists are generated
- QFileInfo fi(resultName);
+ FileInfo fi(resultName.str());
if (!fi.exists())
{
// we force a pagebreak after each formula
- t << p->formulas[i].c_str() << endl << "\\pagebreak\n\n";
+ t << p->formulas[i].c_str() << "\n\\pagebreak\n\n";
formulasToGenerate.push_back(i);
}
Doxygen::indexList->addImageFile(resultName);
}
- t << "\\end{document}" << endl;
+ t << "\\end{document}\n";
+ t.flush();
f.close();
}
if (!formulasToGenerate.empty()) // there are new formulas
@@ -201,7 +200,7 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
err("Problems running latex. Check your installation or look "
"for typos in _formulas.tex and check _formulas.log!\n");
Portable::sysTimerStop();
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return;
}
Portable::sysTimerStop();
@@ -215,36 +214,36 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
// run dvips to convert the page with number pageIndex to an
// postscript file.
sprintf(args,"-q -D 600 -n 1 -p %d -o %s_tmp.ps _formulas.dvi",
- pageIndex,formBase.data());
+ pageIndex,qPrint(formBase));
Portable::sysTimerStart();
if (Portable::system("dvips",args)!=0)
{
err("Problems running dvips. Check your installation!\n");
Portable::sysTimerStop();
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return;
}
Portable::sysTimerStop();
// extract the bounding box for the postscript file
sprintf(args,"-q -dBATCH -dNOPAUSE -P- -dNOSAFER -sDEVICE=bbox %s_tmp.ps 2>%s_tmp.epsi",
- formBase.data(),formBase.data());
+ qPrint(formBase),qPrint(formBase));
Portable::sysTimerStart();
if (Portable::system(Portable::ghostScriptCommand(),args)!=0)
{
err("Problems running %s. Check your installation!\n",Portable::ghostScriptCommand());
Portable::sysTimerStop();
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return;
}
Portable::sysTimerStop();
// extract the bounding box info from the generate .epsi file
int x1=0,y1=0,x2=0,y2=0;
- QFileInfo fi(formBase+"_tmp.epsi");
+ FileInfo fi((formBase+"_tmp.epsi").str());
if (fi.exists())
{
- QString eps = fileToString(formBase+"_tmp.epsi");
+ QCString eps = fileToString(formBase+"_tmp.epsi");
int i = eps.find("%%BoundingBox:");
if (i!=-1)
{
@@ -252,7 +251,7 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
}
else
{
- err("Couldn't extract bounding box from %s_tmp.epsi",formBase.data());
+ err("Couldn't extract bounding box from %s_tmp.epsi",qPrint(formBase));
}
}
//printf("Bounding box [%d %d %d %d]\n",x1,y1,x2,y2);
@@ -272,13 +271,13 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
// crop the image to its bounding box
sprintf(args,"-q -dBATCH -dNOPAUSE -P- -dNOSAFER -sDEVICE=pdfwrite"
" -o %s_tmp.pdf -c \"[/CropBox [%d %d %d %d] /PAGES pdfmark\" -f %s_tmp.ps",
- formBase.data(),x1,y1,x2,y2,formBase.data());
+ qPrint(formBase),x1,y1,x2,y2,qPrint(formBase));
Portable::sysTimerStart();
if (Portable::system(Portable::ghostScriptCommand(),args)!=0)
{
err("Problems running %s. Check your installation!\n",Portable::ghostScriptCommand());
Portable::sysTimerStop();
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return;
}
Portable::sysTimerStop();
@@ -286,13 +285,13 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
// if we have pdf2svg available use it to create a SVG image
if (Portable::checkForExecutable("pdf2svg"))
{
- sprintf(args,"%s_tmp.pdf form_%d.svg",formBase.data(),pageNum);
+ sprintf(args,"%s_tmp.pdf form_%d.svg",qPrint(formBase),pageNum);
Portable::sysTimerStart();
if (Portable::system("pdf2svg",args)!=0)
{
err("Problems running pdf2svg. Check your installation!\n");
Portable::sysTimerStop();
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return;
}
Portable::sysTimerStop();
@@ -303,23 +302,23 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
if (inkscapeVersion == -1)
{
err("Problems determining the version of inkscape. Check your installation!\n");
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return;
}
else if (inkscapeVersion == 0)
{
- sprintf(args,"-l form_%d.svg -z %s_tmp.pdf 2>%s",pageNum,formBase.data(),Portable::devNull());
+ sprintf(args,"-l form_%d.svg -z %s_tmp.pdf 2>%s",pageNum,qPrint(formBase),Portable::devNull());
}
else // inkscapeVersion >= 1
{
- sprintf(args,"--export-type=svg --export-filename=form_%d.svg %s_tmp.pdf 2>%s",pageNum,formBase.data(),Portable::devNull());
+ sprintf(args,"--export-type=svg --export-filename=form_%d.svg %s_tmp.pdf 2>%s",pageNum,qPrint(formBase),Portable::devNull());
}
Portable::sysTimerStart();
if (Portable::system("inkscape",args)!=0)
{
err("Problems running inkscape. Check your installation!\n");
Portable::sysTimerStop();
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return;
}
Portable::sysTimerStop();
@@ -332,49 +331,42 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
if (RM_TMP_FILES)
{
- thisDir.remove(formBase+"_tmp.pdf");
+ thisDir.remove(formBase.str()+"_tmp.pdf");
}
}
else // format==Format::Bitmap
{
// crop the image to its bounding box
sprintf(args,"-q -dBATCH -dNOPAUSE -P- -dNOSAFER -sDEVICE=eps2write"
- " -o %s_tmp.eps -f %s_tmp.ps",formBase.data(),formBase.data());
+ " -o %s_tmp.eps -f %s_tmp.ps",qPrint(formBase),qPrint(formBase));
Portable::sysTimerStart();
if (Portable::system(Portable::ghostScriptCommand(),args)!=0)
{
err("Problems running %s. Check your installation!\n",Portable::ghostScriptCommand());
Portable::sysTimerStop();
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return;
}
// read back %s_tmp.eps and replace
// bounding box values with x1,y1,x2,y2 and remove the HiResBoundingBox
- QFile epsIn(formBase+"_tmp.eps");
- QFile epsOut(formBase+"_tmp_corr.eps");
- if (epsIn.open(IO_ReadOnly) && epsOut.open(IO_WriteOnly))
+ std::ifstream epsIn(formBase.str()+"_tmp.eps",std::ifstream::in);
+ std::ofstream epsOut(formBase.str()+"_tmp_corr.eps",std::ofstream::out | std::ofstream::binary);
+ if (epsIn.is_open() && epsOut.is_open())
{
- int maxLineLen=100*1024;
- while (!epsIn.atEnd())
+ std::string line;
+ while (getline(epsIn,line))
{
- QCString buf(maxLineLen);
- FTextStream t(&epsOut);
- int numBytes = epsIn.readLine(buf.rawData(),maxLineLen);
- if (numBytes>0)
+ if (line.rfind("%%BoundingBox",0)==0)
+ {
+ epsOut << "%%BoundingBox: " << x1 << " " << y1 << " " << x2 << " " << y2 << "\n";
+ }
+ else if (line.rfind("%%HiResBoundingBox",0)==0) // skip this one
{
- buf.resize(numBytes+1);
- if (buf.startsWith("%%BoundingBox"))
- {
- t << "%%BoundingBox: " << x1 << " " << y1 << " " << x2 << " " << y2 << endl;
- }
- else if (buf.startsWith("%%HiResBoundingBox")) // skip this one
- {
- }
- else
- {
- t << buf;
- }
+ }
+ else
+ {
+ epsOut << line << "\n";
}
}
epsIn.close();
@@ -383,8 +375,8 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
else
{
err("Problems correcting the eps files from %s_tmp.eps to %s_tmp_corr.eps\n",
- formBase.data(),formBase.data());
- QDir::setCurrent(oldDir);
+ qPrint(formBase),qPrint(formBase));
+ Dir::setCurrent(oldDir);
return;
}
@@ -396,29 +388,29 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
Portable::sysTimerStop();
sprintf(args,"-q -dNOSAFER -dBATCH -dNOPAUSE -dEPSCrop -sDEVICE=pnggray -dGraphicsAlphaBits=4 -dTextAlphaBits=4 "
- "-r%d -sOutputFile=form_%d.png %s_tmp_corr.eps",(int)(scaleFactor*72),pageNum,formBase.data());
+ "-r%d -sOutputFile=form_%d.png %s_tmp_corr.eps",(int)(scaleFactor*72),pageNum,qPrint(formBase));
Portable::sysTimerStart();
if (Portable::system(Portable::ghostScriptCommand(),args)!=0)
{
err("Problems running %s. Check your installation!\n",Portable::ghostScriptCommand());
Portable::sysTimerStop();
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return;
}
Portable::sysTimerStop();
if (RM_TMP_FILES)
{
- thisDir.remove(formBase+"_tmp.eps");
- thisDir.remove(formBase+"_tmp_corr.eps");
+ thisDir.remove(formBase.str()+"_tmp.eps");
+ thisDir.remove(formBase.str()+"_tmp_corr.eps");
}
}
// remove intermediate image files
if (RM_TMP_FILES)
{
- thisDir.remove(formBase+"_tmp.ps");
- thisDir.remove(formBase+"_tmp.epsi");
+ thisDir.remove(formBase.str()+"_tmp.ps");
+ thisDir.remove(formBase.str()+"_tmp.epsi");
}
pageIndex++;
}
@@ -437,10 +429,10 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
// generated images represent (we use this next time to avoid regeneration
// of the images, and to avoid forcing the user to delete all images in order
// to let a browser refresh the images).
- f.setName("formula.repository");
- if (f.open(IO_WriteOnly))
+ f.open("formula.repository",std::ofstream::out | std::ofstream::binary);
+ if (f.is_open())
{
- FTextStream t(&f);
+ TextStream t(&f);
for (int i=0; i<(int)p->formulas.size(); i++)
{
DisplaySize size = p->getDisplaySize(i);
@@ -449,12 +441,11 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c
{
t << "=" << size.width << "x" << size.height;
}
- t << ":" << p->formulas[i].c_str() << endl;
+ t << ":" << p->formulas[i].c_str() << "\n";
}
- f.close();
}
// reset the directory to the original location.
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
}
void FormulaManager::clear()
@@ -498,7 +489,7 @@ FormulaManager::DisplaySize FormulaManager::displaySize(int formulaId) const
// helper function to detect and return the major version of inkscape.
// return -1 if the version cannot be determined.
-static int determineInkscapeVersion(QDir &thisDir)
+static int determineInkscapeVersion(Dir &thisDir)
{
// The command line interface (CLI) of Inkscape 1.0 has changed in comparison to
// previous versions. In order to invokine Inkscape, the used version is detected
@@ -521,36 +512,18 @@ static int determineInkscapeVersion(QDir &thisDir)
}
}
// read version file and determine major version
- QFile inkscapeVersionIn(inkscapeVersionFile);
- if (inkscapeVersionIn.open(IO_ReadOnly))
+ std::ifstream inkscapeVersionIn(inkscapeVersionFile.str(),std::ifstream::in);
+ if (inkscapeVersionIn.is_open())
{
- int maxLineLen=1024;
- while (!inkscapeVersionIn.atEnd())
+ std::string line;
+ while (getline(inkscapeVersionIn,line))
{
- QCString buf(maxLineLen);
- int numBytes = inkscapeVersionIn.readLine(buf.rawData(),maxLineLen);
- if (numBytes>0)
+ size_t dotPos = line.find('.');
+ if (line.rfind("Inkscape ",0)==0 && dotPos>0)
{
- buf.resize(numBytes+1);
- int dotPos = buf.find('.');
- if (buf.startsWith("Inkscape ") && dotPos>0)
- {
- // get major version
- bool ok;
- int version = buf.mid(9,dotPos-9).toInt(&ok);
- if (!ok)
- {
- Portable::sysTimerStop();
- return -1;
- }
- inkscapeVersion = version;
- break;
- }
- }
- else
- {
- Portable::sysTimerStop();
- return -1;
+ // get major version
+ inkscapeVersion = std::stoi(line.substr(9,dotPos-9));
+ break;
}
}
inkscapeVersionIn.close();
@@ -562,7 +535,7 @@ static int determineInkscapeVersion(QDir &thisDir)
}
if (RM_TMP_FILES)
{
- thisDir.remove(inkscapeVersionFile);
+ thisDir.remove(inkscapeVersionFile.str());
}
Portable::sysTimerStop();
}
diff --git a/src/formula.h b/src/formula.h
index 686cea2..9baeb24 100644
--- a/src/formula.h
+++ b/src/formula.h
@@ -20,7 +20,8 @@
#include <memory>
#include <string>
-#include <qcstring.h>
+
+#include "qcstring.h"
/*! Manager class to handle formulas */
class FormulaManager
@@ -35,10 +36,10 @@ class FormulaManager
enum class Format { Bitmap, Vector };
enum class HighDPI { On, Off };
static FormulaManager &instance();
- void readFormulas(const char *dir,bool doCompare=false);
+ void readFormulas(const QCString &dir,bool doCompare=false);
void clear();
int addFormula(const std::string &formulaText);
- void generateImages(const char *outputDir,Format format,HighDPI hd = HighDPI::Off) const;
+ void generateImages(const QCString &outputDir,Format format,HighDPI hd = HighDPI::Off) const;
std::string findFormula(int formulaId) const;
bool hasFormulas() const;
DisplaySize displaySize(int formulaId) const;
diff --git a/src/fortrancode.h b/src/fortrancode.h
index b8cac31..7601a39 100644
--- a/src/fortrancode.h
+++ b/src/fortrancode.h
@@ -32,11 +32,11 @@ class FortranCodeParser : public CodeParserInterface
FortranCodeParser(FortranFormat format=FortranFormat_Unknown);
virtual ~FortranCodeParser();
void parseCode(CodeOutputInterface &codeOutIntf,
- const char *scopeName,
+ const QCString &scopeName,
const QCString &input,
SrcLangExt lang,
bool isExampleBlock,
- const char *exampleName=0,
+ const QCString &exampleName=QCString(),
FileDef *fileDef=0,
int startLine=-1,
int endLine=-1,
diff --git a/src/fortrancode.l b/src/fortrancode.l
index fbc1a64..67890e4 100644
--- a/src/fortrancode.l
+++ b/src/fortrancode.l
@@ -124,12 +124,12 @@ class Scope
struct fortrancodeYY_state
{
QCString docBlock; //!< contents of all lines of a documentation block
- QCString currentModule=0; //!< name of the current enclosing module
- UseMap useMembers; //!< info about used modules
+ QCString currentModule=QCString(); //!< name of the current enclosing module
+ UseMap useMembers; //!< info about used modules
UseEntry useEntry; //!< current use statement info
std::vector<Scope> scopeStack;
bool isExternal = false;
- QCString str=""; //!> contents of fortran string
+ QCString str=QCString(); //!< contents of fortran string
CodeOutputInterface * code = 0;
@@ -181,21 +181,22 @@ static bool getFortranTypeDefs(const QCString &tname, const QCString &moduleName
static void endFontClass(yyscan_t yyscanner);
static void startFontClass(yyscan_t yyscanner,const char *s);
static void setCurrentDoc(yyscan_t yyscanner,const QCString &anchor);
-static void addToSearchIndex(yyscan_t yyscanner,const char *text);
+static void addToSearchIndex(yyscan_t yyscanner,const QCString &text);
static void startCodeLine(yyscan_t yyscanner);
static void endCodeLine(yyscan_t yyscanner);
static void nextCodeLine(yyscan_t yyscanner);
-static void codifyLines(yyscan_t yyscanner,const char *text);
+static void codifyLines(yyscan_t yyscanner,const QCString &text);
static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
- Definition *d,const char *text);
+ Definition *d,const QCString &text);
static bool getGenericProcedureLink(yyscan_t yyscanner,const ClassDef *cd,
- const char *memberText,
+ const QCString &memberText,
CodeOutputInterface &ol);
static bool getLink(yyscan_t yyscanner,const UseMap &useMap, // map with used modules
- const char *memberText, // exact member text
+ const QCString &memberText, // exact member text
CodeOutputInterface &ol,
- const char *text);
-static void generateLink(yyscan_t yyscanner,CodeOutputInterface &ol, char *lname);
+ const QCString &text);
+static void generateLink(yyscan_t yyscanner,CodeOutputInterface &ol, const QCString &lname);
+static void generateLink(yyscan_t yyscanner,CodeOutputInterface &ol, const char *lname);
static int countLines(yyscan_t yyscanner);
static void startScope(yyscan_t yyscanner);
static void endScope(yyscan_t yyscanner);
@@ -342,7 +343,7 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
BEGIN(UseOnly);
}
<Use>{ID} {
- QCString tmp = yytext;
+ QCString tmp(yytext);
tmp = tmp.lower();
yyextra->insideBody=TRUE;
generateLink(yyscanner,*yyextra->code, yytext);
@@ -359,7 +360,7 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
yyextra->contLineNr++;
YY_FTN_RESET}
<UseOnly>{ID} {
- QCString tmp = yytext;
+ QCString tmp(yytext);
tmp = tmp.lower();
yyextra->useEntry.onlyNames.push_back(tmp);
yyextra->insideBody=TRUE;
@@ -430,10 +431,10 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
yy_pop_state(yyscanner);
}
<ClassName>({ACCESS_SPEC}|ABSTRACT|EXTENDS)/[,:( ] { //| variable declaration
- startFontClass(yyscanner,"keyword");
- yyextra->code->codify(yytext);
- endFontClass(yyscanner);
- }
+ startFontClass(yyscanner,"keyword");
+ yyextra->code->codify(QCString(yytext));
+ endFontClass(yyscanner);
+ }
<ClassName>\n { // interface may be without name
yy_pop_state(yyscanner);
YY_FTN_REJECT;
@@ -504,18 +505,18 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
yy_push_state(YY_START,yyscanner);
BEGIN(Declaration);
startFontClass(yyscanner,"keywordtype");
- yyextra->code->codify(yytext);
+ yyextra->code->codify(QCString(yytext));
endFontClass(yyscanner);
}
<Start>{TYPE_SPEC}/[,:( ] {
- QCString typ = yytext;
+ QCString typ(yytext);
typ = removeRedundantWhiteSpace(typ.lower());
if (typ.startsWith("real")) YY_FTN_REJECT;
if (typ == "type" || typ == "class" || typ == "procedure") yyextra->inTypeDecl = 1;
yy_push_state(YY_START,yyscanner);
BEGIN(Declaration);
startFontClass(yyscanner,"keywordtype");
- yyextra->code->codify(yytext);
+ yyextra->code->codify(QCString(yytext));
endFontClass(yyscanner);
}
<Start>{ATTR_SPEC} {
@@ -526,20 +527,20 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
yyextra->isExternal = true;
}
startFontClass(yyscanner,"keywordtype");
- yyextra->code->codify(yytext);
+ yyextra->code->codify(QCString(yytext));
endFontClass(yyscanner);
}
<Declaration>({TYPE_SPEC}|{ATTR_SPEC})/[,:( ] { //| variable declaration
if (QCString(yytext) == "external") yyextra->isExternal = true;
startFontClass(yyscanner,"keywordtype");
- yyextra->code->codify(yytext);
+ yyextra->code->codify(QCString(yytext));
endFontClass(yyscanner);
}
<Declaration>{ID} { // local var
if (yyextra->isFixedForm && yy_my_start == 1)
{
startFontClass(yyscanner,"comment");
- yyextra->code->codify(yytext);
+ yyextra->code->codify(QCString(yytext));
endFontClass(yyscanner);
}
else if (yyextra->currentMemberDef &&
@@ -552,13 +553,13 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
}
else
{
- yyextra->code->codify(yytext);
- addLocalVar(yyscanner,yytext);
+ yyextra->code->codify(QCString(yytext));
+ addLocalVar(yyscanner,QCString(yytext));
}
}
<Declaration>{BS}("=>"|"="){BS} { // Procedure binding
BEGIN(DeclarationBinding);
- yyextra->code->codify(yytext);
+ yyextra->code->codify(QCString(yytext));
}
<DeclarationBinding>{ID} { // Type bound procedure link
generateLink(yyscanner,*yyextra->code, yytext);
@@ -566,17 +567,17 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
}
<Declaration>[(] { // start of array or type / class specification
yyextra->bracketCount++;
- yyextra->code->codify(yytext);
+ yyextra->code->codify(QCString(yytext));
}
<Declaration>[)] { // end array specification
yyextra->bracketCount--;
if (!yyextra->bracketCount) yyextra->inTypeDecl = 0;
- yyextra->code->codify(yytext);
+ yyextra->code->codify(QCString(yytext));
}
<Declaration,DeclarationBinding>"&" { // continuation line
- yyextra->code->codify(yytext);
+ yyextra->code->codify(QCString(yytext));
if (!yyextra->isFixedForm)
{
yy_push_state(YY_START,yyscanner);
@@ -637,12 +638,12 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
startFontClass(yyscanner,"keywordtype");
yyextra->code->codify(QCString(yytext).stripWhiteSpace());
endFontClass(yyscanner);
- yyextra->code->codify(yytext + 4);
+ yyextra->code->codify(QCString(yytext + 4));
}
else
{
yyextra->insideBody=TRUE;
- generateLink(yyscanner,*yyextra->code, yytext);
+ generateLink(yyscanner,*yyextra->code,yytext);
yyextra->insideBody=FALSE;
}
}
@@ -740,7 +741,7 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
/*------ variable references? -------------------------------------*/
<Start>"%"{BS}{ID} { // ignore references to elements
- yyextra->code->codify(yytext);
+ yyextra->code->codify(QCString(yytext));
}
<Start>{ID} {
yyextra->insideBody=TRUE;
@@ -791,7 +792,7 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
yyextra->contLineNr++;
YY_FTN_RESET
}
-<*>^{BS}"type"{BS}"=" { yyextra->code->codify(yytext); }
+<*>^{BS}"type"{BS}"=" { yyextra->code->codify(QCString(yytext)); }
<*>[\x80-\xFF]* { // keep utf8 characters together...
if (yyextra->isFixedForm && yy_my_start > fixedCommentAfter)
@@ -801,7 +802,7 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
}
else
{
- yyextra->code->codify(yytext);
+ yyextra->code->codify(QCString(yytext));
}
}
<*>. {
@@ -815,11 +816,11 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
}
else
{
- yyextra->code->codify(yytext);
+ yyextra->code->codify(QCString(yytext));
}
}
<*>{LOG_OPER} { // Fortran logical comparison keywords
- yyextra->code->codify(yytext);
+ yyextra->code->codify(QCString(yytext));
}
<*><<EOF>> {
if (YY_START == DocBlock) {
@@ -870,7 +871,7 @@ static void startFontClass(yyscan_t yyscanner,const char *s)
if (!yyextra->currentFontClass || !s || strcmp(yyextra->currentFontClass,s))
{
endFontClass(yyscanner);
- yyextra->code->startFontClass(s);
+ yyextra->code->startFontClass(QCString(s));
yyextra->currentFontClass=s;
}
}
@@ -891,7 +892,7 @@ static void setCurrentDoc(yyscan_t yyscanner,const QCString &anchor)
}
}
-static void addToSearchIndex(yyscan_t yyscanner,const char *text)
+static void addToSearchIndex(yyscan_t yyscanner,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (Doxygen::searchIndex)
@@ -914,7 +915,7 @@ static void startCodeLine(yyscan_t yyscanner)
//lineAnchor.sprintf("l%05d",yyextra->yyLineNr);
const Definition *d = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
- //printf("startCodeLine %d d=%s\n", yyextra->yyLineNr,d ? d->name().data() : "<null>");
+ //printf("startCodeLine %d d=%s\n", yyextra->yyLineNr,d ? qPrint(d->name()) : "<null>");
if (!yyextra->includeCodeFragment && d)
{
yyextra->currentDefinition = d;
@@ -934,19 +935,19 @@ static void startCodeLine(yyscan_t yyscanner)
{
yyextra->code->writeLineNumber(d->getReference(),
d->getOutputFileBase(),
- 0,yyextra->yyLineNr);
+ QCString(),yyextra->yyLineNr);
setCurrentDoc(yyscanner,lineAnchor);
}
}
else
{
- yyextra->code->writeLineNumber(0,0,0,yyextra->yyLineNr);
+ yyextra->code->writeLineNumber(QCString(),QCString(),QCString(),yyextra->yyLineNr);
}
}
yyextra->code->startCodeLine(yyextra->sourceFileDef);
if (yyextra->currentFontClass)
{
- yyextra->code->startFontClass(yyextra->currentFontClass);
+ yyextra->code->startFontClass(QCString(yyextra->currentFontClass));
}
}
@@ -973,11 +974,12 @@ static void nextCodeLine(yyscan_t yyscanner)
/*! write a code fragment 'text' that may span multiple lines, inserting
* line numbers for each line.
*/
-static void codifyLines(yyscan_t yyscanner,const char *text)
+static void codifyLines(yyscan_t yyscanner,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
//printf("codifyLines(%d,\"%s\")\n",yyextra->yyLineNr,text);
- const char *p=text,*sp=p;
+ if (text.isEmpty()) return;
+ const char *p=text.data(),*sp=p;
char c;
bool done=FALSE;
while (!done)
@@ -991,13 +993,13 @@ static void codifyLines(yyscan_t yyscanner,const char *text)
char *tmp = (char*)malloc(l+1);
memcpy(tmp,sp,l);
tmp[l]='\0';
- yyextra->code->codify(tmp);
+ yyextra->code->codify(QCString(tmp));
free(tmp);
nextCodeLine(yyscanner);
}
else
{
- yyextra->code->codify(sp);
+ yyextra->code->codify(QCString(sp));
done=TRUE;
}
}
@@ -1008,7 +1010,7 @@ static void codifyLines(yyscan_t yyscanner,const char *text)
* split into multiple links with the same destination, one for each line.
*/
static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
- Definition *d,const char *text)
+ Definition *d,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
static bool sourceTooltips = Config_getBool(SOURCE_TOOLTIPS);
@@ -1022,7 +1024,7 @@ static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
tooltip = d->briefDescriptionAsTooltip();
}
bool done=FALSE;
- char *p=(char *)text;
+ char *p=text.rawData();
while (!done)
{
char *sp=p;
@@ -1033,13 +1035,13 @@ static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
yyextra->yyLineNr++;
*(p-1)='\0';
//printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp);
- ol.writeCodeLink(ref,file,anchor,sp,tooltip);
+ ol.writeCodeLink(ref,file,anchor,QCString(sp),tooltip);
nextCodeLine(yyscanner);
}
else
{
//printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp);
- ol.writeCodeLink(ref,file,anchor,sp,tooltip);
+ ol.writeCodeLink(ref,file,anchor,QCString(sp),tooltip);
done=TRUE;
}
}
@@ -1083,7 +1085,7 @@ static bool getFortranTypeDefs(const QCString &tname, const QCString &moduleName
//cout << "=== type found in global module" << endl;
return TRUE;
}
- else if (moduleName && (cd= Doxygen::classLinkedMap->find(moduleName+"::"+tname)))
+ else if (!moduleName.isEmpty() && (cd= Doxygen::classLinkedMap->find(moduleName+"::"+tname)))
{
//cout << "=== type found in local module" << endl;
return TRUE;
@@ -1200,7 +1202,7 @@ static MemberDef *getFortranDefs(yyscan_t yyscanner,const QCString &memberName,
@todo implementation
*/
static bool getGenericProcedureLink(yyscan_t yyscanner,const ClassDef *cd,
- const char *memberText,
+ const QCString &memberText,
CodeOutputInterface &ol)
{
(void)cd;
@@ -1210,9 +1212,9 @@ static bool getGenericProcedureLink(yyscan_t yyscanner,const ClassDef *cd,
}
static bool getLink(yyscan_t yyscanner,const UseMap &useMap, // dictionary with used modules
- const char *memberText, // exact member text
+ const QCString &memberText, // exact member text
CodeOutputInterface &ol,
- const char *text)
+ const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
MemberDef *md=0;
@@ -1234,8 +1236,8 @@ static bool getLink(yyscan_t yyscanner,const UseMap &useMap, // dictionary with
std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(md));
}
- writeMultiLineCodeLink(yyscanner,ol,md,text ? text : memberText);
- addToSearchIndex(yyscanner, text ? text : memberText);
+ writeMultiLineCodeLink(yyscanner,ol,md,!text.isEmpty() ? text : memberText);
+ addToSearchIndex(yyscanner, !text.isEmpty() ? text : memberText);
return TRUE;
}
}
@@ -1243,36 +1245,36 @@ static bool getLink(yyscan_t yyscanner,const UseMap &useMap, // dictionary with
}
-static void generateLink(yyscan_t yyscanner,CodeOutputInterface &ol, char *lname)
+static void generateLink(yyscan_t yyscanner,CodeOutputInterface &ol, const QCString &lname)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
ClassDef *cd=0;
NamespaceDef *nsd=0;
- QCString tmp = lname;
- tmp = removeRedundantWhiteSpace(tmp.lower());
+ QCString name = lname;
+ name = removeRedundantWhiteSpace(name.lower());
// check if lowercase lname is a linkable type or interface
- if ( (getFortranTypeDefs(tmp, yyextra->currentModule, cd, yyextra->useMembers)) && cd->isLinkable() )
+ if ( (getFortranTypeDefs(name, yyextra->currentModule, cd, yyextra->useMembers)) && cd->isLinkable() )
{
if ( (cd->compoundType() == ClassDef::Class) && // was Entry::INTERFACE_SEC) &&
- (getGenericProcedureLink(yyscanner, cd, tmp, ol)) )
+ (getGenericProcedureLink(yyscanner, cd, name, ol)) )
{
//cout << "=== generic procedure resolved" << endl;
}
else
{ // write type or interface link
- writeMultiLineCodeLink(yyscanner, ol,cd,tmp);
- addToSearchIndex(yyscanner, tmp);
+ writeMultiLineCodeLink(yyscanner, ol,cd,name);
+ addToSearchIndex(yyscanner, name);
}
}
// check for module
- else if ( (getFortranNamespaceDefs(tmp, nsd)) && nsd->isLinkable() )
+ else if ( (getFortranNamespaceDefs(name, nsd)) && nsd->isLinkable() )
{ // write module link
- writeMultiLineCodeLink(yyscanner,ol,nsd,tmp);
- addToSearchIndex(yyscanner,tmp);
+ writeMultiLineCodeLink(yyscanner,ol,nsd,name);
+ addToSearchIndex(yyscanner,name);
}
// check for function/variable
- else if (getLink(yyscanner,yyextra->useMembers, tmp, ol, tmp))
+ else if (getLink(yyscanner,yyextra->useMembers, name, ol, name))
{
//cout << "=== found link for lowercase " << lname << endl;
}
@@ -1280,12 +1282,17 @@ static void generateLink(yyscan_t yyscanner,CodeOutputInterface &ol, char *lname
{
// nothing found, just write out the word
//startFontClass("charliteral"); //test
- codifyLines(yyscanner,tmp);
+ codifyLines(yyscanner,name);
//endFontClass(yyscanner); //test
- addToSearchIndex(yyscanner,tmp);
+ addToSearchIndex(yyscanner,name);
}
}
+static void generateLink(yyscan_t yyscanner,CodeOutputInterface &ol, const char *lname)
+{
+ generateLink(yyscanner,ol,QCString(lname));
+}
+
/*! counts the number of lines in the input */
static int countLines(yyscan_t yyscanner)
{
@@ -1423,11 +1430,11 @@ void FortranCodeParser::resetCodeParserState()
}
void FortranCodeParser::parseCode(CodeOutputInterface & codeOutIntf,
- const char * scopeName,
+ const QCString & scopeName,
const QCString & input,
SrcLangExt /*lang*/,
bool isExampleBlock,
- const char * exampleName,
+ const QCString & exampleName,
FileDef * fileDef,
int startLine,
int endLine,
@@ -1449,9 +1456,9 @@ void FortranCodeParser::parseCode(CodeOutputInterface & codeOutIntf,
// const MemberDef *,bool,const Definition *searchCtx,
// bool collectXRefs, FortranFormat format)
if (input.isEmpty()) return;
- printlex(yy_flex_debug, TRUE, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
+ printlex(yy_flex_debug, TRUE, __FILE__, fileDef ? qPrint(fileDef->fileName()): NULL);
yyextra->code = &codeOutIntf;
- yyextra->inputString = input;
+ yyextra->inputString = input.data();
yyextra->inputPosition = 0;
yyextra->isFixedForm = recognizeFixedForm(input,p->format);
yyextra->contLineNr = 1;
@@ -1480,11 +1487,11 @@ void FortranCodeParser::parseCode(CodeOutputInterface & codeOutIntf,
if (isExampleBlock && fileDef==0)
{
// create a dummy filedef for the example
- yyextra->sourceFileDef = createFileDef("",exampleName);
+ yyextra->sourceFileDef = createFileDef(QCString(),exampleName);
}
if (yyextra->sourceFileDef)
{
- setCurrentDoc(yyscanner,"l00001");
+ setCurrentDoc(yyscanner,QCString("l00001"));
}
yyextra->currentDefinition = 0;
yyextra->currentMemberDef = 0;
@@ -1514,7 +1521,7 @@ void FortranCodeParser::parseCode(CodeOutputInterface & codeOutIntf,
// write the tooltips
TooltipManager::instance().writeTooltips(codeOutIntf);
- printlex(yy_flex_debug, FALSE, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
+ printlex(yy_flex_debug, FALSE, __FILE__, fileDef ? qPrint(fileDef->fileName()): NULL);
}
//---------------------------------------------------------
diff --git a/src/fortranscanner.h b/src/fortranscanner.h
index 0fbba89..bf286c3 100644
--- a/src/fortranscanner.h
+++ b/src/fortranscanner.h
@@ -29,12 +29,12 @@ class FortranOutlineParser : public OutlineParserInterface
public:
FortranOutlineParser(FortranFormat format=FortranFormat_Unknown);
~FortranOutlineParser();
- void parseInput(const char *fileName,
+ void parseInput(const QCString &fileName,
const char *fileBuf,
const std::shared_ptr<Entry> &root,
ClangTUParser *clangParser);
bool needsPreprocessing(const QCString &extension) const;
- void parsePrototype(const char *text);
+ void parsePrototype(const QCString &text);
private:
struct Private;
diff --git a/src/fortranscanner.l b/src/fortranscanner.l
index cf8a0bb..f36b6ae 100755
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -56,8 +56,6 @@
#include <assert.h>
#include <ctype.h>
-#include <qfile.h>
-
#include "fortranscanner.h"
#include "entry.h"
#include "message.h"
@@ -208,8 +206,8 @@ struct fortranscannerYY_state
//-----------------------------------------------------------------------------
static int getAmpersandAtTheStart(const char *buf, int length);
static int getAmpOrExclAtTheEnd(const char *buf, int length, char ch);
-static QCString extractFromParens(const QCString name);
-static QCString extractBind(const QCString name);
+static QCString extractFromParens(const QCString &name);
+static QCString extractBind(const QCString &name);
static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
@@ -218,8 +216,8 @@ static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief
static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief);
static void subrHandleCommentBlockResult(yyscan_t yyscanner,const QCString &doc,bool brief);
static void addCurrentEntry(yyscan_t yyscanner,bool case_insens);
-static void addModule(yyscan_t yyscanner,const char *name, bool isModule=FALSE);
-static void addSubprogram(yyscan_t yyscanner,const char *text);
+static void addModule(yyscan_t yyscanner,const QCString &name=QCString(), bool isModule=FALSE);
+static void addSubprogram(yyscan_t yyscanner,const QCString &text);
static void addInterface(yyscan_t yyscanner,QCString name, InterfaceType type);
static Argument *getParameter(yyscan_t yyscanner,const QCString &name);
static void scanner_abort(yyscan_t yyscanner);
@@ -228,7 +226,7 @@ static void startScope(yyscan_t yyscanner,Entry *scope);
static bool endScope(yyscan_t yyscanner,Entry *scope, bool isGlobalRoot=FALSE);
static void resolveModuleProcedures(yyscan_t yyscanner,Entry *current_root);
static void truncatePrepass(yyscan_t yyscanner,int index);
-static void pushBuffer(yyscan_t yyscanner,QCString &buffer);
+static void pushBuffer(yyscan_t yyscanner,const QCString &buffer);
static void popBuffer(yyscan_t yyscanner);
static const CommentInPrepass* locatePrepassComment(yyscan_t yyscanner,int from, int to);
static void updateVariablePrepassComment(yyscan_t yyscanner,int from, int to);
@@ -447,7 +445,7 @@ SCOPENAME ({ID}{BS}"::"{BS})*
}
}
<StrIgnore>.?/\n { yy_pop_state(yyscanner); // comment ends with endline character
- DBG_CTX((stderr,"end comment %d %s\n",yyextra->lineNr,yyextra->debugStr.data()));
+ DBG_CTX((stderr,"end comment %d %s\n",yyextra->lineNr,qPrint(yyextra->debugStr)));
} // comment line ends
<StrIgnore>. { yyextra->debugStr+=yytext; }
@@ -457,7 +455,7 @@ SCOPENAME ({ID}{BS}"::"{BS})*
<Start,ModuleBody,SubprogBody>"use"{BS_} {
if (YY_START == Start)
{
- addModule(yyscanner,NULL);
+ addModule(yyscanner);
yy_push_state(ModuleBody,yyscanner); //anon program
}
yy_push_state(Use,yyscanner);
@@ -557,7 +555,7 @@ SCOPENAME ({ID}{BS}"::"{BS})*
<Start>^{BS}{CONTAINS}/({BS}|\n|!|;) {
if (YY_START == Start)
{
- addModule(yyscanner,NULL);
+ addModule(yyscanner);
yy_push_state(ModuleBodyContains,yyscanner); //anon program
}
}
@@ -614,11 +612,11 @@ SCOPENAME ({ID}{BS}"::"{BS})*
}
}
<Module>{ID} {
- addModule(yyscanner,yytext, TRUE);
+ addModule(yyscanner, QCString(yytext), TRUE);
BEGIN(ModuleBody);
}
<Program>{ID} {
- addModule(yyscanner,yytext, FALSE);
+ addModule(yyscanner, QCString(yytext), FALSE);
BEGIN(ModuleBody);
}
@@ -636,7 +634,7 @@ SCOPENAME ({ID}{BS}"::"{BS})*
<Start,ModuleBody>^{BS}type/[^a-z0-9_] {
if (YY_START == Start)
{
- addModule(yyscanner,NULL);
+ addModule(yyscanner,QCString());
yy_push_state(ModuleBody,yyscanner); //anon program
}
@@ -795,7 +793,7 @@ private {
/* variable declaration starts */
if (YY_START == Start)
{
- addModule(yyscanner,NULL);
+ addModule(yyscanner);
yy_push_state(ModuleBody,yyscanner); //anon program
}
yy_push_state(AttributeList,yyscanner);
@@ -804,7 +802,7 @@ private {
/* external can be a "type" or an attribute */
if (YY_START == Start)
{
- addModule(yyscanner,NULL);
+ addModule(yyscanner);
yy_push_state(ModuleBody,yyscanner); //anon program
}
QCString tmp = yytext;
@@ -837,8 +835,8 @@ private {
}
{ATTR_SPEC}. { /* update yyextra->current yyextra->modifiers when it is an ATTR_SPEC and not a variable name */
/* buyyextra->625519 */
- QChar chr = yytext[(int)yyleng-1];
- if (chr.isLetter() || chr.isDigit() || (chr == '_'))
+ char chr = yytext[(int)yyleng-1];
+ if (isId(chr))
{
yyextra->colNr -= (int)yyleng;
REJECT;
@@ -992,7 +990,7 @@ private {
<Variable>";".*"\n" { yyextra->currentModifiers = SymbolModifiers();
yy_pop_state(yyscanner); // end variable declaration list
yyextra->docBlock.resize(0);
- yyextra->inputStringSemi =(const char*)(QCString(" \n") + QCString(yytext+1)).data();
+ yyextra->inputStringSemi = " \n"+QCString(yytext+1);
yyextra->lineNr--;
pushBuffer(yyscanner,yyextra->inputStringSemi);
}
@@ -1000,7 +998,7 @@ private {
if (YY_START == Variable) REJECT; // Just be on the safe side
if (YY_START == String) REJECT; // ";" ignored in strings
if (YY_START == StrIgnore) REJECT; // ";" ignored in regular yyextra->comments
- yyextra->inputStringSemi =(const char*)(QCString(" \n") + QCString(yytext+1)).data();
+ yyextra->inputStringSemi = " \n"+QCString(yytext+1);
yyextra->lineNr--;
pushBuffer(yyscanner,yyextra->inputStringSemi);
}
@@ -1032,11 +1030,11 @@ private {
yy_pop_state(yyscanner); // end initialization
if (yyextra->last_enum)
{
- yyextra->last_enum->initializer= yyextra->initializer;
+ yyextra->last_enum->initializer.str(yyextra->initializer.str());
}
else
{
- if (yyextra->vtype == V_VARIABLE) yyextra->last_entry->initializer= yyextra->initializer;
+ if (yyextra->vtype == V_VARIABLE) yyextra->last_entry->initializer.str(yyextra->initializer.str());
}
}
else
@@ -1048,11 +1046,11 @@ private {
yy_pop_state(yyscanner); // end initialization
if (yyextra->last_enum)
{
- yyextra->last_enum->initializer= yyextra->initializer;
+ yyextra->last_enum->initializer.str(yyextra->initializer.str());
}
else
{
- if (yyextra->vtype == V_VARIABLE) yyextra->last_entry->initializer= yyextra->initializer;
+ if (yyextra->vtype == V_VARIABLE) yyextra->last_entry->initializer.str(yyextra->initializer.str());
}
yyextra->colNr -= 1;
unput(*yytext);
@@ -1062,7 +1060,7 @@ private {
<*>{BS}"enum"{BS}","{BS}"bind"{BS}"("{BS}"c"{BS}")"{BS} {
if (YY_START == Start)
{
- addModule(yyscanner,NULL);
+ addModule(yyscanner);
yy_push_state(ModuleBody,yyscanner); //anon program
}
@@ -1177,7 +1175,7 @@ private {
<Parameterlist>{ID} {
//yyextra->current->type not yet available
QCString param = yytext;
- // std::cout << "3=========> got parameter " << param << std::endl;
+ // std::cout << "3=========> got parameter " << param << "\n";
yyextra->current->args += param;
Argument arg;
arg.name = param;
@@ -1755,7 +1753,7 @@ const char* prepassFixedForm(const char* contents, int *hasContLine)
return newContents;
}
-static void pushBuffer(yyscan_t yyscanner,QCString& buffer)
+static void pushBuffer(yyscan_t yyscanner,const QCString &buffer)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (yyextra->includeStackCnt <= yyextra->includeStackPtr)
@@ -1764,10 +1762,9 @@ static void pushBuffer(yyscan_t yyscanner,QCString& buffer)
yyextra->includeStack = (YY_BUFFER_STATE *)realloc(yyextra->includeStack, yyextra->includeStackCnt * sizeof(YY_BUFFER_STATE));
}
yyextra->includeStack[yyextra->includeStackPtr++] = YY_CURRENT_BUFFER;
- yy_switch_to_buffer(yy_scan_string(buffer,yyscanner),yyscanner);
+ yy_switch_to_buffer(yy_scan_string(buffer.data(),yyscanner),yyscanner);
- DBG_CTX((stderr, "--PUSH--%s", (const char *)buffer));
- buffer = NULL;
+ DBG_CTX((stderr, "--PUSH--%s", qPrint(buffer)));
}
static void popBuffer(yyscan_t yyscanner)
@@ -1816,7 +1813,7 @@ void resolveModuleProcedures(yyscan_t yyscanner,Entry *current_root)
}
/*! Extracts string which resides within parentheses of provided string. */
-static QCString extractFromParens(const QCString name)
+static QCString extractFromParens(const QCString &name)
{
QCString extracted = name;
int start = extracted.find("(");
@@ -1836,7 +1833,7 @@ static QCString extractFromParens(const QCString name)
}
/*! remove useless spaces from bind statement */
-static QCString extractBind(const QCString name)
+static QCString extractBind(const QCString &name)
{
QCString parensPart = extractFromParens(name);
if (parensPart.length() == 1)
@@ -2201,8 +2198,8 @@ static bool endScope(yyscan_t yyscanner,Entry *scope, bool isGlobalRoot)
// iterate all symbol yyextra->modifiers of the scope
for (const auto &kv : mdfsMap)
{
- //cout<<it.key()<<": "<<it.data()<<endl;
- Argument *arg = findArgument(scope, kv.first);
+ //cout<<it.key()<<": "<<qPrint(it)<<endl;
+ Argument *arg = findArgument(scope, QCString(kv.first));
if (arg)
{
@@ -2317,30 +2314,30 @@ static void addCurrentEntry(yyscan_t yyscanner,bool case_insens)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (case_insens) yyextra->current->name = yyextra->current->name.lower();
- //printf("===Adding entry %s to %s\n", yyextra->current->name.data(), yyextra->current_root->name.data());
+ //printf("===Adding entry %s to %s\n", qPrint(yyextra->current->name), qPrint(yyextra->current_root->name));
yyextra->last_entry = yyextra->current;
yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
initEntry(yyscanner);
}
-static void addModule(yyscan_t yyscanner,const char *name, bool isModule)
+static void addModule(yyscan_t yyscanner,const QCString &name, bool isModule)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- DBG_CTX((stderr, "0=========> got module %s\n", name));
+ DBG_CTX((stderr, "0=========> got module %s\n", qPrint(name)));
if (isModule)
yyextra->current->section = Entry::NAMESPACE_SEC;
else
yyextra->current->section = Entry::FUNCTION_SEC;
- if (name!=NULL)
+ if (!name.isEmpty())
{
yyextra->current->name = name;
}
else
{
QCString fname = yyextra->fileName;
- int index = QMAX(fname.findRev('/'), fname.findRev('\\'));
+ int index = std::max(fname.findRev('/'), fname.findRev('\\'));
fname = fname.right(fname.length()-index-1);
fname = fname.prepend("__").append("__");
yyextra->current->name = fname;
@@ -2355,10 +2352,10 @@ static void addModule(yyscan_t yyscanner,const char *name, bool isModule)
}
-static void addSubprogram(yyscan_t yyscanner,const char *text)
+static void addSubprogram(yyscan_t yyscanner,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- DBG_CTX((stderr,"1=========> got subprog, type: %s\n",text));
+ DBG_CTX((stderr,"1=========> got subprog, type: %s\n",qPrint(text)));
yyextra->subrCurrent.push_back(yyextra->current);
yyextra->current->section = Entry::FUNCTION_SEC ;
QCString subtype = text; subtype=subtype.lower().stripWhiteSpace();
@@ -2382,7 +2379,7 @@ static void addInterface(yyscan_t yyscanner,QCString name, InterfaceType type)
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (YY_START == Start)
{
- addModule(yyscanner,NULL);
+ addModule(yyscanner);
yy_push_state(ModuleBody,yyscanner); //anon program
}
@@ -2428,7 +2425,7 @@ static void addInterface(yyscan_t yyscanner,QCString name, InterfaceType type)
static Argument *getParameter(yyscan_t yyscanner,const QCString &name)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- // std::cout<<"addFortranParameter(): "<<name<<" DOCS:"<<(docs.isNull()?QCString("null"):docs)<<std::endl;
+ // std::cout<<"addFortranParameter(): "<<name<<" DOCS:"<<(docs.isNull()?QCString("null"):docs)<<"\n";
Argument *ret = 0;
for (Argument &a:yyextra->current_root->argList)
{
@@ -2469,7 +2466,7 @@ static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief
yyextra->docBlockInBody = FALSE;
return;
}
- DBG_CTX((stderr,"call parseCommentBlock [%s]\n",doc.data()));
+ DBG_CTX((stderr,"call parseCommentBlock [%s]\n",qPrint(doc)));
int lineNr = brief ? yyextra->current->briefLine : yyextra->current->docLine;
int position=0;
bool needsEntry = FALSE;
@@ -2541,8 +2538,8 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b
else
{
// something different specified, give warning and leave error.
- warn(yyextra->fileName,yyextra->lineNr, "%s", ("Routine: " + yyextra->current->name + yyextra->current->args +
- " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName).data());
+ warn(yyextra->fileName,yyextra->lineNr, "Routine: %s%s inconsistency between intent attribute and documentation for parameter %s:",
+ qPrint(yyextra->current->name),qPrint(yyextra->current->args),qPrint(yyextra->argName));
handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " +
yyextra->argName + " " + loc_doc,brief);
}
@@ -2565,8 +2562,8 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b
}
else
{
- warn(yyextra->fileName,yyextra->lineNr, "%s", ("Routine: " + yyextra->current->name + yyextra->current->args +
- " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName).data());
+ warn(yyextra->fileName,yyextra->lineNr, "Routine: %s%s inconsistency between intent attribute and documentation for parameter %s:",
+ qPrint(yyextra->current->name),qPrint(yyextra->current->args),qPrint(yyextra->argName));
handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " +
yyextra->argName + " " + loc_doc,brief);
}
@@ -2587,8 +2584,8 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b
}
else
{
- warn(yyextra->fileName,yyextra->lineNr, "%s", ("Routine: " + yyextra->current->name + yyextra->current->args +
- " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName).data());
+ warn(yyextra->fileName,yyextra->lineNr, "Routine: %s%s inconsistency between intent attribute and documentation for parameter %s:",
+ qPrint(yyextra->current->name),qPrint(yyextra->current->args),qPrint(yyextra->argName));
handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " +
yyextra->argName + " " + loc_doc,brief);
}
@@ -2636,20 +2633,19 @@ static void subrHandleCommentBlockResult(yyscan_t yyscanner,const QCString &doc,
//----------------------------------------------------------------------------
-static void parseMain(yyscan_t yyscanner, const char *fileName,const char *fileBuf,
+static void parseMain(yyscan_t yyscanner, const QCString &fileName,const char *fileBuf,
const std::shared_ptr<Entry> &rt, FortranFormat format)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- char *tmpBuf = NULL;
+ char *tmpBuf = nullptr;
initParser(yyscanner);
-
if (fileBuf==0 || fileBuf[0]=='\0') return;
yyextra->defaultProtection = Public;
yyextra->inputString = fileBuf;
yyextra->inputPosition = 0;
- yyextra->inputStringPrepass = NULL;
+ yyextra->inputStringPrepass = nullptr;
yyextra->inputPositionPrepass = 0;
//yyextra->anonCount = 0; // don't reset per file
@@ -2660,13 +2656,13 @@ static void parseMain(yyscan_t yyscanner, const char *fileName,const char *fileB
if (yyextra->isFixedForm)
{
- msg("Prepassing fixed form of %s\n", fileName);
+ msg("Prepassing fixed form of %s\n", qPrint(fileName));
//printf("---strlen=%d\n", strlen(fileBuf));
//clock_t start=clock();
//printf("Input fixed form string:\n%s\n", fileBuf);
//printf("===========================\n");
- yyextra->inputString = prepassFixedForm(fileBuf, NULL);
+ yyextra->inputString = prepassFixedForm(fileBuf, nullptr);
Debug::print(Debug::FortranFixed2Free,0,"======== Fixed to Free format =========\n---- Input fixed form string ------- \n%s\n", fileBuf);
Debug::print(Debug::FortranFixed2Free,0,"---- Resulting free form string ------- \n%s\n", yyextra->inputString);
//printf("Resulting free form string:\n%s\n", yyextra->inputString);
@@ -2686,7 +2682,7 @@ static void parseMain(yyscan_t yyscanner, const char *fileName,const char *fileB
yyextra->lineNr= 1 ;
yyextra->fileName = fileName;
- msg("Parsing file %s...\n",yyextra->fileName.data());
+ msg("Parsing file %s...\n",qPrint(yyextra->fileName));
yyextra->global_scope = rt.get();
startScope(yyscanner,rt.get()); // implies yyextra->current_root = rt
@@ -2717,7 +2713,7 @@ static void parseMain(yyscan_t yyscanner, const char *fileName,const char *fileB
//debugCompounds(rt); //debug
- rt->program.resize(0);
+ rt->program.str(std::string());
//delete yyextra->current; yyextra->current=0;
yyextra->moduleProcedures.clear();
if (tmpBuf)
@@ -2762,19 +2758,19 @@ FortranOutlineParser::~FortranOutlineParser()
{
}
-void FortranOutlineParser::parseInput(const char *fileName,
- const char *fileBuf,
- const std::shared_ptr<Entry> &root,
- ClangTUParser * /*clangParser*/)
+void FortranOutlineParser::parseInput(const QCString &fileName,
+ const char *fileBuf,
+ const std::shared_ptr<Entry> &root,
+ ClangTUParser * /*clangParser*/)
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
yyextra->thisParser = this;
- printlex(yy_flex_debug, TRUE, __FILE__, fileName);
+ printlex(yy_flex_debug, TRUE, __FILE__, qPrint(fileName));
::parseMain(p->yyscanner,fileName,fileBuf,root,p->format);
- printlex(yy_flex_debug, FALSE, __FILE__, fileName);
+ printlex(yy_flex_debug, FALSE, __FILE__, qPrint(fileName));
}
bool FortranOutlineParser::needsPreprocessing(const QCString &extension) const
@@ -2782,11 +2778,10 @@ bool FortranOutlineParser::needsPreprocessing(const QCString &extension) const
return extension!=extension.lower(); // use preprocessor only for upper case extensions
}
-void FortranOutlineParser::parsePrototype(const char *text)
+void FortranOutlineParser::parsePrototype(const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
- QCString buffer = QCString(text);
- pushBuffer(p->yyscanner,buffer);
+ pushBuffer(p->yyscanner,text);
yyextra->parsingPrototype = TRUE;
BEGIN(Prototype);
fortranscannerYYlex(p->yyscanner);
@@ -2800,7 +2795,7 @@ static void scanner_abort(yyscan_t yyscanner)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
fprintf(stderr,"********************************************************************\n");
- fprintf(stderr,"Error in file %s line: %d, state: %d(%s)\n",yyextra->fileName.data(),yyextra->lineNr,YY_START,stateToString(YY_START));
+ fprintf(stderr,"Error in file %s line: %d, state: %d(%s)\n",qPrint(yyextra->fileName),yyextra->lineNr,YY_START,stateToString(YY_START));
fprintf(stderr,"********************************************************************\n");
bool start=FALSE;
diff --git a/src/ftextstream.cpp b/src/ftextstream.cpp
deleted file mode 100644
index 3038af3..0000000
--- a/src/ftextstream.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-#include "ftextstream.h"
-#include <qfile.h>
-
-//----------------------------------------------------------------------------
-
-class QGStringBuffer : public QIODevice
-{
- public:
- QGStringBuffer( QGString* str );
- ~QGStringBuffer();
- bool open( int m );
- void close();
- void flush();
- uint size() const;
- int at() const;
- bool at( int pos );
- int readBlock( char *, uint) { return -1; }
- int writeBlock( const char *p, uint len );
- int getch() { return -1; }
- int putch( int ch );
- int ungetch( int ) { return -1; }
-
- protected:
- QGString* m_str;
-
- private: // Disabled copy constructor and operator=
- QGStringBuffer( const QGStringBuffer & );
- QGStringBuffer &operator=( const QGStringBuffer & );
-};
-
-QGStringBuffer::QGStringBuffer( QGString* str ) : m_str(str)
-{
- //printf("QGStringBuffer::QGStringBuffer(%p)\n",str);
-}
-
-QGStringBuffer::~QGStringBuffer()
-{
-}
-
-bool QGStringBuffer::open( int m )
-{
- if ( !m_str )
- {
-#if defined(CHECK_STATE)
- qWarning( "QGStringBuffer::open: No string" );
-#endif
- return FALSE;
- }
- if ( isOpen() )
- { // buffer already open
-#if defined(CHECK_STATE)
- qWarning( "QGStringBuffer::open: Buffer already open" );
-#endif
- return FALSE;
- }
- setMode( m );
- if ( m & IO_Truncate )
- { // truncate buffer
- m_str->truncate( 0 );
- }
- if ( m & IO_Append )
- { // append to end of buffer
- ioIndex = m_str->length();
- }
- else
- {
- ioIndex = 0;
- }
- setState( IO_Open );
- setStatus( 0 );
- return TRUE;
-}
-
-void QGStringBuffer::close()
-{
- if ( isOpen() )
- {
- setFlags( IO_Direct );
- ioIndex = 0;
- }
-}
-
-void QGStringBuffer::flush()
-{
-}
-
-uint QGStringBuffer::size() const
-{
- return m_str ? m_str->length() : 0;
-}
-
-int QGStringBuffer::at() const
-{
- return ioIndex;
-}
-
-bool QGStringBuffer::at( int pos )
-{
-#if defined(CHECK_STATE)
- if ( !isOpen() )
- {
- qWarning( "QGStringBuffer::at: Buffer is not open" );
- return FALSE;
- }
-#endif
- if ( (uint)pos >= m_str->length() )
- {
-#if defined(CHECK_RANGE)
- qWarning( "QGStringBuffer::at: Index %d out of range", pos );
-#endif
- return FALSE;
- }
-
- ioIndex = pos;
- return TRUE;
-}
-
-int QGStringBuffer::writeBlock( const char *p, uint len )
-{
- //printf("QGStringBuffer::writeBlock(%p,%d) m_str=%p ioIndex=%d\n",p,len,
- // m_str,ioIndex);
- m_str->enlarge(ioIndex+len+1);
- memcpy(m_str->data()+ioIndex,p,len);
- ioIndex+=len;
- m_str->data()[ioIndex]='\0';
- m_str->setLen(ioIndex);
- return len;
-}
-
-int QGStringBuffer::putch( int ch )
-{
- //printf("QGStringBuffer::putch(%d) m_str=%p ioIndex=%d\n",
- // ch,m_str,ioIndex);
- m_str->enlarge(ioIndex+2);
- m_str->data()[ioIndex] = (char)ch;
- ioIndex++;
- m_str->data()[ioIndex] = '\0';
- m_str->setLen(ioIndex);
- return ch;
-}
-
-
-//----------------------------------------------------------------------------
-
-FTextStream::FTextStream()
-{
- m_dev = 0;
- m_owndev = FALSE;
-}
-
-FTextStream::FTextStream( QIODevice *dev )
-{
- m_dev = dev;
- m_owndev = FALSE;
-}
-
-FTextStream::FTextStream( QGString *s )
-{
- m_dev = new QGStringBuffer(s);
- ((QGStringBuffer*)m_dev)->open( IO_WriteOnly );
- m_owndev = TRUE;
-}
-
-FTextStream::FTextStream( FILE *fh )
-{
- m_dev = new QFile;
- ((QFile *)m_dev)->open( IO_WriteOnly, fh);
- m_owndev = TRUE;
-}
-
-FTextStream::~FTextStream()
-{
- if (m_owndev) delete m_dev;
- m_dev = 0;
-}
-
-QIODevice *FTextStream::device() const
-{
- return m_dev;
-}
-
-void FTextStream::setDevice( QIODevice *dev )
-{
- if (m_owndev)
- {
- delete m_dev;
- m_owndev = FALSE;
- }
- m_dev = dev;
-}
-
-void FTextStream::unsetDevice()
-{
- setDevice(0);
-}
-
-FTextStream &FTextStream::output_int( ulong n, bool neg )
-{
- char buf[20];
- char *p = &buf[19];
- *p = '\0';
- if ( neg )
- {
- n = (ulong)(-(long)n);
- }
- do
- {
- *--p = ((int)(n%10)) + '0';
- n /= 10;
- } while ( n );
- if ( neg ) *--p = '-';
- return operator<<(p);
-}
-
-FTextStream &FTextStream::operator<<( signed short i )
-{
- return output_int( i, i < 0 );
-}
-
-FTextStream &FTextStream::operator<<( unsigned short i )
-{
- return output_int( i, FALSE );
-}
-
-FTextStream &FTextStream::operator<<( signed int i )
-{
- return output_int( i, i < 0 );
-}
-
-FTextStream &FTextStream::operator<<( unsigned int i )
-{
- return output_int( i, FALSE );
-}
-
-FTextStream &FTextStream::operator<<( signed long i )
-{
- return output_int( i, i < 0 );
-}
-
-FTextStream &FTextStream::operator<<( unsigned long i )
-{
- return output_int( i, FALSE );
-}
-
-FTextStream &FTextStream::operator<<( float f )
-{
- return *this << (double)f;
-}
-
-FTextStream &FTextStream::operator<<( double d )
-{
- char buf[64];
- sprintf(buf,"%f",d);
- return *this << buf;
-}
-
-
-
-
-
diff --git a/src/ftextstream.h b/src/ftextstream.h
deleted file mode 100644
index 8e56174..0000000
--- a/src/ftextstream.h
+++ /dev/null
@@ -1,76 +0,0 @@
-#ifndef FTEXTSTREAM_H
-#define FTEXTSTREAM_H
-
-#include <stdio.h>
-
-#include <qiodevice.h>
-#include <qgstring.h>
-
-/** @brief Simplified and optimized version of QTextStream */
-class FTextStream
-{
- public:
- FTextStream();
- FTextStream( QIODevice * );
- FTextStream( QGString * );
- FTextStream( FILE * );
- virtual ~FTextStream();
-
- QIODevice *device() const;
- void setDevice( QIODevice * );
- void unsetDevice();
-
- FTextStream &operator<<( char );
- FTextStream &operator<<( const char *);
- FTextStream &operator<<( const QCString & );
- FTextStream &operator<<( signed short );
- FTextStream &operator<<( unsigned short );
- FTextStream &operator<<( signed int );
- FTextStream &operator<<( unsigned int );
- FTextStream &operator<<( signed long );
- FTextStream &operator<<( unsigned long );
- FTextStream &operator<<( float );
- FTextStream &operator<<( double );
-
- private:
- QIODevice *m_dev;
- bool m_owndev;
- FTextStream &output_int( ulong n, bool neg );
-
- private: // Disabled copy constructor and operator=
-#if defined(Q_DISABLE_COPY)
- FTextStream( const FTextStream & );
- FTextStream &operator=( const FTextStream & );
-#endif
-};
-
-inline FTextStream &FTextStream::operator<<( char c)
-{
- if (m_dev) m_dev->putch(c);
- return *this;
-}
-
-inline FTextStream &FTextStream::operator<<( const char* s)
-{
- uint len = qstrlen( s );
- if (m_dev) m_dev->writeBlock( s, len );
- return *this;
-}
-
-inline FTextStream &FTextStream::operator<<( const QCString &s)
-{
- if (m_dev) m_dev->writeBlock( s, s.length() );
- return *this;
-}
-
-typedef FTextStream & (*FTSFUNC)(FTextStream &);// manipulator function
-
-inline FTextStream &operator<<( FTextStream &s, FTSFUNC f )
-{ return (*f)( s ); }
-
-inline FTextStream &endl( FTextStream & s)
-{
- return s << '\n';
-}
-
-#endif // FTEXTSTREAM_H
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index f411a60..24ed957 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -20,7 +20,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <qfileinfo.h>
#include <algorithm>
#include "ftvhelp.h"
@@ -68,8 +67,8 @@ const char *JAVASCRIPT_LICENSE_TEXT = R"LIC(/*
struct FTVNode
{
- FTVNode(bool dir,const char *r,const char *f,const char *a,
- const char *n,bool sepIndex,bool navIndex,const Definition *df)
+ FTVNode(bool dir,const QCString &r,const QCString &f,const QCString &a,
+ const QCString &n,bool sepIndex,bool navIndex,const Definition *df)
: isLast(TRUE), isDir(dir),ref(r),file(f),anchor(a),name(n), index(0),
parent(0), separateIndex(sepIndex), addToNavIndex(navIndex),
def(df) {}
@@ -209,10 +208,10 @@ void FTVHelp::decContentsDepth()
* \param def Definition corresponding to this entry
*/
void FTVHelp::addContentsItem(bool isDir,
- const char *name,
- const char *ref,
- const char *file,
- const char *anchor,
+ const QCString &name,
+ const QCString &ref,
+ const QCString &file,
+ const QCString &anchor,
bool separateIndex,
bool addToNavIndex,
const Definition *def
@@ -280,7 +279,7 @@ QCString FTVHelp::generateIndentLabel(FTVNode *n,int level)
return result;
}
-void FTVHelp::generateIndent(FTextStream &t, FTVNode *n,bool opened)
+void FTVHelp::generateIndent(TextStream &t, FTVNode *n,bool opened)
{
int indent=0;
FTVNode *p = n->parent;
@@ -300,10 +299,10 @@ void FTVHelp::generateIndent(FTextStream &t, FTVNode *n,bool opened)
}
}
-void FTVHelp::generateLink(FTextStream &t,FTVNode *n)
+void FTVHelp::generateLink(TextStream &t,FTVNode *n)
{
//printf("FTVHelp::generateLink(ref=%s,file=%s,anchor=%s\n",
- // n->ref.data(),n->file.data(),n->anchor.data());
+ // qPrint(n->ref),qPrint(n->file),qPrint(n->anchor));
bool setTarget = FALSE;
if (n->file.isEmpty()) // no link
{
@@ -345,15 +344,15 @@ void FTVHelp::generateLink(FTextStream &t,FTVNode *n)
}
}
-static void generateBriefDoc(FTextStream &t,const Definition *def)
+static void generateBriefDoc(TextStream &t,const Definition *def)
{
QCString brief = def->briefDescription(TRUE);
- //printf("*** %p: generateBriefDoc(%s)='%s'\n",def,def->name().data(),brief.data());
+ //printf("*** %p: generateBriefDoc(%s)='%s'\n",def,qPrint(def->name()),qPrint(brief));
if (!brief.isEmpty())
{
DocNode *root = validatingParseDoc(def->briefFile(),def->briefLine(),
def,0,brief,FALSE,FALSE,
- 0,TRUE,TRUE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,TRUE,Config_getBool(MARKDOWN_SUPPORT));
QCString relPath = relativePathToRoot(def->getOutputFileBase());
HtmlCodeGenerator htmlGen(t,relPath);
HtmlDocVisitor *visitor = new HtmlDocVisitor(t,htmlGen,def);
@@ -384,7 +383,7 @@ static char compoundIcon(const ClassDef *cd)
return icon;
}
-void FTVHelp::generateTree(FTextStream &t, const std::vector<FTVNode*> &nl,int level,int maxLevel,int &index)
+void FTVHelp::generateTree(TextStream &t, const std::vector<FTVNode*> &nl,int level,int maxLevel,int &index)
{
for (const auto &n : nl)
{
@@ -438,7 +437,7 @@ void FTVHelp::generateTree(FTextStream &t, const std::vector<FTVNode*> &nl,int l
{
generateBriefDoc(t,n->def);
}
- t << "</td></tr>" << endl;
+ t << "</td></tr>\n";
folderId++;
generateTree(t,n->children,level+1,maxLevel,index);
}
@@ -480,6 +479,10 @@ void FTVHelp::generateTree(FTextStream &t, const std::vector<FTVNode*> &nl,int l
char icon=compoundIcon(toClassDef(n->def));
t << "<span class=\"icona\"><span class=\"icon\">" << icon << "</span></span>";
}
+ else if (n->def && n->def->definitionType()==Definition::TypeConcept)
+ {
+ t << "<span class=\"icona\"><span class=\"icon\">R</span></span>";
+ }
else if (n->def && n->def->definitionType()==Definition::TypeDir)
{
t << "<span class=\"iconfclosed\"></span>";
@@ -498,7 +501,7 @@ void FTVHelp::generateTree(FTextStream &t, const std::vector<FTVNode*> &nl,int l
{
generateBriefDoc(t,n->def);
}
- t << "</td></tr>" << endl;
+ t << "</td></tr>\n";
}
}
}
@@ -535,7 +538,7 @@ static bool dupOfParent(const FTVNode *n)
return FALSE;
}
-static void generateJSLink(FTextStream &t,const FTVNode *n)
+static void generateJSLink(TextStream &t,const FTVNode *n)
{
if (n->file.isEmpty()) // no link
{
@@ -558,7 +561,7 @@ static QCString convertFileId2Var(const QCString &fileId)
return substitute(varId,"-","_");
}
-static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
+static bool generateJSTree(NavIndexEntryList &navIndex,TextStream &t,
const std::vector<FTVNode*> &nl,int level,bool &first)
{
static QCString htmlOutput = Config_getString(HTML_OUTPUT);
@@ -568,13 +571,13 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
for (const auto &n : nl)
{
// terminate previous entry
- if (!first) t << "," << endl;
+ if (!first) t << ",\n";
first=FALSE;
// start entry
if (!found)
{
- t << "[" << endl;
+ t << "[\n";
}
found=TRUE;
@@ -608,7 +611,7 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
if (!n->children.empty()) // write children to separate file for dynamic loading
{
QCString fileId = n->file;
- if (n->anchor)
+ if (!n->anchor.isEmpty())
{
fileId+="_"+n->anchor;
}
@@ -616,14 +619,16 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
{
fileId+="_dup";
}
- QFile f(htmlOutput+"/"+fileId+".js");
- if (f.open(IO_WriteOnly))
+ QCString fileName = htmlOutput+"/"+fileId+".js";
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (f.is_open())
{
- FTextStream tt(&f);
- tt << "var " << convertFileId2Var(fileId) << " =" << endl;
+ TextStream tt(&f);
+ tt << "var " << convertFileId2Var(fileId) << " =\n";
generateJSTree(navIndex,tt,n->children,1,firstChild);
- tt << endl << "];";
+ tt << "\n];";
}
+ f.close();
t << "\"" << fileId << "\" ]";
}
else // no children
@@ -640,7 +645,7 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
if (emptySection)
t << "null ]";
else
- t << endl << indentStr << " ] ]";
+ t << "\n" << indentStr << " ] ]";
}
}
return found;
@@ -649,17 +654,17 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
static void generateJSNavTree(const std::vector<FTVNode*> &nodeList)
{
QCString htmlOutput = Config_getString(HTML_OUTPUT);
- QFile f(htmlOutput+"/navtreedata.js");
+ std::ofstream f(htmlOutput.str()+"/navtreedata.js",std::ofstream::out | std::ofstream::binary);
NavIndexEntryList navIndex;
- if (f.open(IO_WriteOnly) /*&& fidx.open(IO_WriteOnly)*/)
+ if (f.is_open())
{
- //FTextStream tidx(&fidx);
- //tidx << "var NAVTREEINDEX =" << endl;
- //tidx << "{" << endl;
- FTextStream t(&f);
+ TextStream t(&f);
+ //TextStream tidx(&fidx);
+ //tidx << "var NAVTREEINDEX =\n";
+ //tidx << "{\n";
t << JAVASCRIPT_LICENSE_TEXT;
- t << "var NAVTREE =" << endl;
- t << "[" << endl;
+ t << "var NAVTREE =\n";
+ t << "[\n";
t << " [ ";
QCString projName = Config_getString(PROJECT_NAME);
if (projName.isEmpty())
@@ -689,28 +694,25 @@ static void generateJSNavTree(const std::vector<FTVNode*> &nodeList)
generateJSTree(navIndex,t,nodeList,1,first);
if (first)
- t << "]" << endl;
+ t << "]\n";
else
- t << endl << " ] ]" << endl;
- t << "];" << endl << endl;
+ t << "\n ] ]\n";
+ t << "];\n\n";
// write the navigation index (and sub-indices)
std::sort(navIndex.begin(),navIndex.end(),[](const auto &n1,const auto &n2)
- { return qstrcmp(n1.url,n2.url)<0; });
+ { return !n1.url.isEmpty() && (n2.url.isEmpty() || (n1.url<n2.url)); });
int subIndex=0;
int elemCount=0;
const int maxElemCount=250;
- //QFile fidx(htmlOutput+"/navtreeindex.js");
- QFile fsidx(htmlOutput+"/navtreeindex0.js");
- if (/*fidx.open(IO_WriteOnly) &&*/ fsidx.open(IO_WriteOnly))
+ std::ofstream tsidx(htmlOutput.str()+"/navtreeindex0.js",std::ofstream::out | std::ofstream::binary);
+ if (tsidx.is_open())
{
- //FTextStream tidx(&fidx);
- FTextStream tsidx(&fsidx);
- t << "var NAVTREEINDEX =" << endl;
- t << "[" << endl;
- tsidx << "var NAVTREEINDEX" << subIndex << " =" << endl;
- tsidx << "{" << endl;
+ t << "var NAVTREEINDEX =\n";
+ t << "[\n";
+ tsidx << "var NAVTREEINDEX" << subIndex << " =\n";
+ tsidx << "{\n";
first=TRUE;
auto it = navIndex.begin();
while (it!=navIndex.end())
@@ -720,7 +722,7 @@ static void generateJSNavTree(const std::vector<FTVNode*> &nodeList)
{
if (!first)
{
- t << "," << endl;
+ t << ",\n";
}
else
{
@@ -731,27 +733,27 @@ static void generateJSNavTree(const std::vector<FTVNode*> &nodeList)
tsidx << "\"" << e.url << "\":[" << e.path << "]";
++it;
if (it!=navIndex.end() && elemCount<maxElemCount-1) tsidx << ","; // not last entry
- tsidx << endl;
+ tsidx << "\n";
elemCount++;
if (it!=navIndex.end() && elemCount>=maxElemCount) // switch to new sub-index
{
- tsidx << "};" << endl;
+ tsidx << "};\n";
elemCount=0;
- fsidx.close();
+ tsidx.close();
subIndex++;
- fsidx.setName(htmlOutput+"/navtreeindex"+QCString().setNum(subIndex)+".js");
- if (!fsidx.open(IO_WriteOnly)) break;
- tsidx.setDevice(&fsidx);
- tsidx << "var NAVTREEINDEX" << subIndex << " =" << endl;
- tsidx << "{" << endl;
+ QCString fileName = htmlOutput+"/navtreeindex"+QCString().setNum(subIndex)+".js";
+ tsidx.open(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!tsidx.is_open()) break;
+ tsidx << "var NAVTREEINDEX" << subIndex << " =\n";
+ tsidx << "{\n";
}
}
- tsidx << "};" << endl;
- t << endl << "];" << endl;
+ tsidx << "};\n";
+ t << "\n];\n";
}
- t << endl << "var SYNCONMSG = '" << theTranslator->trPanelSynchronisationTooltip(FALSE) << "';";
- t << endl << "var SYNCOFFMSG = '" << theTranslator->trPanelSynchronisationTooltip(TRUE) << "';";
+ t << "\nvar SYNCONMSG = '" << theTranslator->trPanelSynchronisationTooltip(FALSE) << "';";
+ t << "\nvar SYNCOFFMSG = '" << theTranslator->trPanelSynchronisationTooltip(TRUE) << "';";
}
ResourceMgr::instance().copyResource("navtree.js",htmlOutput);
}
@@ -783,7 +785,7 @@ void FTVHelp::generateTreeViewScripts()
}
// write tree inside page
-void FTVHelp::generateTreeViewInline(FTextStream &t)
+void FTVHelp::generateTreeViewInline(TextStream &t)
{
int preferredNumEntries = Config_getInt(HTML_INDEX_NUM_ENTRIES);
t << "<div class=\"directory\">\n";
diff --git a/src/ftvhelp.h b/src/ftvhelp.h
index b04247c..196b01c 100644
--- a/src/ftvhelp.h
+++ b/src/ftvhelp.h
@@ -27,10 +27,9 @@
#include <vector>
#include "index.h"
-class QFile;
class Definition;
+class TextStream;
struct FTVNode;
-class FTextStream;
/** A class that generates a dynamic tree view side panel.
*/
@@ -44,26 +43,26 @@ class FTVHelp : public IndexIntf
void incContentsDepth();
void decContentsDepth();
void addContentsItem(bool isDir,
- const char *name,
- const char *ref,
- const char *file,
- const char *anchor,
+ const QCString &name,
+ const QCString &ref,
+ const QCString &file,
+ const QCString &anchor,
bool separateIndex,
bool addToNavIndex,
const Definition *def);
- void addIndexItem(const Definition *,const MemberDef *,const char *,const char *) {}
- void addIndexFile(const char *) {}
- void addImageFile(const char *) {}
- void addStyleSheetFile(const char *) {}
+ void addIndexItem(const Definition *,const MemberDef *,const QCString &,const QCString &) {}
+ void addIndexFile(const QCString &) {}
+ void addImageFile(const QCString &) {}
+ void addStyleSheetFile(const QCString &) {}
void generateTreeView();
- void generateTreeViewInline(FTextStream &t);
+ void generateTreeViewInline(TextStream &t);
static void generateTreeViewImages();
void generateTreeViewScripts();
private:
- void generateTree(FTextStream &t,const std::vector<FTVNode*> &nl,int level,int maxLevel,int &index);
+ void generateTree(TextStream &t,const std::vector<FTVNode*> &nl,int level,int maxLevel,int &index);
QCString generateIndentLabel(FTVNode *n,int level);
- void generateIndent(FTextStream &t,FTVNode *n,bool opened);
- void generateLink(FTextStream &t,FTVNode *n);
+ void generateIndent(TextStream &t,FTVNode *n,bool opened);
+ void generateLink(TextStream &t,FTVNode *n);
std::vector< std::vector<FTVNode*> > m_indentNodes;
int m_indent;
bool m_topLevelIndex;
diff --git a/src/groupdef.cpp b/src/groupdef.cpp
index 095069e..a1ed4d5 100644
--- a/src/groupdef.cpp
+++ b/src/groupdef.cpp
@@ -52,18 +52,19 @@
class GroupDefImpl : public DefinitionMixin<GroupDef>
{
public:
- GroupDefImpl(const char *fileName,int line,const char *name,const char *title,const char *refFileName=0);
+ GroupDefImpl(const QCString &fileName,int line,const QCString &name,const QCString &title,const QCString &refFileName=QCString());
virtual ~GroupDefImpl();
virtual DefType definitionType() const { return TypeGroup; }
virtual QCString getOutputFileBase() const;
virtual QCString anchor() const { return QCString(); }
virtual QCString displayName(bool=TRUE) const { return hasGroupTitle() ? m_title : DefinitionMixin::name(); }
- virtual const char *groupTitle() const { return m_title; }
- virtual void setGroupTitle( const char *newtitle );
+ virtual QCString groupTitle() const { return m_title; }
+ virtual void setGroupTitle( const QCString &newtitle );
virtual bool hasGroupTitle( ) const { return m_titleSet; }
virtual void addFile(const FileDef *def);
virtual bool addClass(const ClassDef *def);
+ virtual bool addConcept(const ConceptDef *def);
virtual bool addNamespace(const NamespaceDef *def);
virtual void addGroup(const GroupDef *def);
virtual void addPage(const PageDef *def);
@@ -75,7 +76,7 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
virtual void writeDocumentation(OutputList &ol);
virtual void writeMemberPages(OutputList &ol);
virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const;
- virtual void writeTagFile(FTextStream &);
+ virtual void writeTagFile(TextStream &);
virtual size_t numDocMembers() const;
virtual bool isLinkableInProject() const;
virtual bool isLinkable() const;
@@ -102,6 +103,7 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
virtual const FileList &getFiles() const { return m_fileList; }
virtual const ClassLinkedRefMap &getClasses() const { return m_classes; }
+ virtual const ConceptLinkedRefMap &getConcepts() const { return m_concepts; }
virtual const NamespaceLinkedRefMap &getNamespaces() const { return m_namespaces; }
virtual const GroupList &getSubGroups() const { return m_groups; }
virtual const PageLinkedRefMap &getPages() const { return m_pages; }
@@ -122,6 +124,7 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
void writeNestedGroups(OutputList &ol,const QCString &title);
void writeDirs(OutputList &ol,const QCString &title);
void writeClasses(OutputList &ol,const QCString &title);
+ void writeConcepts(OutputList &ol,const QCString &title);
void writeInlineClasses(OutputList &ol);
void writePageDocumentation(OutputList &ol);
void writeDetailedDescription(OutputList &ol,const QCString &title);
@@ -140,6 +143,7 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
QCString m_fileName; // base name of the generated file
FileList m_fileList; // list of files in the group
ClassLinkedRefMap m_classes; // list of classes in the group
+ ConceptLinkedRefMap m_concepts; // list of concepts in the group
NamespaceLinkedRefMap m_namespaces; // list of namespaces in the group
GroupList m_groups; // list of sub groups.
PageLinkedRefMap m_pages; // list of pages in the group
@@ -154,8 +158,8 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
};
-GroupDef *createGroupDef(const char *fileName,int line,const char *name,
- const char *title,const char *refFileName)
+GroupDef *createGroupDef(const QCString &fileName,int line,const QCString &name,
+ const QCString &title,const QCString &refFileName)
{
return new GroupDefImpl(fileName,line,name,title,refFileName);
}
@@ -163,11 +167,11 @@ GroupDef *createGroupDef(const char *fileName,int line,const char *name,
//---------------------------------------------------------------------------
-GroupDefImpl::GroupDefImpl(const char *df,int dl,const char *na,const char *t,
- const char *refFileName) : DefinitionMixin(df,dl,1,na),
+GroupDefImpl::GroupDefImpl(const QCString &df,int dl,const QCString &na,const QCString &t,
+ const QCString &refFileName) : DefinitionMixin(df,dl,1,na),
m_allMemberList(MemberListType_allMembersList)
{
- if (refFileName)
+ if (!refFileName.isEmpty())
{
m_fileName=stripExtension(refFileName);
}
@@ -186,9 +190,9 @@ GroupDefImpl::~GroupDefImpl()
{
}
-void GroupDefImpl::setGroupTitle( const char *t )
+void GroupDefImpl::setGroupTitle( const QCString &t )
{
- if ( t && *t )
+ if ( !t.isEmpty())
{
m_title = t;
m_titleSet = TRUE;
@@ -256,6 +260,18 @@ bool GroupDefImpl::addClass(const ClassDef *cd)
return FALSE;
}
+bool GroupDefImpl::addConcept(const ConceptDef *cd)
+{
+ if (cd->isHidden()) return FALSE;
+ QCString qn = cd->name();
+ if (m_concepts.find(qn)==0)
+ {
+ m_concepts.add(qn,cd);
+ return TRUE;
+ }
+ return FALSE;
+}
+
bool GroupDefImpl::addNamespace(const NamespaceDef *def)
{
//printf("adding namespace hidden=%d\n",def->isHidden());
@@ -278,7 +294,7 @@ void GroupDefImpl::addDir(DirDef *def)
void GroupDefImpl::addPage(const PageDef *def)
{
if (def->isHidden()) return;
- //printf("Making page %s part of a group\n",def->name.data());
+ //printf("Making page %s part of a group\n",qPrint(def->name));
m_pages.add(def->name(),def);
const_cast<PageDef*>(def)->makePartOfGroup(this);
}
@@ -312,7 +328,7 @@ bool GroupDefImpl::insertMember(const MemberDef *md,bool docOnly)
{
if (md->isHidden()) return FALSE;
updateLanguage(md);
- //printf("GroupDef(%s)::insertMember(%s)\n", title.data(), md->name().data());
+ //printf("GroupDef(%s)::insertMember(%s)\n", qPrint(title), qPrint(md->name()));
MemberNameInfo *mni = m_allMemberNameInfoLinkedMap.add(md->name());
for (auto &srcMi : *mni)
{
@@ -454,16 +470,16 @@ bool GroupDefImpl::insertMember(const MemberDef *md,bool docOnly)
default:
err("GroupDefImpl::insertMembers(): "
"member '%s' (typeid=%d) with scope '%s' inserted in group scope '%s'!\n",
- md->name().data(),md->memberType(),
- md->getClassDef() ? md->getClassDef()->name().data() : "",
- name().data());
+ qPrint(md->name()),md->memberType(),
+ md->getClassDef() ? qPrint(md->getClassDef()->name()) : "",
+ qPrint(name()));
}
return TRUE;
}
void GroupDefImpl::removeMember(MemberDef *md)
{
- // fprintf(stderr, "GroupDef(%s)::removeMember( %s )\n", title.data(), md->name().data());
+ // fprintf(stderr, "GroupDef(%s)::removeMember( %s )\n", qPrint(title), qPrint(md->name()));
MemberNameInfo *mni = m_allMemberNameInfoLinkedMap.find(md->name());
if (mni)
{
@@ -553,7 +569,7 @@ bool GroupDefImpl::findGroup(const GroupDef *def) const
void GroupDefImpl::addGroup(const GroupDef *def)
{
- //printf("adding group '%s' to group '%s'\n",def->name().data(),name().data());
+ //printf("adding group '%s' to group '%s'\n",qPrint(def->name()),qPrint(name()));
//if (Config_getBool(SORT_MEMBER_DOCS))
// groupList->inSort(def);
//else
@@ -597,12 +613,12 @@ void GroupDefImpl::computeAnchors()
m_allMemberList.setAnchors();
}
-void GroupDefImpl::writeTagFile(FTextStream &tagFile)
+void GroupDefImpl::writeTagFile(TextStream &tagFile)
{
- tagFile << " <compound kind=\"group\">" << endl;
- tagFile << " <name>" << convertToXML(name()) << "</name>" << endl;
- tagFile << " <title>" << convertToXML(m_title) << "</title>" << endl;
- tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>" << endl;
+ tagFile << " <compound kind=\"group\">\n";
+ tagFile << " <name>" << convertToXML(name()) << "</name>\n";
+ tagFile << " <title>" << convertToXML(m_title) << "</title>\n";
+ tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>\n";
for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
{
switch (lde->kind())
@@ -614,7 +630,19 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile)
if (cd->isLinkableInProject())
{
tagFile << " <class kind=\"" << cd->compoundTypeString()
- << "\">" << convertToXML(cd->name()) << "</class>" << endl;
+ << "\">" << convertToXML(cd->name()) << "</class>\n";
+ }
+ }
+ }
+ break;
+ case LayoutDocEntry::GroupConcepts:
+ {
+ for (const auto &cd : m_concepts)
+ {
+ if (cd->isLinkableInProject())
+ {
+ tagFile << " <concept>" << convertToXML(cd->name())
+ << "</concept>\n";
}
}
}
@@ -626,7 +654,7 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile)
if (nd->isLinkableInProject())
{
tagFile << " <namespace>" << convertToXML(nd->name())
- << "</namespace>" << endl;
+ << "</namespace>\n";
}
}
}
@@ -637,7 +665,7 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile)
{
if (fd->isLinkableInProject())
{
- tagFile << " <file>" << convertToXML(fd->name()) << "</file>" << endl;
+ tagFile << " <file>" << convertToXML(fd->name()) << "</file>\n";
}
}
}
@@ -649,7 +677,7 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile)
QCString pageName = pd->getOutputFileBase();
if (pd->isLinkableInProject())
{
- tagFile << " <page>" << convertToXML(pageName) << "</page>" << endl;
+ tagFile << " <page>" << convertToXML(pageName) << "</page>\n";
}
}
}
@@ -660,7 +688,7 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile)
{
if (dd->isLinkableInProject())
{
- tagFile << " <dir>" << convertToXML(dd->displayName()) << "</dir>" << endl;
+ tagFile << " <dir>" << convertToXML(dd->displayName()) << "</dir>\n";
}
}
}
@@ -671,7 +699,7 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile)
{
if (gd->isVisible())
{
- tagFile << " <subgroup>" << convertToXML(gd->name()) << "</subgroup>" << endl;
+ tagFile << " <subgroup>" << convertToXML(gd->name()) << "</subgroup>\n";
}
}
}
@@ -699,7 +727,7 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile)
}
}
writeDocAnchorsToTagFile(tagFile);
- tagFile << " </compound>" << endl;
+ tagFile << " </compound>\n";
}
void GroupDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
@@ -717,7 +745,7 @@ void GroupDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title
ol.popGeneratorState();
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- ol.writeAnchor(0,"details");
+ ol.writeAnchor(QCString(),"details");
ol.popGeneratorState();
}
else
@@ -733,7 +761,7 @@ void GroupDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title
if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF))
{
ol.generateDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
// write separator between brief and details
if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF) &&
@@ -754,14 +782,14 @@ void GroupDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title
if (!documentation().isEmpty())
{
ol.generateDoc(docFile(),docLine(),this,0,documentation()+"\n",TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
// write inbody documentation
if (!inbodyDocumentation().isEmpty())
{
ol.generateDoc(inbodyFile(),inbodyLine(),this,0,inbodyDocumentation()+"\n",TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
}
}
@@ -772,7 +800,7 @@ void GroupDefImpl::writeBriefDescription(OutputList &ol)
{
DocRoot *rootNode = validatingParseDoc(briefFile(),briefLine(),this,0,
briefDescription(),TRUE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
if (rootNode && !rootNode->isEmpty())
{
ol.startParagraph();
@@ -789,7 +817,7 @@ void GroupDefImpl::writeBriefDescription(OutputList &ol)
if (hasDetailedDescription())
{
ol.disableAllBut(OutputGenerator::Html);
- ol.startTextLink(0,"details");
+ ol.startTextLink(QCString(),"details");
ol.parseText(theTranslator->trMore());
ol.endTextLink();
}
@@ -808,7 +836,7 @@ void GroupDefImpl::writeGroupGraph(OutputList &ol)
DotGroupCollaboration graph(this);
if (!graph.isTrivial())
{
- msg("Generating dependency graph for group %s\n",qualifiedName().data());
+ msg("Generating dependency graph for group %s\n",qPrint(qualifiedName()));
ol.pushGeneratorState();
ol.disable(OutputGenerator::Man);
//ol.startParagraph();
@@ -837,16 +865,16 @@ void GroupDefImpl::writeFiles(OutputList &ol,const QCString &title)
ol.startMemberItem(fd->getOutputFileBase(),0);
ol.docify(theTranslator->trFile(FALSE,TRUE)+" ");
ol.insertMemberAlign();
- ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,fd->name());
+ ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fd->name());
ol.endMemberItem();
if (!fd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
{
ol.startMemberDescription(fd->getOutputFileBase());
ol.generateDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),FALSE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endMemberDescription();
}
- ol.endMemberDeclaration(0,0);
+ ol.endMemberDeclaration(QCString(),QCString());
}
ol.endMemberList();
}
@@ -882,16 +910,16 @@ void GroupDefImpl::writeNestedGroups(OutputList &ol,const QCString &title)
//ol.docify(theTranslator->trGroup(FALSE,TRUE));
//ol.docify(" ");
ol.insertMemberAlign();
- ol.writeObjectLink(gd->getReference(),gd->getOutputFileBase(),0,gd->groupTitle());
+ ol.writeObjectLink(gd->getReference(),gd->getOutputFileBase(),QCString(),gd->groupTitle());
ol.endMemberItem();
if (!gd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
{
ol.startMemberDescription(gd->getOutputFileBase());
ol.generateDoc(briefFile(),briefLine(),gd,0,gd->briefDescription(),FALSE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endMemberDescription();
}
- ol.endMemberDeclaration(0,0);
+ ol.endMemberDeclaration(QCString(),QCString());
}
}
ol.endMemberList();
@@ -914,16 +942,16 @@ void GroupDefImpl::writeDirs(OutputList &ol,const QCString &title)
ol.startMemberItem(dd->getOutputFileBase(),0);
ol.parseText(theTranslator->trDir(FALSE,TRUE));
ol.insertMemberAlign();
- ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),0,dd->shortName());
+ ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),QCString(),dd->shortName());
ol.endMemberItem();
if (!dd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
{
ol.startMemberDescription(dd->getOutputFileBase());
ol.generateDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),FALSE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endMemberDescription();
}
- ol.endMemberDeclaration(0,0);
+ ol.endMemberDeclaration(QCString(),QCString());
}
ol.endMemberList();
@@ -936,6 +964,12 @@ void GroupDefImpl::writeClasses(OutputList &ol,const QCString &title)
m_classes.writeDeclaration(ol,0,title,FALSE);
}
+void GroupDefImpl::writeConcepts(OutputList &ol,const QCString &title)
+{
+ // write list of concepts
+ m_concepts.writeDeclaration(ol,title,FALSE);
+}
+
void GroupDefImpl::writeInlineClasses(OutputList &ol)
{
m_classes.writeDocumentation(ol);
@@ -956,8 +990,8 @@ void GroupDefImpl::writePageDocumentation(OutputList &ol)
ol.endSection(si->label(),SectionType::Subsection);
}
ol.startTextBlock();
- ol.generateDoc(pd->docFile(),pd->docLine(),pd,0,pd->documentation()+pd->inbodyDocumentation(),TRUE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ ol.generateDoc(pd->docFile(),pd->docLine(),pd,0,(pd->documentation()+pd->inbodyDocumentation()),TRUE,FALSE,
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endTextBlock();
}
}
@@ -1023,20 +1057,22 @@ void GroupDefImpl::writeSummaryLinks(OutputList &ol) const
SrcLangExt lang = getLanguage();
for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
{
- if ((lde->kind()==LayoutDocEntry::GroupClasses && m_classes.declVisible()) ||
- (lde->kind()==LayoutDocEntry::GroupNamespaces && m_namespaces.declVisible()) ||
- (lde->kind()==LayoutDocEntry::GroupFiles && !m_fileList.empty()) ||
+ if ((lde->kind()==LayoutDocEntry::GroupClasses && m_classes.declVisible()) ||
+ (lde->kind()==LayoutDocEntry::GroupConcepts && m_concepts.declVisible()) ||
+ (lde->kind()==LayoutDocEntry::GroupNamespaces && m_namespaces.declVisible()) ||
+ (lde->kind()==LayoutDocEntry::GroupFiles && !m_fileList.empty()) ||
(lde->kind()==LayoutDocEntry::GroupNestedGroups && !m_groups.empty()) ||
- (lde->kind()==LayoutDocEntry::GroupDirs && !m_dirList.empty())
+ (lde->kind()==LayoutDocEntry::GroupDirs && !m_dirList.empty())
)
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
QCString label = lde->kind()==LayoutDocEntry::GroupClasses ? "nested-classes" :
+ lde->kind()==LayoutDocEntry::GroupConcepts ? "concepts" :
lde->kind()==LayoutDocEntry::GroupNamespaces ? "namespaces" :
lde->kind()==LayoutDocEntry::GroupFiles ? "files" :
lde->kind()==LayoutDocEntry::GroupNestedGroups ? "groups" :
"dirs";
- ol.writeSummaryLink(0,label,ls->title(lang),first);
+ ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
first=FALSE;
}
else if (lde->kind()==LayoutDocEntry::MemberDecl)
@@ -1045,7 +1081,7 @@ void GroupDefImpl::writeSummaryLinks(OutputList &ol) const
MemberList * ml = getMemberList(lmd->type);
if (ml && ml->declVisible())
{
- ol.writeSummaryLink(0,MemberList::listTypeAsString(ml->listType()),lmd->title(lang),first);
+ ol.writeSummaryLink(QCString(),MemberList::listTypeAsString(ml->listType()),lmd->title(lang),first);
first=FALSE;
}
}
@@ -1102,7 +1138,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
}
}
- Doxygen::indexList->addIndexItem(this,0,0,m_title);
+ Doxygen::indexList->addIndexItem(this,0,QCString(),m_title);
//---------------------------------------- start flexible part -------------------------------
@@ -1123,6 +1159,12 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
writeClasses(ol,ls->title(lang));
}
break;
+ case LayoutDocEntry::GroupConcepts:
+ {
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
+ writeConcepts(ol,ls->title(lang));
+ }
+ break;
case LayoutDocEntry::GroupInlineClasses:
{
writeInlineClasses(ol);
@@ -1201,11 +1243,14 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
case LayoutDocEntry::NamespaceNestedNamespaces:
case LayoutDocEntry::NamespaceNestedConstantGroups:
case LayoutDocEntry::NamespaceClasses:
+ case LayoutDocEntry::NamespaceConcepts:
case LayoutDocEntry::NamespaceInterfaces:
case LayoutDocEntry::NamespaceStructs:
case LayoutDocEntry::NamespaceExceptions:
case LayoutDocEntry::NamespaceInlineClasses:
+ case LayoutDocEntry::ConceptDefinition:
case LayoutDocEntry::FileClasses:
+ case LayoutDocEntry::FileConcepts:
case LayoutDocEntry::FileInterfaces:
case LayoutDocEntry::FileStructs:
case LayoutDocEntry::FileExceptions:
@@ -1307,18 +1352,36 @@ void addClassToGroups(const Entry *root,ClassDef *cd)
{
cdm->makePartOfGroup(gd);
}
- //printf("Compound %s: in group %s\n",cd->name().data(),gd->groupTitle());
+ //printf("Compound %s: in group %s\n",qPrint(cd->name()),gd->groupTitle());
}
}
}
+void addConceptToGroups(const Entry *root,ConceptDef *cd)
+{
+ for (const Grouping &g : root->groups)
+ {
+ GroupDef *gd = Doxygen::groupLinkedMap->find(g.groupname);
+ if (gd && gd->addConcept(cd))
+ {
+ ConceptDefMutable *cdm = toConceptDefMutable(cd);
+ if (cdm)
+ {
+ cdm->makePartOfGroup(gd);
+ }
+ //printf("Compound %s: in group %s\n",qPrint(cd->name()),gd->groupTitle());
+ }
+ }
+}
+
+
void addNamespaceToGroups(const Entry *root,NamespaceDef *nd)
{
//printf("root->groups.size()=%zu\n",root->groups.size());
for (const Grouping &g : root->groups)
{
GroupDef *gd = Doxygen::groupLinkedMap->find(g.groupname);
- //printf("group '%s' gd=%p\n",g.groupname.data(),(void*)gd);
+ //printf("group '%s' gd=%p\n",qPrint(g.groupname),(void*)gd);
if (gd && gd->addNamespace(nd))
{
NamespaceDefMutable *ndm = toNamespaceDefMutable(nd);
@@ -1326,7 +1389,7 @@ void addNamespaceToGroups(const Entry *root,NamespaceDef *nd)
{
ndm->makePartOfGroup(gd);
}
- //printf("Namespace %s: in group %s\n",nd->name().data(),s->data());
+ //printf("Namespace %s: in group %s\n",qPrint(nd->name()),qPrint(gd->name()));
}
}
}
@@ -1337,19 +1400,19 @@ void addDirToGroups(const Entry *root,DirDef *dd)
for (const Grouping &g : root->groups)
{
GroupDef *gd = Doxygen::groupLinkedMap->find(g.groupname);
- //printf("group '%s'\n",g->groupname.data());
+ //printf("group '%s'\n",qPrint(g->groupname));
if (gd)
{
gd->addDir(dd);
dd->makePartOfGroup(gd);
- //printf("Dir %s: in group %s\n",dd->name().data(),g->groupname.data());
+ //printf("Dir %s: in group %s\n",qPrint(dd->name()),qPrint(g->groupname));
}
}
}
void addGroupToGroups(const Entry *root,GroupDef *subGroup)
{
- //printf("addGroupToGroups for %s groups=%d\n",root->name.data(),root->groups.size());
+ //printf("addGroupToGroups for %s groups=%d\n",qPrint(root->name),root->groups.size());
for (const Grouping &g : root->groups)
{
GroupDef *gd = Doxygen::groupLinkedMap->find(g.groupname);
@@ -1358,12 +1421,12 @@ void addGroupToGroups(const Entry *root,GroupDef *subGroup)
if (gd==subGroup)
{
warn(root->fileName,root->startLine,"Refusing to add group %s to itself",
- gd->name().data());
+ qPrint(gd->name()));
}
else if (subGroup->findGroup(gd))
{
warn(root->fileName,root->startLine,"Refusing to add group %s to group %s, since the latter is already a "
- "subgroup of the former\n", subGroup->name().data(),gd->name().data());
+ "subgroup of the former\n", qPrint(subGroup->name()),qPrint(gd->name()));
}
else if (!gd->findGroup(subGroup))
{
@@ -1378,7 +1441,7 @@ void addGroupToGroups(const Entry *root,GroupDef *subGroup)
void addMemberToGroups(const Entry *root,MemberDef *md)
{
//printf("addMemberToGroups: Root %p = %s, md %p=%s groups=%zu\n",
- // root, root->name.data(), md, md->name().data(), root->groups.size() );
+ // root, qPrint(root->name), md, qPrint(md->name()), root->groups.size() );
// Search entry's group list for group with highest pri.
Grouping::GroupPri_t pri = Grouping::GROUPING_LOWEST;
@@ -1392,11 +1455,11 @@ void addMemberToGroups(const Entry *root,MemberDef *md)
{
if (fgd && gd!=fgd && g.pri==pri)
{
- warn(root->fileName.data(), root->startLine,
+ warn(root->fileName, root->startLine,
"Member %s found in multiple %s groups! "
"The member will be put in group %s, and not in group %s",
- md->name().data(), Grouping::getGroupPriName( pri ),
- gd->name().data(), fgd->name().data()
+ qPrint(md->name()), Grouping::getGroupPriName( pri ),
+ qPrint(gd->name()), qPrint(fgd->name())
);
}
@@ -1440,10 +1503,10 @@ void addMemberToGroups(const Entry *root,MemberDef *md)
warn(md->getGroupFileName(),md->getGroupStartLine(),
"Member documentation for %s found several times in %s groups!\n"
"%s:%d: The member will remain in group %s, and won't be put into group %s",
- md->name().data(), Grouping::getGroupPriName( pri ),
- root->fileName.data(), root->startLine,
- mgd->name().data(),
- fgd->name().data()
+ qPrint(md->name()), Grouping::getGroupPriName( pri ),
+ qPrint(root->fileName), root->startLine,
+ qPrint(mgd->name()),
+ qPrint(fgd->name())
);
}
}
@@ -1460,8 +1523,8 @@ void addMemberToGroups(const Entry *root,MemberDef *md)
if (insertit)
{
//printf("insertMember found at %s line %d: %s: related %s\n",
- // md->getDefFileName().data(),md->getDefLine(),
- // md->name().data(),root->relates.data());
+ // qPrint(md->getDefFileName()),md->getDefLine(),
+ // qPrint(md->name()),qPrint(root->relates));
bool success = fgd->insertMember(md);
if (success)
{
@@ -1491,7 +1554,7 @@ void addExampleToGroups(const Entry *root,PageDef *eg)
{
gd->addExample(eg);
eg->makePartOfGroup(gd);
- //printf("Example %s: in group %s\n",eg->name().data(),s->data());
+ //printf("Example %s: in group %s\n",qPrint(eg->name()),s->data());
}
}
}
@@ -1509,7 +1572,7 @@ void GroupDefImpl::addListReferences()
getOutputFileBase(),
theTranslator->trGroup(TRUE,TRUE),
getOutputFileBase(),name(),
- 0,
+ QCString(),
0
);
}
@@ -1654,7 +1717,7 @@ void GroupDefImpl::writeMemberDeclarations(OutputList &ol,MemberListType lt,cons
}
if (ml)
{
- ml->writeDeclarations(ol,0,0,0,this,title,0);
+ ml->writeDeclarations(ol,0,0,0,this,title,QCString());
}
}
@@ -1675,7 +1738,7 @@ void GroupDefImpl::sortSubGroups()
std::sort(m_groups.begin(),
m_groups.end(),
[](const auto &g1,const auto &g2)
- { return qstrcmp(g1->groupTitle(),g2->groupTitle())<0; });
+ { return g1->groupTitle() < g2->groupTitle(); });
}
bool GroupDefImpl::isLinkableInProject() const
diff --git a/src/groupdef.h b/src/groupdef.h
index 94214c4..587c709 100644
--- a/src/groupdef.h
+++ b/src/groupdef.h
@@ -30,9 +30,11 @@ class MemberList;
class MemberLists;
class FileList;
class ClassLinkedRefMap;
+class ConceptLinkedRefMap;
class NamespaceLinkedRefMap;
class FileDef;
class ClassDef;
+class ConceptDef;
class NamespaceDef;
class GroupList;
class OutputList;
@@ -42,7 +44,6 @@ class DirDef;
class FTVHelp;
class Entry;
class MemberDef;
-class FTextStream;
/** A model of a group of symbols. */
class GroupDef : public DefinitionMutable, public Definition
@@ -54,11 +55,12 @@ class GroupDef : public DefinitionMutable, public Definition
virtual QCString getOutputFileBase() const = 0;
virtual QCString anchor() const = 0;
virtual QCString displayName(bool=TRUE) const = 0;
- virtual const char *groupTitle() const = 0;
- virtual void setGroupTitle( const char *newtitle ) = 0;
+ virtual QCString groupTitle() const = 0;
+ virtual void setGroupTitle( const QCString &newtitle ) = 0;
virtual bool hasGroupTitle( ) const = 0;
virtual void addFile(const FileDef *def) = 0;
virtual bool addClass(const ClassDef *def) = 0;
+ virtual bool addConcept(const ConceptDef *def) = 0;
virtual bool addNamespace(const NamespaceDef *def) = 0;
virtual void addGroup(const GroupDef *def) = 0;
virtual void addPage(const PageDef *def) = 0;
@@ -70,7 +72,7 @@ class GroupDef : public DefinitionMutable, public Definition
virtual void writeDocumentation(OutputList &ol) = 0;
virtual void writeMemberPages(OutputList &ol) = 0;
virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const = 0;
- virtual void writeTagFile(FTextStream &) = 0;
+ virtual void writeTagFile(TextStream &) = 0;
virtual size_t numDocMembers() const = 0;
virtual bool isLinkableInProject() const = 0;
virtual bool isLinkable() const = 0;
@@ -97,6 +99,7 @@ class GroupDef : public DefinitionMutable, public Definition
virtual const FileList &getFiles() const = 0;
virtual const ClassLinkedRefMap &getClasses() const = 0;
+ virtual const ConceptLinkedRefMap &getConcepts() const = 0;
virtual const NamespaceLinkedRefMap &getNamespaces() const = 0;
virtual const GroupList &getSubGroups() const = 0;
virtual const PageLinkedRefMap &getPages() const = 0;
@@ -107,8 +110,8 @@ class GroupDef : public DefinitionMutable, public Definition
};
-GroupDef *createGroupDef(const char *fileName,int line,const char *name,
- const char *title,const char *refFileName=0);
+GroupDef *createGroupDef(const QCString &fileName,int line,const QCString &name,
+ const QCString &title,const QCString &refFileName=QCString());
// --- Cast functions
@@ -126,6 +129,7 @@ class GroupList : public std::vector<const GroupDef *>
};
void addClassToGroups (const Entry *root,ClassDef *cd);
+void addConceptToGroups (const Entry *root,ConceptDef *cd);
void addNamespaceToGroups(const Entry *root,NamespaceDef *nd);
void addGroupToGroups (const Entry *root,GroupDef *subGroup);
void addMemberToGroups (const Entry *root,MemberDef *md);
diff --git a/src/growbuf.h b/src/growbuf.h
index bb26404..8c532ca 100644
--- a/src/growbuf.h
+++ b/src/growbuf.h
@@ -5,7 +5,7 @@
#include <string.h>
#include <string>
-#define GROW_AMOUNT 1024
+#define GROW_AMOUNT 1024*4
/** Class representing a string buffer optimised for growing. */
class GrowBuf
@@ -14,6 +14,37 @@ class GrowBuf
GrowBuf() : m_str(0), m_pos(0), m_len(0) {}
GrowBuf(uint initialSize) : m_pos(0), m_len(initialSize) { m_str=(char*)malloc(m_len); }
~GrowBuf() { free(m_str); }
+ GrowBuf(const GrowBuf &other)
+ {
+ m_len = other.m_len;
+ m_pos = other.m_pos;
+ m_str = (char*)malloc(m_len);
+ memcpy(m_str,other.m_str,m_len);
+ }
+ GrowBuf &operator=(const GrowBuf &other)
+ {
+ if (this!=&other)
+ {
+ m_len = other.m_len;
+ m_pos = other.m_pos;
+ m_str = (char*)malloc(m_len);
+ memcpy(m_str,other.m_str,m_len);
+ }
+ return *this;
+ }
+ GrowBuf(GrowBuf &&other)
+ {
+ m_len = std::move(other.m_len);
+ m_pos = std::move(other.m_pos);
+ m_str = std::move(other.m_str);
+ }
+ GrowBuf &operator=(GrowBuf &&other)
+ {
+ m_len = std::move(other.m_len);
+ m_pos = std::move(other.m_pos);
+ m_str = std::move(other.m_str);
+ return *this;
+ }
void reserve(uint size) { if (m_len<size) { m_len = size; m_str = (char*)realloc(m_str,m_len); } }
void clear() { m_pos=0; }
void addChar(char c) { if (m_pos>=m_len) { m_len+=GROW_AMOUNT; m_str = (char*)realloc(m_str,m_len); }
@@ -56,10 +87,12 @@ class GrowBuf
m_pos+=l;
}
}
- const char *get() { return m_str; }
+ char *get() { return m_str; }
+ const char *get() const { return m_str; }
uint getPos() const { return m_pos; }
void setPos(uint newPos) { m_pos = newPos; }
char at(uint i) const { return m_str[i]; }
+ bool empty() const { return m_pos==0; }
private:
char *m_str;
uint m_pos;
diff --git a/src/htags.cpp b/src/htags.cpp
index 6b5e5fd..cb7b99c 100644
--- a/src/htags.cpp
+++ b/src/htags.cpp
@@ -18,18 +18,16 @@
#include <unordered_map>
#include <string>
-#include <qdir.h>
-
#include "htags.h"
#include "util.h"
#include "message.h"
#include "config.h"
#include "portable.h"
-
+#include "fileinfo.h"
bool Htags::useHtags = FALSE;
-static QDir g_inputDir;
+static Dir g_inputDir;
static std::unordered_map<std::string,std::string> g_symbolMap;
/*! constructs command line of htags(1) and executes it.
@@ -45,14 +43,13 @@ bool Htags::execute(const QCString &htmldir)
QCString projectName = Config_getString(PROJECT_NAME);
QCString projectNumber = Config_getString(PROJECT_NUMBER);
- QCString cwd = QDir::currentDirPath().utf8();
if (inputSource.empty())
{
- g_inputDir.setPath(cwd);
+ g_inputDir.setPath(Dir::currentDirPath());
}
else if (inputSource.size()==1)
{
- g_inputDir.setPath(inputSource.back().c_str());
+ g_inputDir.setPath(inputSource.back());
if (!g_inputDir.exists())
err("Cannot find directory %s. "
"Check the value of the INPUT tag in the configuration file.\n",
@@ -88,9 +85,9 @@ bool Htags::execute(const QCString &htmldir)
commandLine += "\" ";
}
commandLine += " \"" + htmldir + "\"";
- QCString oldDir = QDir::currentDirPath().utf8();
- QDir::setCurrent(g_inputDir.absPath());
- //printf("CommandLine=[%s]\n",commandLine.data());
+ std::string oldDir = Dir::currentDirPath();
+ Dir::setCurrent(g_inputDir.absPath());
+ //printf("CommandLine=[%s]\n",qPrint(commandLine));
Portable::sysTimerStart();
bool result=Portable::system("htags",commandLine,FALSE)==0;
if (!result)
@@ -98,7 +95,7 @@ bool Htags::execute(const QCString &htmldir)
err("Problems running %s. Check your installation\n", "htags");
}
Portable::sysTimerStop();
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return result;
}
@@ -111,7 +108,7 @@ bool Htags::execute(const QCString &htmldir)
bool Htags::loadFilemap(const QCString &htmlDir)
{
QCString fileMapName = htmlDir+"/HTML/FILEMAP";
- QFileInfo fi(fileMapName);
+ FileInfo fi(fileMapName.str());
/*
* Construct FILEMAP dictionary.
*
@@ -125,17 +122,14 @@ bool Htags::loadFilemap(const QCString &htmlDir)
*/
if (fi.exists() && fi.isReadable())
{
- QFile f(fileMapName);
- const int maxlen = 8192;
- QCString line(maxlen+1);
- line.at(maxlen)='\0';
- if (f.open(IO_ReadOnly))
+ std::ifstream f(fileMapName.str(),std::ifstream::in);
+ if (f.is_open())
{
- int len;
- while ((len=f.readLine(line.rawData(),maxlen))>0)
+ std::string lineStr;
+ while (getline(f,lineStr))
{
- line.at(len)='\0';
- //printf("Read line: %s",line.data());
+ QCString line(lineStr);
+ //printf("Read line: %s",qPrint(line));
int sep = line.find('\t');
if (sep!=-1)
{
@@ -144,17 +138,17 @@ bool Htags::loadFilemap(const QCString &htmlDir)
int ext=value.findRev('.');
if (ext!=-1) value=value.left(ext); // strip extension
g_symbolMap.insert(std::make_pair(key.str(),value.str()));
- //printf("Key/Value=(%s,%s)\n",key.data(),value.data());
+ //printf("Key/Value=(%s,%s)\n",qPrint(key),qPrint(value));
}
}
- return TRUE;
+ return true;
}
else
{
- err("file %s cannot be opened\n",fileMapName.data());
+ err("file %s cannot be opened\n",qPrint(fileMapName));
}
}
- return FALSE;
+ return false;
}
/*! convert path name into the url in the hypertext generated by htags.
@@ -164,7 +158,7 @@ bool Htags::loadFilemap(const QCString &htmlDir)
QCString Htags::path2URL(const QCString &path)
{
QCString url,symName=path;
- QCString dir = g_inputDir.absPath().utf8();
+ QCString dir = g_inputDir.absPath();
int dl=dir.length();
if ((int)symName.length()>dl+1)
{
@@ -173,10 +167,10 @@ QCString Htags::path2URL(const QCString &path)
if (!symName.isEmpty())
{
auto it = g_symbolMap.find(symName.str());
- //printf("path2URL=%s symName=%s result=%p\n",path.data(),symName.data(),result);
+ //printf("path2URL=%s symName=%s result=%p\n",qPrint(path),qPrint(symName),result);
if (it!=g_symbolMap.end())
{
- url = QCString("HTML/") + it->second;
+ url = QCString("HTML/"+it->second);
}
}
return url;
diff --git a/src/htmlattrib.h b/src/htmlattrib.h
index 0a7673f..9e22520 100644
--- a/src/htmlattrib.h
+++ b/src/htmlattrib.h
@@ -16,7 +16,8 @@
#define _HTMLATTRIB_H
#include <vector>
-#include <qcstring.h>
+
+#include "qcstring.h"
/*! \brief Class representing a HTML attribute. */
struct HtmlAttrib
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp
index 7c56cc1..a11d045 100644
--- a/src/htmldocvisitor.cpp
+++ b/src/htmldocvisitor.cpp
@@ -13,7 +13,6 @@
*
*/
-#include <qdir.h>
#include "htmldocvisitor.h"
#include "docparser.h"
#include "language.h"
@@ -34,6 +33,7 @@
#include "emoji.h"
#include "plantuml.h"
#include "formula.h"
+#include "fileinfo.h"
static const int NUM_HTML_LIST_TYPES = 4;
static const char types[][NUM_HTML_LIST_TYPES] = {"1", "a", "i", "A"};
@@ -264,7 +264,7 @@ static QCString htmlAttribsToString(const HtmlAttribList &attribs, QCString *pAl
//-------------------------------------------------------------------------
-HtmlDocVisitor::HtmlDocVisitor(FTextStream &t,CodeOutputInterface &ci,
+HtmlDocVisitor::HtmlDocVisitor(TextStream &t,CodeOutputInterface &ci,
const Definition *ctx)
: DocVisitor(DocVisitor_Html), m_t(t), m_ci(ci), m_insidePre(FALSE),
m_hide(FALSE), m_ctx(ctx)
@@ -278,7 +278,7 @@ HtmlDocVisitor::HtmlDocVisitor(FTextStream &t,CodeOutputInterface &ci,
void HtmlDocVisitor::visit(DocWord *w)
{
- //printf("word: %s\n",w->word().data());
+ //printf("word: %s\n",qPrint(w->word()));
if (m_hide) return;
filter(w->word());
}
@@ -286,7 +286,7 @@ void HtmlDocVisitor::visit(DocWord *w)
void HtmlDocVisitor::visit(DocLinkedWord *w)
{
if (m_hide) return;
- //printf("linked word: %s\n",w->word().data());
+ //printf("linked word: %s\n",qPrint(w->word()));
startLink(w->ref(),w->file(),w->relPath(),w->anchor(),w->tooltip());
filter(w->word());
endLink();
@@ -471,20 +471,20 @@ void HtmlDocVisitor::visit(DocStyleChange *s)
}
-static void visitPreCaption(FTextStream &t, DocVerbatim *s)
+static void visitPreCaption(TextStream &t, DocVerbatim *s)
{
if (s->hasCaption())
{
- t << "<div class=\"caption\">" << endl;
+ t << "<div class=\"caption\">\n";
}
}
-static void visitPostCaption(FTextStream &t, DocVerbatim *s)
+static void visitPostCaption(TextStream &t, DocVerbatim *s)
{
if (s->hasCaption())
{
- t << "</div>" << endl;
+ t << "</div>\n";
}
}
@@ -554,28 +554,29 @@ void HtmlDocVisitor::visit(DocVerbatim *s)
forceEndParagraph(s);
fileName.sprintf("%s%d%s",
- (Config_getString(HTML_OUTPUT)+"/inline_dotgraph_").data(),
+ qPrint(Config_getString(HTML_OUTPUT)+"/inline_dotgraph_"),
dotindex++,
".dot"
);
- QFile file(fileName);
- if (!file.open(IO_WriteOnly))
+ std::ofstream file(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!file.is_open())
{
- err("Could not open file %s for writing\n",fileName.data());
+ err("Could not open file %s for writing\n",qPrint(fileName));
}
else
{
- file.writeBlock( s->text(), s->text().length() );
+ QCString stext = s->text();
+ file.write( stext.data(), stext.length() );
file.close();
- m_t << "<div class=\"dotgraph\">" << endl;
+ m_t << "<div class=\"dotgraph\">\n";
writeDotFile(fileName,s->relPath(),s->context());
visitPreCaption(m_t, s);
visitCaption(this, s->children());
visitPostCaption(m_t, s);
- m_t << "</div>" << endl;
+ m_t << "</div>\n";
- if (Config_getBool(DOT_CLEANUP)) file.remove();
+ if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
}
forceStartParagraph(s);
}
@@ -588,13 +589,13 @@ void HtmlDocVisitor::visit(DocVerbatim *s)
QCString baseName(4096);
baseName.sprintf("%s%d",
- (Config_getString(HTML_OUTPUT)+"/inline_mscgraph_").data(),
+ qPrint(Config_getString(HTML_OUTPUT)+"/inline_mscgraph_"),
mscindex++
);
- QFile file(baseName+".msc");
- if (!file.open(IO_WriteOnly))
+ std::ofstream file(baseName.str()+".msc",std::ofstream::out | std::ofstream::binary);
+ if (!file.is_open())
{
- err("Could not open file %s.msc for writing\n",baseName.data());
+ err("Could not open file %s.msc for writing\n",qPrint(baseName));
}
else
{
@@ -602,17 +603,17 @@ void HtmlDocVisitor::visit(DocVerbatim *s)
text+=s->text();
text+="}";
- file.writeBlock( text, text.length() );
+ file.write( text.data(), text.length() );
file.close();
- m_t << "<div class=\"mscgraph\">" << endl;
+ m_t << "<div class=\"mscgraph\">\n";
writeMscFile(baseName+".msc",s->relPath(),s->context());
visitPreCaption(m_t, s);
visitCaption(this, s->children());
visitPostCaption(m_t, s);
- m_t << "</div>" << endl;
+ m_t << "</div>\n";
- if (Config_getBool(DOT_CLEANUP)) file.remove();
+ if (Config_getBool(DOT_CLEANUP)) Dir().remove(baseName.str()+".msc");
}
forceStartParagraph(s);
}
@@ -628,12 +629,12 @@ void HtmlDocVisitor::visit(DocVerbatim *s)
format = PlantumlManager::PUML_SVG;
}
QCString baseName = PlantumlManager::instance().writePlantUMLSource(htmlOutput,s->exampleFile(),s->text(),format);
- m_t << "<div class=\"plantumlgraph\">" << endl;
+ m_t << "<div class=\"plantumlgraph\">\n";
writePlantUMLFile(baseName,s->relPath(),s->context());
visitPreCaption(m_t, s);
visitCaption(this, s->children());
visitPostCaption(m_t, s);
- m_t << "</div>" << endl;
+ m_t << "</div>\n";
forceStartParagraph(s);
}
break;
@@ -676,8 +677,8 @@ void HtmlDocVisitor::visit(DocInclude *inc)
{
forceEndParagraph(inc);
m_ci.startCodeFragment("DoxyCode");
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
getCodeParser(inc->extension()).parseCode(m_ci,
inc->context(),
inc->text(),
@@ -745,8 +746,8 @@ void HtmlDocVisitor::visit(DocInclude *inc)
{
forceEndParagraph(inc);
m_ci.startCodeFragment("DoxyCode");
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
getCodeParser(inc->extension()).parseCode(m_ci,
inc->context(),
extractBlock(inc->text(),inc->blockId()),
@@ -777,7 +778,7 @@ void HtmlDocVisitor::visit(DocInclude *inc)
void HtmlDocVisitor::visit(DocIncOperator *op)
{
//printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
- // op->type(),op->isFirst(),op->isLast(),op->text().data());
+ // op->type(),op->isFirst(),op->isLast(),qPrint(op->text()));
if (op->isFirst())
{
forceEndParagraph(op);
@@ -796,8 +797,8 @@ void HtmlDocVisitor::visit(DocIncOperator *op)
FileDef *fd = 0;
if (!op->includeFileName().isEmpty())
{
- QFileInfo cfi( op->includeFileName() );
- fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( op->includeFileName().str() );
+ fd = createFileDef( cfi.dirPath(), cfi.fileName() );
}
getCodeParser(locLangExt).parseCode(
m_ci,
@@ -827,7 +828,7 @@ void HtmlDocVisitor::visit(DocIncOperator *op)
}
else
{
- if (!m_hide) m_t << endl;
+ if (!m_hide) m_t << "\n";
}
}
@@ -838,7 +839,7 @@ void HtmlDocVisitor::visit(DocFormula *f)
if (bDisplay)
{
forceEndParagraph(f);
- m_t << "<p class=\"formulaDsp\">" << endl;
+ m_t << "<p class=\"formulaDsp\">\n";
}
if (Config_getBool(USE_MATHJAX))
@@ -887,7 +888,7 @@ void HtmlDocVisitor::visit(DocFormula *f)
}
if (bDisplay)
{
- m_t << endl << "</p>" << endl;
+ m_t << "\n</p>\n";
forceStartParagraph(f);
}
}
@@ -901,17 +902,17 @@ void HtmlDocVisitor::visit(DocIndexEntry *e)
}
m_t << "<a name=\"" << anchor << "\"></a>";
//printf("*** DocIndexEntry: word='%s' scope='%s' member='%s'\n",
- // e->entry().data(),
- // e->scope() ? e->scope()->name().data() : "<null>",
- // e->member() ? e->member()->name().data() : "<null>"
+ // qPrint(e->entry()),
+ // e->scope() ? qPrint(e->scope()->name()) : "<null>",
+ // e->member() ? qPrint(e->member()->name()) : "<null>"
// );
Doxygen::indexList->addIndexItem(e->scope(),e->member(),anchor,e->entry());
}
void HtmlDocVisitor::visit(DocSimpleSectSep *)
{
- m_t << "</dd>" << endl;
- m_t << "<dd>" << endl;
+ m_t << "</dd>\n";
+ m_t << "<dd>\n";
}
void HtmlDocVisitor::visit(DocCite *cite)
@@ -1436,8 +1437,8 @@ void HtmlDocVisitor::visitPre(DocSection *s)
forceEndParagraph(s);
m_t << "<h" << s->level() << ">";
m_t << "<a class=\"anchor\" id=\"" << s->anchor();
- m_t << "\"></a>" << endl;
- filter(convertCharEntitiesToUTF8(s->title().data()));
+ m_t << "\"></a>\n";
+ filter(convertCharEntitiesToUTF8(s->title()));
m_t << "</h" << s->level() << ">\n";
}
@@ -1607,7 +1608,7 @@ void HtmlDocVisitor::visitPre(DocInternal *)
{
if (m_hide) return;
//forceEndParagraph(i);
- //m_t << "<p><b>" << theTranslator->trForInternalUseOnly() << "</b></p>" << endl;
+ //m_t << "<p><b>" << theTranslator->trForInternalUseOnly() << "</b></p>\n";
}
void HtmlDocVisitor::visitPost(DocInternal *)
@@ -1670,7 +1671,7 @@ void HtmlDocVisitor::visitPre(DocImage *img)
{
baseName=baseName.right(baseName.length()-i-1);
}
- if (!inlineImage) m_t << "<div class=\"image\">" << endl;
+ if (!inlineImage) m_t << "<div class=\"image\">\n";
QCString sizeAttribs;
if (!img->width().isEmpty())
{
@@ -1712,7 +1713,7 @@ void HtmlDocVisitor::visitPre(DocImage *img)
}
else
{
- m_t << ">" << alt << "</object>" << endl;
+ m_t << ">" << alt << "</object>\n";
}
}
else
@@ -1735,7 +1736,7 @@ void HtmlDocVisitor::visitPre(DocImage *img)
}
else
{
- m_t << "<div class=\"caption\">" << endl;
+ m_t << "<div class=\"caption\">\n";
}
}
else if (inlineImage)
@@ -1769,7 +1770,7 @@ void HtmlDocVisitor::visitPost(DocImage *img)
}
if (!inlineImage) // end <div class="image">
{
- m_t << "</div>" << endl;
+ m_t << "</div>\n";
forceStartParagraph(img);
}
}
@@ -1782,11 +1783,11 @@ void HtmlDocVisitor::visitPost(DocImage *img)
void HtmlDocVisitor::visitPre(DocDotFile *df)
{
if (m_hide) return;
- m_t << "<div class=\"dotgraph\">" << endl;
+ m_t << "<div class=\"dotgraph\">\n";
writeDotFile(df->file(),df->relPath(),df->context());
if (df->hasCaption())
{
- m_t << "<div class=\"caption\">" << endl;
+ m_t << "<div class=\"caption\">\n";
}
}
@@ -1795,19 +1796,19 @@ void HtmlDocVisitor::visitPost(DocDotFile *df)
if (m_hide) return;
if (df->hasCaption())
{
- m_t << "</div>" << endl;
+ m_t << "</div>\n";
}
- m_t << "</div>" << endl;
+ m_t << "</div>\n";
}
void HtmlDocVisitor::visitPre(DocMscFile *df)
{
if (m_hide) return;
- m_t << "<div class=\"mscgraph\">" << endl;
+ m_t << "<div class=\"mscgraph\">\n";
writeMscFile(df->file(),df->relPath(),df->context());
if (df->hasCaption())
{
- m_t << "<div class=\"caption\">" << endl;
+ m_t << "<div class=\"caption\">\n";
}
}
void HtmlDocVisitor::visitPost(DocMscFile *df)
@@ -1815,19 +1816,19 @@ void HtmlDocVisitor::visitPost(DocMscFile *df)
if (m_hide) return;
if (df->hasCaption())
{
- m_t << "</div>" << endl;
+ m_t << "</div>\n";
}
- m_t << "</div>" << endl;
+ m_t << "</div>\n";
}
void HtmlDocVisitor::visitPre(DocDiaFile *df)
{
if (m_hide) return;
- m_t << "<div class=\"diagraph\">" << endl;
+ m_t << "<div class=\"diagraph\">\n";
writeDiaFile(df->file(),df->relPath(),df->context());
if (df->hasCaption())
{
- m_t << "<div class=\"caption\">" << endl;
+ m_t << "<div class=\"caption\">\n";
}
}
void HtmlDocVisitor::visitPost(DocDiaFile *df)
@@ -1835,9 +1836,9 @@ void HtmlDocVisitor::visitPost(DocDiaFile *df)
if (m_hide) return;
if (df->hasCaption())
{
- m_t << "</div>" << endl;
+ m_t << "</div>\n";
}
- m_t << "</div>" << endl;
+ m_t << "</div>\n";
}
void HtmlDocVisitor::visitPre(DocLink *lnk)
@@ -1889,15 +1890,15 @@ void HtmlDocVisitor::visitPre(DocSecRefList *s)
{
if (m_hide) return;
forceEndParagraph(s);
- m_t << "<div>" << endl;
- m_t << "<ul class=\"multicol\">" << endl;
+ m_t << "<div>\n";
+ m_t << "<ul class=\"multicol\">\n";
}
void HtmlDocVisitor::visitPost(DocSecRefList *s)
{
if (m_hide) return;
- m_t << "</ul>" << endl;
- m_t << "</div>" << endl;
+ m_t << "</ul>\n";
+ m_t << "</div>\n";
forceStartParagraph(s);
}
@@ -1930,16 +1931,16 @@ void HtmlDocVisitor::visitPre(DocParamSect *s)
}
m_t << "<dl class=\"" << className << "\"><dt>";
m_t << heading;
- m_t << "</dt><dd>" << endl;
- m_t << " <table class=\"" << className << "\">" << endl;
+ m_t << "</dt><dd>\n";
+ m_t << " <table class=\"" << className << "\">\n";
}
void HtmlDocVisitor::visitPost(DocParamSect *s)
{
if (m_hide) return;
- m_t << " </table>" << endl;
- m_t << " </dd>" << endl;
- m_t << "</dl>" << endl;
+ m_t << " </table>\n";
+ m_t << " </dd>\n";
+ m_t << "</dl>\n";
forceStartParagraph(s);
}
@@ -2016,7 +2017,7 @@ void HtmlDocVisitor::visitPost(DocParamList *)
{
//printf("DocParamList::visitPost\n");
if (m_hide) return;
- m_t << "</td></tr>" << endl;
+ m_t << "</td></tr>\n";
}
void HtmlDocVisitor::visitPre(DocXRefItem *x)
@@ -2046,14 +2047,14 @@ void HtmlDocVisitor::visitPost(DocXRefItem *x)
{
if (m_hide) return;
if (x->title().isEmpty()) return;
- m_t << "</dd></dl>" << endl;
+ m_t << "</dd></dl>\n";
forceStartParagraph(x);
}
void HtmlDocVisitor::visitPre(DocInternalRef *ref)
{
if (m_hide) return;
- startLink(0,ref->file(),ref->relPath(),ref->anchor());
+ startLink(QCString(),ref->file(),ref->relPath(),ref->anchor());
}
void HtmlDocVisitor::visitPost(DocInternalRef *)
@@ -2082,7 +2083,7 @@ void HtmlDocVisitor::visitPre(DocHtmlBlockQuote *b)
void HtmlDocVisitor::visitPost(DocHtmlBlockQuote *b)
{
if (m_hide) return;
- m_t << "</blockquote>" << endl;
+ m_t << "</blockquote>\n";
forceStartParagraph(b);
}
@@ -2096,9 +2097,9 @@ void HtmlDocVisitor::visitPre(DocVhdlFlow *vf)
m_t << "<p>";
m_t << "flowchart: " ; // TODO: translate me
m_t << "<a href=\"";
- m_t << fname.data();
+ m_t << fname;
m_t << ".svg\">";
- m_t << VhdlDocGen::getFlowMember()->name().data();
+ m_t << VhdlDocGen::getFlowMember()->name();
m_t << "</a>";
if (vf->hasCaption())
{
@@ -2129,10 +2130,10 @@ void HtmlDocVisitor::visitPost(DocParBlock *)
-void HtmlDocVisitor::filter(const char *str)
+void HtmlDocVisitor::filter(const QCString &str)
{
- if (str==0) return;
- const char *p=str;
+ if (str.isEmpty()) return;
+ const char *p=str.data();
char c;
while (*p)
{
@@ -2166,10 +2167,10 @@ void HtmlDocVisitor::filter(const char *str)
/// Escape basic entities to produce a valid CDATA attribute value,
/// assume that the outer quoting will be using the double quote &quot;
-void HtmlDocVisitor::filterQuotedCdataAttr(const char* str)
+void HtmlDocVisitor::filterQuotedCdataAttr(const QCString &str)
{
- if (str==0) return;
- const char *p=str;
+ if (str.isEmpty()) return;
+ const char *p=str.data();
char c;
while (*p)
{
@@ -2206,7 +2207,7 @@ void HtmlDocVisitor::startLink(const QCString &ref,const QCString &file,
const QCString &relPath,const QCString &anchor,
const QCString &tooltip)
{
- //printf("HtmlDocVisitor: file=%s anchor=%s\n",file.data(),anchor.data());
+ //printf("HtmlDocVisitor: file=%s anchor=%s\n",qPrint(file),qPrint(anchor));
if (!ref.isEmpty()) // link to entity imported via tag file
{
m_t << "<a class=\"elRef\" ";
@@ -2294,7 +2295,7 @@ void HtmlDocVisitor::writeDiaFile(const QCString &fileName,
QCString outDir = Config_getString(HTML_OUTPUT);
writeDiaGraphFromFile(fileName,outDir,baseName,DIA_BITMAP);
- m_t << "<img src=\"" << relPath << baseName << ".png" << "\" />" << endl;
+ m_t << "<img src=\"" << relPath << baseName << ".png" << "\" />\n";
}
void HtmlDocVisitor::writePlantUMLFile(const QCString &fileName,
@@ -2316,15 +2317,15 @@ void HtmlDocVisitor::writePlantUMLFile(const QCString &fileName,
if (imgExt=="svg")
{
PlantumlManager::instance().generatePlantUMLOutput(fileName,outDir,PlantumlManager::PUML_SVG);
- //m_t << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" << relPath << baseName << ".svg" << "\" />" << endl;
+ //m_t << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" << relPath << baseName << ".svg" << "\" />\n";
//m_t << "<p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p>";
- //m_t << "</iframe>" << endl;
- m_t << "<object type=\"image/svg+xml\" data=\"" << relPath << baseName << ".svg\"></object>" << endl;
+ //m_t << "</iframe>\n";
+ m_t << "<object type=\"image/svg+xml\" data=\"" << relPath << baseName << ".svg\"></object>\n";
}
else
{
PlantumlManager::instance().generatePlantUMLOutput(fileName,outDir,PlantumlManager::PUML_BITMAP);
- m_t << "<img src=\"" << relPath << baseName << ".png" << "\" />" << endl;
+ m_t << "<img src=\"" << relPath << baseName << ".png" << "\" />\n";
}
}
@@ -2377,7 +2378,7 @@ void HtmlDocVisitor::forceEndParagraph(DocNode *n)
const DocNodeList &children = para->children();
auto it = std::find_if(children.begin(),children.end(),[n](const auto &np) { return np.get()==n; });
if (it==children.end()) return;
- int nodeIndex = it - children.begin();
+ int nodeIndex = static_cast<int>(it - children.begin());
nodeIndex--;
if (nodeIndex<0) return; // first node in paragraph
while (nodeIndex>=0 && isInvisibleNode(children.at(nodeIndex).get()))
@@ -2413,7 +2414,7 @@ void HtmlDocVisitor::forceStartParagraph(DocNode *n)
const DocNodeList &children = para->children();
auto it = std::find_if(children.begin(),children.end(),[n](const auto &np) { return np.get()==n; });
if (it==children.end()) return;
- int nodeIndex = it - children.begin();
+ int nodeIndex = static_cast<int>(it - children.begin());
int numNodes = static_cast<int>(para->children().size());
bool styleOutsideParagraph=insideStyleChangeThatIsOutsideParagraph(para,nodeIndex);
if (styleOutsideParagraph) return;
diff --git a/src/htmldocvisitor.h b/src/htmldocvisitor.h
index 084482e..287088d 100644
--- a/src/htmldocvisitor.h
+++ b/src/htmldocvisitor.h
@@ -17,19 +17,19 @@
#define _HTMLDOCVISITOR_H
#include "docvisitor.h"
-#include <qcstring.h>
+#include "qcstring.h"
class Definition;
class MemberDef;
class DocNode;
-class FTextStream;
class CodeOutputInterface;
+class TextStream;
/*! @brief Concrete visitor implementation for HTML output. */
class HtmlDocVisitor : public DocVisitor
{
public:
- HtmlDocVisitor(FTextStream &t,CodeOutputInterface &ci,const Definition *ctx);
+ HtmlDocVisitor(TextStream &t,CodeOutputInterface &ci,const Definition *ctx);
//--------------------------------------
// visitor functions for leaf nodes
@@ -139,8 +139,8 @@ class HtmlDocVisitor : public DocVisitor
//--------------------------------------
void writeObfuscatedMailAddress(const QCString &url);
- void filter(const char *str);
- void filterQuotedCdataAttr(const char* str);
+ void filter(const QCString &str);
+ void filterQuotedCdataAttr(const QCString &str);
void startLink(const QCString &ref,const QCString &file,
const QCString &relPath,const QCString &anchor,
const QCString &tooltip = "");
@@ -157,7 +157,7 @@ class HtmlDocVisitor : public DocVisitor
// state variables
//--------------------------------------
- FTextStream &m_t;
+ TextStream &m_t;
CodeOutputInterface &m_ci;
bool m_insidePre;
bool m_hide;
diff --git a/src/htmlentity.cpp b/src/htmlentity.cpp
index 29ff6e3..8f2eb78 100644
--- a/src/htmlentity.cpp
+++ b/src/htmlentity.cpp
@@ -15,7 +15,7 @@
#include "htmlentity.h"
#include "message.h"
-#include "ftextstream.h"
+#include "textstream.h"
//! Number of doxygen commands mapped as if it were HTML entities
static const int g_numberHtmlMappedCmds = 11;
@@ -474,7 +474,7 @@ DocSymbol::SymType HtmlEntityMapper::name2sym(const QCString &symName) const
return it!=m_name2sym.end() ? it->second : DocSymbol::Sym_Unknown;
}
-void HtmlEntityMapper::writeXMLSchema(FTextStream &t)
+void HtmlEntityMapper::writeXMLSchema(TextStream &t)
{
for (int i=0;i<g_numHtmlEntities - g_numberHtmlMappedCmds;i++)
{
diff --git a/src/htmlentity.h b/src/htmlentity.h
index 5337280..cbdc0a1 100644
--- a/src/htmlentity.h
+++ b/src/htmlentity.h
@@ -20,7 +20,7 @@
#include "docparser.h"
-class FTextStream;
+class TextStream;
/** @brief Singleton helper class to map html entities to other formats */
class HtmlEntityMapper
@@ -37,7 +37,7 @@ class HtmlEntityMapper
const char *man(DocSymbol::SymType symb) const;
const char *rtf(DocSymbol::SymType symb) const;
const DocSymbol::PerlSymb *perl(DocSymbol::SymType symb) const;
- void writeXMLSchema(FTextStream &t);
+ void writeXMLSchema(TextStream &t);
private:
void validate();
HtmlEntityMapper();
diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp
index ebf7aea..7cd893f 100644
--- a/src/htmlgen.cpp
+++ b/src/htmlgen.cpp
@@ -1,8 +1,6 @@
/******************************************************************************
*
- *
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2021 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
@@ -19,8 +17,8 @@
#include <assert.h>
#include <mutex>
+#include <sstream>
-#include <qdir.h>
#include "message.h"
#include "htmlgen.h"
#include "config.h"
@@ -51,6 +49,10 @@
#include "resourcemgr.h"
#include "tooltip.h"
#include "growbuf.h"
+#include "fileinfo.h"
+#include "dir.h"
+#include "utf8.h"
+#include "textstream.h"
//#define DBG_HTML(x) x;
#define DBG_HTML(x)
@@ -63,7 +65,7 @@ static const char *hex="0123456789ABCDEF";
// note: this is only active if DISABLE_INDEX=YES, if DISABLE_INDEX is disabled, this
// part will be rendered inside menu.js
-static void writeClientSearchBox(FTextStream &t,const char *relPath)
+static void writeClientSearchBox(TextStream &t,const QCString &relPath)
{
t << " <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
t << " <span class=\"left\">\n";
@@ -85,7 +87,7 @@ static void writeClientSearchBox(FTextStream &t,const char *relPath)
// note: this is only active if DISABLE_INDEX=YES. if DISABLE_INDEX is disabled, this
// part will be rendered inside menu.js
-static void writeServerSearchBox(FTextStream &t,const char *relPath,bool highlightSearch)
+static void writeServerSearchBox(TextStream &t,const QCString &relPath,bool highlightSearch)
{
bool externalSearch = Config_getBool(EXTERNAL_SEARCH);
t << " <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
@@ -141,7 +143,7 @@ static QCString getConvertLatexMacro()
QCString macrofile = Config_getString(FORMULA_MACROFILE);
if (macrofile.isEmpty()) return "";
QCString s = fileToString(macrofile);
- macrofile = QFileInfo(macrofile).absFilePath().utf8();
+ macrofile = FileInfo(macrofile.str()).absFilePath();
int size = s.length();
GrowBuf out(size);
const char *data = s.data();
@@ -298,8 +300,7 @@ static QCString getConvertLatexMacro()
static QCString getSearchBox(bool serverSide, QCString relPath, bool highlightSearch)
{
- QGString result;
- FTextStream t(&result);
+ TextStream t;
if (serverSide)
{
writeServerSearchBox(t, relPath, highlightSearch);
@@ -308,7 +309,7 @@ static QCString getSearchBox(bool serverSide, QCString relPath, bool highlightSe
{
writeClientSearchBox(t, relPath);
}
- return QCString(result);
+ return t.str();
}
static QCString substituteHtmlKeywords(const QCString &str,
@@ -346,10 +347,10 @@ static QCString substituteHtmlKeywords(const QCString &str,
}
else
{
- QFileInfo cssfi(cssFile);
+ FileInfo cssfi(cssFile.str());
if (cssfi.exists())
{
- cssFile = cssfi.fileName().utf8();
+ cssFile = cssfi.fileName();
}
else
{
@@ -359,22 +360,22 @@ static QCString substituteHtmlKeywords(const QCString &str,
extraCssText = "";
const StringVector &extraCssFile = Config_getList(HTML_EXTRA_STYLESHEET);
- for (const auto &extraFile : extraCssFile)
+ for (const auto &fileName : extraCssFile)
{
- QCString fileName = extraFile.c_str();
- if (!fileName.isEmpty())
+ if (!fileName.empty())
{
- QFileInfo fi(fileName);
+ FileInfo fi(fileName);
if (fi.exists())
{
- extraCssText += "<link href=\"$relpath^"+stripPath(fileName)+"\" rel=\"stylesheet\" type=\"text/css\"/>\n";
+ extraCssText += "<link href=\"$relpath^"+stripPath(fileName.c_str())+"\" rel=\"stylesheet\" type=\"text/css\"/>\n";
}
}
}
if (timeStamp)
{
- generatedBy = theTranslator->trGeneratedAt(dateToString(TRUE), convertToHtml(Config_getString(PROJECT_NAME)));
+ generatedBy = theTranslator->trGeneratedAt(dateToString(TRUE),
+ convertToHtml(Config_getString(PROJECT_NAME)));
}
else
{
@@ -510,20 +511,13 @@ static QCString substituteHtmlKeywords(const QCString &str,
//--------------------------------------------------------------------------
-HtmlCodeGenerator::HtmlCodeGenerator()
-{
-}
-
-HtmlCodeGenerator::HtmlCodeGenerator(FTextStream &t,const QCString &relPath)
- : m_relPath(relPath)
+HtmlCodeGenerator::HtmlCodeGenerator(TextStream &t) : m_t(t)
{
- setTextStream(t);
}
-void HtmlCodeGenerator::setTextStream(FTextStream &t)
+HtmlCodeGenerator::HtmlCodeGenerator(TextStream &t,const QCString &relPath)
+ : m_t(t), m_relPath(relPath)
{
- m_streamSet = t.device()!=0;
- m_t.setDevice(t.device());
}
void HtmlCodeGenerator::setRelativePath(const QCString &path)
@@ -531,12 +525,12 @@ void HtmlCodeGenerator::setRelativePath(const QCString &path)
m_relPath = path;
}
-void HtmlCodeGenerator::codify(const char *str)
+void HtmlCodeGenerator::codify(const QCString &str)
{
int tabSize = Config_getInt(TAB_SIZE);
- if (str && m_streamSet)
+ if (!str.isEmpty())
{
- const char *p=str;
+ const char *p=str.data();
char c;
int spacesToNextTabStop;
while (*p)
@@ -585,7 +579,7 @@ void HtmlCodeGenerator::codify(const char *str)
}
else
{
- p=writeUtf8Char(m_t,p-1);
+ p=writeUTF8Char(m_t,p-1);
m_col++;
}
}
@@ -595,13 +589,13 @@ void HtmlCodeGenerator::codify(const char *str)
}
}
-void HtmlCodeGenerator::docify(const char *str)
+void HtmlCodeGenerator::docify(const QCString &str)
{
//m_t << getHtmlDirEmbeddingChar(getTextDirByConfig(str));
- if (str && m_streamSet)
+ if (!str.isEmpty())
{
- const char *p=str;
+ const char *p=str.data();
char c;
while (*p)
{
@@ -642,10 +636,9 @@ void HtmlCodeGenerator::docify(const char *str)
}
}
-void HtmlCodeGenerator::writeLineNumber(const char *ref,const char *filename,
- const char *anchor,int l)
+void HtmlCodeGenerator::writeLineNumber(const QCString &ref,const QCString &filename,
+ const QCString &anchor,int l)
{
- if (!m_streamSet) return;
const int maxLineNrStr = 10;
char lineNumber[maxLineNrStr];
char lineAnchor[maxLineNrStr];
@@ -659,9 +652,9 @@ void HtmlCodeGenerator::writeLineNumber(const char *ref,const char *filename,
}
m_t << "<a name=\"" << lineAnchor << "\"></a><span class=\"lineno\">";
- if (filename)
+ if (!filename.isEmpty())
{
- _writeCodeLink("line",ref,filename,anchor,lineNumber,0);
+ _writeCodeLink("line",ref,filename,anchor,lineNumber,QCString());
}
else
{
@@ -672,21 +665,20 @@ void HtmlCodeGenerator::writeLineNumber(const char *ref,const char *filename,
m_col=0;
}
-void HtmlCodeGenerator::writeCodeLink(const char *ref,const char *f,
- const char *anchor, const char *name,
- const char *tooltip)
+void HtmlCodeGenerator::writeCodeLink(const QCString &ref,const QCString &f,
+ const QCString &anchor, const QCString &name,
+ const QCString &tooltip)
{
- if (!m_streamSet) return;
//printf("writeCodeLink(ref=%s,f=%s,anchor=%s,name=%s,tooltip=%s)\n",ref,f,anchor,name,tooltip);
_writeCodeLink("code",ref,f,anchor,name,tooltip);
}
-void HtmlCodeGenerator::_writeCodeLink(const char *className,
- const char *ref,const char *f,
- const char *anchor, const char *name,
- const char *tooltip)
+void HtmlCodeGenerator::_writeCodeLink(const QCString &className,
+ const QCString &ref,const QCString &f,
+ const QCString &anchor, const QCString &name,
+ const QCString &tooltip)
{
- if (ref)
+ if (!ref.isEmpty())
{
m_t << "<a class=\"" << className << "Ref\" ";
m_t << externalLinkTarget();
@@ -697,18 +689,18 @@ void HtmlCodeGenerator::_writeCodeLink(const char *className,
}
m_t << "href=\"";
m_t << externalRef(m_relPath,ref,TRUE);
- if (f) m_t << addHtmlExtensionIfMissing(f);
- if (anchor) m_t << "#" << anchor;
+ if (!f.isEmpty()) m_t << addHtmlExtensionIfMissing(f);
+ if (!anchor.isEmpty()) m_t << "#" << anchor;
m_t << "\"";
- if (tooltip) m_t << " title=\"" << convertToHtml(tooltip) << "\"";
+ if (!tooltip.isEmpty()) m_t << " title=\"" << convertToHtml(tooltip) << "\"";
m_t << ">";
docify(name);
m_t << "</a>";
- m_col+=qstrlen(name);
+ m_col+=name.length();
}
-void HtmlCodeGenerator::writeTooltip(const char *id, const DocLinkInfo &docInfo,
- const char *decl, const char *desc,
+void HtmlCodeGenerator::writeTooltip(const QCString &id, const DocLinkInfo &docInfo,
+ const QCString &decl, const QCString &desc,
const SourceLinkInfo &defInfo,
const SourceLinkInfo &declInfo)
{
@@ -731,13 +723,13 @@ void HtmlCodeGenerator::writeTooltip(const char *id, const DocLinkInfo &docInfo,
m_t << "</a>";
}
m_t << "</div>";
- if (decl)
+ if (!decl.isEmpty())
{
m_t << "<div class=\"ttdeci\">";
docify(decl);
m_t << "</div>";
}
- if (desc)
+ if (!desc.isEmpty())
{
m_t << "<div class=\"ttdoc\">";
docify(desc);
@@ -785,76 +777,70 @@ void HtmlCodeGenerator::writeTooltip(const char *id, const DocLinkInfo &docInfo,
}
m_t << "</div>";
}
- m_t << "</div>" << endl;
+ m_t << "</div>\n";
}
void HtmlCodeGenerator::startCodeLine(bool)
{
- if (m_streamSet)
+ m_col=0;
+ if (!m_lineOpen)
{
- m_col=0;
- if (!m_lineOpen)
- {
- m_t << "<div class=\"line\">";
- m_lineOpen = TRUE;
- }
+ m_t << "<div class=\"line\">";
+ m_lineOpen = TRUE;
}
}
void HtmlCodeGenerator::endCodeLine()
{
- if (m_streamSet)
+ if (m_col == 0)
{
- if (m_col == 0)
- {
- m_t << " ";
- m_col++;
- }
- if (m_lineOpen)
- {
- m_t << "</div>\n";
- m_lineOpen = FALSE;
- }
+ m_t << " ";
+ m_col++;
+ }
+ if (m_lineOpen)
+ {
+ m_t << "</div>\n";
+ m_lineOpen = FALSE;
}
}
-void HtmlCodeGenerator::startFontClass(const char *s)
+void HtmlCodeGenerator::startFontClass(const QCString &s)
{
- if (m_streamSet) m_t << "<span class=\"" << s << "\">";
+ m_t << "<span class=\"" << s << "\">";
}
void HtmlCodeGenerator::endFontClass()
{
- if (m_streamSet) m_t << "</span>";
+ m_t << "</span>";
}
-void HtmlCodeGenerator::writeCodeAnchor(const char *anchor)
+void HtmlCodeGenerator::writeCodeAnchor(const QCString &anchor)
{
- if (m_streamSet) m_t << "<a name=\"" << anchor << "\"></a>";
+ m_t << "<a name=\"" << anchor << "\"></a>";
}
-void HtmlCodeGenerator::startCodeFragment(const char *)
+void HtmlCodeGenerator::startCodeFragment(const QCString &)
{
- if (m_streamSet) m_t << "<div class=\"fragment\">";
+ m_t << "<div class=\"fragment\">";
}
-void HtmlCodeGenerator::endCodeFragment(const char *)
+void HtmlCodeGenerator::endCodeFragment(const QCString &)
{
//endCodeLine checks is there is still an open code line, if so closes it.
endCodeLine();
- if (m_streamSet) m_t << "</div><!-- fragment -->";
+ m_t << "</div><!-- fragment -->";
}
//--------------------------------------------------------------------------
-HtmlGenerator::HtmlGenerator() : OutputGenerator(Config_getString(HTML_OUTPUT))
+HtmlGenerator::HtmlGenerator() : OutputGenerator(Config_getString(HTML_OUTPUT)), m_codeGen(m_t)
{
}
-HtmlGenerator::HtmlGenerator(const HtmlGenerator &og) : OutputGenerator(og)
+HtmlGenerator::HtmlGenerator(const HtmlGenerator &og) : OutputGenerator(og), m_codeGen(og.m_codeGen)
{
}
@@ -878,16 +864,16 @@ HtmlGenerator::~HtmlGenerator()
void HtmlGenerator::init()
{
QCString dname = Config_getString(HTML_OUTPUT);
- QDir d(dname);
- if (!d.exists() && !d.mkdir(dname))
+ Dir d(dname.str());
+ if (!d.exists() && !d.mkdir(dname.str()))
{
- term("Could not create output directory %s\n",dname.data());
+ term("Could not create output directory %s\n",qPrint(dname));
}
//writeLogo(dname);
if (!Config_getString(HTML_HEADER).isEmpty())
{
g_header=fileToString(Config_getString(HTML_HEADER));
- //printf("g_header='%s'\n",g_header.data());
+ //printf("g_header='%s'\n",qPrint(g_header));
}
else
{
@@ -897,7 +883,7 @@ void HtmlGenerator::init()
if (!Config_getString(HTML_FOOTER).isEmpty())
{
g_footer=fileToString(Config_getString(HTML_FOOTER));
- //printf("g_footer='%s'\n",g_footer.data());
+ //printf("g_footer='%s'\n",qPrint(g_footer));
}
else
{
@@ -909,10 +895,10 @@ void HtmlGenerator::init()
if (!Config_getString(MATHJAX_CODEFILE).isEmpty())
{
g_mathjax_code=fileToString(Config_getString(MATHJAX_CODEFILE));
- //printf("g_mathjax_code='%s'\n",g_mathjax_code.data());
+ //printf("g_mathjax_code='%s'\n",qPrint(g_mathjax_code));
}
g_latex_macro=getConvertLatexMacro();
- //printf("converted g_latex_macro='%s'\n",g_latex_macro.data());
+ //printf("converted g_latex_macro='%s'\n",qPrint(g_latex_macro));
}
createSubDirs(d);
@@ -936,15 +922,15 @@ void HtmlGenerator::init()
}
{
- QFile f(dname+"/dynsections.js");
- if (f.open(IO_WriteOnly))
+ std::ofstream f(dname.str()+"/dynsections.js",std::ofstream::out | std::ofstream::binary);
+ if (f.is_open())
{
- FTextStream t(&f);
+ TextStream t(&f);
t << mgr.getAsString("dynsections.js");
if (Config_getBool(SOURCE_BROWSER) && Config_getBool(SOURCE_TOOLTIPS))
{
- t << endl <<
- "$(document).ready(function() {\n"
+ t <<
+ "\n$(document).ready(function() {\n"
" $('.code,.codeRef').each(function() {\n"
" $(this).data('powertip',$('#a'+$(this).attr('href').replace(/.*\\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html());\n"
" $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true });\n"
@@ -985,7 +971,7 @@ void HtmlGenerator::writeTabData()
mgr.copyResource("nav_g.png",dname);
}
-void HtmlGenerator::writeSearchData(const char *dname)
+void HtmlGenerator::writeSearchData(const QCString &dname)
{
bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
//writeImgData(dname,serverBasedSearch ? search_server_data : search_client_data);
@@ -1011,10 +997,10 @@ void HtmlGenerator::writeSearchData(const char *dname)
}
QCString searchDirName = dname;
- QFile f(searchDirName+"/search.css");
- if (f.open(IO_WriteOnly))
+ std::ofstream f(searchDirName.str()+"/search.css",std::ofstream::out | std::ofstream::binary);
+ if (f.is_open())
{
- FTextStream t(&f);
+ TextStream t(&f);
QCString searchCss;
if (Config_getBool(DISABLE_INDEX))
{
@@ -1034,30 +1020,27 @@ void HtmlGenerator::writeSearchData(const char *dname)
}
}
-void HtmlGenerator::writeStyleSheetFile(QFile &file)
+void HtmlGenerator::writeStyleSheetFile(TextStream &t)
{
- FTextStream t(&file);
t << replaceColorMarkers(substitute(ResourceMgr::instance().getAsString("doxygen.css"),"$doxygenversion",getDoxygenVersion()));
}
-void HtmlGenerator::writeHeaderFile(QFile &file, const char * /*cssname*/)
+void HtmlGenerator::writeHeaderFile(TextStream &t, const QCString & /*cssname*/)
{
- FTextStream t(&file);
- t << "<!-- HTML header for doxygen " << getDoxygenVersion() << "-->" << endl;
+ t << "<!-- HTML header for doxygen " << getDoxygenVersion() << "-->\n";
t << ResourceMgr::instance().getAsString("header.html");
}
-void HtmlGenerator::writeFooterFile(QFile &file)
+void HtmlGenerator::writeFooterFile(TextStream &t)
{
- FTextStream t(&file);
- t << "<!-- HTML footer for doxygen " << getDoxygenVersion() << "-->" << endl;
+ t << "<!-- HTML footer for doxygen " << getDoxygenVersion() << "-->\n";
t << ResourceMgr::instance().getAsString("footer.html");
}
static std::mutex g_indexLock;
-void HtmlGenerator::startFile(const char *name,const char *,
- const char *title,int id)
+void HtmlGenerator::startFile(const QCString &name,const QCString &,
+ const QCString &title,int id)
{
//printf("HtmlGenerator::startFile(%s)\n",name);
m_relPath = relativePathToRoot(name);
@@ -1066,7 +1049,6 @@ void HtmlGenerator::startFile(const char *name,const char *,
startPlainFile(fileName);
m_codeGen.setId(id);
- m_codeGen.setTextStream(t);
m_codeGen.setRelativePath(m_relPath);
{
std::lock_guard<std::mutex> lock(g_indexLock);
@@ -1074,26 +1056,26 @@ void HtmlGenerator::startFile(const char *name,const char *,
}
m_lastFile = fileName;
- t << substituteHtmlKeywords(g_header,convertToHtml(filterTitle(title?title:"")),m_relPath);
+ m_t << substituteHtmlKeywords(g_header,convertToHtml(filterTitle(title)),m_relPath);
- t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen "
- << getDoxygenVersion() << " -->" << endl;
+ m_t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen "
+ << getDoxygenVersion() << " -->\n";
//bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
bool searchEngine = Config_getBool(SEARCHENGINE);
if (searchEngine /*&& !generateTreeView*/)
{
- t << "<script type=\"text/javascript\">\n";
- t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
- t << "var searchBox = new SearchBox(\"searchBox\", \""
- << m_relPath<< "search\",false,'" << theTranslator->trSearch() << "','" << Doxygen::htmlFileExtension << "');\n";
- t << "/* @license-end */\n";
- t << "</script>\n";
+ m_t << "<script type=\"text/javascript\">\n";
+ m_t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
+ m_t << "var searchBox = new SearchBox(\"searchBox\", \""
+ << m_relPath<< "search\",false,'" << theTranslator->trSearch() << "','" << Doxygen::htmlFileExtension << "');\n";
+ m_t << "/* @license-end */\n";
+ m_t << "</script>\n";
}
//generateDynamicSections(t,relPath);
m_sectionCount=0;
}
-void HtmlGenerator::writeSearchInfo(FTextStream &t,const QCString &)
+void HtmlGenerator::writeSearchInfo(TextStream &t,const QCString &)
{
bool searchEngine = Config_getBool(SEARCHENGINE);
bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
@@ -1118,11 +1100,11 @@ void HtmlGenerator::writeSearchInfo(FTextStream &t,const QCString &)
void HtmlGenerator::writeSearchInfo()
{
- writeSearchInfo(t,m_relPath);
+ writeSearchInfo(m_t,m_relPath);
}
-QCString HtmlGenerator::writeLogoAsString(const char *path)
+QCString HtmlGenerator::writeLogoAsString(const QCString &path)
{
bool timeStamp = Config_getBool(HTML_TIMESTAMP);
QCString result;
@@ -1148,18 +1130,18 @@ QCString HtmlGenerator::writeLogoAsString(const char *path)
void HtmlGenerator::writeLogo()
{
- t << writeLogoAsString(m_relPath);
+ m_t << writeLogoAsString(m_relPath);
}
-void HtmlGenerator::writePageFooter(FTextStream &t,const QCString &lastTitle,
+void HtmlGenerator::writePageFooter(TextStream &t,const QCString &lastTitle,
const QCString &relPath,const QCString &navPath)
{
t << substituteHtmlKeywords(g_footer,convertToHtml(lastTitle),relPath,navPath);
}
-void HtmlGenerator::writeFooter(const char *navPath)
+void HtmlGenerator::writeFooter(const QCString &navPath)
{
- writePageFooter(t,m_lastTitle,m_relPath,navPath);
+ writePageFooter(m_t,m_lastTitle,m_relPath,navPath);
}
void HtmlGenerator::endFile()
@@ -1169,12 +1151,12 @@ void HtmlGenerator::endFile()
void HtmlGenerator::startProjectNumber()
{
- t << "<h3 class=\"version\">";
+ m_t << "<h3 class=\"version\">";
}
void HtmlGenerator::endProjectNumber()
{
- t << "</h3>";
+ m_t << "</h3>";
}
void HtmlGenerator::writeStyleInfo(int part)
@@ -1188,42 +1170,41 @@ void HtmlGenerator::writeStyleInfo(int part)
startPlainFile("doxygen.css");
// alternative, cooler looking titles
- //t << "H1 { text-align: center; border-width: thin none thin none;" << endl;
- //t << " border-style : double; border-color : blue; padding-left : 1em; padding-right : 1em }" << endl;
+ //t << "H1 { text-align: center; border-width: thin none thin none;\n";
+ //t << " border-style : double; border-color : blue; padding-left : 1em; padding-right : 1em }\n";
- t << replaceColorMarkers(substitute(ResourceMgr::instance().getAsString("doxygen.css"),"$doxygenversion",getDoxygenVersion()));
+ m_t << replaceColorMarkers(substitute(ResourceMgr::instance().getAsString("doxygen.css"),"$doxygenversion",getDoxygenVersion()));
endPlainFile();
Doxygen::indexList->addStyleSheetFile("doxygen.css");
}
else // write user defined style sheet
{
QCString cssname=Config_getString(HTML_STYLESHEET);
- QFileInfo cssfi(cssname);
+ FileInfo cssfi(cssname.str());
if (!cssfi.exists() || !cssfi.isFile() || !cssfi.isReadable())
{
- err("style sheet %s does not exist or is not readable!", Config_getString(HTML_STYLESHEET).data());
+ err("style sheet %s does not exist or is not readable!", qPrint(Config_getString(HTML_STYLESHEET)));
}
else
{
// convert style sheet to string
QCString fileStr = fileToString(cssname);
// write the string into the output dir
- startPlainFile(cssfi.fileName().utf8());
- t << fileStr;
+ startPlainFile(cssfi.fileName().c_str());
+ m_t << fileStr;
endPlainFile();
}
- Doxygen::indexList->addStyleSheetFile(cssfi.fileName().utf8());
+ Doxygen::indexList->addStyleSheetFile(cssfi.fileName().c_str());
}
const StringVector &extraCssFiles = Config_getList(HTML_EXTRA_STYLESHEET);
- for (const auto &extraCss : extraCssFiles)
+ for (const auto &fileName : extraCssFiles)
{
- QCString fileName = extraCss.c_str();
- if (!fileName.isEmpty())
+ if (!fileName.empty())
{
- QFileInfo fi(fileName);
+ FileInfo fi(fileName);
if (fi.exists())
{
- Doxygen::indexList->addStyleSheetFile(fi.fileName().utf8());
+ Doxygen::indexList->addStyleSheetFile(fi.fileName().c_str());
}
}
}
@@ -1237,160 +1218,160 @@ void HtmlGenerator::writeStyleInfo(int part)
}
}
-void HtmlGenerator::startDoxyAnchor(const char *,const char *,
- const char *anchor, const char *,
- const char *)
+void HtmlGenerator::startDoxyAnchor(const QCString &,const QCString &,
+ const QCString &anchor, const QCString &,
+ const QCString &)
{
- t << "<a id=\"" << anchor << "\"></a>";
+ m_t << "<a id=\"" << anchor << "\"></a>";
}
-void HtmlGenerator::endDoxyAnchor(const char *,const char *)
+void HtmlGenerator::endDoxyAnchor(const QCString &,const QCString &)
{
}
//void HtmlGenerator::newParagraph()
//{
-// t << endl << "<p>" << endl;
+// t << "\n<p>\n";
//}
-void HtmlGenerator::startParagraph(const char *classDef)
+void HtmlGenerator::startParagraph(const QCString &classDef)
{
- if (classDef)
- t << endl << "<p class=\"" << classDef << "\">";
+ if (!classDef.isEmpty())
+ m_t << "\n<p class=\"" << classDef << "\">";
else
- t << endl << "<p>";
+ m_t << "\n<p>";
}
void HtmlGenerator::endParagraph()
{
- t << "</p>" << endl;
+ m_t << "</p>\n";
}
-void HtmlGenerator::writeString(const char *text)
+void HtmlGenerator::writeString(const QCString &text)
{
- t << text;
+ m_t << text;
}
void HtmlGenerator::startIndexListItem()
{
- t << "<li>";
+ m_t << "<li>";
}
void HtmlGenerator::endIndexListItem()
{
- t << "</li>" << endl;
+ m_t << "</li>\n";
}
-void HtmlGenerator::startIndexItem(const char *ref,const char *f)
+void HtmlGenerator::startIndexItem(const QCString &ref,const QCString &f)
{
//printf("HtmlGenerator::startIndexItem(%s,%s)\n",ref,f);
- if (ref || f)
+ if (!ref.isEmpty() || !f.isEmpty())
{
- if (ref)
+ if (!ref.isEmpty())
{
- t << "<a class=\"elRef\" ";
- t << externalLinkTarget();
+ m_t << "<a class=\"elRef\" ";
+ m_t << externalLinkTarget();
}
else
{
- t << "<a class=\"el\" ";
+ m_t << "<a class=\"el\" ";
}
- t << "href=\"";
- t << externalRef(m_relPath,ref,TRUE);
- if (f) t << addHtmlExtensionIfMissing(f);
- t << "\">";
+ m_t << "href=\"";
+ m_t << externalRef(m_relPath,ref,TRUE);
+ if (!f.isEmpty()) m_t << addHtmlExtensionIfMissing(f);
+ m_t << "\">";
}
else
{
- t << "<b>";
+ m_t << "<b>";
}
}
-void HtmlGenerator::endIndexItem(const char *ref,const char *f)
+void HtmlGenerator::endIndexItem(const QCString &ref,const QCString &f)
{
//printf("HtmlGenerator::endIndexItem(%s,%s,%s)\n",ref,f,name);
- if (ref || f)
+ if (!ref.isEmpty() || !f.isEmpty())
{
- t << "</a>";
+ m_t << "</a>";
}
else
{
- t << "</b>";
+ m_t << "</b>";
}
}
-void HtmlGenerator::writeStartAnnoItem(const char *,const char *f,
- const char *path,const char *name)
+void HtmlGenerator::writeStartAnnoItem(const QCString &,const QCString &f,
+ const QCString &path,const QCString &name)
{
- t << "<li>";
- if (path) docify(path);
- t << "<a class=\"el\" href=\"" << addHtmlExtensionIfMissing(f) << "\">";
+ m_t << "<li>";
+ if (!path.isEmpty()) docify(path);
+ m_t << "<a class=\"el\" href=\"" << addHtmlExtensionIfMissing(f) << "\">";
docify(name);
- t << "</a> ";
+ m_t << "</a> ";
}
-void HtmlGenerator::writeObjectLink(const char *ref,const char *f,
- const char *anchor, const char *name)
+void HtmlGenerator::writeObjectLink(const QCString &ref,const QCString &f,
+ const QCString &anchor, const QCString &name)
{
- if (ref)
+ if (!ref.isEmpty())
{
- t << "<a class=\"elRef\" ";
- t << externalLinkTarget();
+ m_t << "<a class=\"elRef\" ";
+ m_t << externalLinkTarget();
}
else
{
- t << "<a class=\"el\" ";
+ m_t << "<a class=\"el\" ";
}
- t << "href=\"";
- t << externalRef(m_relPath,ref,TRUE);
- if (f) t << addHtmlExtensionIfMissing(f);
- if (anchor) t << "#" << anchor;
- t << "\">";
+ m_t << "href=\"";
+ m_t << externalRef(m_relPath,ref,TRUE);
+ if (!f.isEmpty()) m_t << addHtmlExtensionIfMissing(f);
+ if (!anchor.isEmpty()) m_t << "#" << anchor;
+ m_t << "\">";
docify(name);
- t << "</a>";
+ m_t << "</a>";
}
-void HtmlGenerator::startTextLink(const char *f,const char *anchor)
+void HtmlGenerator::startTextLink(const QCString &f,const QCString &anchor)
{
- t << "<a href=\"";
- if (f) t << m_relPath << addHtmlExtensionIfMissing(f);
- if (anchor) t << "#" << anchor;
- t << "\">";
+ m_t << "<a href=\"";
+ if (!f.isEmpty()) m_t << m_relPath << addHtmlExtensionIfMissing(f);
+ if (!anchor.isEmpty()) m_t << "#" << anchor;
+ m_t << "\">";
}
void HtmlGenerator::endTextLink()
{
- t << "</a>";
+ m_t << "</a>";
}
-void HtmlGenerator::startHtmlLink(const char *url)
+void HtmlGenerator::startHtmlLink(const QCString &url)
{
bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
- t << "<a ";
- if (generateTreeView) t << "target=\"top\" ";
- t << "href=\"";
- if (url) t << url;
- t << "\">";
+ m_t << "<a ";
+ if (generateTreeView) m_t << "target=\"top\" ";
+ m_t << "href=\"";
+ if (!url.isEmpty()) m_t << url;
+ m_t << "\">";
}
void HtmlGenerator::endHtmlLink()
{
- t << "</a>";
+ m_t << "</a>";
}
void HtmlGenerator::startGroupHeader(int extraIndentLevel)
{
if (extraIndentLevel==2)
{
- t << "<h4 class=\"groupheader\">";
+ m_t << "<h4 class=\"groupheader\">";
}
else if (extraIndentLevel==1)
{
- t << "<h3 class=\"groupheader\">";
+ m_t << "<h3 class=\"groupheader\">";
}
else // extraIndentLevel==0
{
- t << "<h2 class=\"groupheader\">";
+ m_t << "<h2 class=\"groupheader\">";
}
}
@@ -1398,79 +1379,79 @@ void HtmlGenerator::endGroupHeader(int extraIndentLevel)
{
if (extraIndentLevel==2)
{
- t << "</h4>" << endl;
+ m_t << "</h4>\n";
}
else if (extraIndentLevel==1)
{
- t << "</h3>" << endl;
+ m_t << "</h3>\n";
}
else
{
- t << "</h2>" << endl;
+ m_t << "</h2>\n";
}
}
-void HtmlGenerator::startSection(const char *lab,const char *,SectionType type)
+void HtmlGenerator::startSection(const QCString &lab,const QCString &,SectionType type)
{
switch(type)
{
- case SectionType::Page: t << "\n\n<h1>"; break;
- case SectionType::Section: t << "\n\n<h2>"; break;
- case SectionType::Subsection: t << "\n\n<h3>"; break;
- case SectionType::Subsubsection: t << "\n\n<h4>"; break;
- case SectionType::Paragraph: t << "\n\n<h5>"; break;
+ case SectionType::Page: m_t << "\n\n<h1>"; break;
+ case SectionType::Section: m_t << "\n\n<h2>"; break;
+ case SectionType::Subsection: m_t << "\n\n<h3>"; break;
+ case SectionType::Subsubsection: m_t << "\n\n<h4>"; break;
+ case SectionType::Paragraph: m_t << "\n\n<h5>"; break;
default: ASSERT(0); break;
}
- t << "<a id=\"" << lab << "\"></a>";
+ m_t << "<a id=\"" << lab << "\"></a>";
}
-void HtmlGenerator::endSection(const char *,SectionType type)
+void HtmlGenerator::endSection(const QCString &,SectionType type)
{
switch(type)
{
- case SectionType::Page: t << "</h1>"; break;
- case SectionType::Section: t << "</h2>"; break;
- case SectionType::Subsection: t << "</h3>"; break;
- case SectionType::Subsubsection: t << "</h4>"; break;
- case SectionType::Paragraph: t << "</h5>"; break;
+ case SectionType::Page: m_t << "</h1>"; break;
+ case SectionType::Section: m_t << "</h2>"; break;
+ case SectionType::Subsection: m_t << "</h3>"; break;
+ case SectionType::Subsubsection: m_t << "</h4>"; break;
+ case SectionType::Paragraph: m_t << "</h5>"; break;
default: ASSERT(0); break;
}
}
-void HtmlGenerator::docify(const char *str)
+void HtmlGenerator::docify(const QCString &str)
{
docify(str,FALSE);
}
-void HtmlGenerator::docify(const char *str,bool inHtmlComment)
+void HtmlGenerator::docify(const QCString &str,bool inHtmlComment)
{
- if (str)
+ if (!str.isEmpty())
{
- const char *p=str;
+ const char *p=str.data();
char c;
while (*p)
{
c=*p++;
switch(c)
{
- case '<': t << "&lt;"; break;
- case '>': t << "&gt;"; break;
- case '&': t << "&amp;"; break;
- case '"': t << "&quot;"; break;
- case '-': if (inHtmlComment) t << "&#45;"; else t << "-"; break;
+ case '<': m_t << "&lt;"; break;
+ case '>': m_t << "&gt;"; break;
+ case '&': m_t << "&amp;"; break;
+ case '"': m_t << "&quot;"; break;
+ case '-': if (inHtmlComment) m_t << "&#45;"; else m_t << "-"; break;
case '\\':
if (*p=='<')
- { t << "&lt;"; p++; }
+ { m_t << "&lt;"; p++; }
else if (*p=='>')
- { t << "&gt;"; p++; }
+ { m_t << "&gt;"; p++; }
else if (*p=='(')
- { t << "\\&zwj;("; p++; }
+ { m_t << "\\&zwj;("; p++; }
else if (*p==')')
- { t << "\\&zwj;)"; p++; }
+ { m_t << "\\&zwj;)"; p++; }
else
- t << "\\";
+ m_t << "\\";
break;
- default: t << c;
+ default: m_t << c;
}
}
}
@@ -1486,7 +1467,7 @@ void HtmlGenerator::writeChar(char c)
//--- helper function for dynamic sections -------------------------
-static void startSectionHeader(FTextStream &t,
+static void startSectionHeader(TextStream &t,
const QCString &relPath,int sectionCount)
{
//t << "<!-- startSectionHeader -->";
@@ -1496,23 +1477,23 @@ static void startSectionHeader(FTextStream &t,
t << "<div id=\"dynsection-" << sectionCount << "\" "
"onclick=\"return toggleVisibility(this)\" "
"class=\"dynheader closed\" "
- "style=\"cursor:pointer;\">" << endl;
+ "style=\"cursor:pointer;\">\n";
t << " <img id=\"dynsection-" << sectionCount << "-trigger\" src=\""
<< relPath << "closed.png\" alt=\"+\"/> ";
}
else
{
- t << "<div class=\"dynheader\">" << endl;
+ t << "<div class=\"dynheader\">\n";
}
}
-static void endSectionHeader(FTextStream &t)
+static void endSectionHeader(TextStream &t)
{
//t << "<!-- endSectionHeader -->";
- t << "</div>" << endl;
+ t << "</div>\n";
}
-static void startSectionSummary(FTextStream &t,int sectionCount)
+static void startSectionSummary(TextStream &t,int sectionCount)
{
//t << "<!-- startSectionSummary -->";
bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
@@ -1520,21 +1501,21 @@ static void startSectionSummary(FTextStream &t,int sectionCount)
{
t << "<div id=\"dynsection-" << sectionCount << "-summary\" "
"class=\"dynsummary\" "
- "style=\"display:block;\">" << endl;
+ "style=\"display:block;\">\n";
}
}
-static void endSectionSummary(FTextStream &t)
+static void endSectionSummary(TextStream &t)
{
//t << "<!-- endSectionSummary -->";
bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
if (dynamicSections)
{
- t << "</div>" << endl;
+ t << "</div>\n";
}
}
-static void startSectionContent(FTextStream &t,int sectionCount)
+static void startSectionContent(TextStream &t,int sectionCount)
{
//t << "<!-- startSectionContent -->";
bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
@@ -1542,163 +1523,169 @@ static void startSectionContent(FTextStream &t,int sectionCount)
{
t << "<div id=\"dynsection-" << sectionCount << "-content\" "
"class=\"dyncontent\" "
- "style=\"display:none;\">" << endl;
+ "style=\"display:none;\">\n";
}
else
{
- t << "<div class=\"dyncontent\">" << endl;
+ t << "<div class=\"dyncontent\">\n";
}
}
-static void endSectionContent(FTextStream &t)
+static void endSectionContent(TextStream &t)
{
//t << "<!-- endSectionContent -->";
- t << "</div>" << endl;
+ t << "</div>\n";
}
//----------------------------
void HtmlGenerator::startClassDiagram()
{
- startSectionHeader(t,m_relPath,m_sectionCount);
+ startSectionHeader(m_t,m_relPath,m_sectionCount);
}
void HtmlGenerator::endClassDiagram(const ClassDiagram &d,
- const char *fileName,const char *name)
+ const QCString &fileName,const QCString &name)
{
- QGString result;
- FTextStream tt(&result);
-
- endSectionHeader(t);
- startSectionSummary(t,m_sectionCount);
- endSectionSummary(t);
- startSectionContent(t,m_sectionCount);
+ endSectionHeader(m_t);
+ startSectionSummary(m_t,m_sectionCount);
+ endSectionSummary(m_t);
+ startSectionContent(m_t,m_sectionCount);
+ TextStream tt;
d.writeImage(tt,dir(),m_relPath,fileName);
- if (!result.isEmpty())
- {
- t << " <div class=\"center\">" << endl;
- t << " <img src=\"";
- t << m_relPath << fileName << ".png\" usemap=\"#" << convertToId(name);
- t << "_map\" alt=\"\"/>" << endl;
- t << " <map id=\"" << convertToId(name);
- t << "_map\" name=\"" << convertToId(name);
- t << "_map\">" << endl;
- t << result;
- t << " </map>" << endl;
- t << "</div>";
+ if (!tt.empty())
+ {
+ m_t << " <div class=\"center\">\n";
+ m_t << " <img src=\"";
+ m_t << m_relPath << fileName << ".png\" usemap=\"#" << convertToId(name);
+ m_t << "_map\" alt=\"\"/>\n";
+ m_t << " <map id=\"" << convertToId(name);
+ m_t << "_map\" name=\"" << convertToId(name);
+ m_t << "_map\">\n";
+ m_t << tt.str();
+ m_t << " </map>\n";
+ m_t << "</div>";
}
else
{
- t << " <div class=\"center\">" << endl;
- t << " <img src=\"";
- t << m_relPath << fileName << ".png\" alt=\"\"/>" << endl;
- t << " </div>";
+ m_t << " <div class=\"center\">\n";
+ m_t << " <img src=\"";
+ m_t << m_relPath << fileName << ".png\" alt=\"\"/>\n";
+ m_t << " </div>";
}
- endSectionContent(t);
+ endSectionContent(m_t);
m_sectionCount++;
}
void HtmlGenerator::startMemberList()
{
- DBG_HTML(t << "<!-- startMemberList -->" << endl)
+ DBG_HTML(m_t << "<!-- startMemberList -->\n")
}
void HtmlGenerator::endMemberList()
{
- DBG_HTML(t << "<!-- endMemberList -->" << endl)
+ DBG_HTML(m_t << "<!-- endMemberList -->\n")
}
// anonymous type:
// 0 = single column right aligned
// 1 = double column left aligned
// 2 = single column left aligned
-void HtmlGenerator::startMemberItem(const char *anchor,int annoType,const char *inheritId)
+void HtmlGenerator::startMemberItem(const QCString &anchor,int annoType,const QCString &inheritId)
{
- DBG_HTML(t << "<!-- startMemberItem() -->" << endl)
+ DBG_HTML(m_t << "<!-- startMemberItem() -->\n")
if (m_emptySection)
{
- t << "<table class=\"memberdecls\">" << endl;
+ m_t << "<table class=\"memberdecls\">\n";
m_emptySection=FALSE;
}
- t << "<tr class=\"memitem:" << anchor;
- if (inheritId)
+ m_t << "<tr class=\"memitem:" << anchor;
+ if (!inheritId.isEmpty())
{
- t << " inherit " << inheritId;
+ m_t << " inherit " << inheritId;
}
- t << "\">";
+ m_t << "\">";
insertMemberAlignLeft(annoType, true);
}
void HtmlGenerator::endMemberItem()
{
- t << "</td></tr>";
- t << endl;
+ m_t << "</td></tr>\n";
}
void HtmlGenerator::startMemberTemplateParams()
{
}
-void HtmlGenerator::endMemberTemplateParams(const char *anchor,const char *inheritId)
+void HtmlGenerator::endMemberTemplateParams(const QCString &anchor,const QCString &inheritId)
{
- t << "</td></tr>" << endl;
- t << "<tr class=\"memitem:" << anchor;
- if (inheritId)
+ m_t << "</td></tr>\n";
+ m_t << "<tr class=\"memitem:" << anchor;
+ if (!inheritId.isEmpty())
{
- t << " inherit " << inheritId;
+ m_t << " inherit " << inheritId;
}
- t << "\"><td class=\"memTemplItemLeft\" align=\"right\" valign=\"top\">";
+ m_t << "\"><td class=\"memTemplItemLeft\" align=\"right\" valign=\"top\">";
+}
+
+void HtmlGenerator::startCompoundTemplateParams()
+{
+ m_t << "<div class=\"compoundTemplParams\">";
}
+void HtmlGenerator::endCompoundTemplateParams()
+{
+ m_t << "</div>";
+}
void HtmlGenerator::insertMemberAlign(bool templ)
{
- DBG_HTML(t << "<!-- insertMemberAlign -->" << endl)
+ DBG_HTML(m_t << "<!-- insertMemberAlign -->\n")
QCString className = templ ? "memTemplItemRight" : "memItemRight";
- t << "&#160;</td><td class=\"" << className << "\" valign=\"bottom\">";
+ m_t << "&#160;</td><td class=\"" << className << "\" valign=\"bottom\">";
}
void HtmlGenerator::insertMemberAlignLeft(int annoType, bool initTag)
{
- if (!initTag) t << "&#160;</td>";
+ if (!initTag) m_t << "&#160;</td>";
switch(annoType)
{
- case 0: t << "<td class=\"memItemLeft\" align=\"right\" valign=\"top\">"; break;
- case 1: t << "<td class=\"memItemLeft\" >"; break;
- case 2: t << "<td class=\"memItemLeft\" valign=\"top\">"; break;
- default: t << "<td class=\"memTemplParams\" colspan=\"2\">"; break;
+ case 0: m_t << "<td class=\"memItemLeft\" align=\"right\" valign=\"top\">"; break;
+ case 1: m_t << "<td class=\"memItemLeft\" >"; break;
+ case 2: m_t << "<td class=\"memItemLeft\" valign=\"top\">"; break;
+ default: m_t << "<td class=\"memTemplParams\" colspan=\"2\">"; break;
}
}
-void HtmlGenerator::startMemberDescription(const char *anchor,const char *inheritId, bool typ)
+void HtmlGenerator::startMemberDescription(const QCString &anchor,const QCString &inheritId, bool typ)
{
- DBG_HTML(t << "<!-- startMemberDescription -->" << endl)
- if (m_emptySection)
- {
- t << "<table class=\"memberdecls\">" << endl;
- m_emptySection=FALSE;
- }
- t << "<tr class=\"memdesc:" << anchor;
- if (inheritId)
+ DBG_HTML(m_t << "<!-- startMemberDescription -->\n")
+ if (m_emptySection)
{
- t << " inherit " << inheritId;
+ m_t << "<table class=\"memberdecls\">\n";
+ m_emptySection=FALSE;
}
- t << "\">";
- t << "<td class=\"mdescLeft\">&#160;</td>";
- if (typ) t << "<td class=\"mdescLeft\">&#160;</td>";
- t << "<td class=\"mdescRight\">";;
+ m_t << "<tr class=\"memdesc:" << anchor;
+ if (!inheritId.isEmpty())
+ {
+ m_t << " inherit " << inheritId;
+ }
+ m_t << "\">";
+ m_t << "<td class=\"mdescLeft\">&#160;</td>";
+ if (typ) m_t << "<td class=\"mdescLeft\">&#160;</td>";
+ m_t << "<td class=\"mdescRight\">";;
}
void HtmlGenerator::endMemberDescription()
{
- DBG_HTML(t << "<!-- endMemberDescription -->" << endl)
- t << "<br /></td></tr>" << endl;
+ DBG_HTML(m_t << "<!-- endMemberDescription -->\n")
+ m_t << "<br /></td></tr>\n";
}
void HtmlGenerator::startMemberSections()
{
- DBG_HTML(t << "<!-- startMemberSections -->" << endl)
+ DBG_HTML(m_t << "<!-- startMemberSections -->\n")
m_emptySection=TRUE; // we postpone writing <table> until we actually
// write a row to prevent empty tables, which
// are not valid XHTML!
@@ -1706,365 +1693,362 @@ void HtmlGenerator::startMemberSections()
void HtmlGenerator::endMemberSections()
{
- DBG_HTML(t << "<!-- endMemberSections -->" << endl)
+ DBG_HTML(m_t << "<!-- endMemberSections -->\n")
if (!m_emptySection)
{
- t << "</table>" << endl;
+ m_t << "</table>\n";
}
}
-void HtmlGenerator::startMemberHeader(const char *anchor, int typ)
+void HtmlGenerator::startMemberHeader(const QCString &anchor, int typ)
{
- DBG_HTML(t << "<!-- startMemberHeader -->" << endl)
+ DBG_HTML(m_t << "<!-- startMemberHeader -->\n")
if (!m_emptySection)
{
- t << "</table>";
+ m_t << "</table>";
m_emptySection=TRUE;
}
if (m_emptySection)
{
- t << "<table class=\"memberdecls\">" << endl;
+ m_t << "<table class=\"memberdecls\">\n";
m_emptySection=FALSE;
}
- t << "<tr class=\"heading\"><td colspan=\"" << typ << "\"><h2 class=\"groupheader\">";
- if (anchor)
+ m_t << "<tr class=\"heading\"><td colspan=\"" << typ << "\"><h2 class=\"groupheader\">";
+ if (!anchor.isEmpty())
{
- t << "<a name=\"" << anchor << "\"></a>" << endl;
+ m_t << "<a name=\"" << anchor << "\"></a>\n";
}
}
void HtmlGenerator::endMemberHeader()
{
- DBG_HTML(t << "<!-- endMemberHeader -->" << endl)
- t << "</h2></td></tr>" << endl;
+ DBG_HTML(m_t << "<!-- endMemberHeader -->\n")
+ m_t << "</h2></td></tr>\n";
}
void HtmlGenerator::startMemberSubtitle()
{
- DBG_HTML(t << "<!-- startMemberSubtitle -->" << endl)
- t << "<tr><td class=\"ititle\" colspan=\"2\">";
+ DBG_HTML(m_t << "<!-- startMemberSubtitle -->\n")
+ m_t << "<tr><td class=\"ititle\" colspan=\"2\">";
}
void HtmlGenerator::endMemberSubtitle()
{
- DBG_HTML(t << "<!-- endMemberSubtitle -->" << endl)
- t << "</td></tr>" << endl;
+ DBG_HTML(m_t << "<!-- endMemberSubtitle -->\n")
+ m_t << "</td></tr>\n";
}
void HtmlGenerator::startIndexList()
{
- t << "<table>" << endl;
+ m_t << "<table>\n";
}
void HtmlGenerator::endIndexList()
{
- t << "</table>" << endl;
+ m_t << "</table>\n";
}
void HtmlGenerator::startIndexKey()
{
// inserted 'class = ...', 02 jan 2002, jh
- t << " <tr><td class=\"indexkey\">";
+ m_t << " <tr><td class=\"indexkey\">";
}
void HtmlGenerator::endIndexKey()
{
- t << "</td>";
+ m_t << "</td>";
}
void HtmlGenerator::startIndexValue(bool)
{
// inserted 'class = ...', 02 jan 2002, jh
- t << "<td class=\"indexvalue\">";
+ m_t << "<td class=\"indexvalue\">";
}
-void HtmlGenerator::endIndexValue(const char *,bool)
+void HtmlGenerator::endIndexValue(const QCString &,bool)
{
- t << "</td></tr>" << endl;
+ m_t << "</td></tr>\n";
}
void HtmlGenerator::startMemberDocList()
{
- DBG_HTML(t << "<!-- startMemberDocList -->" << endl;)
+ DBG_HTML(m_t << "<!-- startMemberDocList -->\n";)
}
void HtmlGenerator::endMemberDocList()
{
- DBG_HTML(t << "<!-- endMemberDocList -->" << endl;)
+ DBG_HTML(m_t << "<!-- endMemberDocList -->\n";)
}
-void HtmlGenerator::startMemberDoc( const char *clName, const char *memName,
- const char *anchor, const char *title,
+void HtmlGenerator::startMemberDoc( const QCString &clName, const QCString &memName,
+ const QCString &anchor, const QCString &title,
int memCount, int memTotal, bool showInline)
{
- DBG_HTML(t << "<!-- startMemberDoc -->" << endl;)
- t << "\n<h2 class=\"memtitle\">"
- << "<span class=\"permalink\"><a href=\"#" << anchor << "\">&#9670;&nbsp;</a></span>";
+ DBG_HTML(m_t << "<!-- startMemberDoc -->\n";)
+ m_t << "\n<h2 class=\"memtitle\">"
+ << "<span class=\"permalink\"><a href=\"#" << anchor << "\">&#9670;&nbsp;</a></span>";
docify(title);
if (memTotal>1)
{
- t << " <span class=\"overload\">[" << memCount << "/" << memTotal <<"]</span>";
+ m_t << " <span class=\"overload\">[" << memCount << "/" << memTotal <<"]</span>";
}
- t << "</h2>"
- << endl;
- t << "\n<div class=\"memitem\">" << endl;
- t << "<div class=\"memproto\">" << endl;
+ m_t << "</h2>\n";
+ m_t << "\n<div class=\"memitem\">\n";
+ m_t << "<div class=\"memproto\">\n";
}
void HtmlGenerator::startMemberDocPrefixItem()
{
- DBG_HTML(t << "<!-- startMemberDocPrefixItem -->" << endl;)
- t << "<div class=\"memtemplate\">" << endl;
+ DBG_HTML(m_t << "<!-- startMemberDocPrefixItem -->\n";)
+ m_t << "<div class=\"memtemplate\">\n";
}
void HtmlGenerator::endMemberDocPrefixItem()
{
- DBG_HTML(t << "<!-- endMemberDocPrefixItem -->" << endl;)
- t << "</div>" << endl;
+ DBG_HTML(m_t << "<!-- endMemberDocPrefixItem -->\n";)
+ m_t << "</div>\n";
}
void HtmlGenerator::startMemberDocName(bool /*align*/)
{
- DBG_HTML(t << "<!-- startMemberDocName -->" << endl;)
+ DBG_HTML(m_t << "<!-- startMemberDocName -->\n";)
- t << " <table class=\"memname\">" << endl;
+ m_t << " <table class=\"memname\">\n";
- t << " <tr>" << endl;
- t << " <td class=\"memname\">";
+ m_t << " <tr>\n";
+ m_t << " <td class=\"memname\">";
}
void HtmlGenerator::endMemberDocName()
{
- DBG_HTML(t << "<!-- endMemberDocName -->" << endl;)
- t << "</td>" << endl;
+ DBG_HTML(m_t << "<!-- endMemberDocName -->\n";)
+ m_t << "</td>\n";
}
void HtmlGenerator::startParameterList(bool openBracket)
{
- DBG_HTML(t << "<!-- startParameterList -->" << endl;)
- t << " <td>";
- if (openBracket) t << "(";
- t << "</td>" << endl;
+ DBG_HTML(m_t << "<!-- startParameterList -->\n";)
+ m_t << " <td>";
+ if (openBracket) m_t << "(";
+ m_t << "</td>\n";
}
-void HtmlGenerator::startParameterType(bool first,const char *key)
+void HtmlGenerator::startParameterType(bool first,const QCString &key)
{
if (first)
{
- DBG_HTML(t << "<!-- startFirstParameterType -->" << endl;)
- t << " <td class=\"paramtype\">";
+ DBG_HTML(m_t << "<!-- startFirstParameterType -->\n";)
+ m_t << " <td class=\"paramtype\">";
}
else
{
- DBG_HTML(t << "<!-- startParameterType -->" << endl;)
- t << " <tr>" << endl;
- t << " <td class=\"paramkey\">";
- if (key) t << key;
- t << "</td>" << endl;
- t << " <td></td>" << endl;
- t << " <td class=\"paramtype\">";
+ DBG_HTML(m_t << "<!-- startParameterType -->\n";)
+ m_t << " <tr>\n";
+ m_t << " <td class=\"paramkey\">" << key << "</td>\n";
+ m_t << " <td></td>\n";
+ m_t << " <td class=\"paramtype\">";
}
}
void HtmlGenerator::endParameterType()
{
- DBG_HTML(t << "<!-- endParameterType -->" << endl;)
- t << "&#160;</td>" << endl;
+ DBG_HTML(m_t << "<!-- endParameterType -->\n";)
+ m_t << "&#160;</td>\n";
}
void HtmlGenerator::startParameterName(bool /*oneArgOnly*/)
{
- DBG_HTML(t << "<!-- startParameterName -->" << endl;)
- t << " <td class=\"paramname\">";
+ DBG_HTML(m_t << "<!-- startParameterName -->\n";)
+ m_t << " <td class=\"paramname\">";
}
void HtmlGenerator::endParameterName(bool last,bool emptyList,bool closeBracket)
{
- DBG_HTML(t << "<!-- endParameterName -->" << endl;)
+ DBG_HTML(m_t << "<!-- endParameterName -->\n";)
if (last)
{
if (emptyList)
{
- if (closeBracket) t << "</td><td>)";
- t << "</td>" << endl;
- t << " <td>";
+ if (closeBracket) m_t << "</td><td>)";
+ m_t << "</td>\n";
+ m_t << " <td>";
}
else
{
- t << "&#160;</td>" << endl;
- t << " </tr>" << endl;
- t << " <tr>" << endl;
- t << " <td></td>" << endl;
- t << " <td>";
- if (closeBracket) t << ")";
- t << "</td>" << endl;
- t << " <td></td><td>";
+ m_t << "&#160;</td>\n";
+ m_t << " </tr>\n";
+ m_t << " <tr>\n";
+ m_t << " <td></td>\n";
+ m_t << " <td>";
+ if (closeBracket) m_t << ")";
+ m_t << "</td>\n";
+ m_t << " <td></td><td>";
}
}
else
{
- t << "</td>" << endl;
- t << " </tr>" << endl;
+ m_t << "</td>\n";
+ m_t << " </tr>\n";
}
}
void HtmlGenerator::endParameterList()
{
- DBG_HTML(t << "<!-- endParameterList -->" << endl;)
- t << "</td>" << endl;
- t << " </tr>" << endl;
+ DBG_HTML(m_t << "<!-- endParameterList -->\n";)
+ m_t << "</td>\n";
+ m_t << " </tr>\n";
}
-void HtmlGenerator::exceptionEntry(const char* prefix,bool closeBracket)
+void HtmlGenerator::exceptionEntry(const QCString &prefix,bool closeBracket)
{
- DBG_HTML(t << "<!-- exceptionEntry -->" << endl;)
- t << "</td>" << endl;
- t << " </tr>" << endl;
- t << " <tr>" << endl;
- t << " <td align=\"right\">";
+ DBG_HTML(m_t << "<!-- exceptionEntry -->\n";)
+ m_t << "</td>\n";
+ m_t << " </tr>\n";
+ m_t << " <tr>\n";
+ m_t << " <td align=\"right\">";
// colspan 2 so it gets both parameter type and parameter name columns
- if (prefix)
- t << prefix << "</td><td>(</td><td colspan=\"2\">";
+ if (!prefix.isEmpty())
+ m_t << prefix << "</td><td>(</td><td colspan=\"2\">";
else if (closeBracket)
- t << "</td><td>)</td><td></td><td>";
+ m_t << "</td><td>)</td><td></td><td>";
else
- t << "</td><td></td><td colspan=\"2\">";
+ m_t << "</td><td></td><td colspan=\"2\">";
}
void HtmlGenerator::endMemberDoc(bool hasArgs)
{
- DBG_HTML(t << "<!-- endMemberDoc -->" << endl;)
+ DBG_HTML(m_t << "<!-- endMemberDoc -->\n";)
if (!hasArgs)
{
- t << " </tr>" << endl;
+ m_t << " </tr>\n";
}
- t << " </table>" << endl;
- // t << "</div>" << endl;
+ m_t << " </table>\n";
+ // m_t << "</div>\n";
}
void HtmlGenerator::startDotGraph()
{
- startSectionHeader(t,m_relPath,m_sectionCount);
+ startSectionHeader(m_t,m_relPath,m_sectionCount);
}
void HtmlGenerator::endDotGraph(DotClassGraph &g)
{
bool generateLegend = Config_getBool(GENERATE_LEGEND);
bool umlLook = Config_getBool(UML_LOOK);
- endSectionHeader(t);
- startSectionSummary(t,m_sectionCount);
- endSectionSummary(t);
- startSectionContent(t,m_sectionCount);
+ endSectionHeader(m_t);
+ startSectionSummary(m_t,m_sectionCount);
+ endSectionSummary(m_t);
+ startSectionContent(m_t,m_sectionCount);
- g.writeGraph(t,GOF_BITMAP,EOF_Html,dir(),fileName(),m_relPath,TRUE,TRUE,m_sectionCount);
+ g.writeGraph(m_t,GOF_BITMAP,EOF_Html,dir(),fileName(),m_relPath,TRUE,TRUE,m_sectionCount);
if (generateLegend && !umlLook)
{
- t << "<center><span class=\"legend\">[";
- startHtmlLink(m_relPath+"graph_legend"+Doxygen::htmlFileExtension);
- t << theTranslator->trLegend();
+ m_t << "<center><span class=\"legend\">[";
+ startHtmlLink((m_relPath+"graph_legend"+Doxygen::htmlFileExtension));
+ m_t << theTranslator->trLegend();
endHtmlLink();
- t << "]</span></center>";
+ m_t << "]</span></center>";
}
- endSectionContent(t);
+ endSectionContent(m_t);
m_sectionCount++;
}
void HtmlGenerator::startInclDepGraph()
{
- startSectionHeader(t,m_relPath,m_sectionCount);
+ startSectionHeader(m_t,m_relPath,m_sectionCount);
}
void HtmlGenerator::endInclDepGraph(DotInclDepGraph &g)
{
- endSectionHeader(t);
- startSectionSummary(t,m_sectionCount);
- endSectionSummary(t);
- startSectionContent(t,m_sectionCount);
+ endSectionHeader(m_t);
+ startSectionSummary(m_t,m_sectionCount);
+ endSectionSummary(m_t);
+ startSectionContent(m_t,m_sectionCount);
- g.writeGraph(t,GOF_BITMAP,EOF_Html,dir(),fileName(),m_relPath,TRUE,m_sectionCount);
+ g.writeGraph(m_t,GOF_BITMAP,EOF_Html,dir(),fileName(),m_relPath,TRUE,m_sectionCount);
- endSectionContent(t);
+ endSectionContent(m_t);
m_sectionCount++;
}
void HtmlGenerator::startGroupCollaboration()
{
- startSectionHeader(t,m_relPath,m_sectionCount);
+ startSectionHeader(m_t,m_relPath,m_sectionCount);
}
void HtmlGenerator::endGroupCollaboration(DotGroupCollaboration &g)
{
- endSectionHeader(t);
- startSectionSummary(t,m_sectionCount);
- endSectionSummary(t);
- startSectionContent(t,m_sectionCount);
+ endSectionHeader(m_t);
+ startSectionSummary(m_t,m_sectionCount);
+ endSectionSummary(m_t);
+ startSectionContent(m_t,m_sectionCount);
- g.writeGraph(t,GOF_BITMAP,EOF_Html,dir(),fileName(),m_relPath,TRUE,m_sectionCount);
+ g.writeGraph(m_t,GOF_BITMAP,EOF_Html,dir(),fileName(),m_relPath,TRUE,m_sectionCount);
- endSectionContent(t);
+ endSectionContent(m_t);
m_sectionCount++;
}
void HtmlGenerator::startCallGraph()
{
- startSectionHeader(t,m_relPath,m_sectionCount);
+ startSectionHeader(m_t,m_relPath,m_sectionCount);
}
void HtmlGenerator::endCallGraph(DotCallGraph &g)
{
- endSectionHeader(t);
- startSectionSummary(t,m_sectionCount);
- endSectionSummary(t);
- startSectionContent(t,m_sectionCount);
+ endSectionHeader(m_t);
+ startSectionSummary(m_t,m_sectionCount);
+ endSectionSummary(m_t);
+ startSectionContent(m_t,m_sectionCount);
- g.writeGraph(t,GOF_BITMAP,EOF_Html,dir(),fileName(),m_relPath,TRUE,m_sectionCount);
+ g.writeGraph(m_t,GOF_BITMAP,EOF_Html,dir(),fileName(),m_relPath,TRUE,m_sectionCount);
- endSectionContent(t);
+ endSectionContent(m_t);
m_sectionCount++;
}
void HtmlGenerator::startDirDepGraph()
{
- startSectionHeader(t,m_relPath,m_sectionCount);
+ startSectionHeader(m_t,m_relPath,m_sectionCount);
}
void HtmlGenerator::endDirDepGraph(DotDirDeps &g)
{
- endSectionHeader(t);
- startSectionSummary(t,m_sectionCount);
- endSectionSummary(t);
- startSectionContent(t,m_sectionCount);
+ endSectionHeader(m_t);
+ startSectionSummary(m_t,m_sectionCount);
+ endSectionSummary(m_t);
+ startSectionContent(m_t,m_sectionCount);
- g.writeGraph(t,GOF_BITMAP,EOF_Html,dir(),fileName(),m_relPath,TRUE,m_sectionCount);
+ g.writeGraph(m_t,GOF_BITMAP,EOF_Html,dir(),fileName(),m_relPath,TRUE,m_sectionCount);
- endSectionContent(t);
+ endSectionContent(m_t);
m_sectionCount++;
}
void HtmlGenerator::writeGraphicalHierarchy(DotGfxHierarchyTable &g)
{
- g.writeGraph(t,dir(),fileName());
+ g.writeGraph(m_t,dir(),fileName());
}
void HtmlGenerator::startMemberGroupHeader(bool)
{
- t << "<tr><td colspan=\"2\"><div class=\"groupHeader\">";
+ m_t << "<tr><td colspan=\"2\"><div class=\"groupHeader\">";
}
void HtmlGenerator::endMemberGroupHeader()
{
- t << "</div></td></tr>" << endl;
+ m_t << "</div></td></tr>\n";
}
void HtmlGenerator::startMemberGroupDocs()
{
- t << "<tr><td colspan=\"2\"><div class=\"groupText\">";
+ m_t << "<tr><td colspan=\"2\"><div class=\"groupText\">";
}
void HtmlGenerator::endMemberGroupDocs()
{
- t << "</div></td></tr>" << endl;
+ m_t << "</div></td></tr>\n";
}
void HtmlGenerator::startMemberGroup()
@@ -2077,18 +2061,18 @@ void HtmlGenerator::endMemberGroup(bool)
void HtmlGenerator::startIndent()
{
- DBG_HTML(t << "<!-- startIndent -->" << endl;)
+ DBG_HTML(m_t << "<!-- startIndent -->\n";)
- t << "<div class=\"memdoc\">\n";
+ m_t << "<div class=\"memdoc\">\n";
}
void HtmlGenerator::endIndent()
{
- DBG_HTML(t << "<!-- endIndent -->" << endl;)
- t << endl << "</div>" << endl << "</div>" << endl;
+ DBG_HTML(m_t << "<!-- endIndent -->\n";)
+ m_t << "\n</div>\n" << "</div>\n";
}
-void HtmlGenerator::addIndexItem(const char *,const char *)
+void HtmlGenerator::addIndexItem(const QCString &,const QCString &)
{
}
@@ -2097,86 +2081,86 @@ void HtmlGenerator::writeNonBreakableSpace(int n)
int i;
for (i=0;i<n;i++)
{
- t << "&#160;";
+ m_t << "&#160;";
}
}
-void HtmlGenerator::startDescTable(const char *title)
+void HtmlGenerator::startDescTable(const QCString &title)
{
- t << "<table class=\"fieldtable\">" << endl
- << "<tr><th colspan=\"2\">" << title << "</th></tr>";
+ m_t << "<table class=\"fieldtable\">\n"
+ << "<tr><th colspan=\"2\">" << title << "</th></tr>";
}
void HtmlGenerator::endDescTable()
{
- t << "</table>" << endl;
+ m_t << "</table>\n";
}
void HtmlGenerator::startDescTableRow()
{
- t << "<tr>";
+ m_t << "<tr>";
}
void HtmlGenerator::endDescTableRow()
{
- t << "</tr>" << endl;
+ m_t << "</tr>\n";
}
void HtmlGenerator::startDescTableTitle()
{
- t << "<td class=\"fieldname\">";
+ m_t << "<td class=\"fieldname\">";
}
void HtmlGenerator::endDescTableTitle()
{
- t << "&#160;</td>";
+ m_t << "&#160;</td>";
}
void HtmlGenerator::startDescTableData()
{
- t << "<td class=\"fielddoc\">";
+ m_t << "<td class=\"fielddoc\">";
}
void HtmlGenerator::endDescTableData()
{
- t << "</td>";
+ m_t << "</td>";
}
void HtmlGenerator::startExamples()
{
- t << "<dl class=\"section examples\"><dt>";
+ m_t << "<dl class=\"section examples\"><dt>";
docify(theTranslator->trExamples());
- t << "</dt>";
+ m_t << "</dt>";
}
void HtmlGenerator::endExamples()
{
- t << "</dl>" << endl;
+ m_t << "</dl>\n";
}
void HtmlGenerator::startParamList(ParamListTypes,
- const char *title)
+ const QCString &title)
{
- t << "<dl><dt><b>";
+ m_t << "<dl><dt><b>";
docify(title);
- t << "</b></dt>";
+ m_t << "</b></dt>";
}
void HtmlGenerator::endParamList()
{
- t << "</dl>";
+ m_t << "</dl>";
}
void HtmlGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *,int id)
{
m_codeGen.setId(id);
- HtmlDocVisitor *visitor = new HtmlDocVisitor(t,m_codeGen,ctx);
+ HtmlDocVisitor *visitor = new HtmlDocVisitor(m_t,m_codeGen,ctx);
n->accept(visitor);
delete visitor;
}
//---------------- helpers for index generation -----------------------------
-static void startQuickIndexList(FTextStream &t,bool compact,bool topLevel=TRUE)
+static void startQuickIndexList(TextStream &t,bool compact,bool topLevel=TRUE)
{
if (compact)
{
@@ -2196,7 +2180,7 @@ static void startQuickIndexList(FTextStream &t,bool compact,bool topLevel=TRUE)
}
}
-static void endQuickIndexList(FTextStream &t,bool compact)
+static void endQuickIndexList(TextStream &t,bool compact)
{
if (compact)
{
@@ -2209,7 +2193,7 @@ static void endQuickIndexList(FTextStream &t,bool compact)
}
}
-static void startQuickIndexItem(FTextStream &t,const char *l,
+static void startQuickIndexItem(TextStream &t,const QCString &l,
bool hl,bool /*compact*/,
const QCString &relPath)
{
@@ -2219,14 +2203,14 @@ static void startQuickIndexItem(FTextStream &t,const char *l,
t << " class=\"current\"";
}
t << ">";
- if (l) t << "<a href=\"" << correctURL(l,relPath) << "\">";
+ if (!l.isEmpty()) t << "<a href=\"" << correctURL(l,relPath) << "\">";
t << "<span>";
}
-static void endQuickIndexItem(FTextStream &t,const char *l)
+static void endQuickIndexItem(TextStream &t,const QCString &l)
{
t << "</span>";
- if (l) t << "</a>";
+ if (!l.isEmpty()) t << "</a>";
t << "</li>\n";
}
@@ -2244,6 +2228,7 @@ static bool quickLinkVisible(LayoutNavEntry::Kind kind)
case LayoutNavEntry::Namespaces: return documentedNamespaces>0 && showNamespaces;
case LayoutNavEntry::NamespaceList: return documentedNamespaces>0 && showNamespaces;
case LayoutNavEntry::NamespaceMembers: return documentedNamespaceMembers[NMHL_All]>0;
+ case LayoutNavEntry::Concepts: return documentedConcepts>0;
case LayoutNavEntry::Classes: return annotatedClasses>0;
case LayoutNavEntry::ClassList: return annotatedClasses>0;
case LayoutNavEntry::ClassIndex: return annotatedClasses>0;
@@ -2271,7 +2256,7 @@ static bool quickLinkVisible(LayoutNavEntry::Kind kind)
return FALSE;
}
-static void renderQuickLinksAsTree(FTextStream &t,const QCString &relPath,LayoutNavEntry *root)
+static void renderQuickLinksAsTree(TextStream &t,const QCString &relPath,LayoutNavEntry *root)
{
int count=0;
@@ -2300,7 +2285,7 @@ static void renderQuickLinksAsTree(FTextStream &t,const QCString &relPath,Layout
}
-static void renderQuickLinksAsTabs(FTextStream &t,const QCString &relPath,
+static void renderQuickLinksAsTabs(TextStream &t,const QCString &relPath,
LayoutNavEntry *hlEntry,LayoutNavEntry::Kind kind,
bool highlightParent,bool highlightSearch)
{
@@ -2369,9 +2354,9 @@ static void renderQuickLinksAsTabs(FTextStream &t,const QCString &relPath,
}
}
-static void writeDefaultQuickLinks(FTextStream &t,bool compact,
+static void writeDefaultQuickLinks(TextStream &t,bool compact,
HighlightedItem hli,
- const char *file,
+ const QCString &file,
const QCString &relPath)
{
bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
@@ -2391,6 +2376,7 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact,
case HLI_InterfaceHierarchy: kind = LayoutNavEntry::InterfaceHierarchy; break;
case HLI_ExceptionHierarchy: kind = LayoutNavEntry::ExceptionHierarchy; break;
case HLI_Classes: kind = LayoutNavEntry::ClassIndex; altKind = LayoutNavEntry::Classes; break;
+ case HLI_Concepts: kind = LayoutNavEntry::Concepts; break;
case HLI_Interfaces: kind = LayoutNavEntry::InterfaceIndex; altKind = LayoutNavEntry::Interfaces; break;
case HLI_Structs: kind = LayoutNavEntry::StructIndex; altKind = LayoutNavEntry::Structs; break;
case HLI_Exceptions: kind = LayoutNavEntry::ExceptionIndex; altKind = LayoutNavEntry::Exceptions; break;
@@ -2407,6 +2393,8 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact,
case HLI_UserGroup: kind = LayoutNavEntry::UserGroup; break;
case HLI_ClassVisible: kind = LayoutNavEntry::ClassList; altKind = LayoutNavEntry::Classes;
highlightParent = TRUE; break;
+ case HLI_ConceptVisible: kind = LayoutNavEntry::Concepts;
+ highlightParent = TRUE; break;
case HLI_InterfaceVisible: kind = LayoutNavEntry::InterfaceList; altKind = LayoutNavEntry::Interfaces;
highlightParent = TRUE; break;
case HLI_StructVisible: kind = LayoutNavEntry::StructList; altKind = LayoutNavEntry::Structs;
@@ -2432,16 +2420,16 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact,
{
searchPage = "search.php";
}
- t << "<script type=\"text/javascript\" src=\"" << relPath << "menudata.js\"></script>" << endl;
- t << "<script type=\"text/javascript\" src=\"" << relPath << "menu.js\"></script>" << endl;
- t << "<script type=\"text/javascript\">" << endl;
+ t << "<script type=\"text/javascript\" src=\"" << relPath << "menudata.js\"></script>\n";
+ t << "<script type=\"text/javascript\" src=\"" << relPath << "menu.js\"></script>\n";
+ t << "<script type=\"text/javascript\">\n";
t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
- t << "$(function() {" << endl;
+ t << "$(function() {\n";
t << " initMenu('" << relPath << "',"
<< (searchEngine?"true":"false") << ","
<< (serverBasedSearch?"true":"false") << ",'"
<< searchPage << "','"
- << theTranslator->trSearch() << "');" << endl;
+ << theTranslator->trSearch() << "');\n";
if (Config_getBool(SEARCHENGINE))
{
if (!serverBasedSearch)
@@ -2456,15 +2444,15 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact,
<< " });\n";
}
}
- t << "});" << endl;
+ t << "});\n";
t << "/* @license-end */";
- t << "</script>" << endl;
- t << "<div id=\"main-nav\"></div>" << endl;
+ t << "</script>\n";
+ t << "<div id=\"main-nav\"></div>\n";
}
else if (compact) // && !Config_getBool(HTML_DYNAMIC_MENUS)
{
// find highlighted index item
- LayoutNavEntry *hlEntry = root->find(kind,kind==LayoutNavEntry::UserGroup ? file : 0);
+ LayoutNavEntry *hlEntry = root->find(kind,kind==LayoutNavEntry::UserGroup ? file : QCString());
if (!hlEntry && altKind!=(LayoutNavEntry::Kind)-1) { hlEntry=root->find(altKind); kind=altKind; }
if (!hlEntry) // highlighted item not found in the index! -> just show the level 1 index...
{
@@ -2493,10 +2481,10 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact,
void HtmlGenerator::endQuickIndices()
{
- t << "</div><!-- top -->" << endl;
+ m_t << "</div><!-- top -->\n";
}
-QCString HtmlGenerator::writeSplitBarAsString(const char *name,const char *relpath)
+QCString HtmlGenerator::writeSplitBarAsString(const QCString &name,const QCString &relpath)
{
bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
QCString result;
@@ -2504,62 +2492,62 @@ QCString HtmlGenerator::writeSplitBarAsString(const char *name,const char *relpa
if (generateTreeView)
{
result = QCString(
- "<div id=\"side-nav\" class=\"ui-resizable side-nav-resizable\">\n"
- " <div id=\"nav-tree\">\n"
- " <div id=\"nav-tree-contents\">\n"
- " <div id=\"nav-sync\" class=\"sync\"></div>\n"
- " </div>\n"
- " </div>\n"
- " <div id=\"splitbar\" style=\"-moz-user-select:none;\" \n"
- " class=\"ui-resizable-handle\">\n"
- " </div>\n"
- "</div>\n"
- "<script type=\"text/javascript\">\n"
- "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n"
- "$(document).ready(function(){initNavTree('") +
- QCString(addHtmlExtensionIfMissing(name)) +
- QCString("','") + relpath +
- QCString("'); initResizable(); });\n"
- "/* @license-end */\n"
- "</script>\n"
- "<div id=\"doc-content\">\n");
+ "<div id=\"side-nav\" class=\"ui-resizable side-nav-resizable\">\n"
+ " <div id=\"nav-tree\">\n"
+ " <div id=\"nav-tree-contents\">\n"
+ " <div id=\"nav-sync\" class=\"sync\"></div>\n"
+ " </div>\n"
+ " </div>\n"
+ " <div id=\"splitbar\" style=\"-moz-user-select:none;\" \n"
+ " class=\"ui-resizable-handle\">\n"
+ " </div>\n"
+ "</div>\n"
+ "<script type=\"text/javascript\">\n"
+ "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n"
+ "$(document).ready(function(){initNavTree('") +
+ QCString(addHtmlExtensionIfMissing(name)) +
+ QCString("','") + relpath +
+ QCString("'); initResizable(); });\n"
+ "/* @license-end */\n"
+ "</script>\n"
+ "<div id=\"doc-content\">\n");
}
return result;
}
-void HtmlGenerator::writeSplitBar(const char *name)
+void HtmlGenerator::writeSplitBar(const QCString &name)
{
- t << writeSplitBarAsString(name,m_relPath);
+ m_t << writeSplitBarAsString(name,m_relPath);
}
-void HtmlGenerator::writeNavigationPath(const char *s)
+void HtmlGenerator::writeNavigationPath(const QCString &s)
{
- t << substitute(s,"$relpath^",m_relPath);
+ m_t << substitute(s,"$relpath^",m_relPath);
}
void HtmlGenerator::startContents()
{
- t << "<div class=\"contents\">" << endl;
+ m_t << "<div class=\"contents\">\n";
}
void HtmlGenerator::endContents()
{
- t << "</div><!-- contents -->" << endl;
+ m_t << "</div><!-- contents -->\n";
}
-void HtmlGenerator::startPageDoc(const char *pageTitle)
+void HtmlGenerator::startPageDoc(const QCString &pageTitle)
{
- t << "<div>";
+ m_t << "<div>";
}
void HtmlGenerator::endPageDoc()
{
- t << "</div><!-- PageDoc -->" << endl;
+ m_t << "</div><!-- PageDoc -->\n";
}
-void HtmlGenerator::writeQuickLinks(bool compact,HighlightedItem hli,const char *file)
+void HtmlGenerator::writeQuickLinks(bool compact,HighlightedItem hli,const QCString &file)
{
- writeDefaultQuickLinks(t,compact,hli,file,m_relPath);
+ writeDefaultQuickLinks(m_t,compact,hli,file,m_relPath);
}
// PHP based search script
@@ -2572,10 +2560,10 @@ void HtmlGenerator::writeSearchPage()
// OPENSEARCH_PROVIDER {
QCString configFileName = htmlOutput+"/search_config.php";
- QFile cf(configFileName);
- if (cf.open(IO_WriteOnly))
+ std::ofstream f(configFileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (f.is_open())
{
- FTextStream t(&cf);
+ TextStream t(&f);
t << "<?php\n\n";
t << "$config = array(\n";
t << " 'PROJECT_NAME' => \"" << convertToHtml(projectName) << "\",\n";
@@ -2596,20 +2584,21 @@ void HtmlGenerator::writeSearchPage()
t << ");\n\n";
t << "?>\n";
}
+ f.close();
ResourceMgr::instance().copyResource("search_functions.php",htmlOutput);
ResourceMgr::instance().copyResource("search_opensearch.php",htmlOutput);
// OPENSEARCH_PROVIDER }
QCString fileName = htmlOutput+"/search.php";
- QFile f(fileName);
- if (f.open(IO_WriteOnly))
+ f.open(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (f.is_open())
{
- FTextStream t(&f);
+ TextStream t(&f);
t << substituteHtmlKeywords(g_header,"Search","");
t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen "
- << getDoxygenVersion() << " -->" << endl;
+ << getDoxygenVersion() << " -->\n";
t << "<script type=\"text/javascript\">\n";
t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
t << "var searchBox = new SearchBox(\"searchBox\", \""
@@ -2618,11 +2607,11 @@ void HtmlGenerator::writeSearchPage()
t << "</script>\n";
if (!Config_getBool(DISABLE_INDEX))
{
- writeDefaultQuickLinks(t,TRUE,HLI_Search,0,"");
+ writeDefaultQuickLinks(t,TRUE,HLI_Search,QCString(),QCString());
}
else
{
- t << "</div>" << endl;
+ t << "</div>\n";
}
t << "<?php\n";
@@ -2638,16 +2627,18 @@ void HtmlGenerator::writeSearchPage()
writePageFooter(t,"Search","","");
}
+ f.close();
+
QCString scriptName = htmlOutput+"/search/search.js";
- QFile sf(scriptName);
- if (sf.open(IO_WriteOnly))
+ f.open(scriptName.str(),std::ofstream::out | std::ofstream::binary);
+ if (f.is_open())
{
- FTextStream t(&sf);
+ TextStream t(&f);
t << ResourceMgr::instance().getAsString("extsearch.js");
}
else
{
- err("Failed to open file '%s' for writing...\n",scriptName.data());
+ err("Failed to open file '%s' for writing...\n",qPrint(scriptName));
}
}
@@ -2656,14 +2647,14 @@ void HtmlGenerator::writeExternalSearchPage()
bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
QCString dname = Config_getString(HTML_OUTPUT);
QCString fileName = dname+"/search"+Doxygen::htmlFileExtension;
- QFile f(fileName);
- if (f.open(IO_WriteOnly))
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (f.is_open())
{
- FTextStream t(&f);
+ TextStream t(&f);
t << substituteHtmlKeywords(g_header,"Search","");
t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen "
- << getDoxygenVersion() << " -->" << endl;
+ << getDoxygenVersion() << " -->\n";
t << "<script type=\"text/javascript\">\n";
t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
t << "var searchBox = new SearchBox(\"searchBox\", \""
@@ -2672,7 +2663,7 @@ void HtmlGenerator::writeExternalSearchPage()
t << "</script>\n";
if (!Config_getBool(DISABLE_INDEX))
{
- writeDefaultQuickLinks(t,TRUE,HLI_Search,0,"");
+ writeDefaultQuickLinks(t,TRUE,HLI_Search,QCString(),QCString());
t << " <input type=\"text\" id=\"MSearchField\" name=\"query\" value=\"\" size=\"20\" accesskey=\"S\" onfocus=\"searchBox.OnSearchFieldFocus(true)\" onblur=\"searchBox.OnSearchFieldFocus(false)\"/>\n";
t << " </form>\n";
t << " </div><div class=\"right\"></div>\n";
@@ -2684,38 +2675,40 @@ void HtmlGenerator::writeExternalSearchPage()
}
else
{
- t << "</div>" << endl;
+ t << "</div>\n";
}
t << writeSplitBarAsString("search","");
- t << "<div class=\"header\">" << endl;
- t << " <div class=\"headertitle\">" << endl;
- t << " <div class=\"title\">" << theTranslator->trSearchResultsTitle() << "</div>" << endl;
- t << " </div>" << endl;
- t << "</div>" << endl;
- t << "<div class=\"contents\">" << endl;
+ t << "<div class=\"header\">\n";
+ t << " <div class=\"headertitle\">\n";
+ t << " <div class=\"title\">" << theTranslator->trSearchResultsTitle() << "</div>\n";
+ t << " </div>\n";
+ t << "</div>\n";
+ t << "<div class=\"contents\">\n";
- t << "<div id=\"searchresults\"></div>" << endl;
- t << "</div>" << endl;
+ t << "<div id=\"searchresults\"></div>\n";
+ t << "</div>\n";
if (generateTreeView)
{
- t << "</div><!-- doc-content -->" << endl;
+ t << "</div><!-- doc-content -->\n";
}
writePageFooter(t,"Search","","");
}
+ f.close();
+
QCString scriptName = dname+"/search/search.js";
- QFile sf(scriptName);
- if (sf.open(IO_WriteOnly))
+ f.open(scriptName.str(),std::ofstream::out | std::ofstream::binary);
+ if (f.is_open())
{
- FTextStream t(&sf);
+ TextStream t(&f);
t << "var searchResultsText=["
<< "\"" << theTranslator->trSearchResults(0) << "\","
<< "\"" << theTranslator->trSearchResults(1) << "\","
- << "\"" << theTranslator->trSearchResults(2) << "\"];" << endl;
- t << "var serverUrl=\"" << Config_getString(SEARCHENGINE_URL) << "\";" << endl;
- t << "var tagMap = {" << endl;
+ << "\"" << theTranslator->trSearchResults(2) << "\"];\n";
+ t << "var serverUrl=\"" << Config_getString(SEARCHENGINE_URL) << "\";\n";
+ t << "var tagMap = {\n";
bool first=TRUE;
// add search mappings
const StringVector &extraSearchMappings = Config_getList(EXTRA_SEARCH_MAPPINGS);
@@ -2729,207 +2722,207 @@ void HtmlGenerator::writeExternalSearchPage()
QCString destName = mapLine.right(mapLine.length()-eqPos-1).stripWhiteSpace();
if (!tagName.isEmpty())
{
- if (!first) t << "," << endl;
+ if (!first) t << ",\n";
t << " \"" << tagName << "\": \"" << destName << "\"";
first=FALSE;
}
}
}
- if (!first) t << endl;
- t << "};" << endl << endl;
+ if (!first) t << "\n";
+ t << "};\n\n";
t << ResourceMgr::instance().getAsString("extsearch.js");
- t << endl;
- t << "$(document).ready(function() {" << endl;
- t << " var query = trim(getURLParameter('query'));" << endl;
- t << " if (query) {" << endl;
- t << " searchFor(query,0,20);" << endl;
- t << " } else {" << endl;
- t << " var results = $('#results');" << endl;
- t << " results.html('<p>" << theTranslator->trSearchResults(0) << "</p>');" << endl;
- t << " }" << endl;
- t << "});" << endl;
+ t << "\n";
+ t << "$(document).ready(function() {\n";
+ t << " var query = trim(getURLParameter('query'));\n";
+ t << " if (query) {\n";
+ t << " searchFor(query,0,20);\n";
+ t << " } else {\n";
+ t << " var results = $('#results');\n";
+ t << " results.html('<p>" << theTranslator->trSearchResults(0) << "</p>');\n";
+ t << " }\n";
+ t << "});\n";
}
else
{
- err("Failed to open file '%s' for writing...\n",scriptName.data());
+ err("Failed to open file '%s' for writing...\n",qPrint(scriptName));
}
}
-void HtmlGenerator::startConstraintList(const char *header)
+void HtmlGenerator::startConstraintList(const QCString &header)
{
- t << "<div class=\"typeconstraint\">" << endl;
- t << "<dl><dt><b>" << header << "</b></dt><dd>" << endl;
- t << "<table border=\"0\" cellspacing=\"2\" cellpadding=\"0\">" << endl;
+ m_t << "<div class=\"typeconstraint\">\n";
+ m_t << "<dl><dt><b>" << header << "</b></dt><dd>\n";
+ m_t << "<table border=\"0\" cellspacing=\"2\" cellpadding=\"0\">\n";
}
void HtmlGenerator::startConstraintParam()
{
- t << "<tr><td valign=\"top\"><em>";
+ m_t << "<tr><td valign=\"top\"><em>";
}
void HtmlGenerator::endConstraintParam()
{
- t << "</em></td>";
+ m_t << "</em></td>";
}
void HtmlGenerator::startConstraintType()
{
- t << "<td>&#160;:</td><td valign=\"top\"><em>";
+ m_t << "<td>&#160;:</td><td valign=\"top\"><em>";
}
void HtmlGenerator::endConstraintType()
{
- t << "</em></td>";
+ m_t << "</em></td>";
}
void HtmlGenerator::startConstraintDocs()
{
- t << "<td>&#160;";
+ m_t << "<td>&#160;";
}
void HtmlGenerator::endConstraintDocs()
{
- t << "</td></tr>" << endl;
+ m_t << "</td></tr>\n";
}
void HtmlGenerator::endConstraintList()
{
- t << "</table>" << endl;
- t << "</dd>" << endl;
- t << "</dl>" << endl;
- t << "</div>" << endl;
+ m_t << "</table>\n";
+ m_t << "</dd>\n";
+ m_t << "</dl>\n";
+ m_t << "</div>\n";
}
-void HtmlGenerator::lineBreak(const char *style)
+void HtmlGenerator::lineBreak(const QCString &style)
{
- if (style)
+ if (!style.isEmpty())
{
- t << "<br class=\"" << style << "\" />" << endl;
+ m_t << "<br class=\"" << style << "\" />\n";
}
else
{
- t << "<br />" << endl;
+ m_t << "<br />\n";
}
}
void HtmlGenerator::startHeaderSection()
{
- t << "<div class=\"header\">" << endl;
+ m_t << "<div class=\"header\">\n";
}
-void HtmlGenerator::startTitleHead(const char *)
+void HtmlGenerator::startTitleHead(const QCString &)
{
- t << " <div class=\"headertitle\">" << endl;
+ m_t << " <div class=\"headertitle\">\n";
startTitle();
}
-void HtmlGenerator::endTitleHead(const char *,const char *)
+void HtmlGenerator::endTitleHead(const QCString &,const QCString &)
{
endTitle();
- t << " </div>" << endl;
+ m_t << " </div>\n";
}
void HtmlGenerator::endHeaderSection()
{
- t << "</div><!--header-->" << endl;
+ m_t << "</div><!--header-->\n";
}
void HtmlGenerator::startInlineHeader()
{
if (m_emptySection)
{
- t << "<table class=\"memberdecls\">" << endl;
+ m_t << "<table class=\"memberdecls\">\n";
m_emptySection=FALSE;
}
- t << "<tr><td colspan=\"2\"><h3>";
+ m_t << "<tr><td colspan=\"2\"><h3>";
}
void HtmlGenerator::endInlineHeader()
{
- t << "</h3></td></tr>" << endl;
+ m_t << "</h3></td></tr>\n";
}
void HtmlGenerator::startMemberDocSimple(bool isEnum)
{
- DBG_HTML(t << "<!-- startMemberDocSimple -->" << endl;)
- t << "<table class=\"fieldtable\">" << endl;
- t << "<tr><th colspan=\"" << (isEnum?"2":"3") << "\">";
- t << (isEnum? theTranslator->trEnumerationValues() :
- theTranslator->trCompoundMembers()) << "</th></tr>" << endl;
+ DBG_HTML(m_t << "<!-- startMemberDocSimple -->\n";)
+ m_t << "<table class=\"fieldtable\">\n";
+ m_t << "<tr><th colspan=\"" << (isEnum?"2":"3") << "\">";
+ m_t << (isEnum? theTranslator->trEnumerationValues() :
+ theTranslator->trCompoundMembers()) << "</th></tr>\n";
}
void HtmlGenerator::endMemberDocSimple(bool)
{
- DBG_HTML(t << "<!-- endMemberDocSimple -->" << endl;)
- t << "</table>" << endl;
+ DBG_HTML(m_t << "<!-- endMemberDocSimple -->\n";)
+ m_t << "</table>\n";
}
void HtmlGenerator::startInlineMemberType()
{
- DBG_HTML(t << "<!-- startInlineMemberType -->" << endl;)
- t << "<tr><td class=\"fieldtype\">" << endl;
+ DBG_HTML(m_t << "<!-- startInlineMemberType -->\n";)
+ m_t << "<tr><td class=\"fieldtype\">\n";
}
void HtmlGenerator::endInlineMemberType()
{
- DBG_HTML(t << "<!-- endInlineMemberType -->" << endl;)
- t << "</td>" << endl;
+ DBG_HTML(m_t << "<!-- endInlineMemberType -->\n";)
+ m_t << "</td>\n";
}
void HtmlGenerator::startInlineMemberName()
{
- DBG_HTML(t << "<!-- startInlineMemberName -->" << endl;)
- t << "<td class=\"fieldname\">" << endl;
+ DBG_HTML(m_t << "<!-- startInlineMemberName -->\n";)
+ m_t << "<td class=\"fieldname\">\n";
}
void HtmlGenerator::endInlineMemberName()
{
- DBG_HTML(t << "<!-- endInlineMemberName -->" << endl;)
- t << "</td>" << endl;
+ DBG_HTML(m_t << "<!-- endInlineMemberName -->\n";)
+ m_t << "</td>\n";
}
void HtmlGenerator::startInlineMemberDoc()
{
- DBG_HTML(t << "<!-- startInlineMemberDoc -->" << endl;)
- t << "<td class=\"fielddoc\">" << endl;
+ DBG_HTML(m_t << "<!-- startInlineMemberDoc -->\n";)
+ m_t << "<td class=\"fielddoc\">\n";
}
void HtmlGenerator::endInlineMemberDoc()
{
- DBG_HTML(t << "<!-- endInlineMemberDoc -->" << endl;)
- t << "</td></tr>" << endl;
+ DBG_HTML(m_t << "<!-- endInlineMemberDoc -->\n";)
+ m_t << "</td></tr>\n";
}
void HtmlGenerator::startLabels()
{
- DBG_HTML(t << "<!-- startLabels -->" << endl;)
- t << "<span class=\"mlabels\">";
+ DBG_HTML(m_t << "<!-- startLabels -->\n";)
+ m_t << "<span class=\"mlabels\">";
}
-void HtmlGenerator::writeLabel(const char *l,bool /*isLast*/)
+void HtmlGenerator::writeLabel(const QCString &l,bool /*isLast*/)
{
- DBG_HTML(t << "<!-- writeLabel(" << l << ") -->" << endl;)
- //t << "<tt>[" << l << "]</tt>";
- //if (!isLast) t << ", ";
- t << "<span class=\"mlabel\">" << l << "</span>";
+ DBG_HTML(m_t << "<!-- writeLabel(" << l << ") -->\n";)
+ //m_t << "<tt>[" << l << "]</tt>";
+ //if (!isLast) m_t << ", ";
+ m_t << "<span class=\"mlabel\">" << l << "</span>";
}
void HtmlGenerator::endLabels()
{
- DBG_HTML(t << "<!-- endLabels -->" << endl;)
- t << "</span>";
+ DBG_HTML(m_t << "<!-- endLabels -->\n";)
+ m_t << "</span>";
}
void HtmlGenerator::writeInheritedSectionTitle(
- const char *id, const char *ref,
- const char *file, const char *anchor,
- const char *title, const char *name)
+ const QCString &id, const QCString &ref,
+ const QCString &file, const QCString &anchor,
+ const QCString &title, const QCString &name)
{
- DBG_HTML(t << "<!-- writeInheritedSectionTitle -->" << endl;)
+ DBG_HTML(m_t << "<!-- writeInheritedSectionTitle -->\n";)
QCString a = anchor;
if (!a.isEmpty()) a.prepend("#");
QCString classLink = QCString("<a class=\"el\" ");
- if (ref)
+ if (!ref.isEmpty())
{
classLink+= externalLinkTarget();
classLink += " href=\"";
@@ -2942,49 +2935,49 @@ void HtmlGenerator::writeInheritedSectionTitle(
}
classLink=classLink+addHtmlExtensionIfMissing(file)+a;
classLink+=QCString("\">")+convertToHtml(name,FALSE)+"</a>";
- t << "<tr class=\"inherit_header " << id << "\">"
+ m_t << "<tr class=\"inherit_header " << id << "\">"
<< "<td colspan=\"2\" onclick=\"javascript:toggleInherit('" << id << "')\">"
<< "<img src=\"" << m_relPath << "closed.png\" alt=\"-\"/>&#160;"
<< theTranslator->trInheritedFrom(convertToHtml(title,FALSE),classLink)
- << "</td></tr>" << endl;
+ << "</td></tr>\n";
}
-void HtmlGenerator::writeSummaryLink(const char *file,const char *anchor,const char *title,bool first)
+void HtmlGenerator::writeSummaryLink(const QCString &file,const QCString &anchor,const QCString &title,bool first)
{
if (first)
{
- t << " <div class=\"summary\">\n";
+ m_t << " <div class=\"summary\">\n";
}
else
{
- t << " &#124;\n";
+ m_t << " &#124;\n";
}
- t << "<a href=\"";
- if (file)
+ m_t << "<a href=\"";
+ if (!file.isEmpty())
{
- t << m_relPath << addHtmlExtensionIfMissing(file);
+ m_t << m_relPath << addHtmlExtensionIfMissing(file);
}
- else
+ else if (!anchor.isEmpty())
{
- t << "#";
- t << anchor;
+ m_t << "#";
+ m_t << anchor;
}
- t << "\">";
- t << title;
- t << "</a>";
+ m_t << "\">";
+ m_t << title;
+ m_t << "</a>";
}
-void HtmlGenerator::endMemberDeclaration(const char *anchor,const char *inheritId)
+void HtmlGenerator::endMemberDeclaration(const QCString &anchor,const QCString &inheritId)
{
- t << "<tr class=\"separator:" << anchor;
- if (inheritId)
+ m_t << "<tr class=\"separator:" << anchor;
+ if (!inheritId.isEmpty())
{
- t << " inherit " << inheritId;
+ m_t << " inherit " << inheritId;
}
- t << "\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n";
+ m_t << "\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n";
}
-void HtmlGenerator::setCurrentDoc(const Definition *context,const char *anchor,bool isSourceFile)
+void HtmlGenerator::setCurrentDoc(const Definition *context,const QCString &anchor,bool isSourceFile)
{
if (Doxygen::searchIndex)
{
@@ -2992,7 +2985,7 @@ void HtmlGenerator::setCurrentDoc(const Definition *context,const char *anchor,b
}
}
-void HtmlGenerator::addWord(const char *word,bool hiPriority)
+void HtmlGenerator::addWord(const QCString &word,bool hiPriority)
{
if (Doxygen::searchIndex)
{
diff --git a/src/htmlgen.h b/src/htmlgen.h
index 659a69e..845f259 100644
--- a/src/htmlgen.h
+++ b/src/htmlgen.h
@@ -17,49 +17,44 @@
#define HTMLGEN_H
#include "outputgen.h"
-#include "ftextstream.h"
-
-class QFile;
class HtmlCodeGenerator : public CodeOutputInterface
{
public:
- HtmlCodeGenerator(FTextStream &t,const QCString &relPath);
- HtmlCodeGenerator();
+ HtmlCodeGenerator(TextStream &t,const QCString &relPath);
+ HtmlCodeGenerator(TextStream &t);
int id() const { return m_id; }
void setId(int id) { m_id = id; }
- void setTextStream(FTextStream &t);
void setRelativePath(const QCString &path);
- void codify(const char *text);
- void writeCodeLink(const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip);
- void writeTooltip(const char *id,
+ void codify(const QCString &text);
+ void writeCodeLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip);
+ void writeTooltip(const QCString &id,
const DocLinkInfo &docInfo,
- const char *decl,
- const char *desc,
+ const QCString &decl,
+ const QCString &desc,
const SourceLinkInfo &defInfo,
const SourceLinkInfo &declInfo
);
- void writeLineNumber(const char *,const char *,const char *,int);
+ void writeLineNumber(const QCString &,const QCString &,const QCString &,int);
void startCodeLine(bool);
void endCodeLine();
- void startFontClass(const char *s);
+ void startFontClass(const QCString &s);
void endFontClass();
- void writeCodeAnchor(const char *anchor);
- void setCurrentDoc(const Definition *,const char *,bool) {}
- void addWord(const char *,bool) {}
- void startCodeFragment(const char *style);
- void endCodeFragment(const char *);
+ void writeCodeAnchor(const QCString &anchor);
+ void setCurrentDoc(const Definition *,const QCString &,bool) {}
+ void addWord(const QCString &,bool) {}
+ void startCodeFragment(const QCString &style);
+ void endCodeFragment(const QCString &);
private:
- void _writeCodeLink(const char *className,
- const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip);
- void docify(const char *str);
- bool m_streamSet = false;
- FTextStream m_t;
+ void _writeCodeLink(const QCString &className,
+ const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip);
+ void docify(const QCString &str);
+ TextStream &m_t;
int m_col = 0;
QCString m_relPath;
bool m_lineOpen = false;
@@ -78,70 +73,70 @@ class HtmlGenerator : public OutputGenerator
virtual OutputType type() const { return Html; }
static void init();
- static void writeStyleSheetFile(QFile &f);
- static void writeHeaderFile(QFile &f, const char *cssname);
- static void writeFooterFile(QFile &f);
+ static void writeStyleSheetFile(TextStream &t);
+ static void writeHeaderFile(TextStream &t, const QCString &cssname);
+ static void writeFooterFile(TextStream &t);
static void writeTabData();
- static void writeSearchInfo(FTextStream &t,const QCString &relPath);
- static void writeSearchData(const char *dir);
+ static void writeSearchInfo(TextStream &t,const QCString &relPath);
+ static void writeSearchData(const QCString &dir);
static void writeSearchPage();
static void writeExternalSearchPage();
- static QCString writeLogoAsString(const char *path);
- static QCString writeSplitBarAsString(const char *name,const char *relpath);
+ static QCString writeLogoAsString(const QCString &path);
+ static QCString writeSplitBarAsString(const QCString &name,const QCString &relpath);
// ---- CodeOutputInterface
- void codify(const char *text)
+ void codify(const QCString &text)
{ m_codeGen.codify(text); }
- void writeCodeLink(const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip)
+ void writeCodeLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip)
{ m_codeGen.writeCodeLink(ref,file,anchor,name,tooltip); }
- void writeLineNumber(const char *ref,const char *file,const char *anchor,int lineNumber)
+ void writeLineNumber(const QCString &ref,const QCString &file,const QCString &anchor,int lineNumber)
{ m_codeGen.writeLineNumber(ref,file,anchor,lineNumber); }
- void writeTooltip(const char *id, const DocLinkInfo &docInfo, const char *decl,
- const char *desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo
+ void writeTooltip(const QCString &id, const DocLinkInfo &docInfo, const QCString &decl,
+ const QCString &desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo
)
{ m_codeGen.writeTooltip(id,docInfo,decl,desc,defInfo,declInfo); }
void startCodeLine(bool hasLineNumbers)
{ m_codeGen.startCodeLine(hasLineNumbers); }
void endCodeLine()
{ m_codeGen.endCodeLine(); }
- void startFontClass(const char *s)
+ void startFontClass(const QCString &s)
{ m_codeGen.startFontClass(s); }
void endFontClass()
{ m_codeGen.endFontClass(); }
- void writeCodeAnchor(const char *anchor)
+ void writeCodeAnchor(const QCString &anchor)
{ m_codeGen.writeCodeAnchor(anchor); }
- void startCodeFragment(const char *style)
+ void startCodeFragment(const QCString &style)
{ m_codeGen.startCodeFragment(style); }
- void endCodeFragment(const char *style)
+ void endCodeFragment(const QCString &style)
{ m_codeGen.endCodeFragment(style); }
// ---------------------------
- void setCurrentDoc(const Definition *context,const char *anchor,bool isSourceFile);
- void addWord(const char *word,bool hiPriority);
+ void setCurrentDoc(const Definition *context,const QCString &anchor,bool isSourceFile);
+ void addWord(const QCString &word,bool hiPriority);
void writeDoc(DocNode *,const Definition *,const MemberDef *,int id);
- void startFile(const char *name,const char *manName,const char *title,int id);
- void writeFooter(const char *navPath);
+ void startFile(const QCString &name,const QCString &manName,const QCString &title,int id);
+ void writeFooter(const QCString &navPath);
void endFile();
void clearBuffer();
void writeSearchInfo();
void startIndexSection(IndexSections) {}
void endIndexSection(IndexSections) {}
- void writePageLink(const char *,bool) {}
+ void writePageLink(const QCString &,bool) {}
void startProjectNumber();
void endProjectNumber();
void writeStyleInfo(int part);
- void startTitleHead(const char *);
- void endTitleHead(const char *,const char *);
- void startTitle() { t << "<div class=\"title\">"; }
- void endTitle() { t << "</div>"; }
+ void startTitleHead(const QCString &);
+ void endTitleHead(const QCString &,const QCString &);
+ void startTitle() { m_t << "<div class=\"title\">"; }
+ void endTitle() { m_t << "</div>"; }
- void startParagraph(const char *classDef);
+ void startParagraph(const QCString &classDef);
void endParagraph();
- void writeString(const char *text);
+ void writeString(const QCString &text);
void startIndexListItem();
void endIndexListItem();
void startIndexList();
@@ -149,32 +144,32 @@ class HtmlGenerator : public OutputGenerator
void startIndexKey();
void endIndexKey();
void startIndexValue(bool);
- void endIndexValue(const char *,bool);
- void startItemList() { t << "<ul>" << endl; }
- void endItemList() { t << "</ul>" << endl; }
- void startIndexItem(const char *ref,const char *file);
- void endIndexItem(const char *ref,const char *file);
- void docify(const char *text);
+ void endIndexValue(const QCString &,bool);
+ void startItemList() { m_t << "<ul>\n"; }
+ void endItemList() { m_t << "</ul>\n"; }
+ void startIndexItem(const QCString &ref,const QCString &file);
+ void endIndexItem(const QCString &ref,const QCString &file);
+ void docify(const QCString &text);
- void writeObjectLink(const char *ref,const char *file,
- const char *anchor,const char *name);
+ void writeObjectLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name);
- void startTextLink(const char *file,const char *anchor);
+ void startTextLink(const QCString &file,const QCString &anchor);
void endTextLink();
- void startHtmlLink(const char *url);
+ void startHtmlLink(const QCString &url);
void endHtmlLink();
- void startTypewriter() { t << "<code>"; }
- void endTypewriter() { t << "</code>"; }
+ void startTypewriter() { m_t << "<code>"; }
+ void endTypewriter() { m_t << "</code>"; }
void startGroupHeader(int);
void endGroupHeader(int);
- void startItemListItem() { t << "<li>"; }
- void endItemListItem() { t << "</li>\n"; }
+ void startItemListItem() { m_t << "<li>"; }
+ void endItemListItem() { m_t << "</li>\n"; }
void startMemberSections();
void endMemberSections();
void startHeaderSection();
void endHeaderSection();
- void startMemberHeader(const char *, int);
+ void startMemberHeader(const QCString &, int);
void endMemberHeader();
void startMemberSubtitle();
void endMemberSubtitle();
@@ -186,10 +181,12 @@ class HtmlGenerator : public OutputGenerator
void endInlineHeader();
void startAnonTypeScope(int) {}
void endAnonTypeScope(int) {}
- void startMemberItem(const char *anchor,int,const char *inheritId);
+ void startMemberItem(const QCString &anchor,int,const QCString &inheritId);
void endMemberItem();
void startMemberTemplateParams();
- void endMemberTemplateParams(const char *anchor,const char *inheritId);
+ void endMemberTemplateParams(const QCString &anchor,const QCString &inheritId);
+ void startCompoundTemplateParams();
+ void endCompoundTemplateParams();
void startMemberGroupHeader(bool);
void endMemberGroupHeader();
@@ -200,77 +197,77 @@ class HtmlGenerator : public OutputGenerator
void insertMemberAlign(bool);
void insertMemberAlignLeft(int,bool);
- void startMemberDescription(const char *anchor,const char *inheritId, bool typ);
+ void startMemberDescription(const QCString &anchor,const QCString &inheritId, bool typ);
void endMemberDescription();
void startMemberDeclaration() {}
- void endMemberDeclaration(const char *anchor,const char *inheritId);
- void writeInheritedSectionTitle(const char *id, const char *ref,
- const char *file, const char *anchor,
- const char *title,const char *name);
+ void endMemberDeclaration(const QCString &anchor,const QCString &inheritId);
+ void writeInheritedSectionTitle(const QCString &id, const QCString &ref,
+ const QCString &file, const QCString &anchor,
+ const QCString &title,const QCString &name);
- void writeRuler() { t << "<hr/>"; }
- void writeAnchor(const char *,const char *name)
- { t << "<a name=\"" << name <<"\" id=\"" << name << "\"></a>"; }
- void startEmphasis() { t << "<em>"; }
- void endEmphasis() { t << "</em>"; }
- void startBold() { t << "<b>"; }
- void endBold() { t << "</b>"; }
- void startDescription() { t << endl << "<dl>" << endl; }
- void endDescription() { t << endl << "</dl>\n" << endl; }
- void startDescItem() { t << "<dt>"; }
- void endDescItem() { t << "</dt>"; }
- void startDescForItem() { t << "<dd>"; }
- void endDescForItem() { t << "</dd>\n"; }
- void lineBreak(const char *style);
+ void writeRuler() { m_t << "<hr/>"; }
+ void writeAnchor(const QCString &,const QCString &name)
+ { m_t << "<a name=\"" << name <<"\" id=\"" << name << "\"></a>"; }
+ void startEmphasis() { m_t << "<em>"; }
+ void endEmphasis() { m_t << "</em>"; }
+ void startBold() { m_t << "<b>"; }
+ void endBold() { m_t << "</b>"; }
+ void startDescription() { m_t << "\n<dl>\n"; }
+ void endDescription() { m_t << "\n</dl>\n\n"; }
+ void startDescItem() { m_t << "<dt>"; }
+ void endDescItem() { m_t << "</dt>"; }
+ void startDescForItem() { m_t << "<dd>"; }
+ void endDescForItem() { m_t << "</dd>\n"; }
+ void lineBreak(const QCString &style);
void writeChar(char c);
- void startMemberDoc(const char *clName, const char *memName,
- const char *anchor, const char *title,
+ void startMemberDoc(const QCString &clName, const QCString &memName,
+ const QCString &anchor, const QCString &title,
int memCount, int memTotal, bool showInline);
void endMemberDoc(bool);
- void startDoxyAnchor(const char *fName,const char *manName,
- const char *anchor,const char *name,
- const char *args);
- void endDoxyAnchor(const char *fName,const char *anchor);
+ void startDoxyAnchor(const QCString &fName,const QCString &manName,
+ const QCString &anchor,const QCString &name,
+ const QCString &args);
+ void endDoxyAnchor(const QCString &fName,const QCString &anchor);
void writeLatexSpacing() {}
- void writeStartAnnoItem(const char *type,const char *file,
- const char *path,const char *name);
- void writeEndAnnoItem(const char *) { t << endl; }
- void startSubsection() { t << "<h2>"; }
- void endSubsection() { t << "</h2>" << endl; }
- void startSubsubsection() { t << "<h3>"; }
- void endSubsubsection() { t << "</h3>" << endl; }
- void startCenter() { t << "<center>" << endl; }
- void endCenter() { t << "</center>" << endl; }
- void startSmall() { t << "<small>" << endl; }
- void endSmall() { t << "</small>" << endl; }
+ void writeStartAnnoItem(const QCString &type,const QCString &file,
+ const QCString &path,const QCString &name);
+ void writeEndAnnoItem(const QCString &) { m_t << "\n"; }
+ void startSubsection() { m_t << "<h2>"; }
+ void endSubsection() { m_t << "</h2>\n"; }
+ void startSubsubsection() { m_t << "<h3>"; }
+ void endSubsubsection() { m_t << "</h3>\n"; }
+ void startCenter() { m_t << "<center>\n"; }
+ void endCenter() { m_t << "</center>\n"; }
+ void startSmall() { m_t << "<small>\n"; }
+ void endSmall() { m_t << "</small>\n"; }
void startExamples();
void endExamples();
- void startParamList(ParamListTypes,const char *);
+ void startParamList(ParamListTypes,const QCString &);
void endParamList();
- void startSection(const char *,const char *,SectionType);
- void endSection(const char *,SectionType);
- void addIndexItem(const char *,const char *);
+ void startSection(const QCString &,const QCString &,SectionType);
+ void endSection(const QCString &,SectionType);
+ void addIndexItem(const QCString &,const QCString &);
void startIndent();
void endIndent();
void writeSynopsis() {}
void startClassDiagram();
- void endClassDiagram(const ClassDiagram &,const char *,const char *);
+ void endClassDiagram(const ClassDiagram &,const QCString &,const QCString &);
void startPageRef() {}
- void endPageRef(const char *,const char *) {}
+ void endPageRef(const QCString &,const QCString &) {}
void startQuickIndices() {}
void endQuickIndices();
- void writeSplitBar(const char *name);
- void writeNavigationPath(const char *s);
+ void writeSplitBar(const QCString &name);
+ void writeNavigationPath(const QCString &s);
void writeLogo();
- void writeQuickLinks(bool compact,HighlightedItem hli,const char *file);
- void writeSummaryLink(const char *file,const char *anchor,const char *title,bool first);
+ void writeQuickLinks(bool compact,HighlightedItem hli,const QCString &file);
+ void writeSummaryLink(const QCString &file,const QCString &anchor,const QCString &title,bool first);
void startContents();
void endContents();
- void startPageDoc(const char *pageTitle);
+ void startPageDoc(const QCString &pageTitle);
void endPageDoc();
void writeNonBreakableSpace(int);
- void startDescTable(const char *title);
+ void startDescTable(const QCString &title);
void endDescTable();
void startDescTableRow();
void endDescTableRow();
@@ -292,24 +289,24 @@ class HtmlGenerator : public OutputGenerator
void writeGraphicalHierarchy(DotGfxHierarchyTable &g);
void startTextBlock(bool)
- { t << "<div class=\"textblock\">"; }
+ { m_t << "<div class=\"textblock\">"; }
void endTextBlock(bool)
- { t << "</div>"; }
+ { m_t << "</div>"; }
void lastIndexPage() {}
void startMemberDocPrefixItem();
void endMemberDocPrefixItem();
void startMemberDocName(bool);
void endMemberDocName();
- void startParameterType(bool first,const char *key);
+ void startParameterType(bool first,const QCString &key);
void endParameterType();
void startParameterName(bool);
void endParameterName(bool last,bool emptyList,bool closeBracket);
void startParameterList(bool);
void endParameterList();
- virtual void exceptionEntry(const char*,bool);
+ void exceptionEntry(const QCString &,bool);
- void startConstraintList(const char *);
+ void startConstraintList(const QCString &);
void startConstraintParam();
void endConstraintParam();
void startConstraintType();
@@ -328,15 +325,15 @@ class HtmlGenerator : public OutputGenerator
void endInlineMemberDoc();
void startLabels();
- void writeLabel(const char *l,bool isLast);
+ void writeLabel(const QCString &l,bool isLast);
void endLabels();
private:
- static void writePageFooter(FTextStream &t,const QCString &,const QCString &,const QCString &);
+ static void writePageFooter(TextStream &t,const QCString &,const QCString &,const QCString &);
QCString m_lastTitle;
QCString m_lastFile;
QCString m_relPath;
- void docify(const char *text,bool inHtmlComment);
+ void docify(const QCString &text,bool inHtmlComment);
int m_sectionCount = 0;
bool m_emptySection = false;
diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp
index d34c8d3..1672b69 100644
--- a/src/htmlhelp.cpp
+++ b/src/htmlhelp.cpp
@@ -19,8 +19,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <qfile.h>
-#include <qfileinfo.h>
#include "htmlhelp.h"
#include "config.h"
@@ -34,6 +32,7 @@
#include "util.h"
#include "linkedmap.h"
#include "regex.h"
+#include "fileinfo.h"
//----------------------------------------------------------------------------
@@ -50,12 +49,12 @@ class HtmlHelpRecoder
void initialize()
{
- const char *str = Config_getString(CHM_INDEX_ENCODING);
- if (!str) str = "CP1250"; // use safe and likely default
+ QCString str = Config_getString(CHM_INDEX_ENCODING);
+ if (str.isEmpty()) str = "CP1250"; // use safe and likely default
m_fromUtf8 = portable_iconv_open(str,"UTF-8");
if (m_fromUtf8==m_iconv_null)
{
- term("unsupported character conversion for CHM_INDEX_ENCODING: '%s'->'UTF-8'\n", str);
+ term("unsupported character conversion for CHM_INDEX_ENCODING: '%s'->'UTF-8'\n", qPrint(str));
}
}
void finalize()
@@ -99,7 +98,7 @@ class HtmlHelpRecoder
/** Class representing a field in the HTML help index. */
struct IndexField
{
- IndexField(const char *k,const char *n,const char *u,const char *a,bool l,bool r) :
+ IndexField(const QCString &k,const QCString &n,const QCString &u,const QCString &a,bool l,bool r) :
key(k), name(n), url(u), anchor(a), link(l), reversed(r) {}
QCString key;
QCString name;
@@ -117,10 +116,10 @@ class HtmlHelpIndex
public:
HtmlHelpIndex(HtmlHelpRecoder &recoder);
~HtmlHelpIndex();
- void addItem(const char *first,const char *second,
- const char *url, const char *anchor,
+ void addItem(const QCString &first,const QCString &second,
+ const QCString &url, const QCString &anchor,
bool hasLink,bool reversed);
- void writeFields(FTextStream &t);
+ void writeFields(std::ostream &t);
size_t size() const { return m_map.size(); }
private:
LinkedMap<IndexField> m_map;
@@ -150,21 +149,21 @@ HtmlHelpIndex::~HtmlHelpIndex()
* \param reversed TRUE if level1 is the member name and level2 the compound
* name.
*/
-void HtmlHelpIndex::addItem(const char *level1,const char *level2,
- const char *url,const char *anchor,bool hasLink,
+void HtmlHelpIndex::addItem(const QCString &level1,const QCString &level2,
+ const QCString &url,const QCString &anchor,bool hasLink,
bool reversed)
{
static const reg::Ex re(R"(@\d+)");
- std::string key = level1;
- if (level2) key+= std::string("?") + level2;
+ std::string key = level1.str();
+ if (!level2.isEmpty()) key+= std::string("?") + level2.str();
if (reg::search(key,re)) // skip anonymous stuff
{
return;
}
std::string key_anchor;
- if (anchor)
+ if (!anchor.isEmpty())
{
- key_anchor = key+anchor;
+ key_anchor = key+anchor.str();
}
else
{
@@ -210,7 +209,7 @@ static QCString field2URL(const IndexField *f,bool checkReversed)
* b1 -> link to url#anchor
* </pre>
*/
-void HtmlHelpIndex::writeFields(FTextStream &t)
+void HtmlHelpIndex::writeFields(std::ostream &t)
{
std::sort(std::begin(m_map),
std::end(m_map),
@@ -234,7 +233,7 @@ void HtmlHelpIndex::writeFields(FTextStream &t)
}
{ // finish old list at level 2
- if (level2Started) t << " </UL>" << endl;
+ if (level2Started) t << " </UL>\n";
level2Started=FALSE;
// <Antony>
@@ -287,12 +286,12 @@ void HtmlHelpIndex::writeFields(FTextStream &t)
}
if (!level2Started && !level2.isEmpty())
{ // start new list at level 2
- t << " <UL>" << endl;
+ t << " <UL>\n";
level2Started=TRUE;
}
else if (level2Started && level2.isEmpty())
{ // end list at level 2
- t << " </UL>" << endl;
+ t << " </UL>\n";
level2Started=FALSE;
}
if (level2Started)
@@ -304,7 +303,7 @@ void HtmlHelpIndex::writeFields(FTextStream &t)
"</OBJECT>\n";
}
}
- if (level2Started) t << " </UL>" << endl;
+ if (level2Started) t << " </UL>\n";
}
//----------------------------------------------------------------------------
@@ -314,9 +313,7 @@ class HtmlHelp::Private
public:
Private() : index(recoder) {}
void createProjectFile();
- QFile cf;
- QFile kf;
- FTextStream cts,kts;
+ std::ofstream cts,kts;
bool ctsItemPresent = false;
int dc = 0;
StringSet indexFiles;
@@ -447,13 +444,12 @@ void HtmlHelp::initialize()
/* open the contents file */
QCString fName = Config_getString(HTML_OUTPUT) + "/index.hhc";
- p->cf.setName(fName);
- if (!p->cf.open(IO_WriteOnly))
+ p->cts.open(fName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!p->cts.is_open())
{
- term("Could not open file %s for writing\n",fName.data());
+ term("Could not open file %s for writing\n",qPrint(fName));
}
/* Write the header of the contents file */
- p->cts.setDevice(&p->cf);
p->cts << "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n"
"<HTML><HEAD></HEAD><BODY>\n"
"<OBJECT type=\"text/site properties\">\n"
@@ -463,13 +459,12 @@ void HtmlHelp::initialize()
/* open the contents file */
fName = Config_getString(HTML_OUTPUT) + "/index.hhk";
- p->kf.setName(fName);
- if (!p->kf.open(IO_WriteOnly))
+ p->kts.open(fName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!p->kts.is_open())
{
- term("Could not open file %s for writing\n",fName.data());
+ term("Could not open file %s for writing\n",qPrint(fName));
}
/* Write the header of the contents file */
- p->kts.setDevice(&p->kf);
p->kts << "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n"
"<HTML><HEAD></HEAD><BODY>\n"
"<OBJECT type=\"text/site properties\">\n"
@@ -487,7 +482,7 @@ QCString HtmlHelp::getLanguageString()
auto it = s_languageDict.find(theTranslator->idLanguage().str());
if (it!=s_languageDict.end())
{
- return it->second;
+ return QCString(it->second);
}
}
// default language
@@ -500,11 +495,9 @@ void HtmlHelp::Private::createProjectFile()
{
/* Write the project file */
QCString fName = Config_getString(HTML_OUTPUT) + "/index.hhp";
- QFile f(fName);
- if (f.open(IO_WriteOnly))
+ std::ofstream t(fName.str(),std::ofstream::out | std::ofstream::binary);
+ if (t.is_open())
{
- FTextStream t(&f);
-
const char *hhcFile = "\"index.hhc\"";
const char *hhkFile = "\"index.hhk\"";
bool hhkPresent = index.size()>0;
@@ -523,12 +516,12 @@ void HtmlHelp::Private::createProjectFile()
t << "Default Window=main\n"
"Default topic=" << indexName << "\n";
if (hhkPresent) t << "Index file=index.hhk\n";
- t << "Language=" << getLanguageString() << endl;
+ t << "Language=" << getLanguageString() << "\n";
if (Config_getBool(BINARY_TOC)) t << "Binary TOC=YES\n";
if (Config_getBool(GENERATE_CHI)) t << "Create CHI file=YES\n";
- t << "Title=" << recoder.recode(Config_getString(PROJECT_NAME)) << endl << endl;
+ t << "Title=" << recoder.recode(Config_getString(PROJECT_NAME)) << "\n\n";
- t << "[WINDOWS]" << endl;
+ t << "[WINDOWS]\n";
// NOTE: the 0x10387e number is a set of bits specifying the buttons
// which should appear in the CHM viewer; that specific value
@@ -544,35 +537,35 @@ void HtmlHelp::Private::createProjectFile()
{
t << "main=\"" << recoder.recode(Config_getString(PROJECT_NAME)) << "\"," << hhcFile << ","
<< hhkFile << ",\"" << indexName << "\",\"" <<
- indexName << "\",,,,,0x23520,,0x70387e,,,,,,,,0" << endl << endl;
+ indexName << "\",,,,,0x23520,,0x70387e,,,,,,,,0\n\n";
}
else
{
t << "main=\"" << recoder.recode(Config_getString(PROJECT_NAME)) << "\"," << hhcFile << ","
<< hhkFile << ",\"" << indexName << "\",\"" <<
- indexName << "\",,,,,0x23520,,0x10387e,,,,,,,,0" << endl << endl;
+ indexName << "\",,,,,0x23520,,0x10387e,,,,,,,,0\n\n";
}
- t << "[FILES]" << endl;
+ t << "[FILES]\n";
for (auto &s : indexFiles)
{
- t << s.c_str() << endl;
+ t << s.c_str() << "\n";
}
for (auto &s : imageFiles)
{
- t << QFileInfo(s.c_str()).fileName().data() << endl;
+ t << FileInfo(s).fileName() << "\n";
}
- f.close();
+ t.close();
}
else
{
- err("Could not open file %s for writing\n",fName.data());
+ err("Could not open file %s for writing\n",qPrint(fName));
}
}
-void HtmlHelp::addIndexFile(const char *s)
+void HtmlHelp::addIndexFile(const QCString &s)
{
- p->indexFiles.insert(s);
+ p->indexFiles.insert(s.str());
}
/*! Finalizes the HTML help. This will finish and close the
@@ -585,8 +578,7 @@ void HtmlHelp::finalize()
p->cts << "</UL>\n";
p->cts << "</BODY>\n";
p->cts << "</HTML>\n";
- p->cts.unsetDevice();
- p->cf.close();
+ p->cts.close();
p->index.writeFields(p->kts);
@@ -594,8 +586,7 @@ void HtmlHelp::finalize()
p->kts << "</UL>\n";
p->kts << "</BODY>\n";
p->kts << "</HTML>\n";
- p->kts.unsetDevice();
- p->kf.close();
+ p->kts.close();
p->createProjectFile();
@@ -635,10 +626,10 @@ void HtmlHelp::decContentsDepth()
* \param def not used.
*/
void HtmlHelp::addContentsItem(bool isDir,
- const char *name,
- const char * /*ref*/,
- const char *file,
- const char *anchor,
+ const QCString &name,
+ const QCString & /*ref*/,
+ const QCString &file,
+ const QCString &anchor,
bool /* separateIndex */,
bool /* addToNavIndex */,
const Definition * /* def */)
@@ -656,9 +647,9 @@ void HtmlHelp::addContentsItem(bool isDir,
int i; for (i=0;i<p->dc;i++) p->cts << " ";
p->cts << "<LI><OBJECT type=\"text/sitemap\">";
p->cts << "<param name=\"Name\" value=\"" << convertToHtml(p->recoder.recode(name),TRUE) << "\">";
- if (file) // made file optional param - KPW
+ if (!file.isEmpty()) // made file optional param - KPW
{
- if (file && (file[0]=='!' || file[0]=='^')) // special markers for user defined URLs
+ if (file[0]=='!' || file[0]=='^') // special markers for user defined URLs
{
p->cts << "<param name=\"";
if (file[0]=='^') p->cts << "URL"; else p->cts << "Local";
@@ -669,7 +660,7 @@ void HtmlHelp::addContentsItem(bool isDir,
{
p->cts << "<param name=\"Local\" value=\"";
p->cts << file << Doxygen::htmlFileExtension;
- if (anchor) p->cts << "#" << anchor;
+ if (!anchor.isEmpty()) p->cts << "#" << anchor;
}
p->cts << "\">";
}
@@ -688,7 +679,7 @@ void HtmlHelp::addContentsItem(bool isDir,
void HtmlHelp::addIndexItem(const Definition *context,const MemberDef *md,
- const char *sectionAnchor,const char *word)
+ const QCString &sectionAnchor,const QCString &word)
{
if (md)
{
@@ -708,19 +699,19 @@ void HtmlHelp::addIndexItem(const Definition *context,const MemberDef *md,
QCString level2 = md->name();
QCString contRef = separateMemberPages ? cfname : cfiname;
QCString memRef = cfname;
- QCString anchor = sectionAnchor ? QCString(sectionAnchor) : md->anchor();
+ QCString anchor = !sectionAnchor.isEmpty() ? sectionAnchor : md->anchor();
p->index.addItem(level1,level2,contRef,anchor,TRUE,FALSE);
p->index.addItem(level2,level1,memRef,anchor,TRUE,TRUE);
}
else if (context)
{
- QCString level1 = word ? QCString(word) : context->name();
- p->index.addItem(level1,0,context->getOutputFileBase(),sectionAnchor,TRUE,FALSE);
+ QCString level1 = !word.isEmpty() ? word : context->name();
+ p->index.addItem(level1,QCString(),context->getOutputFileBase(),sectionAnchor,TRUE,FALSE);
}
}
-void HtmlHelp::addImageFile(const char *fileName)
+void HtmlHelp::addImageFile(const QCString &fileName)
{
- p->imageFiles.insert(fileName);
+ p->imageFiles.insert(fileName.str());
}
diff --git a/src/htmlhelp.h b/src/htmlhelp.h
index 421320e..9d8eea5 100644
--- a/src/htmlhelp.h
+++ b/src/htmlhelp.h
@@ -66,18 +66,18 @@ class HtmlHelp : public IndexIntf
void incContentsDepth();
void decContentsDepth();
void addContentsItem(bool isDir,
- const char *name,
- const char *ref,
- const char *file,
- const char *anchor,
+ const QCString &name,
+ const QCString &ref,
+ const QCString &file,
+ const QCString &anchor,
bool separateIndex,
bool addToNavIndex,
const Definition *def);
void addIndexItem(const Definition *context,const MemberDef *md,
- const char *sectionAnchor, const char *title);
- void addIndexFile(const char *name);
- void addImageFile(const char *);
- void addStyleSheetFile(const char *) {}
+ const QCString &sectionAnchor, const QCString &title);
+ void addIndexFile(const QCString &name);
+ void addImageFile(const QCString &);
+ void addStyleSheetFile(const QCString &) {}
static QCString getLanguageString();
private:
diff --git a/src/image.cpp b/src/image.cpp
index 2a8108b..0b353a9 100644
--- a/src/image.cpp
+++ b/src/image.cpp
@@ -1,13 +1,13 @@
/******************************************************************************
*
- *
+ *
*
*
* Copyright (C) 1997-2015 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
+ * 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.
*
@@ -17,7 +17,6 @@
*/
#include "image.h"
-#include <qfile.h>
#include <math.h>
#include "lodepng.h"
#include "config.h"
@@ -37,10 +36,10 @@ const int charSetWidth=80;
const int charHeight=12;
const int numChars=96;
-unsigned short charPos[numChars] =
- {
- 0, 5, 8, 13, 20, 27, 38, 47,
- 50, 54, 58, 65, 72, 76, 83, 87,
+unsigned short charPos[numChars] =
+ {
+ 0, 5, 8, 13, 20, 27, 38, 47,
+ 50, 54, 58, 65, 72, 76, 83, 87,
91, 98,105,112,119,126,133,140,
147,154,161,164,167,174,181,188,
195,207,216,224,233,242,250,258,
@@ -53,7 +52,7 @@ unsigned short charPos[numChars] =
594,600,607,613,617,620,624,631
};
-unsigned char charWidth[numChars] =
+unsigned char charWidth[numChars] =
{
5, 3, 5, 7, 7,11, 9, 3,
4, 4, 7, 7, 4, 7, 4, 4,
@@ -67,7 +66,7 @@ unsigned char charWidth[numChars] =
3, 7, 7, 7, 7, 7, 4, 7,
7, 3, 3, 6, 3, 9, 7, 7,
7, 6, 5, 6, 3, 7, 7, 9,
- 6, 7, 6, 4, 3, 4, 7, 5
+ 6, 7, 6, 4, 3, 4, 7, 5
};
unsigned char fontRaw[charSetWidth*charHeight] = {
@@ -261,7 +260,7 @@ uchar Image::getPixel(uint x,uint y) const
return 0;
}
-void Image::writeChar(uint x,uint y,char c,uchar fg)
+void Image::writeChar(uint x,uint y,char c,uchar fg)
{
if (c>=' ')
{
@@ -279,8 +278,8 @@ void Image::writeChar(uint x,uint y,char c,uchar fg)
while (bitsLeft>0)
{
uint bits=8-bitOffset;
- if (bits>bitsLeft) bits=bitsLeft;
- bitPattern<<=bits;
+ if (bits>bitsLeft) bits=bitsLeft;
+ bitPattern<<=bits;
bitPattern|=((fontRaw[byteOffset]<<bitOffset)&0xff)>>(8-bits);
bitsLeft-=bits;
bitOffset=0;
@@ -295,15 +294,16 @@ void Image::writeChar(uint x,uint y,char c,uchar fg)
}
rowOffset+=charSetWidth;
}
- }
+ }
}
-void Image::writeString(uint x,uint y,const char *s,uchar fg)
+void Image::writeString(uint x,uint y,const QCString &s,uchar fg)
{
- if (s)
+ if (!s.isEmpty())
{
+ const char *p = s.data();
char c;
- while ((c=*s++))
+ while ((c=*p++))
{
writeChar(x,y,c,fg);
x+=charWidth[c-' '];
@@ -311,13 +311,14 @@ void Image::writeString(uint x,uint y,const char *s,uchar fg)
}
}
-uint Image::stringLength(const char *s)
+uint Image::stringLength(const QCString &s)
{
uint w=0;
- if (s)
+ if (!s.isEmpty())
{
+ const char *p = s.data();
char c;
- while ((c=*s++)) w+=charWidth[c-' '];
+ while ((c=*p++)) w+=charWidth[c-' '];
}
return w;
}
@@ -325,12 +326,12 @@ uint Image::stringLength(const char *s)
void Image::drawHorzLine(uint y,uint xs,uint xe,uchar colIndex,uint mask)
{
uint x,i=0,j=0;
- for (x=xs;x<=xe;x++,j++)
+ for (x=xs;x<=xe;x++,j++)
{
if (j&1) i++;
if (mask&(1<<(i&0x1f))) setPixel(x,y,colIndex);
}
-}
+}
void Image::drawHorzArrow(uint y,uint xs,uint xe,uchar colIndex,uint mask)
{
@@ -341,12 +342,12 @@ void Image::drawHorzArrow(uint y,uint xs,uint xe,uchar colIndex,uint mask)
uint h=i>>1;
drawVertLine(xe-i,y-h,y+h,colIndex,0xffffffff);
}
-}
+}
void Image::drawVertLine(uint x,uint ys,uint ye,uchar colIndex,uint mask)
{
uint y,i=0;
- for (y=ys;y<=ye;y++,i++)
+ for (y=ys;y<=ye;y++,i++)
{
if (mask&(1<<(i&0x1f))) setPixel(x,y,colIndex);
}
@@ -376,11 +377,11 @@ void Image::fillRect(uint x,uint y,uint width,uint height,uchar colIndex,uint ma
uint xp,yp,xi,yi;
for (yp=y,yi=0;yp<y+height;yp++,yi++)
for (xp=x,xi=0;xp<x+width;xp++,xi++)
- if (mask&(1<<((xi+yi)&0x1f)))
+ if (mask&(1<<((xi+yi)&0x1f)))
setPixel(xp,yp,colIndex);
}
-bool Image::save(const char *fileName,int mode)
+bool Image::save(const QCString &fileName,int mode)
{
static bool useTransparency = Config_getBool(FORMULA_TRANSPARENT);
uchar* buffer;
@@ -388,8 +389,8 @@ bool Image::save(const char *fileName,int mode)
LodePNG_Encoder encoder;
LodePNG_Encoder_init(&encoder);
uint numCols = mode==0 ? 8 : 16;
- Color *pPal = mode==0 ? palette :
- useTransparency ? palette2 :
+ Color *pPal = mode==0 ? palette :
+ useTransparency ? palette2 :
palette3 ;
uint i;
for (i=0;i<numCols;i++,pPal++)
@@ -397,10 +398,10 @@ bool Image::save(const char *fileName,int mode)
LodePNG_InfoColor_addPalette(&encoder.infoPng.color,
pPal->red,pPal->green,pPal->blue,pPal->alpha);
}
- encoder.infoPng.color.colorType = 3;
+ encoder.infoPng.color.colorType = 3;
encoder.infoRaw.color.colorType = 3;
LodePNG_encode(&encoder, &buffer, &bufferSize, m_data, m_width, m_height);
- LodePNG_saveFile(buffer, bufferSize, fileName);
+ LodePNG_saveFile(buffer, bufferSize, fileName.data());
free(buffer);
LodePNG_Encoder_cleanup(&encoder);
return TRUE;
@@ -505,7 +506,7 @@ ColoredImage::~ColoredImage()
free(m_data);
}
-bool ColoredImage::save(const char *fileName)
+bool ColoredImage::save(const QCString &fileName)
{
uchar *buffer;
size_t bufferSize;
@@ -514,7 +515,7 @@ bool ColoredImage::save(const char *fileName)
encoder.infoPng.color.colorType = m_hasAlpha ? 6 : 2; // 2=RGB 24 bit, 6=RGBA 32 bit
encoder.infoRaw.color.colorType = 6; // 6=RGBA 32 bit
LodePNG_encode(&encoder, &buffer, &bufferSize, m_data, m_width, m_height);
- LodePNG_saveFile(buffer, bufferSize, fileName);
+ LodePNG_saveFile(buffer, bufferSize, fileName.data());
LodePNG_Encoder_cleanup(&encoder);
free(buffer);
return TRUE;
diff --git a/src/image.h b/src/image.h
index 6eb2c21..cbeea87 100644
--- a/src/image.h
+++ b/src/image.h
@@ -20,6 +20,7 @@
#define _IMAGE_H
#include "types.h"
+#include "qcstring.h"
/** Class representing a bitmap image generated by doxygen. */
class Image
@@ -31,19 +32,19 @@ class Image
void setPixel(uint x,uint y,uchar val);
uchar getPixel(uint x,uint y) const;
void writeChar(uint x,uint y,char c,uchar fg);
- void writeString(uint x,uint y,const char *s,uchar fg);
+ void writeString(uint x,uint y,const QCString &s,uchar fg);
void drawHorzLine(uint y,uint xs,uint xe,uchar colIndex,uint mask);
void drawHorzArrow(uint y,uint xs,uint xe,uchar colIndex,uint mask);
void drawVertLine(uint x,uint ys,uint ye,uchar colIndex,uint mask);
void drawVertArrow(uint x,uint ys,uint ye,uchar colIndex,uint mask);
void drawRect(uint x,uint y,uint width,uint height,uchar colIndex,uint mask);
void fillRect(uint x,uint y,uint width,uint height,uchar colIndex,uint mask);
- bool save(const char *fileName,int mode=0);
- friend uint stringLength(const char *s);
+ bool save(const QCString &fileName,int mode=0);
+ friend uint stringLength(const QCString &s);
uint width() const { return m_width; }
uint height() const { return m_height; }
uchar *data() const { return m_data; }
- static uint stringLength(const char *s);
+ static uint stringLength(const QCString &s);
private:
uint m_width;
@@ -59,7 +60,7 @@ class ColoredImage
const uchar *greyLevels,const uchar *alphaLevels,
int saturation,int hue,int gamma);
~ColoredImage();
- bool save(const char *fileName);
+ bool save(const QCString &fileName);
static void hsl2rgb(double h,double s,double l,
double *pRed,double *pGreen,double *pBlue);
private:
diff --git a/src/index.cpp b/src/index.cpp
index 7a31f0f..1497aad 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -1,8 +1,6 @@
/******************************************************************************
*
- *
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2021 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
@@ -19,12 +17,11 @@
* @brief This file contains functions for the various index pages.
*/
-#include <stdlib.h>
-
+#include <cstdlib>
+#include <sstream>
#include <array>
#include <assert.h>
-#include <qdir.h>
#include "message.h"
#include "index.h"
@@ -50,6 +47,7 @@
#include "namespacedef.h"
#include "filename.h"
#include "tooltip.h"
+#include "utf8.h"
#define MAX_ITEMS_BEFORE_MULTIPAGE_INDEX 200
#define MAX_ITEMS_BEFORE_QUICK_INDEX 30
@@ -69,6 +67,7 @@ int hierarchyExceptions;
int documentedFiles;
int documentedGroups;
int documentedNamespaces;
+int documentedConcepts;
int indexedPages;
int documentedClassMembers[CMHL_Total];
int documentedFileMembers[FMHL_Total];
@@ -82,6 +81,7 @@ static void countFiles(int &htmlFiles,int &files);
static int countGroups();
static int countDirs();
static int countNamespaces();
+static int countConcepts();
static int countAnnotatedClasses(int *cp,ClassDef::CompoundType ct);
static void countRelatedPages(int &docPages,int &indexPages);
@@ -104,6 +104,7 @@ void countDataStructures()
countRelatedPages(documentedPages,indexedPages); // "pages"
documentedGroups = countGroups(); // "modules"
documentedNamespaces = countNamespaces(); // "namespaces"
+ documentedConcepts = countConcepts(); // "concepts"
documentedDirs = countDirs(); // "dirs"
// "globals"
// "namespacemembers"
@@ -189,7 +190,7 @@ static void endQuickIndexList(OutputList &ol)
ol.writeString(" </div>\n");
}
-static void startQuickIndexItem(OutputList &ol,const char *l,
+static void startQuickIndexItem(OutputList &ol,const QCString &l,
bool hl,bool compact,bool &first)
{
first=FALSE;
@@ -216,7 +217,7 @@ QCString fixSpaces(const QCString &s)
return substitute(s," ","&#160;");
}
-void startTitle(OutputList &ol,const char *fileName,const DefinitionMutable *def)
+void startTitle(OutputList &ol,const QCString &fileName,const DefinitionMutable *def)
{
ol.startHeaderSection();
if (def) def->writeSummaryLinks(ol);
@@ -225,16 +226,16 @@ void startTitle(OutputList &ol,const char *fileName,const DefinitionMutable *def
ol.disable(OutputGenerator::Man);
}
-void endTitle(OutputList &ol,const char *fileName,const char *name)
+void endTitle(OutputList &ol,const QCString &fileName,const QCString &name)
{
ol.popGeneratorState();
ol.endTitleHead(fileName,name);
ol.endHeaderSection();
}
-void startFile(OutputList &ol,const char *name,const char *manName,
- const char *title,HighlightedItem hli,bool additionalIndices,
- const char *altSidebarName)
+void startFile(OutputList &ol,const QCString &name,const QCString &manName,
+ const QCString &title,HighlightedItem hli,bool additionalIndices,
+ const QCString &altSidebarName)
{
static bool disableIndex = Config_getBool(DISABLE_INDEX);
ol.startFile(name,manName,title);
@@ -247,7 +248,7 @@ void startFile(OutputList &ol,const char *name,const char *manName,
{
ol.endQuickIndices();
}
- ol.writeSplitBar(altSidebarName ? altSidebarName : name);
+ ol.writeSplitBar(!altSidebarName.isEmpty() ? altSidebarName : name);
ol.writeSearchInfo();
}
@@ -309,12 +310,12 @@ static void writeMemberToIndex(const Definition *def,const MemberDef *md,bool ad
if (md->getOuterScope()==def || md->getOuterScope()==Doxygen::globalScope)
{
Doxygen::indexList->addContentsItem(isDir,
- md->name(),md->getReference(),md->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
+ md->name(),md->getReference(),md->getOutputFileBase(),md->anchor(),FALSE,addToIndex && md->getGroupDef()==nullptr);
}
else // inherited member
{
Doxygen::indexList->addContentsItem(isDir,
- md->name(),def->getReference(),def->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
+ md->name(),def->getReference(),def->getOutputFileBase(),md->anchor(),FALSE,addToIndex && md->getGroupDef()==nullptr);
}
if (isDir)
{
@@ -349,7 +350,9 @@ static void writeMemberToIndex(const Definition *def,const MemberDef *md,bool ad
template<class T>
void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
const QCString &name,const QCString &anchor,
- bool addToIndex=TRUE,bool preventSeparateIndex=FALSE)
+ bool addToIndex=TRUE,bool preventSeparateIndex=FALSE,
+ const ConceptLinkedRefMap *concepts = nullptr)
+
{
bool hasMembers = !def->getMemberLists().empty() || !def->getMemberGroups().empty();
Doxygen::indexList->addContentsItem(hasMembers,name,
@@ -362,13 +365,22 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
{
if (cd->isLinkable()) numClasses++;
}
- //printf("addMembersToIndex(def=%s hasMembers=%d numClasses=%d)\n",def->name().data(),hasMembers,numClasses);
- if (hasMembers || numClasses>0)
+ int numConcepts=0;
+ if (concepts)
+ {
+ for (const auto &cd : *concepts)
+ {
+ if (cd->isLinkable()) numConcepts++;
+ }
+ }
+ //printf("addMembersToIndex(def=%s hasMembers=%d numClasses=%d)\n",qPrint(def->name()),hasMembers,numClasses);
+ if (hasMembers || numClasses>0 || numConcepts>0)
{
Doxygen::indexList->incContentsDepth();
for (const auto &lde : LayoutDocManager::instance().docEntries(part))
{
- if (lde->kind()==LayoutDocEntry::MemberDef)
+ auto kind = lde->kind();
+ if (kind==LayoutDocEntry::MemberDef)
{
const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get();
MemberList *ml = def->getMemberList(lmd->type);
@@ -383,9 +395,9 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
}
}
}
- else if (lde->kind()==LayoutDocEntry::NamespaceClasses ||
- lde->kind()==LayoutDocEntry::FileClasses ||
- lde->kind()==LayoutDocEntry::ClassNestedClasses
+ else if (kind==LayoutDocEntry::NamespaceClasses ||
+ kind==LayoutDocEntry::FileClasses ||
+ kind==LayoutDocEntry::ClassNestedClasses
)
{
for (const auto &cd : def->getClasses())
@@ -394,12 +406,26 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
{
static bool inlineSimpleStructs = Config_getBool(INLINE_SIMPLE_STRUCTS);
bool isNestedClass = def->definitionType()==Definition::TypeClass;
- addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(FALSE),cd->anchor(),
+ addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(lde->kind()==LayoutDocEntry::FileClasses),cd->anchor(),
addToIndex && (isNestedClass || (cd->isSimple() && inlineSimpleStructs)),
preventSeparateIndex || cd->isEmbeddedInOuterScope());
}
}
}
+ else if (kind==LayoutDocEntry::FileConcepts && concepts)
+ {
+ for (const auto &cd : *concepts)
+ {
+ if (cd->isLinkable() && (cd->partOfGroups().empty() || def->definitionType()==Definition::TypeGroup))
+ {
+ Doxygen::indexList->addContentsItem(false,cd->displayName(),
+ cd->getReference(),cd->getOutputFileBase(),QCString(),
+ addToIndex,
+ false,
+ cd);
+ }
+ }
+ }
}
Doxygen::indexList->decContentsDepth();
@@ -451,10 +477,10 @@ static void writeClassTreeToOutput(OutputList &ol,const BaseClassList &bcl,int l
//printf("Passed...\n");
bool hasChildren = visitedClasses.find(cd)==visitedClasses.end() &&
classHasVisibleChildren(cd);
- //printf("tree4: Has children %s: %d\n",cd->name().data(),hasChildren);
+ //printf("tree4: Has children %s: %d\n",qPrint(cd->name()),hasChildren);
if (cd->isLinkable())
{
- //printf("Writing class %s\n",cd->displayName().data());
+ //printf("Writing class %s\n",qPrint(cd->displayName()));
ol.startIndexItem(cd->getReference(),cd->getOutputFileBase());
ol.parseText(cd->displayName());
ol.endIndexItem(cd->getReference(),cd->getOutputFileBase());
@@ -482,21 +508,21 @@ static void writeClassTreeToOutput(OutputList &ol,const BaseClassList &bcl,int l
}
else
{
- ol.startIndexItem(0,0);
+ ol.startIndexItem(QCString(),QCString());
ol.parseText(cd->name());
- ol.endIndexItem(0,0);
+ ol.endIndexItem(QCString(),QCString());
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),0,0,0);
+ Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),QCString(),QCString(),QCString());
}
if (ftv)
{
- ftv->addContentsItem(hasChildren,cd->displayName(),0,0,0,FALSE,FALSE,cd);
+ ftv->addContentsItem(hasChildren,cd->displayName(),QCString(),QCString(),QCString(),FALSE,FALSE,cd);
}
}
if (hasChildren)
{
- //printf("Class %s at %p visited=%d\n",cd->name().data(),cd,cd->visited);
+ //printf("Class %s at %p visited=%d\n",qPrint(cd->name()),cd,cd->visited);
visitedClasses.insert(cd);
if (cd->getLanguage()==SrcLangExt_VHDL)
{
@@ -560,7 +586,7 @@ static void writeDirTreeNode(OutputList &ol, const DirDef *dd, int level, FTVHel
{
warn(dd->getDefFileName(),dd->getDefLine(),
"maximum nesting level exceeded for directory %s: "
- "check for possible recursive directory relation!\n",dd->name().data()
+ "check for possible recursive directory relation!\n",qPrint(dd->name())
);
return;
}
@@ -575,16 +601,16 @@ static void writeDirTreeNode(OutputList &ol, const DirDef *dd, int level, FTVHel
(tocExpand && // or toc expand and
!dd->getFiles().empty() // there are files
);
- //printf("gd='%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count());
+ //printf("gd='%s': pageDict=%d\n",qPrint(gd->name()),gd->pageDict->count());
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(isDir,dd->shortName(),dd->getReference(),dd->getOutputFileBase(),0,TRUE,TRUE);
+ Doxygen::indexList->addContentsItem(isDir,dd->shortName(),dd->getReference(),dd->getOutputFileBase(),QCString(),TRUE,TRUE);
Doxygen::indexList->incContentsDepth();
}
if (ftv)
{
ftv->addContentsItem(isDir,dd->shortName(),dd->getReference(),
- dd->getOutputFileBase(),0,FALSE,TRUE,dd);
+ dd->getOutputFileBase(),QCString(),FALSE,TRUE,dd);
ftv->incContentsDepth();
}
@@ -656,7 +682,7 @@ static void writeDirTreeNode(OutputList &ol, const DirDef *dd, int level, FTVHel
ftv->addContentsItem(FALSE,
fd->displayName(),
reference,outputBase,
- 0,FALSE,FALSE,fd);
+ QCString(),FALSE,FALSE,fd);
}
}
}
@@ -677,13 +703,14 @@ static void writeDirTreeNode(OutputList &ol, const DirDef *dd, int level, FTVHel
doc = fileVisibleInIndex(fd,src);
if (doc)
{
- addMembersToIndex(fd,LayoutDocManager::File,fd->displayName(),QCString(),TRUE);
+ addMembersToIndex(fd,LayoutDocManager::File,fd->displayName(),QCString(),
+ TRUE,FALSE,&fd->getConcepts());
}
else if (src)
{
Doxygen::indexList->addContentsItem(
- FALSE, fd->name(), 0,
- fd->getSourceFileBase(), 0, FALSE, TRUE, fd);
+ FALSE, fd->name(), QCString(),
+ fd->getSourceFileBase(), QCString(), FALSE, TRUE, fd);
}
}
}
@@ -738,20 +765,20 @@ static void writeDirHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex)
if (doc || src)
{
ftv->addContentsItem(FALSE,fd->displayName(),
- reference, outputBase, 0,
+ reference, outputBase, QCString(),
FALSE,FALSE,fd.get());
}
if (addToIndex)
{
if (doc)
{
- addMembersToIndex(fd.get(),LayoutDocManager::File,fd->displayName(),QCString(),TRUE);
+ addMembersToIndex(fd.get(),LayoutDocManager::File,fd->displayName(),QCString(),TRUE,FALSE,&fd->getConcepts());
}
else if (src)
{
Doxygen::indexList->addContentsItem(
- FALSE, fd->name(), 0,
- fd->getSourceFileBase(), 0, FALSE, TRUE, fd.get());
+ FALSE, fd->name(), QCString(),
+ fd->getSourceFileBase(), QCString(), FALSE, TRUE, fd.get());
}
}
}
@@ -775,7 +802,7 @@ static void writeClassTreeForList(OutputList &ol,const ClassLinkedMap &cl,bool &
for (const auto &cd : cl)
{
//printf("class %s hasVisibleRoot=%d isVisibleInHierarchy=%d\n",
- // cd->name().data(),
+ // qPrint(cd->name()),
// hasVisibleRoot(cd->baseClasses()),
// cd->isVisibleInHierarchy()
// );
@@ -813,11 +840,11 @@ static void writeClassTreeForList(OutputList &ol,const ClassLinkedMap &cl,bool &
ol.startIndexListItem();
bool hasChildren = visitedClasses.find(cd.get())==visitedClasses.end() &&
classHasVisibleChildren(cd.get());
- //printf("list: Has children %s: %d\n",cd->name().data(),hasChildren);
+ //printf("list: Has children %s: %d\n",qPrint(cd->name()),hasChildren);
if (cd->isLinkable())
{
//printf("Writing class %s isLinkable()=%d isLinkableInProject()=%d cd->templateMaster()=%p\n",
- // cd->displayName().data(),cd->isLinkable(),cd->isLinkableInProject(),cd->templateMaster());
+ // qPrint(cd->displayName()),cd->isLinkable(),cd->isLinkableInProject(),cd->templateMaster());
ol.startIndexItem(cd->getReference(),cd->getOutputFileBase());
ol.parseText(cd->displayName());
ol.endIndexItem(cd->getReference(),cd->getOutputFileBase());
@@ -839,16 +866,16 @@ static void writeClassTreeForList(OutputList &ol,const ClassLinkedMap &cl,bool &
}
else
{
- ol.startIndexItem(0,0);
+ ol.startIndexItem(QCString(),QCString());
ol.parseText(cd->displayName());
- ol.endIndexItem(0,0);
+ ol.endIndexItem(QCString(),QCString());
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),0,0,0,FALSE,FALSE);
+ Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),QCString(),QCString(),QCString(),FALSE,FALSE);
}
if (ftv)
{
- ftv->addContentsItem(hasChildren,cd->displayName(),0,0,0,FALSE,FALSE,cd.get());
+ ftv->addContentsItem(hasChildren,cd->displayName(),QCString(),QCString(),QCString(),FALSE,FALSE,cd.get());
}
}
if (cd->getLanguage()==SrcLangExt_VHDL && hasChildren)
@@ -940,10 +967,10 @@ static void writeHierarchicalIndex(OutputList &ol)
QCString title = lne ? lne->title() : theTranslator->trClassHierarchy();
bool addToIndex = lne==0 || lne->visible();
- startFile(ol,"hierarchy",0, title, HLI_ClassHierarchy);
- startTitle(ol,0);
+ startFile(ol,"hierarchy",QCString(), title, HLI_ClassHierarchy);
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
ol.startTextBlock();
@@ -954,7 +981,7 @@ static void writeHierarchicalIndex(OutputList &ol)
ol.disable(OutputGenerator::RTF);
ol.disable(OutputGenerator::Docbook);
ol.startParagraph();
- ol.startTextLink("inherits",0);
+ ol.startTextLink("inherits",QCString());
ol.parseText(theTranslator->trGotoGraphicalHierarchy());
ol.endTextLink();
ol.endParagraph();
@@ -987,16 +1014,15 @@ static void writeHierarchicalIndex(OutputList &ol)
{
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,title,0,"hierarchy",0,TRUE,TRUE);
+ Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"hierarchy",QCString(),TRUE,TRUE);
}
FTVHelp* ftv = new FTVHelp(FALSE);
writeClassHierarchy(ol,ftv,addToIndex,ClassDef::Class);
- QGString outStr;
- FTextStream t(&outStr);
+ TextStream t;
ftv->generateTreeViewInline(t);
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- ol.writeString(outStr);
+ ol.writeString(t.str().c_str());
ol.popGeneratorState();
delete ftv;
}
@@ -1017,14 +1043,14 @@ static void writeGraphicalClassHierarchy(OutputList &ol)
ol.disableAllBut(OutputGenerator::Html);
LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassHierarchy);
QCString title = lne ? lne->title() : theTranslator->trClassHierarchy();
- startFile(ol,"inherits",0,title,HLI_ClassHierarchy,FALSE,"hierarchy");
- startTitle(ol,0);
+ startFile(ol,"inherits",QCString(),title,HLI_ClassHierarchy,FALSE,"hierarchy");
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
ol.startTextBlock();
ol.startParagraph();
- ol.startTextLink("hierarchy",0);
+ ol.startTextLink("hierarchy",QCString());
ol.parseText(theTranslator->trGotoTextualHierarchy());
ol.endTextLink();
ol.endParagraph();
@@ -1048,10 +1074,10 @@ static void writeHierarchicalInterfaceIndex(OutputList &ol)
QCString title = lne ? lne->title() : theTranslator->trInterfaceHierarchy();
bool addToIndex = lne==0 || lne->visible();
- startFile(ol,"interfacehierarchy",0, title, HLI_InterfaceHierarchy);
- startTitle(ol,0);
+ startFile(ol,"interfacehierarchy",QCString(), title, HLI_InterfaceHierarchy);
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
ol.startTextBlock();
@@ -1060,7 +1086,7 @@ static void writeHierarchicalInterfaceIndex(OutputList &ol)
ol.disable(OutputGenerator::Latex);
ol.disable(OutputGenerator::RTF);
ol.startParagraph();
- ol.startTextLink("interfaceinherits",0);
+ ol.startTextLink("interfaceinherits",QCString());
ol.parseText(theTranslator->trGotoGraphicalHierarchy());
ol.endTextLink();
ol.endParagraph();
@@ -1094,16 +1120,15 @@ static void writeHierarchicalInterfaceIndex(OutputList &ol)
{
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,title,0,"interfacehierarchy",0,TRUE,TRUE);
+ Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"interfacehierarchy",QCString(),TRUE,TRUE);
}
FTVHelp* ftv = new FTVHelp(FALSE);
writeClassHierarchy(ol,ftv,addToIndex,ClassDef::Interface);
- QGString outStr;
- FTextStream t(&outStr);
+ TextStream t;
ftv->generateTreeViewInline(t);
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- ol.writeString(outStr);
+ ol.writeString(t.str().c_str());
ol.popGeneratorState();
delete ftv;
}
@@ -1124,14 +1149,14 @@ static void writeGraphicalInterfaceHierarchy(OutputList &ol)
ol.disableAllBut(OutputGenerator::Html);
LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::InterfaceHierarchy);
QCString title = lne ? lne->title() : theTranslator->trInterfaceHierarchy();
- startFile(ol,"interfaceinherits",0,title,HLI_InterfaceHierarchy,FALSE,"interfacehierarchy");
- startTitle(ol,0);
+ startFile(ol,"interfaceinherits",QCString(),title,HLI_InterfaceHierarchy,FALSE,"interfacehierarchy");
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
ol.startTextBlock();
ol.startParagraph();
- ol.startTextLink("interfacehierarchy",0);
+ ol.startTextLink("interfacehierarchy",QCString());
ol.parseText(theTranslator->trGotoTextualHierarchy());
ol.endTextLink();
ol.endParagraph();
@@ -1155,10 +1180,10 @@ static void writeHierarchicalExceptionIndex(OutputList &ol)
QCString title = lne ? lne->title() : theTranslator->trExceptionHierarchy();
bool addToIndex = lne==0 || lne->visible();
- startFile(ol,"exceptionhierarchy",0, title, HLI_ExceptionHierarchy);
- startTitle(ol,0);
+ startFile(ol,"exceptionhierarchy",QCString(), title, HLI_ExceptionHierarchy);
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
ol.startTextBlock();
@@ -1167,7 +1192,7 @@ static void writeHierarchicalExceptionIndex(OutputList &ol)
ol.disable(OutputGenerator::Latex);
ol.disable(OutputGenerator::RTF);
ol.startParagraph();
- ol.startTextLink("exceptioninherits",0);
+ ol.startTextLink("exceptioninherits",QCString());
ol.parseText(theTranslator->trGotoGraphicalHierarchy());
ol.endTextLink();
ol.endParagraph();
@@ -1201,16 +1226,15 @@ static void writeHierarchicalExceptionIndex(OutputList &ol)
{
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,title,0,"exceptionhierarchy",0,TRUE,TRUE);
+ Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"exceptionhierarchy",QCString(),TRUE,TRUE);
}
FTVHelp* ftv = new FTVHelp(FALSE);
writeClassHierarchy(ol,ftv,addToIndex,ClassDef::Exception);
- QGString outStr;
- FTextStream t(&outStr);
+ TextStream t;
ftv->generateTreeViewInline(t);
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- ol.writeString(outStr);
+ ol.writeString(t.str().c_str());
ol.popGeneratorState();
delete ftv;
}
@@ -1231,14 +1255,14 @@ static void writeGraphicalExceptionHierarchy(OutputList &ol)
ol.disableAllBut(OutputGenerator::Html);
LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ExceptionHierarchy);
QCString title = lne ? lne->title() : theTranslator->trExceptionHierarchy();
- startFile(ol,"exceptioninherits",0,title,HLI_ExceptionHierarchy,FALSE,"exceptionhierarchy");
- startTitle(ol,0);
+ startFile(ol,"exceptioninherits",QCString(),title,HLI_ExceptionHierarchy,FALSE,"exceptionhierarchy");
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
ol.startTextBlock();
ol.startParagraph();
- ol.startTextLink("exceptionhierarchy",0);
+ ol.startTextLink("exceptionhierarchy",QCString());
ol.parseText(theTranslator->trGotoTextualHierarchy());
ol.endTextLink();
ol.endParagraph();
@@ -1275,7 +1299,7 @@ static void countFiles(int &htmlFiles,int &files)
static void writeSingleFileIndex(OutputList &ol,const FileDef *fd)
{
- //printf("Found filedef %s\n",fd->name().data());
+ //printf("Found filedef %s\n",qPrint(fd->name()));
bool doc = fd->isLinkableInProject();
bool src = fd->generateSourceFile();
bool nameOk = !fd->isDocumentationFile();
@@ -1284,7 +1308,7 @@ static void writeSingleFileIndex(OutputList &ol,const FileDef *fd)
QCString path;
if (Config_getBool(FULL_PATH_NAMES))
{
- path=stripFromPath(fd->getPath().copy());
+ path=stripFromPath(fd->getPath());
}
QCString fullName=fd->name();
if (!path.isEmpty())
@@ -1297,7 +1321,7 @@ static void writeSingleFileIndex(OutputList &ol,const FileDef *fd)
ol.docify(path);
if (doc)
{
- ol.writeObjectLink(0,fd->getOutputFileBase(),0,fd->name());
+ ol.writeObjectLink(QCString(),fd->getOutputFileBase(),QCString(),fd->name());
//if (addToIndex)
//{
// addMembersToIndex(fd,LayoutDocManager::File,fullName,QCString());
@@ -1310,7 +1334,7 @@ static void writeSingleFileIndex(OutputList &ol,const FileDef *fd)
ol.endBold();
//if (addToIndex)
//{
- // Doxygen::indexList->addContentsItem(FALSE,fullName,0,0,0);
+ // Doxygen::indexList->addContentsItem(FALSE,fullName,QCString(),QCString(),QCString());
//}
}
if (src)
@@ -1318,7 +1342,7 @@ static void writeSingleFileIndex(OutputList &ol,const FileDef *fd)
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
ol.docify(" ");
- ol.startTextLink(fd->includeName(),0);
+ ol.startTextLink(fd->includeName(),QCString());
ol.docify("[");
ol.parseText(theTranslator->trCode());
ol.docify("]");
@@ -1337,7 +1361,7 @@ static void writeSingleFileIndex(OutputList &ol,const FileDef *fd)
fd->briefDescription(TRUE),
FALSE, // index words
FALSE, // isExample
- 0, // example name
+ QCString(), // example name
TRUE, // single line
TRUE, // link from index
Config_getBool(MARKDOWN_SUPPORT)
@@ -1366,20 +1390,20 @@ static void writeFileIndex(OutputList &ol)
QCString title = lne ? lne->title() : theTranslator->trFileList();
bool addToIndex = lne==0 || lne->visible();
- startFile(ol,"files",0,title,HLI_Files);
- startTitle(ol,0);
+ startFile(ol,"files",QCString(),title,HLI_Files);
+ startTitle(ol,QCString());
//if (!Config_getString(PROJECT_NAME).isEmpty())
//{
// title.prepend(Config_getString(PROJECT_NAME)+" ");
//}
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
ol.startTextBlock();
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,title,0,"files",0,TRUE,TRUE);
+ Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"files",QCString(),TRUE,TRUE);
Doxygen::indexList->incContentsDepth();
}
@@ -1462,10 +1486,9 @@ static void writeFileIndex(OutputList &ol)
FTVHelp* ftv = new FTVHelp(FALSE);
writeDirHierarchy(ol,ftv,addToIndex);
- QGString outStr;
- FTextStream t(&outStr);
+ TextStream t;
ftv->generateTreeViewInline(t);
- ol.writeString(outStr);
+ ol.writeString(t.str().c_str());
delete ftv;
ol.popGeneratorState();
@@ -1492,6 +1515,18 @@ static int countNamespaces()
}
//----------------------------------------------------------------------------
+static int countConcepts()
+{
+ int count=0;
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ if (cd->isLinkableInProject()) count++;
+ }
+ return count;
+}
+
+
+//----------------------------------------------------------------------------
template<typename Ptr> const ClassDef *get_pointer(const Ptr &p);
template<> const ClassDef *get_pointer(const ClassLinkedMap::Ptr &p) { return p.get(); }
template<> const ClassDef *get_pointer(const ClassLinkedRefMap::Ptr &p) { return p; }
@@ -1515,7 +1550,7 @@ static void writeClassTree(const ListType &cl,FTVHelp *ftv,bool addToIndex,bool
if ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ARCHITECTURECLASS)
{
QCString n=cd->name();
- cdm->setClassName(n.data());
+ cdm->setClassName(n);
}
}
@@ -1598,7 +1633,7 @@ static void writeNamespaceMembers(const NamespaceDef *nd,bool addToIndex)
{
for (const auto &md : *ml)
{
- //printf(" member %s visible=%d\n",md->name().data(),memberVisibleInIndex(md));
+ //printf(" member %s visible=%d\n",qPrint(md->name()),memberVisibleInIndex(md));
if (memberVisibleInIndex(md))
{
writeMemberToIndex(nd,md,addToIndex);
@@ -1609,6 +1644,7 @@ static void writeNamespaceMembers(const NamespaceDef *nd,bool addToIndex)
}
}
+static void writeConceptList(const ConceptLinkedRefMap &concepts, FTVHelp *ftv,bool addToIndex);
static void writeNamespaceTree(const NamespaceLinkedRefMap &nsLinkedMap,FTVHelp *ftv,
bool rootOnly,bool addToIndex);
@@ -1620,11 +1656,12 @@ static void writeNamespaceTreeElement(const NamespaceDef *nd,FTVHelp *ftv,
{
bool hasChildren = namespaceHasNestedNamespace(nd) ||
- namespaceHasNestedClass(nd,false,ClassDef::Class);
+ namespaceHasNestedClass(nd,false,ClassDef::Class) ||
+ namespaceHasNestedConcept(nd);
bool isLinkable = nd->isLinkableInProject();
int visibleMembers = countVisibleMembers(nd);
- //printf("namespace %s hasChildren=%d visibleMembers=%d\n",nd->name().data(),hasChildren,visibleMembers);
+ //printf("namespace %s hasChildren=%d visibleMembers=%d\n",qPrint(nd->name()),hasChildren,visibleMembers);
QCString ref;
QCString file;
@@ -1641,25 +1678,24 @@ static void writeNamespaceTreeElement(const NamespaceDef *nd,FTVHelp *ftv,
bool isDir = hasChildren || visibleMembers>0;
if ((isLinkable) || isDir)
{
- ftv->addContentsItem(hasChildren,nd->localName(),ref,file,0,FALSE,TRUE,nd);
+ ftv->addContentsItem(hasChildren,nd->localName(),ref,file,QCString(),FALSE,nd->partOfGroups().empty(),nd);
if (addToIndex)
{
Doxygen::indexList->addContentsItem(isDir,nd->localName(),ref,file,QCString(),
- hasChildren && !file.isEmpty(),addToIndex);
+ hasChildren && !file.isEmpty(),nd->partOfGroups().empty());
}
if (addToIndex && isDir)
{
Doxygen::indexList->incContentsDepth();
}
- //printf("*** writeNamespaceTree count=%d addToIndex=%d false=%d classCount=%d\n",
- // count,addToIndex,false,classCount);
if (isDir)
{
ftv->incContentsDepth();
writeNamespaceTree(nd->getNamespaces(),ftv,FALSE,addToIndex);
writeClassTree(nd->getClasses(),ftv,FALSE,FALSE,ClassDef::Class);
+ writeConceptList(nd->getConcepts(),ftv,FALSE);
writeNamespaceMembers(nd,addToIndex);
ftv->decContentsDepth();
}
@@ -1702,7 +1738,7 @@ static void writeClassTreeInsideNamespaceElement(const NamespaceDef *nd,FTVHelp
bool isDir = namespaceHasNestedClass(nd,sliceOpt,ct);
bool isLinkable = nd->isLinkableInProject();
- //printf("namespace %s isDir=%d\n",nd->name().data(),isDir);
+ //printf("namespace %s isDir=%d\n",qPrint(nd->name()),isDir);
QCString ref;
QCString file;
@@ -1718,7 +1754,7 @@ static void writeClassTreeInsideNamespaceElement(const NamespaceDef *nd,FTVHelp
if (isDir)
{
- ftv->addContentsItem(isDir,nd->localName(),ref,file,0,FALSE,TRUE,nd);
+ ftv->addContentsItem(isDir,nd->localName(),ref,file,QCString(),FALSE,TRUE,nd);
if (addToIndex)
{
@@ -1792,10 +1828,10 @@ static void writeNamespaceIndex(OutputList &ol)
if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces); // fall back
QCString title = lne ? lne->title() : theTranslator->trNamespaceList();
bool addToIndex = lne==0 || lne->visible();
- startFile(ol,"namespaces",0,title,HLI_Namespaces);
- startTitle(ol,0);
+ startFile(ol,"namespaces",QCString(),title,HLI_Namespaces);
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
ol.startTextBlock();
ol.parseText(lne ? lne->intro() : theTranslator->trNamespaceListDescription(Config_getBool(EXTRACT_ALL)));
@@ -1822,11 +1858,11 @@ static void writeNamespaceIndex(OutputList &ol)
ol.startIndexKey();
if (nd->getLanguage()==SrcLangExt_VHDL)
{
- ol.writeObjectLink(0, nd->getOutputFileBase().replace(0,qstrlen("namespace"),"class"),0,nd->displayName());
+ ol.writeObjectLink(QCString(), nd->getOutputFileBase().replace(0,qstrlen("namespace"),"class"),QCString(),nd->displayName());
}
else
{
- ol.writeObjectLink(0,nd->getOutputFileBase(),0,nd->displayName());
+ ol.writeObjectLink(QCString(),nd->getOutputFileBase(),QCString(),nd->displayName());
}
ol.endIndexKey();
@@ -1841,7 +1877,7 @@ static void writeNamespaceIndex(OutputList &ol)
nd->briefDescription(TRUE),
FALSE, // index words
FALSE, // isExample
- 0, // example name
+ QCString(), // example name
TRUE, // single line
TRUE, // link from index
Config_getBool(MARKDOWN_SUPPORT)
@@ -1865,15 +1901,14 @@ static void writeNamespaceIndex(OutputList &ol)
{
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,title,0,"namespaces",0,TRUE,TRUE);
+ Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"namespaces",QCString(),TRUE,TRUE);
Doxygen::indexList->incContentsDepth();
}
FTVHelp* ftv = new FTVHelp(FALSE);
writeNamespaceTree(*Doxygen::namespaceLinkedMap,ftv,TRUE,addToIndex);
- QGString outStr;
- FTextStream t(&outStr);
+ TextStream t;
ftv->generateTreeViewInline(t);
- ol.writeString(outStr);
+ ol.writeString(t.str().c_str());
delete ftv;
if (addToIndex)
{
@@ -1956,10 +1991,10 @@ static void writeAnnotatedClassList(OutputList &ol,ClassDef::CompoundType ct)
if (cd->getLanguage()==SrcLangExt_VHDL)
{
QCString prot= VhdlDocGen::getProtectionName((VhdlDocGen::VhdlClasses)cd->protection());
- ol.docify(prot.data());
+ ol.docify(prot);
ol.writeString(" ");
}
- ol.writeObjectLink(0,cd->getOutputFileBase(),cd->anchor(),cd->displayName());
+ ol.writeObjectLink(QCString(),cd->getOutputFileBase(),cd->anchor(),cd->displayName());
ol.endIndexKey();
bool hasBrief = !cd->briefDescription().isEmpty();
ol.startIndexValue(hasBrief);
@@ -1971,7 +2006,7 @@ static void writeAnnotatedClassList(OutputList &ol,ClassDef::CompoundType ct)
cd->briefDescription(TRUE),
FALSE, // indexWords
FALSE, // isExample
- 0, // example name
+ QCString(), // example name
TRUE, // single line
TRUE, // link from index
Config_getBool(MARKDOWN_SUPPORT)
@@ -1994,10 +2029,10 @@ inline bool isId1(int c)
return (c<127 && c>31); // printable ASCII character
}
-static QCString letterToLabel(const char *startLetter)
+static QCString letterToLabel(const QCString &startLetter)
{
- const char *p = startLetter;
- if (startLetter==0 || *startLetter==0) return "";
+ if (startLetter.isEmpty()) return startLetter;
+ const char *p = startLetter.data();
char c = *p;
QCString result;
if (isId1(c))
@@ -2060,13 +2095,12 @@ static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct
if (cd->getLanguage()==SrcLangExt_VHDL && !((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS ))// no architecture
continue;
+ // get the first UTF8 character (after the part that should be ignored)
int index = getPrefixIndex(cd->className());
- //printf("name=%s index=%d %d\n",cd->className().data(),index,cd->protection());
- char charStr[MAX_UTF8_CHAR_SIZE];
- if (getUtf8Char(cd->className().data()+index,charStr,CaseModifier::ToUpper)>0)
- // get the first UTF8 character (after the part that should be ignored)
+ std::string letter = getUTF8CharAt(cd->className().str(),index);
+ if (!letter.empty())
{
- indexLettersUsed.insert(charStr);
+ indexLettersUsed.insert(convertUTF8ToUpper(letter));
}
}
}
@@ -2079,9 +2113,9 @@ static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct
if (!first) alphaLinks += "&#160;|&#160;";
first=false;
QCString li = letterToLabel(letter.c_str());
- alphaLinks += (QCString)"<a class=\"qindex\" href=\"#letter_" +
+ alphaLinks += "<a class=\"qindex\" href=\"#letter_" +
li + "\">" +
- letter + "</a>";
+ QCString(letter) + "</a>";
}
alphaLinks += "</div>\n";
ol.writeString(alphaLinks);
@@ -2100,12 +2134,13 @@ static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct
if (cd->isLinkableInProject() && cd->templateMaster()==0)
{
- int index = getPrefixIndex(cd->className());
- char charStr[MAX_UTF8_CHAR_SIZE];
- if (getUtf8Char(cd->className().data()+index,charStr,CaseModifier::ToUpper)>0)
- // get the first UTF8 character (after the part that should be ignored)
+ QCString className = cd->className();
+ int index = getPrefixIndex(className);
+ std::string letter = getUTF8CharAt(className.str(),index);
+ if (!letter.empty())
{
- auto it = classesByLetter.find(charStr);
+ letter = convertUTF8ToUpper(letter);
+ auto it = classesByLetter.find(letter);
if (it!=classesByLetter.end()) // add class to the existing list
{
it->second.push_back(cd.get());
@@ -2113,8 +2148,7 @@ static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct
else // new entry
{
classesByLetter.insert(
- std::make_pair(std::string(charStr),
- std::vector<const ClassDef*>({ cd.get() })));
+ std::make_pair(letter, std::vector<const ClassDef*>({ cd.get() })));
}
}
}
@@ -2180,7 +2214,7 @@ static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct
if (nd && nd->isLinkable())
{
ol.writeObjectLink(nd->getReference(),
- nd->getOutputFileBase(),0,nsDispName);
+ nd->getOutputFileBase(),QCString(),nsDispName);
}
else
{
@@ -2208,15 +2242,15 @@ static void writeAlphabeticalIndex(OutputList &ol)
QCString title = lne ? lne->title() : theTranslator->trCompoundIndex();
bool addToIndex = lne==0 || lne->visible();
- startFile(ol,"classes",0,title,HLI_Classes);
+ startFile(ol,"classes",QCString(),title,HLI_Classes);
- startTitle(ol,0);
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(FALSE,title,0,"classes",0,FALSE,TRUE);
+ Doxygen::indexList->addContentsItem(FALSE,title,QCString(),"classes",QCString(),FALSE,TRUE);
}
ol.startContents();
@@ -2237,15 +2271,15 @@ static void writeAlphabeticalInterfaceIndex(OutputList &ol)
QCString title = lne ? lne->title() : theTranslator->trInterfaceIndex();
bool addToIndex = lne==0 || lne->visible();
- startFile(ol,"interfaces",0,title,HLI_Interfaces);
+ startFile(ol,"interfaces",QCString(),title,HLI_Interfaces);
- startTitle(ol,0);
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(FALSE,title,0,"interfaces",0,FALSE,TRUE);
+ Doxygen::indexList->addContentsItem(FALSE,title,QCString(),"interfaces",QCString(),FALSE,TRUE);
}
ol.startContents();
@@ -2266,15 +2300,15 @@ static void writeAlphabeticalStructIndex(OutputList &ol)
QCString title = lne ? lne->title() : theTranslator->trStructIndex();
bool addToIndex = lne==0 || lne->visible();
- startFile(ol,"structs",0,title,HLI_Structs);
+ startFile(ol,"structs",QCString(),title,HLI_Structs);
- startTitle(ol,0);
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(FALSE,title,0,"structs",0,FALSE,TRUE);
+ Doxygen::indexList->addContentsItem(FALSE,title,QCString(),"structs",QCString(),FALSE,TRUE);
}
ol.startContents();
@@ -2295,15 +2329,15 @@ static void writeAlphabeticalExceptionIndex(OutputList &ol)
QCString title = lne ? lne->title() : theTranslator->trExceptionIndex();
bool addToIndex = lne==0 || lne->visible();
- startFile(ol,"exceptions",0,title,HLI_Exceptions);
+ startFile(ol,"exceptions",QCString(),title,HLI_Exceptions);
- startTitle(ol,0);
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(FALSE,title,0,"exceptions",0,FALSE,TRUE);
+ Doxygen::indexList->addContentsItem(FALSE,title,QCString(),"exceptions",QCString(),FALSE,TRUE);
}
ol.startContents();
@@ -2358,11 +2392,11 @@ static void writeAnnotatedIndexGeneric(OutputList &ol,const AnnotatedIndexContex
QCString title = lne ? lne->title() : ctx.listDefaultTitleText;
bool addToIndex = lne==0 || lne->visible();
- startFile(ol,ctx.fileBaseName,0,title,ctx.hiItem);
+ startFile(ol,ctx.fileBaseName,QCString(),title,ctx.hiItem);
- startTitle(ol,0);
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
@@ -2391,16 +2425,15 @@ static void writeAnnotatedIndexGeneric(OutputList &ol,const AnnotatedIndexContex
{
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,title,0,ctx.fileBaseName,0,TRUE,TRUE);
+ Doxygen::indexList->addContentsItem(TRUE,title,QCString(),ctx.fileBaseName,QCString(),TRUE,TRUE);
Doxygen::indexList->incContentsDepth();
}
FTVHelp ftv(false);
writeClassTreeInsideNamespace(*Doxygen::namespaceLinkedMap,&ftv,TRUE,addToIndex,ctx.compoundType);
writeClassTree(*Doxygen::classLinkedMap,&ftv,addToIndex,TRUE,ctx.compoundType);
- QGString outStr;
- FTextStream t(&outStr);
+ TextStream t;
ftv.generateTreeViewInline(t);
- ol.writeString(outStr);
+ ol.writeString(t.str().c_str());
if (addToIndex)
{
Doxygen::indexList->decContentsDepth();
@@ -2471,7 +2504,7 @@ static void writeAnnotatedExceptionIndex(OutputList &ol)
}
//----------------------------------------------------------------------------
-static void writeClassLinkForMember(OutputList &ol,const MemberDef *md,const char *separator,
+static void writeClassLinkForMember(OutputList &ol,const MemberDef *md,const QCString &separator,
QCString &prevClassName)
{
const ClassDef *cd=md->getClassDef();
@@ -2485,7 +2518,7 @@ static void writeClassLinkForMember(OutputList &ol,const MemberDef *md,const cha
}
}
-static void writeFileLinkForMember(OutputList &ol,const MemberDef *md,const char *separator,
+static void writeFileLinkForMember(OutputList &ol,const MemberDef *md,const QCString &separator,
QCString &prevFileName)
{
const FileDef *fd=md->getFileDef();
@@ -2499,7 +2532,7 @@ static void writeFileLinkForMember(OutputList &ol,const MemberDef *md,const char
}
}
-static void writeNamespaceLinkForMember(OutputList &ol,const MemberDef *md,const char *separator,
+static void writeNamespaceLinkForMember(OutputList &ol,const MemberDef *md,const QCString &separator,
QCString &prevNamespaceName)
{
const NamespaceDef *nd=md->getNamespaceDef();
@@ -2520,7 +2553,7 @@ static void writeMemberList(OutputList &ol,bool useSections,const std::string &p
int index = (int)type;
ASSERT(index<3);
- typedef void (*writeLinkForMember_t)(OutputList &ol,const MemberDef *md,const char *separator,
+ typedef void (*writeLinkForMember_t)(OutputList &ol,const MemberDef *md,const QCString &separator,
QCString &prevNamespaceName);
// each index tab has its own write function
@@ -2561,7 +2594,7 @@ static void writeMemberList(OutputList &ol,bool useSections,const std::string &p
(md->isFunction() || md->isSlot() || md->isSignal());
QCString name=md->name();
int startIndex = getPrefixIndex(name);
- if (QCString(name.data()+startIndex)!=prevName) // new entry
+ if (name.data()+startIndex!=prevName) // new entry
{
if ((prevName.isEmpty() ||
tolower(name.at(startIndex))!=tolower(prevName.at(0))) &&
@@ -2642,9 +2675,10 @@ void addClassMemberNameToIndex(const MemberDef *md)
{
QCString n = md->name();
int index = getPrefixIndex(n);
- char letter[MAX_UTF8_CHAR_SIZE];
- if (getUtf8Char(n.data()+index,letter,CaseModifier::ToLower)>0)
+ std::string letter = getUTF8CharAt(n.str(),index);
+ if (!letter.empty())
{
+ letter = convertUTF8ToLower(letter);
bool isFriendToHide = hideFriendCompounds &&
(QCString(md->typeString())=="friend class" ||
QCString(md->typeString())=="friend struct" ||
@@ -2720,9 +2754,10 @@ void addNamespaceMemberNameToIndex(const MemberDef *md)
{
QCString n = md->name();
int index = getPrefixIndex(n);
- char letter[MAX_UTF8_CHAR_SIZE];
- if (getUtf8Char(n.data()+index,letter,CaseModifier::ToLower)>0)
+ std::string letter = getUTF8CharAt(n.str(),index);
+ if (!letter.empty())
{
+ letter = convertUTF8ToLower(letter);
if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
{
MemberIndexMap_add(g_namespaceIndexLetterUsed[NMHL_All],letter,md);
@@ -2787,9 +2822,10 @@ void addFileMemberNameToIndex(const MemberDef *md)
{
QCString n = md->name();
int index = getPrefixIndex(n);
- char letter[MAX_UTF8_CHAR_SIZE];
- if (getUtf8Char(n.data()+index,letter,CaseModifier::ToLower)>0)
+ std::string letter = getUTF8CharAt(n.str(),index);
+ if (!letter.empty())
{
+ letter = convertUTF8ToLower(letter);
if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
{
MemberIndexMap_add(g_fileIndexLetterUsed[FMHL_All],letter,md);
@@ -2904,7 +2940,7 @@ static void writeQuickMemberIndex(OutputList &ol,
/** Helper class representing a class member in the navigation menu. */
struct CmhlInfo
{
- CmhlInfo(const char *fn,const char *t) : fname(fn), title(t) {}
+ CmhlInfo(const char *fn,const QCString &t) : fname(fn), title(t) {}
const char *fname;
QCString title;
};
@@ -2954,8 +2990,8 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(multiPageIndex,getCmhlInfo(hl)->title,0,
- getCmhlInfo(hl)->fname,0,multiPageIndex,TRUE);
+ Doxygen::indexList->addContentsItem(multiPageIndex,getCmhlInfo(hl)->title,QCString(),
+ getCmhlInfo(hl)->fname,QCString(),multiPageIndex,TRUE);
if (multiPageIndex) Doxygen::indexList->incContentsDepth();
}
@@ -2966,23 +3002,23 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h
QCString fileName = getCmhlInfo(hl)->fname;
if (multiPageIndex)
{
- QCString cs = page;
+ QCString cs(page);
if (!first)
{
fileName+="_"+letterToLabel(cs);
}
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
+ Doxygen::indexList->addContentsItem(FALSE,cs,QCString(),fileName,QCString(),FALSE,TRUE);
}
}
bool quickIndex = documentedClassMembers[hl]>maxItemsBeforeQuickIndex;
- ol.startFile(fileName+extension,0,title);
+ ol.startFile(fileName+extension,QCString(),title);
ol.startQuickIndices();
if (!disableIndex)
{
- ol.writeQuickLinks(TRUE,HLI_Functions,0);
+ ol.writeQuickLinks(TRUE,HLI_Functions,QCString());
if (!Config_getBool(HTML_DYNAMIC_MENUS))
{
@@ -3003,7 +3039,7 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h
startQuickIndexItem(ol,getCmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,TRUE,first);
ol.writeString(fixSpaces(getCmhlInfo(i)->title));
//printf("multiPageIndex=%d first=%d fileName=%s file=%s title=%s\n",
- // multiPageIndex,first,fileName.data(),getCmhlInfo(i)->fname,getCmhlInfo(i)->title.data());
+ // multiPageIndex,first,qPrint(fileName),getCmhlInfo(i)->fname,qPrint(getCmhlInfo(i)->title));
endQuickIndexItem(ol);
}
}
@@ -3057,7 +3093,7 @@ static void writeClassMemberIndex(OutputList &ol)
if (documentedClassMembers[CMHL_All]>0 && addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,lne ? lne->title() : theTranslator->trCompoundMembers(),0,"functions",0);
+ Doxygen::indexList->addContentsItem(TRUE,lne ? lne->title() : theTranslator->trCompoundMembers(),QCString(),"functions",QCString());
Doxygen::indexList->incContentsDepth();
}
writeClassMemberIndexFiltered(ol,CMHL_All);
@@ -3081,7 +3117,7 @@ static void writeClassMemberIndex(OutputList &ol)
/** Helper class representing a file member in the navigation menu. */
struct FmhlInfo
{
- FmhlInfo(const char *fn,const char *t) : fname(fn), title(t) {}
+ FmhlInfo(const char *fn,const QCString &t) : fname(fn), title(t) {}
const char *fname;
QCString title;
};
@@ -3131,8 +3167,8 @@ static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl)
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(multiPageIndex,getFmhlInfo(hl)->title,0,
- getFmhlInfo(hl)->fname,0,multiPageIndex,TRUE);
+ Doxygen::indexList->addContentsItem(multiPageIndex,getFmhlInfo(hl)->title,QCString(),
+ getFmhlInfo(hl)->fname,QCString(),multiPageIndex,TRUE);
if (multiPageIndex) Doxygen::indexList->incContentsDepth();
}
@@ -3143,23 +3179,23 @@ static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl)
QCString fileName = getFmhlInfo(hl)->fname;
if (multiPageIndex)
{
- QCString cs = page;
+ QCString cs(page);
if (!first)
{
fileName+="_"+letterToLabel(cs);
}
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
+ Doxygen::indexList->addContentsItem(FALSE,cs,QCString(),fileName,QCString(),FALSE,TRUE);
}
}
bool quickIndex = documentedFileMembers[hl]>maxItemsBeforeQuickIndex;
- ol.startFile(fileName+extension,0,title);
+ ol.startFile(fileName+extension,QCString(),title);
ol.startQuickIndices();
if (!disableIndex)
{
- ol.writeQuickLinks(TRUE,HLI_Globals,0);
+ ol.writeQuickLinks(TRUE,HLI_Globals,QCString());
if (!Config_getBool(HTML_DYNAMIC_MENUS))
{
startQuickIndexList(ol);
@@ -3228,7 +3264,7 @@ static void writeFileMemberIndex(OutputList &ol)
bool addToIndex = lne==0 || lne->visible();
if (documentedFileMembers[FMHL_All]>0 && addToIndex)
{
- Doxygen::indexList->addContentsItem(FALSE,lne ? lne->title() : theTranslator->trFileMembers(),0,"globals",0);
+ Doxygen::indexList->addContentsItem(FALSE,lne ? lne->title() : theTranslator->trFileMembers(),QCString(),"globals",QCString());
Doxygen::indexList->incContentsDepth();
}
writeFileMemberIndexFiltered(ol,FMHL_All);
@@ -3252,7 +3288,7 @@ static void writeFileMemberIndex(OutputList &ol)
/** Helper class representing a namespace member in the navigation menu. */
struct NmhlInfo
{
- NmhlInfo(const char *fn,const char *t) : fname(fn), title(t) {}
+ NmhlInfo(const char *fn,const QCString &t) : fname(fn), title(t) {}
const char *fname;
QCString title;
};
@@ -3305,8 +3341,8 @@ static void writeNamespaceMemberIndexFiltered(OutputList &ol,
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(multiPageIndex,getNmhlInfo(hl)->title,0,
- getNmhlInfo(hl)->fname,0,multiPageIndex,TRUE);
+ Doxygen::indexList->addContentsItem(multiPageIndex,getNmhlInfo(hl)->title,QCString(),
+ getNmhlInfo(hl)->fname,QCString(),multiPageIndex,TRUE);
if (multiPageIndex) Doxygen::indexList->incContentsDepth();
}
@@ -3317,23 +3353,23 @@ static void writeNamespaceMemberIndexFiltered(OutputList &ol,
QCString fileName = getNmhlInfo(hl)->fname;
if (multiPageIndex)
{
- QCString cs = page;
+ QCString cs(page);
if (!first)
{
fileName+="_"+letterToLabel(cs);
}
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
+ Doxygen::indexList->addContentsItem(FALSE,cs,QCString(),fileName,QCString(),FALSE,TRUE);
}
}
bool quickIndex = documentedNamespaceMembers[hl]>maxItemsBeforeQuickIndex;
- ol.startFile(fileName+extension,0,title);
+ ol.startFile(fileName+extension,QCString(),title);
ol.startQuickIndices();
if (!disableIndex)
{
- ol.writeQuickLinks(TRUE,HLI_NamespaceMembers,0);
+ ol.writeQuickLinks(TRUE,HLI_NamespaceMembers,QCString());
if (!Config_getBool(HTML_DYNAMIC_MENUS))
{
startQuickIndexList(ol);
@@ -3402,7 +3438,7 @@ static void writeNamespaceMemberIndex(OutputList &ol)
bool addToIndex = lne==0 || lne->visible();
if (documentedNamespaceMembers[NMHL_All]>0 && addToIndex)
{
- Doxygen::indexList->addContentsItem(FALSE,lne ? lne->title() : theTranslator->trNamespaceMembers(),0,"namespacemembers",0);
+ Doxygen::indexList->addContentsItem(FALSE,lne ? lne->title() : theTranslator->trNamespaceMembers(),QCString(),"namespacemembers",QCString());
Doxygen::indexList->incContentsDepth();
}
//bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
@@ -3435,17 +3471,17 @@ static void writeExampleIndex(OutputList &ol)
QCString title = lne ? lne->title() : theTranslator->trExamples();
bool addToIndex = lne==0 || lne->visible();
- startFile(ol,"examples",0,title,HLI_Examples);
+ startFile(ol,"examples",QCString(),title,HLI_Examples);
- startTitle(ol,0);
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,title,0,"examples",0,TRUE,TRUE);
+ Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"examples",QCString(),TRUE,TRUE);
Doxygen::indexList->incContentsDepth();
}
@@ -3460,18 +3496,18 @@ static void writeExampleIndex(OutputList &ol)
QCString n=pd->getOutputFileBase();
if (!pd->title().isEmpty())
{
- ol.writeObjectLink(0,n,0,pd->title());
+ ol.writeObjectLink(QCString(),n,QCString(),pd->title());
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(FALSE,filterTitle(pd->title().str()),pd->getReference(),n,0,FALSE,TRUE);
+ Doxygen::indexList->addContentsItem(FALSE,filterTitle(pd->title().str()),pd->getReference(),n,QCString(),FALSE,TRUE);
}
}
else
{
- ol.writeObjectLink(0,n,0,pd->name());
+ ol.writeObjectLink(QCString(),n,QCString(),pd->name());
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(FALSE,pd->name(),pd->getReference(),n,0,FALSE,TRUE);
+ Doxygen::indexList->addContentsItem(FALSE,pd->name(),pd->getReference(),n,QCString(),FALSE,TRUE);
}
}
ol.endItemListItem();
@@ -3521,7 +3557,7 @@ static bool mainPageHasOwnTitle()
static void writePages(const PageDef *pd,FTVHelp *ftv)
{
- //printf("writePages()=%s pd=%p mainpage=%p\n",pd->name().data(),pd,Doxygen::mainPage);
+ //printf("writePages()=%s pd=%p mainpage=%p\n",qPrint(pd->name()),pd,Doxygen::mainPage);
LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Pages);
bool addToIndex = lne==0 || lne->visible();
if (!addToIndex) return;
@@ -3540,18 +3576,18 @@ static void writePages(const PageDef *pd,FTVHelp *ftv)
if (ftv)
{
- //printf("*** adding %s hasSubPages=%d hasSections=%d\n",pageTitle.data(),hasSubPages,hasSections);
+ //printf("*** adding %s hasSubPages=%d hasSections=%d\n",qPrint(pageTitle),hasSubPages,hasSections);
ftv->addContentsItem(
hasSubPages,pageTitle,
pd->getReference(),pd->getOutputFileBase(),
- 0,hasSubPages,TRUE,pd);
+ QCString(),hasSubPages,TRUE,pd);
}
if (addToIndex && pd!=Doxygen::mainPage.get())
{
Doxygen::indexList->addContentsItem(
hasSubPages || hasSections,pageTitle,
pd->getReference(),pd->getOutputFileBase(),
- 0,hasSubPages,TRUE);
+ QCString(),hasSubPages,TRUE);
}
}
if (hasSubPages && ftv) ftv->incContentsDepth();
@@ -3574,7 +3610,7 @@ static void writePages(const PageDef *pd,FTVHelp *ftv)
{
Doxygen::indexList->decContentsDepth();
}
- //printf("end writePages()=%s\n",pd->title().data());
+ //printf("end writePages()=%s\n",qPrint(pd->title()));
}
//----------------------------------------------------------------------------
@@ -3586,10 +3622,10 @@ static void writePageIndex(OutputList &ol)
ol.disableAllBut(OutputGenerator::Html);
LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Pages);
QCString title = lne ? lne->title() : theTranslator->trRelatedPages();
- startFile(ol,"pages",0,title,HLI_Pages);
- startTitle(ol,0);
+ startFile(ol,"pages",QCString(),title,HLI_Pages);
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
ol.startTextBlock();
ol.parseText(lne ? lne->intro() : theTranslator->trRelatedPagesDescription());
@@ -3607,10 +3643,9 @@ static void writePageIndex(OutputList &ol)
writePages(pd.get(),ftv);
}
}
- QGString outStr;
- FTextStream t(&outStr);
+ TextStream t;
ftv->generateTreeViewInline(t);
- ol.writeString(outStr);
+ ol.writeString(t.str().c_str());
delete ftv;
}
@@ -3673,10 +3708,10 @@ void writeGraphInfo(OutputList &ol)
// temporarily disable create subdirs for linking to our example
createSubdirs = Config_updateBool(CREATE_SUBDIRS,FALSE);
- startFile(ol,"graph_legend",0,theTranslator->trLegendTitle().data());
- startTitle(ol,0);
+ startFile(ol,"graph_legend",QCString(),theTranslator->trLegendTitle());
+ startTitle(ol,QCString());
ol.parseText(theTranslator->trLegendTitle());
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
QCString legendDocs = theTranslator->trLegendDocs();
int s = legendDocs.find("<center>");
@@ -3685,11 +3720,11 @@ void writeGraphInfo(OutputList &ol)
if (imgExt=="svg" && s!=-1 && e!=-1)
{
legendDocs = legendDocs.left(s+8) + "[!-- SVG 0 --]\n" + legendDocs.mid(e);
- //printf("legendDocs=%s\n",legendDocs.data());
+ //printf("legendDocs=%s\n",qPrint(legendDocs));
}
FileDef *fd = createFileDef("","graph_legend.dox");
ol.generateDoc("graph_legend",1,fd,0,legendDocs,FALSE,FALSE,
- 0,FALSE,FALSE,FALSE);
+ QCString(),FALSE,FALSE,FALSE);
delete fd;
// restore config settings
@@ -3713,7 +3748,7 @@ static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FT
if (level>20)
{
warn(gd->getDefFileName(),gd->getDefLine(),
- "maximum nesting level exceeded for group %s: check for possible recursive group relation!\n",gd->name().data()
+ "maximum nesting level exceeded for group %s: check for possible recursive group relation!\n",qPrint(gd->name())
);
return;
}
@@ -3726,7 +3761,7 @@ static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FT
(!gd->isReference() || Config_getBool(EXTERNAL_GROUPS)) // hide external groups by default
)
{
- //printf("gd->name()=%s #members=%d\n",gd->name().data(),gd->countMembers());
+ //printf("gd->name()=%s #members=%d\n",qPrint(gd->name()),gd->countMembers());
// write group info
bool hasSubGroups = !gd->getSubGroups().empty();
bool hasSubPages = !gd->getPages().empty();
@@ -3743,21 +3778,22 @@ static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FT
numSubItems += gd->getNamespaces().size();
numSubItems += gd->getClasses().size();
numSubItems += gd->getFiles().size();
+ numSubItems += gd->getConcepts().size();
numSubItems += gd->getDirs().size();
numSubItems += gd->getPages().size();
}
bool isDir = hasSubGroups || hasSubPages || numSubItems>0;
- //printf("gd='%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count());
+ //printf("gd='%s': pageDict=%d\n",qPrint(gd->name()),gd->pageDict->count());
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(isDir,gd->groupTitle(),gd->getReference(),gd->getOutputFileBase(),0,isDir,TRUE);
+ Doxygen::indexList->addContentsItem(isDir,gd->groupTitle(),gd->getReference(),gd->getOutputFileBase(),QCString(),isDir,TRUE);
Doxygen::indexList->incContentsDepth();
}
if (ftv)
{
ftv->addContentsItem(hasSubGroups,gd->groupTitle(),
- gd->getReference(),gd->getOutputFileBase(),0,
+ gd->getReference(),gd->getOutputFileBase(),QCString(),
FALSE,FALSE,gd);
ftv->incContentsDepth();
}
@@ -3793,7 +3829,7 @@ static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FT
if (md->isVisible() && !md->isAnonymous())
{
Doxygen::indexList->addContentsItem(isDir,
- md->name(),md->getReference(),
+ md->qualifiedName(),md->getReference(),
md->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
}
if (isDir)
@@ -3804,7 +3840,7 @@ static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FT
if (emd->isVisible())
{
Doxygen::indexList->addContentsItem(FALSE,
- emd->name(),emd->getReference(),emd->getOutputFileBase(),
+ emd->qualifiedName(),emd->getReference(),emd->getOutputFileBase(),
emd->anchor(),FALSE,addToIndex);
}
}
@@ -3820,21 +3856,15 @@ static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FT
//bool nestedClassInSameGroup =
// cd->getOuterScope() && cd->getOuterScope()->definitionType()==Definition::TypeClass &&
// cd->getOuterScope()->partOfGroups().empty() && cd->getOuterScope()->partOfGroups()->contains(gd);
- //printf("===== GroupClasses: %s visible=%d nestedClassInSameGroup=%d\n",cd->name().data(),cd->isVisible(),nestedClassInSameGroup);
+ //printf("===== GroupClasses: %s visible=%d nestedClassInSameGroup=%d\n",qPrint(cd->name()),cd->isVisible(),nestedClassInSameGroup);
if (cd->isVisible() /*&& !nestedClassInSameGroup*/)
{
- //if (cd->isEmbeddedInOuterScope())
- //{
- //printf("add class & members %d\n",addToIndex);
- addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(FALSE),cd->anchor(),addToIndex,TRUE);
- //}
- //else // only index the class, not its members
- //{
- // printf("%s: add class only\n",cd->name().data());
- // Doxygen::indexList->addContentsItem(FALSE,
- // cd->displayName(TRUE),cd->getReference(),
- // cd->getOutputFileBase(),cd->anchor(),addToIndex,TRUE);
- //}
+ addMembersToIndex(cd,
+ LayoutDocManager::Class,
+ cd->displayName(),
+ cd->anchor(),
+ addToIndex,
+ TRUE);
}
}
}
@@ -3845,8 +3875,20 @@ static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FT
if (nd->isVisible())
{
Doxygen::indexList->addContentsItem(FALSE,
- nd->localName(),nd->getReference(),
- nd->getOutputFileBase(),0,FALSE,FALSE);
+ nd->displayName(),nd->getReference(),
+ nd->getOutputFileBase(),QCString(),FALSE,addToIndex);
+ }
+ }
+ }
+ else if (lde->kind()==LayoutDocEntry::GroupConcepts && addToIndex)
+ {
+ for (const auto &cd : gd->getConcepts())
+ {
+ if (cd->isVisible())
+ {
+ Doxygen::indexList->addContentsItem(FALSE,
+ cd->displayName(),cd->getReference(),
+ cd->getOutputFileBase(),QCString(),FALSE,addToIndex);
}
}
}
@@ -3858,7 +3900,7 @@ static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FT
{
Doxygen::indexList->addContentsItem(FALSE,
fd->displayName(),fd->getReference(),
- fd->getOutputFileBase(),0,FALSE,FALSE);
+ fd->getOutputFileBase(),QCString(),FALSE,FALSE);
}
}
}
@@ -3870,7 +3912,7 @@ static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FT
{
Doxygen::indexList->addContentsItem(FALSE,
dd->shortName(),dd->getReference(),
- dd->getOutputFileBase(),0,FALSE,FALSE);
+ dd->getOutputFileBase(),QCString(),FALSE,FALSE);
}
}
}
@@ -3887,7 +3929,7 @@ static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FT
pd->title(),
gd->getReference(),
gd->getOutputFileBase(),
- si ? si->label().data() : 0,
+ si ? si->label() : QCString(),
hasSubPages || hasSections,
TRUE); // addToNavIndex
if (hasSections || hasSubPages)
@@ -3965,10 +4007,10 @@ static void writeGroupIndex(OutputList &ol)
QCString title = lne ? lne->title() : theTranslator->trModules();
bool addToIndex = lne==0 || lne->visible();
- startFile(ol,"modules",0,title,HLI_Modules);
- startTitle(ol,0);
+ startFile(ol,"modules",QCString(),title,HLI_Modules);
+ startTitle(ol,QCString());
ol.parseText(title);
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
ol.startTextBlock();
ol.parseText(lne ? lne->intro() : theTranslator->trModulesDescription());
@@ -3998,16 +4040,15 @@ static void writeGroupIndex(OutputList &ol)
{
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,title,0,"modules",0,TRUE,TRUE);
+ Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"modules",QCString(),TRUE,TRUE);
Doxygen::indexList->incContentsDepth();
}
FTVHelp* ftv = new FTVHelp(FALSE);
writeGroupHierarchy(ol,ftv,addToIndex);
- QGString outStr;
- FTextStream t(&outStr);
+ TextStream t;
ftv->generateTreeViewInline(t);
ol.disableAllBut(OutputGenerator::Html);
- ol.writeString(outStr);
+ ol.writeString(t.str().c_str());
delete ftv;
if (addToIndex)
{
@@ -4024,16 +4065,221 @@ static void writeGroupIndex(OutputList &ol)
//----------------------------------------------------------------------------
+static void writeConceptList(const ConceptLinkedRefMap &concepts, FTVHelp *ftv,bool addToIndex)
+{
+ for (const auto &cd : concepts)
+ {
+ ftv->addContentsItem(false,cd->displayName(FALSE),cd->getReference(),
+ cd->getOutputFileBase(),QCString(),false,cd->partOfGroups().empty(),cd);
+ if (addToIndex)
+ {
+ Doxygen::indexList->addContentsItem(false,cd->displayName(FALSE),cd->getReference(),
+ cd->getOutputFileBase(),QCString(),false,cd->partOfGroups().empty());
+ }
+ }
+}
+
+static void writeConceptTreeInsideNamespaceElement(const NamespaceDef *nd,FTVHelp *ftv,
+ bool rootOnly, bool addToIndex);
+
+static void writeConceptTreeInsideNamespace(const NamespaceLinkedRefMap &nsLinkedMap,FTVHelp *ftv,
+ bool rootOnly, bool addToIndex)
+{
+ for (const auto &nd : nsLinkedMap)
+ {
+ writeConceptTreeInsideNamespaceElement(nd,ftv,rootOnly,addToIndex);
+ }
+}
+
+
+static void writeConceptTreeInsideNamespaceElement(const NamespaceDef *nd,FTVHelp *ftv,
+ bool rootOnly, bool addToIndex)
+{
+ if (!nd->isAnonymous() &&
+ (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
+ {
+ bool isDir = namespaceHasNestedConcept(nd);
+ bool isLinkable = nd->isLinkableInProject();
+
+ //printf("namespace %s isDir=%d\n",qPrint(nd->name()),isDir);
+
+ QCString ref;
+ QCString file;
+ if (isLinkable)
+ {
+ ref = nd->getReference();
+ file = nd->getOutputFileBase();
+ }
+
+ if (isDir)
+ {
+ ftv->addContentsItem(isDir,nd->localName(),ref,file,QCString(),FALSE,TRUE,nd);
+
+ if (addToIndex)
+ {
+ // the namespace entry is already shown under the namespace list so don't
+ // add it to the nav index and don't create a separate index file for it otherwise
+ // it will overwrite the one written for the namespace list.
+ Doxygen::indexList->addContentsItem(isDir,nd->localName(),ref,file,QCString(),
+ false, // separateIndex
+ false // addToNavIndex
+ );
+ }
+ if (addToIndex)
+ {
+ Doxygen::indexList->incContentsDepth();
+ }
+
+ ftv->incContentsDepth();
+ writeConceptTreeInsideNamespace(nd->getNamespaces(),ftv,FALSE,addToIndex);
+ writeConceptList(nd->getConcepts(),ftv,addToIndex);
+ ftv->decContentsDepth();
+
+ if (addToIndex)
+ {
+ Doxygen::indexList->decContentsDepth();
+ }
+ }
+ }
+}
+
+static void writeConceptRootList(FTVHelp *ftv,bool addToIndex)
+{
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ if (cd->getOuterScope()==0 ||
+ cd->getOuterScope()==Doxygen::globalScope)
+ {
+ //printf("*** adding %s hasSubPages=%d hasSections=%d\n",qPrint(pageTitle),hasSubPages,hasSections);
+ ftv->addContentsItem(
+ false,cd->localName(),cd->getReference(),cd->getOutputFileBase(),
+ QCString(),false,true,cd.get());
+ if (addToIndex)
+ {
+ Doxygen::indexList->addContentsItem(
+ false,cd->localName(),cd->getReference(),cd->getOutputFileBase(),
+ QCString(),false,true);
+ }
+ }
+ }
+}
+
+static void writeConceptIndex(OutputList &ol)
+{
+ if (documentedConcepts==0) return;
+ ol.pushGeneratorState();
+ // 1.{
+ ol.disable(OutputGenerator::Man);
+ ol.disable(OutputGenerator::Docbook);
+ LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Concepts);
+ QCString title = lne ? lne->title() : theTranslator->trConceptList();
+ bool addToIndex = lne==0 || lne->visible();
+
+ startFile(ol,"concepts",QCString(),title,HLI_Concepts);
+ startTitle(ol,QCString());
+ ol.parseText(title);
+ endTitle(ol,QCString(),QCString());
+ ol.startContents();
+ ol.startTextBlock();
+ ol.parseText(lne ? lne->intro() : theTranslator->trConceptListDescription(Config_getBool(EXTRACT_ALL)));
+ ol.endTextBlock();
+
+ // ---------------
+ // Normal group index for Latex/RTF
+ // ---------------
+ // 2.{
+ ol.pushGeneratorState();
+ ol.disable(OutputGenerator::Html);
+
+ bool first=TRUE;
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ if (cd->isLinkableInProject())
+ {
+ if (first)
+ {
+ ol.startIndexList();
+ first=FALSE;
+ }
+ //ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name());
+ ol.startIndexKey();
+ ol.writeObjectLink(QCString(),cd->getOutputFileBase(),QCString(),cd->displayName());
+ ol.endIndexKey();
+
+ bool hasBrief = !cd->briefDescription().isEmpty();
+ ol.startIndexValue(hasBrief);
+ if (hasBrief)
+ {
+ //ol.docify(" (");
+ ol.generateDoc(
+ cd->briefFile(),cd->briefLine(),
+ cd.get(),0,
+ cd->briefDescription(TRUE),
+ FALSE, // index words
+ FALSE, // isExample
+ QCString(), // example name
+ TRUE, // single line
+ TRUE, // link from index
+ Config_getBool(MARKDOWN_SUPPORT)
+ );
+ //ol.docify(")");
+ }
+ ol.endIndexValue(cd->getOutputFileBase(),hasBrief);
+
+ }
+ }
+ if (!first) ol.endIndexList();
+
+ ol.popGeneratorState();
+ // 2.}
+
+ // ---------------
+ // interactive group index for HTML
+ // ---------------
+ // 2.{
+ ol.pushGeneratorState();
+ ol.disableAllBut(OutputGenerator::Html);
+
+ {
+ if (addToIndex)
+ {
+ Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"concepts",QCString(),TRUE,TRUE);
+ Doxygen::indexList->incContentsDepth();
+ }
+ FTVHelp ftv(false);
+ for (const auto &nd : *Doxygen::namespaceLinkedMap)
+ {
+ writeConceptTreeInsideNamespaceElement(nd.get(),&ftv,true,addToIndex);
+ }
+ writeConceptRootList(&ftv,addToIndex);
+ TextStream t;
+ ftv.generateTreeViewInline(t);
+ ol.writeString(t.str().c_str());
+ if (addToIndex)
+ {
+ Doxygen::indexList->decContentsDepth();
+ }
+ }
+ ol.popGeneratorState();
+ // 2.}
+
+ endFile(ol);
+ ol.popGeneratorState();
+ // 1.}
+}
+
+//----------------------------------------------------------------------------
+
static void writeUserGroupStubPage(OutputList &ol,LayoutNavEntry *lne)
{
if (lne->baseFile().left(9)=="usergroup")
{
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- startFile(ol,lne->baseFile(),0,lne->title(),HLI_UserGroup);
- startTitle(ol,0);
+ startFile(ol,lne->baseFile(),QCString(),lne->title(),HLI_UserGroup);
+ startTitle(ol,QCString());
ol.parseText(lne->title());
- endTitle(ol,0,0);
+ endTitle(ol,QCString(),QCString());
ol.startContents();
int count=0;
for (const auto &entry: lne->children())
@@ -4081,7 +4327,7 @@ static void writeIndex(OutputList &ol)
ol.disableAllBut(OutputGenerator::Html);
QCString defFileName =
- Doxygen::mainPage ? Doxygen::mainPage->docFile().data() : "[generated]";
+ Doxygen::mainPage ? Doxygen::mainPage->docFile() : QCString("[generated]");
int defLine =
Doxygen::mainPage ? Doxygen::mainPage->docLine() : -1;
@@ -4096,7 +4342,7 @@ static void writeIndex(OutputList &ol)
}
QCString indexName="index";
- ol.startFile(indexName,0,title);
+ ol.startFile(indexName,QCString(),title);
if (Doxygen::mainPage)
{
@@ -4104,7 +4350,7 @@ static void writeIndex(OutputList &ol)
(!projectName.isEmpty() && mainPageHasTitle() && qstricmp(title,projectName)!=0)
) // to avoid duplicate entries in the treeview
{
- Doxygen::indexList->addContentsItem(Doxygen::mainPage->hasSubPages(),title,0,indexName,0,Doxygen::mainPage->hasSubPages(),TRUE);
+ Doxygen::indexList->addContentsItem(Doxygen::mainPage->hasSubPages(),title,QCString(),indexName,QCString(),Doxygen::mainPage->hasSubPages(),TRUE);
}
if (Doxygen::mainPage->hasSubPages() || Doxygen::mainPage->hasSections())
{
@@ -4115,7 +4361,7 @@ static void writeIndex(OutputList &ol)
ol.startQuickIndices();
if (!Config_getBool(DISABLE_INDEX))
{
- ol.writeQuickLinks(TRUE,HLI_Main,0);
+ ol.writeQuickLinks(TRUE,HLI_Main,QCString());
}
ol.endQuickIndices();
ol.writeSplitBar(indexName);
@@ -4138,10 +4384,10 @@ static void writeIndex(OutputList &ol)
if (Doxygen::mainPage->title().lower()!="notitle")
{
ol.startHeaderSection();
- ol.startTitleHead(0);
+ ol.startTitleHead(QCString());
ol.generateDoc(Doxygen::mainPage->docFile(),Doxygen::mainPage->getStartBodyLine(),
Doxygen::mainPage.get(),0,Doxygen::mainPage->title(),TRUE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
headerWritten = TRUE;
}
}
@@ -4150,21 +4396,21 @@ static void writeIndex(OutputList &ol)
if (!projectName.isEmpty())
{
ol.startHeaderSection();
- ol.startTitleHead(0);
+ ol.startTitleHead(QCString());
ol.parseText(projPrefix+theTranslator->trDocumentation());
headerWritten = TRUE;
}
}
if (headerWritten)
{
- ol.endTitleHead(0,0);
+ ol.endTitleHead(QCString(),QCString());
ol.endHeaderSection();
}
ol.startContents();
if (Config_getBool(DISABLE_INDEX) && Doxygen::mainPage==0)
{
- ol.writeQuickLinks(FALSE,HLI_Main,0);
+ ol.writeQuickLinks(FALSE,HLI_Main,QCString());
}
if (Doxygen::mainPage)
@@ -4178,7 +4424,7 @@ static void writeIndex(OutputList &ol)
ol.startTextBlock();
ol.generateDoc(defFileName,defLine,Doxygen::mainPage.get(),0,
Doxygen::mainPage->documentation(),TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endTextBlock();
ol.endPageDoc();
@@ -4195,7 +4441,7 @@ static void writeIndex(OutputList &ol)
ol.enable(OutputGenerator::Docbook);
ol.enable(OutputGenerator::RTF);
- ol.startFile("refman",0,0);
+ ol.startFile("refman",QCString(),QCString());
ol.startIndexSection(isTitlePageStart);
ol.disable(OutputGenerator::Latex);
ol.disable(OutputGenerator::Docbook);
@@ -4213,7 +4459,7 @@ static void writeIndex(OutputList &ol)
{
ol.startProjectNumber();
ol.generateDoc(defFileName,defLine,Doxygen::mainPage.get(),0,Config_getString(PROJECT_NUMBER),FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endProjectNumber();
}
ol.endIndexSection(isTitlePageStart);
@@ -4272,7 +4518,7 @@ static void writeIndex(OutputList &ol)
ol.endIndexSection(isPageDocumentation2);
ol.popGeneratorState();
- ol.writeAnchor(0,pd->getOutputFileBase());
+ ol.writeAnchor(QCString(),pd->getOutputFileBase());
ol.writePageLink(pd->getOutputFileBase(),first);
first=FALSE;
@@ -4306,6 +4552,12 @@ static void writeIndex(OutputList &ol)
ol.parseText(/*projPrefix+*/(fortranOpt?theTranslator->trModulesIndex():theTranslator->trNamespaceIndex()));
ol.endIndexSection(isNamespaceIndex);
}
+ if (documentedConcepts>0)
+ {
+ ol.startIndexSection(isConceptIndex);
+ ol.parseText(/*projPrefix+*/theTranslator->trConceptIndex());
+ ol.endIndexSection(isConceptIndex);
+ }
if (hierarchyInterfaces>0)
{
ol.startIndexSection(isClassHierarchyIndex);
@@ -4377,6 +4629,12 @@ static void writeIndex(OutputList &ol)
ol.parseText(/*projPrefix+*/(fortranOpt?theTranslator->trModuleDocumentation():theTranslator->trNamespaceDocumentation()));
ol.endIndexSection(isNamespaceDocumentation);
}
+ if (documentedConcepts>0)
+ {
+ ol.startIndexSection(isConceptDocumentation);
+ ol.parseText(/*projPrefix+*/theTranslator->trConceptDocumentation());
+ ol.endIndexSection(isConceptDocumentation);
+ }
if (annotatedInterfacesPrinted>0)
{
ol.startIndexSection(isClassDocumentation);
@@ -4420,12 +4678,12 @@ static void writeIndex(OutputList &ol)
{
Doxygen::insideMainPage=TRUE;
ol.disable(OutputGenerator::Man);
- startFile(ol,Doxygen::mainPage->name(),0,Doxygen::mainPage->title());
+ startFile(ol,Doxygen::mainPage->name(),QCString(),Doxygen::mainPage->title());
ol.startContents();
ol.startTextBlock();
ol.generateDoc(defFileName,defLine,Doxygen::mainPage.get(),0,
Doxygen::mainPage->documentation(),FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT)
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT)
);
ol.endTextBlock();
endFile(ol);
@@ -4436,7 +4694,7 @@ static void writeIndex(OutputList &ol)
ol.popGeneratorState();
}
-static QArray<bool> indexWritten;
+static std::vector<bool> indexWritten;
static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &entries)
{
@@ -4447,13 +4705,13 @@ static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &
uint index = (uint)kind;
if (index>=indexWritten.size())
{
- uint i;
- uint oldSize = indexWritten.size();
- uint newSize = index+1;
+ size_t i;
+ size_t oldSize = indexWritten.size();
+ size_t newSize = index+1;
indexWritten.resize(newSize);
for (i=oldSize;i<newSize;i++) indexWritten.at(i)=FALSE;
}
- //printf("starting %s kind=%d\n",lne->title().data(),lne->kind());
+ //printf("starting %s kind=%d\n",qPrint(lne->title()),lne->kind());
bool addToIndex=lne->visible();
bool needsClosing=FALSE;
if (!indexWritten.at(index))
@@ -4479,7 +4737,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &
{
if (documentedNamespaces>0 && addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0);
+ Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString());
Doxygen::indexList->incContentsDepth();
needsClosing=TRUE;
}
@@ -4508,7 +4766,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &
case LayoutNavEntry::Classes:
if (annotatedClasses>0 && addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0);
+ Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString());
Doxygen::indexList->incContentsDepth();
needsClosing=TRUE;
}
@@ -4518,6 +4776,10 @@ static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &
writeAnnotatedIndex(ol);
}
break;
+ case LayoutNavEntry::Concepts:
+ msg("Generating concept index...\n");
+ writeConceptIndex(ol);
+ break;
case LayoutNavEntry::ClassList:
msg("Generating annotated compound index...\n");
writeAnnotatedIndex(ol);
@@ -4545,7 +4807,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &
case LayoutNavEntry::Interfaces:
if (sliceOpt && annotatedInterfaces>0 && addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0);
+ Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString());
Doxygen::indexList->incContentsDepth();
needsClosing=TRUE;
}
@@ -4579,7 +4841,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &
case LayoutNavEntry::Structs:
if (sliceOpt && annotatedStructs>0 && addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0);
+ Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString());
Doxygen::indexList->incContentsDepth();
needsClosing=TRUE;
}
@@ -4601,7 +4863,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &
case LayoutNavEntry::Exceptions:
if (sliceOpt && annotatedExceptions>0 && addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0);
+ Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString());
Doxygen::indexList->incContentsDepth();
needsClosing=TRUE;
}
@@ -4639,7 +4901,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &
{
if (documentedHtmlFiles>0 && addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0);
+ Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString());
Doxygen::indexList->incContentsDepth();
needsClosing=TRUE;
}
@@ -4679,7 +4941,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &
url.prepend("^"); // prepend ^ to absolute URL
}
bool isRef = lne->baseFile().left(4)=="@ref" || lne->baseFile().left(4)=="\\ref";
- Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,url,0,FALSE,isRef || isRelative);
+ Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),url,QCString(),FALSE,isRef || isRelative);
}
break;
case LayoutNavEntry::UserGroup:
@@ -4690,7 +4952,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &
{
if (url=="![none]")
{
- Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,0,0,FALSE,FALSE);
+ Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),QCString(),QCString(),FALSE,FALSE);
}
else
{
@@ -4700,12 +4962,12 @@ static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &
url.prepend("^"); // prepend ^ to absolute URL
}
bool isRef = lne->baseFile().left(4)=="@ref" || lne->baseFile().left(4)=="\\ref";
- Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,url,0,FALSE,isRef || isRelative);
+ Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),url,QCString(),FALSE,isRef || isRelative);
}
}
else
{
- Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0,TRUE,TRUE);
+ Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString(),TRUE,TRUE);
}
Doxygen::indexList->incContentsDepth();
needsClosing=TRUE;
@@ -4736,7 +4998,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &
break;
}
}
- //printf("ending %s kind=%d\n",lne->title().data(),lne->kind());
+ //printf("ending %s kind=%d\n",qPrint(lne->title()),lne->kind());
}
}
@@ -4755,6 +5017,7 @@ static bool quickLinkVisible(LayoutNavEntry::Kind kind)
case LayoutNavEntry::Namespaces: return documentedNamespaces>0 && showNamespaces;
case LayoutNavEntry::NamespaceList: return documentedNamespaces>0 && showNamespaces;
case LayoutNavEntry::NamespaceMembers: return documentedNamespaceMembers[NMHL_All]>0;
+ case LayoutNavEntry::Concepts: return documentedConcepts>0;
case LayoutNavEntry::Classes: return annotatedClasses>0;
case LayoutNavEntry::ClassList: return annotatedClasses>0;
case LayoutNavEntry::ClassIndex: return annotatedClasses>0;
@@ -4783,7 +5046,7 @@ static bool quickLinkVisible(LayoutNavEntry::Kind kind)
}
template<class T,std::size_t total>
-void renderMemberIndicesAsJs(FTextStream &t,
+void renderMemberIndicesAsJs(std::ostream &t,
const int *numDocumented,
const std::array<MemberIndexMap,total> &memberLists,
const T *(*getInfo)(size_t hl))
@@ -4800,7 +5063,7 @@ void renderMemberIndicesAsJs(FTextStream &t,
t << "children:[";
firstMember=FALSE;
}
- t << endl << "{text:\"" << convertToJSString(getInfo(i)->title) << "\",url:\""
+ t << "\n{text:\"" << convertToJSString(getInfo(i)->title) << "\",url:\""
<< convertToJSString(getInfo(i)->fname+Doxygen::htmlFileExtension) << "\"";
// Check if we have many members, then add sub entries per letter...
@@ -4813,14 +5076,14 @@ void renderMemberIndicesAsJs(FTextStream &t,
{
multiPageIndex=TRUE;
}
- t << ",children:[" << endl;
+ t << ",children:[\n";
bool firstLetter=TRUE;
for (const auto &kv : memberLists[i])
{
- if (!firstLetter) t << "," << endl;
+ if (!firstLetter) t << ",\n";
std::string letter = kv.first;
- QCString ci = letter;
- QCString is = letterToLabel(ci);
+ QCString ci(letter);
+ QCString is(letterToLabel(ci));
QCString anchor;
QCString extension=Doxygen::htmlFileExtension;
QCString fullName = getInfo(i)->fname;
@@ -4843,7 +5106,7 @@ void renderMemberIndicesAsJs(FTextStream &t,
}
}
-static bool renderQuickLinksAsJs(FTextStream &t,LayoutNavEntry *root,bool first)
+static bool renderQuickLinksAsJs(std::ostream &t,LayoutNavEntry *root,bool first)
{
int count=0;
for (const auto &entry : root->children())
@@ -4854,12 +5117,12 @@ static bool renderQuickLinksAsJs(FTextStream &t,LayoutNavEntry *root,bool first)
{
bool firstChild = TRUE;
if (!first) t << ",";
- t << "children:[" << endl;
+ t << "children:[\n";
for (const auto &entry : root->children())
{
if (entry->visible() && quickLinkVisible(entry->kind()))
{
- if (!firstChild) t << "," << endl;
+ if (!firstChild) t << ",\n";
firstChild=FALSE;
QCString url = entry->url();
t << "{text:\"" << convertToJSString(entry->title()) << "\",url:\""
@@ -4896,16 +5159,15 @@ static void writeMenuData()
{
if (!Config_getBool(GENERATE_HTML) || Config_getBool(DISABLE_INDEX)) return;
QCString outputDir = Config_getBool(HTML_OUTPUT);
- QFile f(outputDir+"/menudata.js");
LayoutNavEntry *root = LayoutDocManager::instance().rootNavEntry();
- if (f.open(IO_WriteOnly))
+ std::ofstream t(outputDir.str()+"/menudata.js",std::ofstream::out | std::ofstream::binary);
+ if (t.is_open())
{
- FTextStream t(&f);
t << JAVASCRIPT_LICENSE_TEXT;
t << "var menudata={";
bool hasChildren = renderQuickLinksAsJs(t,root,TRUE);
if (hasChildren) t << "]";
- t << "}" << endl;
+ t << "}\n";
}
}
diff --git a/src/index.h b/src/index.h
index e11304e..a10cbc9 100644
--- a/src/index.h
+++ b/src/index.h
@@ -20,13 +20,12 @@
#include <vector>
#include <memory>
-#include <qcstring.h>
+#include "qcstring.h"
class Definition;
class DefinitionMutable;
class MemberDef;
class OutputList;
-class FTextStream;
/** \brief Abstract interface for index generators. */
class IndexIntf
@@ -37,14 +36,14 @@ class IndexIntf
virtual void finalize() = 0;
virtual void incContentsDepth() = 0;
virtual void decContentsDepth() = 0;
- virtual void addContentsItem(bool isDir, const char *name, const char *ref,
- const char *file, const char *anchor, bool separateIndex,
+ virtual void addContentsItem(bool isDir, const QCString &name, const QCString &ref,
+ const QCString &file, const QCString &anchor, bool separateIndex,
bool addToNavIndex,const Definition *def) = 0;
virtual void addIndexItem(const Definition *context,const MemberDef *md,
- const char *sectionAnchor,const char *title) = 0;
- virtual void addIndexFile(const char *name) = 0;
- virtual void addImageFile(const char *name) = 0;
- virtual void addStyleSheetFile(const char *name) = 0;
+ const QCString &sectionAnchor,const QCString &title) = 0;
+ virtual void addIndexFile(const QCString &name) = 0;
+ virtual void addImageFile(const QCString &name) = 0;
+ virtual void addStyleSheetFile(const QCString &name) = 0;
};
/** \brief A list of index interfaces.
@@ -94,17 +93,17 @@ class IndexList : public IndexIntf
{ if (m_enabled) foreach(&IndexIntf::incContentsDepth); }
void decContentsDepth()
{ if (m_enabled) foreach(&IndexIntf::decContentsDepth); }
- void addContentsItem(bool isDir, const char *name, const char *ref,
- const char *file, const char *anchor,bool separateIndex=FALSE,bool addToNavIndex=FALSE,
+ void addContentsItem(bool isDir, const QCString &name, const QCString &ref,
+ const QCString &file, const QCString &anchor,bool separateIndex=FALSE,bool addToNavIndex=FALSE,
const Definition *def=0)
{ if (m_enabled) foreach(&IndexIntf::addContentsItem,isDir,name,ref,file,anchor,separateIndex,addToNavIndex,def); }
- void addIndexItem(const Definition *context,const MemberDef *md,const char *sectionAnchor=0,const char *title=0)
+ void addIndexItem(const Definition *context,const MemberDef *md,const QCString &sectionAnchor=QCString(),const QCString &title=QCString())
{ if (m_enabled) foreach(&IndexIntf::addIndexItem,context,md,sectionAnchor,title); }
- void addIndexFile(const char *name)
+ void addIndexFile(const QCString &name)
{ if (m_enabled) foreach(&IndexIntf::addIndexFile,name); }
- void addImageFile(const char *name)
+ void addImageFile(const QCString &name)
{ if (m_enabled) foreach(&IndexIntf::addImageFile,name); }
- void addStyleSheetFile(const char *name)
+ void addStyleSheetFile(const QCString &name)
{ if (m_enabled) foreach(&IndexIntf::addStyleSheetFile,name); }
private:
@@ -120,6 +119,7 @@ enum IndexSections
isModuleIndex,
isDirIndex,
isNamespaceIndex,
+ isConceptIndex,
isClassHierarchyIndex,
isCompoundIndex,
isFileIndex,
@@ -128,6 +128,7 @@ enum IndexSections
isDirDocumentation,
isNamespaceDocumentation,
isClassDocumentation,
+ isConceptDocumentation,
isFileDocumentation,
isExampleDocumentation,
isPageDocumentation,
@@ -146,6 +147,7 @@ enum HighlightedItem
HLI_InterfaceHierarchy,
HLI_ExceptionHierarchy,
HLI_Classes,
+ HLI_Concepts,
HLI_Interfaces,
HLI_Structs,
HLI_Exceptions,
@@ -163,6 +165,7 @@ enum HighlightedItem
HLI_UserGroup,
HLI_ClassVisible,
+ HLI_ConceptVisible,
HLI_InterfaceVisible,
HLI_StructVisible,
HLI_ExceptionVisible,
@@ -239,6 +242,7 @@ extern int hierarchyExceptions;
extern int documentedFiles;
extern int documentedGroups;
extern int documentedNamespaces;
+extern int documentedConcepts;
extern int indexedPages;
extern int documentedClassMembers[CMHL_Total];
extern int documentedFileMembers[FMHL_Total];
@@ -247,11 +251,11 @@ extern int documentedDirs;
extern int documentedHtmlFiles;
extern int documentedPages;
-void startTitle(OutputList &ol,const char *fileName,const DefinitionMutable *def=0);
-void endTitle(OutputList &ol,const char *fileName,const char *name);
-void startFile(OutputList &ol,const char *name,const char *manName,
- const char *title,HighlightedItem hli=HLI_None,
- bool additionalIndices=FALSE,const char *altSidebarName=0);
+void startTitle(OutputList &ol,const QCString &fileName,const DefinitionMutable *def=0);
+void endTitle(OutputList &ol,const QCString &fileName,const QCString &name);
+void startFile(OutputList &ol,const QCString &name,const QCString &manName,
+ const QCString &title,HighlightedItem hli=HLI_None,
+ bool additionalIndices=FALSE,const QCString &altSidebarName=QCString());
void endFile(OutputList &ol,bool skipNavIndex=FALSE,bool skipEndContents=FALSE,
const QCString &navPath=QCString());
void endFileWithNavPath(const Definition *d,OutputList &ol);
diff --git a/src/language.cpp b/src/language.cpp
index 299c452..af2ca3d 100644
--- a/src/language.cpp
+++ b/src/language.cpp
@@ -152,11 +152,11 @@
#endif
#endif // !ENGLISH_ONLY
-#define L_EQUAL(a) !qstricmp(langName,a)
+#define L_EQUAL(a) !qstricmp(langName.data(),a)
Translator *theTranslator=0;
-bool setTranslator(const char *langName)
+bool setTranslator(const QCString &langName)
{
if (L_EQUAL("english"))
{
@@ -417,6 +417,6 @@ bool setTranslator(const char *langName)
}
QCString msg = theTranslator->updateNeededMessage();
- if (!msg.isEmpty()) warn_uncond("%s", msg.data());
+ if (!msg.isEmpty()) warn_uncond("%s", qPrint(msg));
return TRUE;
}
diff --git a/src/language.h b/src/language.h
index 7c8eef9..8f38bfc 100644
--- a/src/language.h
+++ b/src/language.h
@@ -1,12 +1,12 @@
/******************************************************************************
*
- *
+ *
*
* Copyright (C) 1997-2015 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
+ * 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.
*
@@ -21,6 +21,6 @@
#include "translator.h"
extern Translator *theTranslator;
-extern bool setTranslator(const char *languageName);
+extern bool setTranslator(const QCString &languageName);
#endif
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 019030d..5bb695a 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -15,8 +15,10 @@
* input used in their production; they are not affected by this license.
*
*/
+
+#include <algorithm>
+
#include "htmlattrib.h"
-#include <qfileinfo.h>
#include "latexdocvisitor.h"
#include "latexgen.h"
#include "docparser.h"
@@ -35,6 +37,7 @@
#include "htmlentity.h"
#include "emoji.h"
#include "plantuml.h"
+#include "fileinfo.h"
const int maxLevels=5;
static const char *secLabels[maxLevels] =
@@ -46,10 +49,10 @@ static const char *getSectionName(int level)
int l = level;
if (compactLatex) l++;
if (Doxygen::insideMainPage) l--;
- return secLabels[QMIN(maxLevels-1,l)];
+ return secLabels[std::min(maxLevels-1,l)];
}
-static void visitPreStart(FTextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage = FALSE)
+static void visitPreStart(TextStream &t, bool hasCaption, QCString name, QCString width, QCString height, bool inlineImage = FALSE)
{
if (inlineImage)
{
@@ -119,7 +122,7 @@ static void visitPreStart(FTextStream &t, bool hasCaption, QCString name, QCStr
-static void visitPostEnd(FTextStream &t, bool hasCaption, bool inlineImage = FALSE)
+static void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage = FALSE)
{
if (inlineImage)
{
@@ -173,8 +176,8 @@ QCString LatexDocVisitor::escapeMakeIndexChars(const char *s)
}
-LatexDocVisitor::LatexDocVisitor(FTextStream &t,LatexCodeGenerator &ci,
- const char *langExt,bool insideTabbing)
+LatexDocVisitor::LatexDocVisitor(TextStream &t,LatexCodeGenerator &ci,
+ const QCString &langExt,bool insideTabbing)
: DocVisitor(DocVisitor_Latex), m_t(t), m_ci(ci), m_insidePre(FALSE),
m_insideItem(FALSE), m_hide(FALSE), m_hideCaption(FALSE), m_insideTabbing(insideTabbing),
m_langExt(langExt)
@@ -375,25 +378,25 @@ void LatexDocVisitor::visit(DocVerbatim *s)
QCString fileName(4096);
fileName.sprintf("%s%d%s",
- (Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_").data(),
+ qPrint(Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_"),
dotindex++,
".dot"
);
- QFile file(fileName);
- if (!file.open(IO_WriteOnly))
+ std::ofstream file(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!file.is_open())
{
- err("Could not open file %s for writing\n",fileName.data());
+ err("Could not open file %s for writing\n",qPrint(fileName));
}
else
{
- file.writeBlock( s->text(), s->text().length() );
+ file.write( s->text().data(), s->text().length() );
file.close();
startDotFile(fileName,s->width(),s->height(),s->hasCaption());
visitCaption(this, s->children());
endDotFile(s->hasCaption());
- if (Config_getBool(DOT_CLEANUP)) file.remove();
+ if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
}
}
break;
@@ -403,25 +406,26 @@ void LatexDocVisitor::visit(DocVerbatim *s)
QCString baseName(4096);
baseName.sprintf("%s%d",
- (Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_").data(),
+ qPrint(Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_"),
mscindex++
);
- QFile file(baseName+".msc");
- if (!file.open(IO_WriteOnly))
+ std::string fileName = baseName.str()+".msc";
+ std::ofstream file(fileName,std::ofstream::out | std::ofstream::binary);
+ if (!file.is_open())
{
- err("Could not open file %s.msc for writing\n",baseName.data());
+ err("Could not open file %s for writing\n",fileName.c_str());
}
else
{
QCString text = "msc {";
text+=s->text();
text+="}";
- file.writeBlock( text, text.length() );
+ file.write( text.data(), text.length() );
file.close();
writeMscFile(baseName, s);
- if (Config_getBool(DOT_CLEANUP)) file.remove();
+ if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName);
}
}
break;
@@ -439,11 +443,11 @@ void LatexDocVisitor::visit(DocVerbatim *s)
void LatexDocVisitor::visit(DocAnchor *anc)
{
if (m_hide) return;
- m_t << "\\label{" << stripPath(anc->file()) << "_" << anc->anchor() << "}%" << endl;
+ m_t << "\\label{" << stripPath(anc->file()) << "_" << anc->anchor() << "}%\n";
if (!anc->file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
{
m_t << "\\Hypertarget{" << stripPath(anc->file()) << "_" << anc->anchor()
- << "}%" << endl;
+ << "}%\n";
}
}
@@ -456,8 +460,8 @@ void LatexDocVisitor::visit(DocInclude *inc)
case DocInclude::IncWithLines:
{
m_ci.startCodeFragment("DoxyCodeInclude");
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
getCodeParser(inc->extension()).parseCode(m_ci,inc->context(),
inc->text(),
langExt,
@@ -521,8 +525,8 @@ void LatexDocVisitor::visit(DocInclude *inc)
break;
case DocInclude::SnipWithLines:
{
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
m_ci.startCodeFragment("DoxyCodeInclude");
getCodeParser(inc->extension()).parseCode(m_ci,
inc->context(),
@@ -552,7 +556,7 @@ void LatexDocVisitor::visit(DocInclude *inc)
void LatexDocVisitor::visit(DocIncOperator *op)
{
//printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
- // op->type(),op->isFirst(),op->isLast(),op->text().data());
+ // op->type(),op->isFirst(),op->isLast(),qPrint(op->text()));
if (op->isFirst())
{
if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
@@ -570,8 +574,8 @@ void LatexDocVisitor::visit(DocIncOperator *op)
FileDef *fd = 0;
if (!op->includeFileName().isEmpty())
{
- QFileInfo cfi( op->includeFileName() );
- fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( op->includeFileName().str() );
+ fd = createFileDef( cfi.dirPath(), cfi.fileName() );
}
getCodeParser(locLangExt).parseCode(m_ci,op->context(),op->text(),langExt,
@@ -595,7 +599,7 @@ void LatexDocVisitor::visit(DocIncOperator *op)
}
else
{
- if (!m_hide) m_t << endl;
+ if (!m_hide) m_t << "\n";
}
}
@@ -702,7 +706,7 @@ void LatexDocVisitor::visitPost(DocPara *p)
!(p->parent() && // and for parameter sections
p->parent()->kind()==DocNode::Kind_ParamSect
)
- ) m_t << endl << endl;
+ ) m_t << "\n\n";
}
void LatexDocVisitor::visitPre(DocRoot *)
@@ -873,13 +877,13 @@ void LatexDocVisitor::visitPost(DocTitle *)
void LatexDocVisitor::visitPre(DocSimpleList *)
{
if (m_hide) return;
- m_t << "\\begin{DoxyItemize}" << endl;
+ m_t << "\\begin{DoxyItemize}\n";
}
void LatexDocVisitor::visitPost(DocSimpleList *)
{
if (m_hide) return;
- m_t << "\\end{DoxyItemize}" << endl;
+ m_t << "\\end{DoxyItemize}\n";
}
void LatexDocVisitor::visitPre(DocSimpleListItem *)
@@ -900,8 +904,8 @@ void LatexDocVisitor::visitPre(DocSection *s)
m_t << "\\hypertarget{" << stripPath(s->file()) << "_" << s->anchor() << "}{}";
}
m_t << "\\" << getSectionName(s->level()) << "{";
- filter(convertCharEntitiesToUTF8(s->title().data()));
- m_t << "}\\label{" << stripPath(s->file()) << "_" << s->anchor() << "}" << endl;
+ filter(convertCharEntitiesToUTF8(s->title()));
+ m_t << "}\\label{" << stripPath(s->file()) << "_" << s->anchor() << "}\n";
}
void LatexDocVisitor::visitPost(DocSection *)
@@ -945,7 +949,7 @@ void LatexDocVisitor::visitPost(DocHtmlListItem *)
//void LatexDocVisitor::visitPost(DocHtmlPre *)
//{
// m_insidePre=FALSE;
-// m_t << "\\end{alltt}\\normalsize " << endl;
+// m_t << "\\end{alltt}\\normalsize \n";
//}
@@ -1041,7 +1045,7 @@ static bool tableIsNested(const DocNode *n)
return isNested;
}
-static void writeStartTableCommand(FTextStream &t,const DocNode *n,int cols)
+static void writeStartTableCommand(TextStream &t,const DocNode *n,int cols)
{
if (tableIsNested(n))
{
@@ -1054,7 +1058,7 @@ static void writeStartTableCommand(FTextStream &t,const DocNode *n,int cols)
//return isNested ? "TabularNC" : "TabularC";
}
-static void writeEndTableCommand(FTextStream &t,const DocNode *n)
+static void writeEndTableCommand(TextStream &t,const DocNode *n)
{
if (tableIsNested(n))
{
@@ -1080,7 +1084,7 @@ void LatexDocVisitor::visitPre(DocHtmlTable *t)
m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
<< "}{}";
}
- m_t << endl;
+ m_t << "\n";
}
writeStartTableCommand(m_t,t->parent(),(uint)t->numColumns());
@@ -1199,14 +1203,14 @@ void LatexDocVisitor::visitPost(DocHtmlRow *row)
{
if (firstRow())
{
- m_t << "\\endfirsthead" << endl;
- m_t << "\\hline" << endl;
- m_t << "\\endfoot" << endl;
- m_t << "\\hline" << endl;
+ m_t << "\\endfirsthead\n";
+ m_t << "\\hline\n";
+ m_t << "\\endfoot\n";
+ m_t << "\\hline\n";
}
else
{
- m_t << "\\endhead" << endl;
+ m_t << "\\endhead\n";
}
}
}
@@ -1328,7 +1332,7 @@ void LatexDocVisitor::visitPre(DocInternal *)
void LatexDocVisitor::visitPost(DocInternal *)
{
if (m_hide) return;
- //m_t << "\\end{DoxyInternal}" << endl;
+ //m_t << "\\end{DoxyInternal}\n";
}
void LatexDocVisitor::visitPre(DocHRef *href)
@@ -1446,7 +1450,7 @@ void LatexDocVisitor::visitPre(DocRef *ref)
// ref->anchor() for LaTeX/RTF
if (ref->isSubPage())
{
- startLink(ref->ref(),0,ref->anchor());
+ startLink(ref->ref(),QCString(),ref->anchor());
}
else
{
@@ -1460,7 +1464,7 @@ void LatexDocVisitor::visitPost(DocRef *ref)
if (m_hide) return;
if (ref->isSubPage())
{
- endLink(ref->ref(),0,ref->anchor());
+ endLink(ref->ref(),QCString(),ref->anchor());
}
else
{
@@ -1487,23 +1491,23 @@ void LatexDocVisitor::visitPost(DocSecRefItem *ref)
{
m_t << "}}";
}
- m_t << "}{\\ref{" << ref->file() << "_" << ref->anchor() << "}}{}" << endl;
+ m_t << "}{\\ref{" << ref->file() << "_" << ref->anchor() << "}}{}\n";
}
void LatexDocVisitor::visitPre(DocSecRefList *)
{
if (m_hide) return;
- m_t << "\\footnotesize" << endl;
- m_t << "\\begin{multicols}{2}" << endl;
- m_t << "\\begin{DoxyCompactList}" << endl;
+ m_t << "\\footnotesize\n";
+ m_t << "\\begin{multicols}{2}\n";
+ m_t << "\\begin{DoxyCompactList}\n";
}
void LatexDocVisitor::visitPost(DocSecRefList *)
{
if (m_hide) return;
- m_t << "\\end{DoxyCompactList}" << endl;
- m_t << "\\end{multicols}" << endl;
- m_t << "\\normalsize" << endl;
+ m_t << "\\end{DoxyCompactList}\n";
+ m_t << "\\end{multicols}\n";
+ m_t << "\\normalsize\n";
}
void LatexDocVisitor::visitPre(DocParamSect *s)
@@ -1661,8 +1665,8 @@ void LatexDocVisitor::visitPost(DocParamList *pl)
parentType==DocParamSect::TemplateParam;
if (useTable)
{
- m_t << "\\\\" << endl
- << "\\hline" << endl;
+ m_t << "\\\\\n"
+ << "\\hline\n";
}
}
@@ -1673,7 +1677,7 @@ void LatexDocVisitor::visitPre(DocXRefItem *x)
if (x->title().isEmpty()) return;
m_t << "\\begin{DoxyRefDesc}{";
filter(x->title());
- m_t << "}" << endl;
+ m_t << "}\n";
bool anonymousEnum = x->file()=="@";
m_t << "\\item[";
if (pdfHyperlinks && !anonymousEnum)
@@ -1698,19 +1702,19 @@ void LatexDocVisitor::visitPost(DocXRefItem *x)
{
if (m_hide) return;
if (x->title().isEmpty()) return;
- m_t << "\\end{DoxyRefDesc}" << endl;
+ m_t << "\\end{DoxyRefDesc}\n";
}
void LatexDocVisitor::visitPre(DocInternalRef *ref)
{
if (m_hide) return;
- startLink(0,ref->file(),ref->anchor());
+ startLink(QCString(),ref->file(),ref->anchor());
}
void LatexDocVisitor::visitPost(DocInternalRef *ref)
{
if (m_hide) return;
- endLink(0,ref->file(),ref->anchor());
+ endLink(QCString(),ref->file(),ref->anchor());
}
void LatexDocVisitor::visitPre(DocText *)
@@ -1724,13 +1728,13 @@ void LatexDocVisitor::visitPost(DocText *)
void LatexDocVisitor::visitPre(DocHtmlBlockQuote *)
{
if (m_hide) return;
- m_t << "\\begin{quote}" << endl;
+ m_t << "\\begin{quote}\n";
}
void LatexDocVisitor::visitPost(DocHtmlBlockQuote *)
{
if (m_hide) return;
- m_t << "\\end{quote}" << endl;
+ m_t << "\\end{quote}\n";
}
void LatexDocVisitor::visitPre(DocVhdlFlow *)
@@ -1753,7 +1757,7 @@ void LatexDocVisitor::visitPost(DocParBlock *)
if (m_hide) return;
}
-void LatexDocVisitor::filter(const char *str)
+void LatexDocVisitor::filter(const QCString &str)
{
filterLatexString(m_t,str,
m_insideTabbing,
diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h
index cd6c442..696147f 100644
--- a/src/latexdocvisitor.h
+++ b/src/latexdocvisitor.h
@@ -18,18 +18,18 @@
#include <stack>
+#include "qcstring.h"
#include "docvisitor.h"
-#include <qcstring.h>
-class FTextStream;
class LatexCodeGenerator;
+class TextStream;
/*! @brief Concrete visitor implementation for LaTeX output. */
class LatexDocVisitor : public DocVisitor
{
public:
- LatexDocVisitor(FTextStream &t,LatexCodeGenerator &ci,
- const char *langExt,bool insideTabbing);
+ LatexDocVisitor(TextStream &t,LatexCodeGenerator &ci,
+ const QCString &langExt,bool insideTabbing);
//--------------------------------------
// visitor functions for leaf nodes
@@ -152,7 +152,7 @@ class LatexDocVisitor : public DocVisitor
// helper functions
//--------------------------------------
- void filter(const char *str);
+ void filter(const QCString &str);
void startLink(const QCString &ref,const QCString &file,
const QCString &anchor,bool refToTable=FALSE);
void endLink(const QCString &ref,const QCString &file,
@@ -177,7 +177,7 @@ class LatexDocVisitor : public DocVisitor
// state variables
//--------------------------------------
- FTextStream &m_t;
+ TextStream &m_t;
LatexCodeGenerator &m_ci;
bool m_insidePre;
bool m_insideItem;
diff --git a/src/latexgen.cpp b/src/latexgen.cpp
index e73f6b8..fdcb993 100644
--- a/src/latexgen.cpp
+++ b/src/latexgen.cpp
@@ -15,9 +15,9 @@
*
*/
-#include <stdlib.h>
+#include <cstdlib>
+#include <sstream>
-#include <qdir.h>
#include "latexgen.h"
#include "config.h"
#include "message.h"
@@ -43,28 +43,23 @@
#include "filename.h"
#include "resourcemgr.h"
#include "portable.h"
+#include "fileinfo.h"
+#include "utf8.h"
static QCString g_header;
static QCString g_footer;
-LatexCodeGenerator::LatexCodeGenerator(FTextStream &t,const QCString &relPath,const QCString &sourceFileName)
- : m_relPath(relPath), m_sourceFileName(sourceFileName)
+LatexCodeGenerator::LatexCodeGenerator(TextStream &t,const QCString &relPath,const QCString &sourceFileName)
+ : m_t(t), m_relPath(relPath), m_sourceFileName(sourceFileName)
{
m_prettyCode=Config_getBool(LATEX_SOURCE_CODE);
- setTextStream(t);
}
-LatexCodeGenerator::LatexCodeGenerator()
+LatexCodeGenerator::LatexCodeGenerator(TextStream &t) : m_t(t)
{
m_prettyCode=Config_getBool(LATEX_SOURCE_CODE);
}
-void LatexCodeGenerator::setTextStream(FTextStream &t)
-{
- m_streamSet = t.device()!=0;
- m_t.setDevice(t.device());
-}
-
void LatexCodeGenerator::setRelativePath(const QCString &path)
{
m_relPath = path;
@@ -75,11 +70,11 @@ void LatexCodeGenerator::setSourceFileName(const QCString &name)
m_sourceFileName = name;
}
-void LatexCodeGenerator::codify(const char *str)
+void LatexCodeGenerator::codify(const QCString &str)
{
- if (str)
+ if (!str.isEmpty())
{
- const signed char *p=(const signed char*)str;
+ const signed char *p=(const signed char*)str.data();
signed char c;
//char cs[5];
int spacesToNextTabStop;
@@ -117,26 +112,15 @@ void LatexCodeGenerator::codify(const char *str)
#undef COPYCHAR
// helper macro to copy a single utf8 character, dealing with multibyte chars.
#define COPYCHAR() do { \
- if (lresult < (i + 5)) \
+ int bytes = getUTF8CharNumBytes(c); \
+ if (lresult < (i + bytes + 1)) \
{ \
lresult += 512; \
result = (signed char *)realloc(result, lresult); \
} \
- result[i++]=c; p++; \
- if (c<0) /* multibyte utf-8 character */ \
+ for (int j=0; j<bytes && *p; j++) \
{ \
- /* 1xxx.xxxx: >=2 byte character */ \
result[i++]=*p++; \
- if (((uchar)c&0xE0)==0xE0) \
- { \
- /* 111x.xxxx: >=3 byte character */ \
- result[i++]=*p++; \
- } \
- if (((uchar)c&0xF0)==0xF0) \
- { \
- /* 1111.xxxx: 4 byte character */ \
- result[i++]=*p++; \
- } \
} \
m_col++; \
} while(0)
@@ -164,19 +148,19 @@ void LatexCodeGenerator::codify(const char *str)
}
-void LatexCodeGenerator::writeCodeLink(const char *ref,const char *f,
- const char *anchor,const char *name,
- const char *)
+void LatexCodeGenerator::writeCodeLink(const QCString &ref,const QCString &f,
+ const QCString &anchor,const QCString &name,
+ const QCString &)
{
bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
bool usePDFLatex = Config_getBool(USE_PDFLATEX);
- int l = qstrlen(name);
- if (!ref && usePDFLatex && pdfHyperlinks)
+ uint l = name.length();
+ if (ref.isEmpty() && usePDFLatex && pdfHyperlinks)
{
m_t << "\\mbox{\\hyperlink{";
- if (f) m_t << stripPath(f);
- if (f && anchor) m_t << "_";
- if (anchor) m_t << anchor;
+ if (!f.isEmpty()) m_t << stripPath(f);
+ if (!f.isEmpty() && !anchor.isEmpty()) m_t << "_";
+ if (!anchor.isEmpty()) m_t << anchor;
m_t << "}{";
codify(name);
m_t << "}}";
@@ -188,7 +172,7 @@ void LatexCodeGenerator::writeCodeLink(const char *ref,const char *f,
m_col+=l;
}
-void LatexCodeGenerator::writeLineNumber(const char *ref,const char *fileName,const char *anchor,int l)
+void LatexCodeGenerator::writeLineNumber(const QCString &ref,const QCString &fileName,const QCString &anchor,int l)
{
bool usePDFLatex = Config_getBool(USE_PDFLATEX);
bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
@@ -202,7 +186,7 @@ void LatexCodeGenerator::writeLineNumber(const char *ref,const char *fileName,co
QCString lineNumber;
lineNumber.sprintf("%05d",l);
- if (fileName && !m_sourceFileName.isEmpty())
+ if (!fileName.isEmpty() && !m_sourceFileName.isEmpty())
{
QCString lineAnchor;
lineAnchor.sprintf("_l%05d",l);
@@ -212,7 +196,7 @@ void LatexCodeGenerator::writeLineNumber(const char *ref,const char *fileName,co
{
m_t << "\\Hypertarget{" << stripPath(lineAnchor) << "}";
}
- writeCodeLink(ref,fileName,anchor,lineNumber,0);
+ writeCodeLink(ref,fileName,anchor,lineNumber,QCString());
}
else
{
@@ -248,7 +232,7 @@ void LatexCodeGenerator::endCodeLine()
codify("\n");
}
-void LatexCodeGenerator::startFontClass(const char *name)
+void LatexCodeGenerator::startFontClass(const QCString &name)
{
m_t << "\\textcolor{" << name << "}{";
}
@@ -258,12 +242,12 @@ void LatexCodeGenerator::endFontClass()
m_t << "}";
}
-void LatexCodeGenerator::startCodeFragment(const char *style)
+void LatexCodeGenerator::startCodeFragment(const QCString &style)
{
m_t << "\n\\begin{" << style << "}{" << m_usedTableLevel << "}\n";
}
-void LatexCodeGenerator::endCodeFragment(const char *style)
+void LatexCodeGenerator::endCodeFragment(const QCString &style)
{
//endCodeLine checks is there is still an open code line, if so closes it.
endCodeLine();
@@ -274,12 +258,12 @@ void LatexCodeGenerator::endCodeFragment(const char *style)
//-------------------------------
-LatexGenerator::LatexGenerator() : OutputGenerator(Config_getString(LATEX_OUTPUT))
+LatexGenerator::LatexGenerator() : OutputGenerator(Config_getString(LATEX_OUTPUT)), m_codeGen(m_t)
{
//printf("LatexGenerator::LatexGenerator() m_insideTabbing=FALSE\n");
}
-LatexGenerator::LatexGenerator(const LatexGenerator &og) : OutputGenerator(og)
+LatexGenerator::LatexGenerator(const LatexGenerator &og) : OutputGenerator(og), m_codeGen(og.m_codeGen)
{
}
@@ -302,94 +286,94 @@ static void writeLatexMakefile()
{
bool generateBib = !CitationManager::instance().isEmpty();
QCString fileName=Config_getString(LATEX_OUTPUT)+"/Makefile";
- QFile file(fileName);
- if (!file.open(IO_WriteOnly))
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- term("Could not open file %s for writing\n",fileName.data());
+ term("Could not open file %s for writing\n",qPrint(fileName));
}
+ TextStream t(&f);
// inserted by KONNO Akihisa <konno@researchers.jp> 2002-03-05
QCString latex_command = theTranslator->latexCommandName();
QCString mkidx_command = Config_getString(MAKEINDEX_CMD_NAME);
// end insertion by KONNO Akihisa <konno@researchers.jp> 2002-03-05
- FTextStream t(&file);
if (!Config_getBool(USE_PDFLATEX)) // use plain old latex
{
- t << "LATEX_CMD=" << latex_command << endl
- << endl
- << "all: refman.dvi" << endl
- << endl
- << "ps: refman.ps" << endl
- << endl
- << "pdf: refman.pdf" << endl
- << endl
- << "ps_2on1: refman_2on1.ps" << endl
- << endl
- << "pdf_2on1: refman_2on1.pdf" << endl
- << endl
- << "refman.ps: refman.dvi" << endl
- << "\tdvips -o refman.ps refman.dvi" << endl
- << endl;
- t << "refman.pdf: refman.ps" << endl;
- t << "\tps2pdf refman.ps refman.pdf" << endl << endl;
- t << "refman.dvi: clean refman.tex doxygen.sty" << endl
- << "\techo \"Running latex...\"" << endl
- << "\t$(LATEX_CMD) refman.tex" << endl
- << "\techo \"Running makeindex...\"" << endl
- << "\t" << mkidx_command << " refman.idx" << endl;
+ t << "LATEX_CMD=" << latex_command << "\n"
+ << "\n"
+ << "all: refman.dvi\n"
+ << "\n"
+ << "ps: refman.ps\n"
+ << "\n"
+ << "pdf: refman.pdf\n"
+ << "\n"
+ << "ps_2on1: refman_2on1.ps\n"
+ << "\n"
+ << "pdf_2on1: refman_2on1.pdf\n"
+ << "\n"
+ << "refman.ps: refman.dvi\n"
+ << "\tdvips -o refman.ps refman.dvi\n"
+ << "\n";
+ t << "refman.pdf: refman.ps\n";
+ t << "\tps2pdf refman.ps refman.pdf\n\n";
+ t << "refman.dvi: clean refman.tex doxygen.sty\n"
+ << "\techo \"Running latex...\"\n"
+ << "\t$(LATEX_CMD) refman.tex\n"
+ << "\techo \"Running makeindex...\"\n"
+ << "\t" << mkidx_command << " refman.idx\n";
if (generateBib)
{
- t << "\techo \"Running bibtex...\"" << endl;
- t << "\tbibtex refman" << endl;
- t << "\techo \"Rerunning latex....\"" << endl;
- t << "\t$(LATEX_CMD) refman.tex" << endl;
+ t << "\techo \"Running bibtex...\"\n";
+ t << "\tbibtex refman\n";
+ t << "\techo \"Rerunning latex....\"\n";
+ t << "\t$(LATEX_CMD) refman.tex\n";
}
- t << "\techo \"Rerunning latex....\"" << endl
- << "\t$(LATEX_CMD) refman.tex" << endl
- << "\tlatex_count=8 ; \\" << endl
- << "\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\" << endl
- << "\t do \\" << endl
- << "\t echo \"Rerunning latex....\" ;\\" << endl
- << "\t $(LATEX_CMD) refman.tex ; \\" << endl
- << "\t latex_count=`expr $$latex_count - 1` ;\\" << endl
- << "\t done" << endl
- << "\t" << mkidx_command << " refman.idx" << endl
- << "\t$(LATEX_CMD) refman.tex" << endl << endl
- << "refman_2on1.ps: refman.ps" << endl
- << "\tpsnup -2 refman.ps >refman_2on1.ps" << endl
- << endl
- << "refman_2on1.pdf: refman_2on1.ps" << endl
- << "\tps2pdf refman_2on1.ps refman_2on1.pdf" << endl;
+ t << "\techo \"Rerunning latex....\"\n"
+ << "\t$(LATEX_CMD) refman.tex\n"
+ << "\tlatex_count=8 ; \\\n"
+ << "\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\\n"
+ << "\t do \\\n"
+ << "\t echo \"Rerunning latex....\" ;\\\n"
+ << "\t $(LATEX_CMD) refman.tex ; \\\n"
+ << "\t latex_count=`expr $$latex_count - 1` ;\\\n"
+ << "\t done\n"
+ << "\t" << mkidx_command << " refman.idx\n"
+ << "\t$(LATEX_CMD) refman.tex\n\n"
+ << "refman_2on1.ps: refman.ps\n"
+ << "\tpsnup -2 refman.ps >refman_2on1.ps\n"
+ << "\n"
+ << "refman_2on1.pdf: refman_2on1.ps\n"
+ << "\tps2pdf refman_2on1.ps refman_2on1.pdf\n";
}
else // use pdflatex for higher quality output
{
- t << "LATEX_CMD=" << latex_command << endl
- << endl;
- t << "all: refman.pdf" << endl << endl
- << "pdf: refman.pdf" << endl << endl;
- t << "refman.pdf: clean refman.tex" << endl;
- t << "\t$(LATEX_CMD) refman" << endl;
- t << "\t" << mkidx_command << " refman.idx" << endl;
+ t << "LATEX_CMD=" << latex_command << "\n"
+ << "\n";
+ t << "all: refman.pdf\n\n"
+ << "pdf: refman.pdf\n\n";
+ t << "refman.pdf: clean refman.tex\n";
+ t << "\t$(LATEX_CMD) refman\n";
+ t << "\t" << mkidx_command << " refman.idx\n";
if (generateBib)
{
- t << "\tbibtex refman" << endl;
- t << "\t$(LATEX_CMD) refman" << endl;
+ t << "\tbibtex refman\n";
+ t << "\t$(LATEX_CMD) refman\n";
}
- t << "\t$(LATEX_CMD) refman" << endl
- << "\tlatex_count=8 ; \\" << endl
- << "\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\" << endl
- << "\t do \\" << endl
- << "\t echo \"Rerunning latex....\" ;\\" << endl
- << "\t $(LATEX_CMD) refman ;\\" << endl
- << "\t latex_count=`expr $$latex_count - 1` ;\\" << endl
- << "\t done" << endl
- << "\t" << mkidx_command << " refman.idx" << endl
- << "\t$(LATEX_CMD) refman" << endl << endl;
- }
-
- t << endl
- << "clean:" << endl
+ t << "\t$(LATEX_CMD) refman\n"
+ << "\tlatex_count=8 ; \\\n"
+ << "\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\\n"
+ << "\t do \\\n"
+ << "\t echo \"Rerunning latex....\" ;\\\n"
+ << "\t $(LATEX_CMD) refman ;\\\n"
+ << "\t latex_count=`expr $$latex_count - 1` ;\\\n"
+ << "\t done\n"
+ << "\t" << mkidx_command << " refman.idx\n"
+ << "\t$(LATEX_CMD) refman\n\n";
+ }
+
+ t << "\n"
+ << "clean:\n"
<< "\trm -f "
- << "*.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf" << endl;
+ << "*.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf\n";
}
static void writeMakeBat()
@@ -399,80 +383,79 @@ static void writeMakeBat()
QCString fileName=dir+"/make.bat";
QCString latex_command = theTranslator->latexCommandName();
QCString mkidx_command = Config_getString(MAKEINDEX_CMD_NAME);
- QFile file(fileName);
bool generateBib = !CitationManager::instance().isEmpty();
- if (!file.open(IO_WriteOnly))
+ std::ofstream t(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!t.is_open())
{
- term("Could not open file %s for writing\n",fileName.data());
+ term("Could not open file %s for writing\n",qPrint(fileName));
}
- FTextStream t(&file);
- t << "set Dir_Old=%cd%\n";
- t << "cd /D %~dp0\n\n";
- t << "del /s /f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf\n\n";
+ t << "set Dir_Old=%cd%\r\n";
+ t << "cd /D %~dp0\r\n\r\n";
+ t << "del /s /f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf\r\n\r\n";
if (!Config_getBool(USE_PDFLATEX)) // use plain old latex
{
- t << "set LATEX_CMD=" << latex_command << "\n";
- t << "%LATEX_CMD% refman.tex\n";
- t << "echo ----\n";
- t << mkidx_command << " refman.idx\n";
+ t << "set LATEX_CMD=" << latex_command << "\r\n";
+ t << "%LATEX_CMD% refman.tex\r\n";
+ t << "echo ----\r\n";
+ t << mkidx_command << " refman.idx\r\n";
if (generateBib)
{
- t << "bibtex refman\n";
- t << "echo ----\n";
- t << "\t%LATEX_CMD% refman.tex\n";
+ t << "bibtex refman\r\n";
+ t << "echo ----\r\n";
+ t << "\t%LATEX_CMD% refman.tex\r\n";
}
- t << "setlocal enabledelayedexpansion\n";
- t << "set count=8\n";
- t << ":repeat\n";
- t << "set content=X\n";
- t << "for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\n";
- t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\n";
- t << "if !content! == X goto :skip\n";
- t << "set /a count-=1\n";
- t << "if !count! EQU 0 goto :skip\n\n";
- t << "echo ----\n";
- t << "%LATEX_CMD% refman.tex\n";
- t << "goto :repeat\n";
- t << ":skip\n";
- t << "endlocal\n";
- t << mkidx_command << " refman.idx\n";
- t << "%LATEX_CMD% refman.tex\n";
- t << "dvips -o refman.ps refman.dvi\n";
+ t << "setlocal enabledelayedexpansion\r\n";
+ t << "set count=8\r\n";
+ t << ":repeat\r\n";
+ t << "set content=X\r\n";
+ t << "for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\r\n";
+ t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\r\n";
+ t << "if !content! == X goto :skip\r\n";
+ t << "set /a count-=1\r\n";
+ t << "if !count! EQU 0 goto :skip\r\n\r\n";
+ t << "echo ----\r\n";
+ t << "%LATEX_CMD% refman.tex\r\n";
+ t << "goto :repeat\r\n";
+ t << ":skip\r\n";
+ t << "endlocal\r\n";
+ t << mkidx_command << " refman.idx\r\n";
+ t << "%LATEX_CMD% refman.tex\r\n";
+ t << "dvips -o refman.ps refman.dvi\r\n";
t << Portable::ghostScriptCommand();
t << " -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "
- "-sOutputFile=refman.pdf -c save pop -f refman.ps\n";
+ "-sOutputFile=refman.pdf -c save pop -f refman.ps\r\n";
}
else // use pdflatex
{
- t << "set LATEX_CMD=" << latex_command << "\n";
- t << "%LATEX_CMD% refman\n";
- t << "echo ----\n";
- t << mkidx_command << " refman.idx\n";
+ t << "set LATEX_CMD=" << latex_command << "\r\n";
+ t << "%LATEX_CMD% refman\r\n";
+ t << "echo ----\r\n";
+ t << mkidx_command << " refman.idx\r\n";
if (generateBib)
{
- t << "bibtex refman" << endl;
- t << "%LATEX_CMD% refman" << endl;
+ t << "bibtex refman\r\n";
+ t << "%LATEX_CMD% refman\r\n";
}
- t << "echo ----\n";
- t << "%LATEX_CMD% refman\n\n";
- t << "setlocal enabledelayedexpansion\n";
- t << "set count=8\n";
- t << ":repeat\n";
- t << "set content=X\n";
- t << "for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\n";
- t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\n";
- t << "if !content! == X goto :skip\n";
- t << "set /a count-=1\n";
- t << "if !count! EQU 0 goto :skip\n\n";
- t << "echo ----\n";
- t << "%LATEX_CMD% refman\n";
- t << "goto :repeat\n";
- t << ":skip\n";
- t << "endlocal\n";
- t << mkidx_command << " refman.idx\n";
- t << "%LATEX_CMD% refman\n";
- t << "cd /D %Dir_Old%\n";
- t << "set Dir_Old=\n";
+ t << "echo ----\r\n";
+ t << "%LATEX_CMD% refman\r\n\r\n";
+ t << "setlocal enabledelayedexpansion\r\n";
+ t << "set count=8\r\n";
+ t << ":repeat\r\n";
+ t << "set content=X\r\n";
+ t << "for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun LaTeX\" refman.log' ) do set content=\"%%~T\"\r\n";
+ t << "if !content! == X for /F \"tokens=*\" %%T in ( 'findstr /C:\"Rerun to get cross-references right\" refman.log' ) do set content=\"%%~T\"\r\n";
+ t << "if !content! == X goto :skip\r\n";
+ t << "set /a count-=1\r\n";
+ t << "if !count! EQU 0 goto :skip\r\n\r\n";
+ t << "echo ----\r\n";
+ t << "%LATEX_CMD% refman\r\n";
+ t << "goto :repeat\r\n";
+ t << ":skip\r\n";
+ t << "endlocal\r\n";
+ t << mkidx_command << " refman.idx\r\n";
+ t << "%LATEX_CMD% refman\r\n";
+ t << "cd /D %Dir_Old%\r\n";
+ t << "set Dir_Old=\r\n";
}
#endif
}
@@ -480,16 +463,16 @@ static void writeMakeBat()
void LatexGenerator::init()
{
QCString dname = Config_getString(LATEX_OUTPUT);
- QDir d(dname);
- if (!d.exists() && !d.mkdir(dname))
+ Dir d(dname.str());
+ if (!d.exists() && !d.mkdir(dname.str()))
{
- term("Could not create output directory %s\n",dname.data());
+ term("Could not create output directory %s\n",qPrint(dname));
}
if (!Config_getString(LATEX_HEADER).isEmpty())
{
g_header=fileToString(Config_getString(LATEX_HEADER));
- //printf("g_header='%s'\n",g_header.data());
+ //printf("g_header='%s'\n",qPrint(g_header));
}
else
{
@@ -498,7 +481,7 @@ void LatexGenerator::init()
if (!Config_getString(LATEX_FOOTER).isEmpty())
{
g_footer=fileToString(Config_getString(LATEX_FOOTER));
- //printf("g_footer='%s'\n",g_footer.data());
+ //printf("g_footer='%s'\n",qPrint(g_footer));
}
else
{
@@ -511,33 +494,30 @@ void LatexGenerator::init()
createSubDirs(d);
}
-static void writeDefaultStyleSheet(FTextStream &t)
+static void writeDefaultStyleSheet(TextStream &t)
{
t << ResourceMgr::instance().getAsString("doxygen.sty");
}
-void LatexGenerator::writeHeaderFile(QFile &f)
+void LatexGenerator::writeHeaderFile(TextStream &t)
{
- FTextStream t(&f);
- t << "% Latex header for doxygen " << getDoxygenVersion() << endl;
+ t << "% Latex header for doxygen " << getDoxygenVersion() << "\n";
t << ResourceMgr::instance().getAsString("header.tex");
}
-void LatexGenerator::writeFooterFile(QFile &f)
+void LatexGenerator::writeFooterFile(TextStream &t)
{
- FTextStream t(&f);
- t << "% Latex footer for doxygen " << getDoxygenVersion() << endl;
+ t << "% Latex footer for doxygen " << getDoxygenVersion() << "\n";
t << ResourceMgr::instance().getAsString("footer.tex");
}
-void LatexGenerator::writeStyleSheetFile(QFile &f)
+void LatexGenerator::writeStyleSheetFile(TextStream &t)
{
- FTextStream t(&f);
- t << "% stylesheet for doxygen " << getDoxygenVersion() << endl;
+ t << "% stylesheet for doxygen " << getDoxygenVersion() << "\n";
writeDefaultStyleSheet(t);
}
-void LatexGenerator::startFile(const char *name,const char *,const char *,int)
+void LatexGenerator::startFile(const QCString &name,const QCString &,const QCString &,int)
{
#if 0
setEncoding(Config_getString(LATEX_OUTPUT_ENCODING));
@@ -546,7 +526,6 @@ void LatexGenerator::startFile(const char *name,const char *,const char *,int)
m_relPath = relativePathToRoot(fileName);
if (fileName.right(4)!=".tex" && fileName.right(4)!=".sty") fileName+=".tex";
startPlainFile(fileName);
- m_codeGen.setTextStream(t);
m_codeGen.setRelativePath(m_relPath);
m_codeGen.setSourceFileName(stripPath(fileName));
}
@@ -564,30 +543,29 @@ void LatexGenerator::endFile()
void LatexGenerator::startProjectNumber()
{
- t << "\\\\[1ex]\\large ";
+ m_t << "\\\\[1ex]\\large ";
}
static QCString extraLatexStyleSheet()
{
QCString result;
const StringVector &extraLatexStyles = Config_getList(LATEX_EXTRA_STYLESHEET);
- for (const auto &extraStyle : extraLatexStyles)
+ for (const auto &fileName : extraLatexStyles)
{
- QCString fileName = extraStyle.c_str();
- if (!fileName.isEmpty())
+ if (!fileName.empty())
{
- QFileInfo fi(fileName);
+ FileInfo fi(fileName);
if (fi.exists())
{
result += "\\usepackage{";
- if (checkExtension(fi.fileName().data(), LATEX_STYLE_EXTENSION))
+ if (checkExtension(fi.fileName().c_str(), LATEX_STYLE_EXTENSION))
{
// strip the extension, it will be added by the usepackage in the tex conversion process
- result += stripExtensionGeneral(fi.fileName().data(), LATEX_STYLE_EXTENSION);
+ result += stripExtensionGeneral(fi.fileName().c_str(), LATEX_STYLE_EXTENSION);
}
else
{
- result += fi.fileName().utf8();
+ result += fi.fileName();
}
result += "}\n";
}
@@ -605,7 +583,7 @@ static QCString makeIndex()
if (latex_mkidx_command[0] == '\\')
result += latex_mkidx_command;
else
- result += '\\'+latex_mkidx_command;
+ result += "\\"+latex_mkidx_command;
}
else
{
@@ -629,13 +607,13 @@ static QCString substituteLatexKeywords(const QCString &str,
style="plain";
}
- QGString genString;
- FTextStream tg(&genString);
- QCString generatedBy;
+ TextStream tg;
bool timeStamp = Config_getBool(LATEX_TIMESTAMP);
+ QCString generatedBy;
if (timeStamp)
{
- generatedBy = theTranslator->trGeneratedAt(dateToString(TRUE), Config_getString(PROJECT_NAME));
+ generatedBy = theTranslator->trGeneratedAt(dateToString(TRUE).data(),
+ Config_getString(PROJECT_NAME).data());
}
else
{
@@ -648,7 +626,7 @@ static QCString substituteLatexKeywords(const QCString &str,
false, // insideTable
false // keepSpaces
);
- generatedBy = genString;
+ generatedBy = tg.str();
QCString latexFontenc = theTranslator->latexFontenc();
@@ -656,24 +634,20 @@ static QCString substituteLatexKeywords(const QCString &str,
if (latexEmojiDirectory.isEmpty()) latexEmojiDirectory = ".";
latexEmojiDirectory = substitute(latexEmojiDirectory,"\\","/");
- QGString genExtraLatexPackages;
- FTextStream tg1(&genExtraLatexPackages);
+ TextStream tg1;
writeExtraLatexPackages(tg1);
- QCString extraLatexPackages;
- extraLatexPackages = genExtraLatexPackages;
+ QCString extraLatexPackages = tg1.str();
- QGString genLatexSpecialFormulaChars;
- FTextStream tg2(&genLatexSpecialFormulaChars);
+ TextStream tg2;
writeLatexSpecialFormulaChars(tg2);
- QCString latexSpecialFormulaChars;
- latexSpecialFormulaChars = genLatexSpecialFormulaChars;
+ QCString latexSpecialFormulaChars = tg2.str();
QCString formulaMacrofile = Config_getString(FORMULA_MACROFILE);
if (!formulaMacrofile.isEmpty())
{
- QFileInfo fi(formulaMacrofile);
- formulaMacrofile=fi.absFilePath().utf8();
- QCString stripMacroFile = fi.fileName().data();
+ FileInfo fi(formulaMacrofile.str());
+ formulaMacrofile=fi.absFilePath();
+ QCString stripMacroFile = fi.fileName();
copyFile(formulaMacrofile,Config_getString(LATEX_OUTPUT) + "/" + stripMacroFile);
}
@@ -722,45 +696,49 @@ void LatexGenerator::startIndexSection(IndexSections is)
switch (is)
{
case isTitlePageStart:
- t << substituteLatexKeywords(g_header,convertToLaTeX(Config_getString(PROJECT_NAME)));
+ m_t << substituteLatexKeywords(g_header,convertToLaTeX(Config_getString(PROJECT_NAME)));
break;
case isTitlePageAuthor:
break;
case isMainPage:
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //Introduction}\n"
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Introduction}\n"
break;
//case isPackageIndex:
- // if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- // t << "{"; //Package Index}\n"
+ // if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ // m_t << "{"; //Package Index}\n"
// break;
case isModuleIndex:
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //Module Index}\n"
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Module Index}\n"
break;
case isDirIndex:
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //Directory Index}\n"
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Directory Index}\n"
break;
case isNamespaceIndex:
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //Namespace Index}\n"
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Namespace Index}\n"
+ break;
+ case isConceptIndex:
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Concept Index}\n"
break;
case isClassHierarchyIndex:
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //Hierarchical Index}\n"
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Hierarchical Index}\n"
break;
case isCompoundIndex:
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //Annotated Compound Index}\n"
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Annotated Compound Index}\n"
break;
case isFileIndex:
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //Annotated File Index}\n"
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Annotated File Index}\n"
break;
case isPageIndex:
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //Annotated Page Index}\n"
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Annotated Page Index}\n"
break;
case isModuleDocumentation:
{
@@ -768,8 +746,8 @@ void LatexGenerator::startIndexSection(IndexSections is)
{
if (!gd->isReference())
{
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //Module Documentation}\n";
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Module Documentation}\n";
break;
}
}
@@ -781,8 +759,8 @@ void LatexGenerator::startIndexSection(IndexSections is)
{
if (dd->isLinkableInProject())
{
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //Module Documentation}\n";
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Module Documentation}\n";
break;
}
}
@@ -794,8 +772,21 @@ void LatexGenerator::startIndexSection(IndexSections is)
{
if (nd->isLinkableInProject() && !nd->isAlias())
{
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; // Namespace Documentation}\n":
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; // Namespace Documentation}\n":
+ break;
+ }
+ }
+ }
+ break;
+ case isConceptDocumentation:
+ {
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ if (cd->isLinkableInProject() && !cd->isAlias())
+ {
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; // Concept Documentation}\n":
break;
}
}
@@ -811,8 +802,8 @@ void LatexGenerator::startIndexSection(IndexSections is)
!cd->isAlias()
)
{
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //Compound Documentation}\n";
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Compound Documentation}\n";
break;
}
}
@@ -829,8 +820,8 @@ void LatexGenerator::startIndexSection(IndexSections is)
{
if (isFirst)
{
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //File Documentation}\n";
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //File Documentation}\n";
isFirst=FALSE;
break;
}
@@ -841,14 +832,14 @@ void LatexGenerator::startIndexSection(IndexSections is)
break;
case isExampleDocumentation:
{
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //Example Documentation}\n";
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Example Documentation}\n";
}
break;
case isPageDocumentation:
{
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{"; //Page Documentation}\n";
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{"; //Page Documentation}\n";
}
break;
case isPageDocumentation2:
@@ -871,31 +862,34 @@ void LatexGenerator::endIndexSection(IndexSections is)
{
//QCString indexName=Config_getBool(GENERATE_TREEVIEW)?"main":"index";
QCString indexName="index";
- t << "}\n\\label{index}";
- if (Config_getBool(PDF_HYPERLINKS)) t << "\\hypertarget{index}{}";
- t << "\\input{" << indexName << "}\n";
+ m_t << "}\n\\label{index}";
+ if (Config_getBool(PDF_HYPERLINKS)) m_t << "\\hypertarget{index}{}";
+ m_t << "\\input{" << indexName << "}\n";
}
break;
case isModuleIndex:
- t << "}\n\\input{modules}\n";
+ m_t << "}\n\\input{modules}\n";
break;
case isDirIndex:
- t << "}\n\\input{dirs}\n";
+ m_t << "}\n\\input{dirs}\n";
break;
case isNamespaceIndex:
- t << "}\n\\input{namespaces}\n";
+ m_t << "}\n\\input{namespaces}\n";
+ break;
+ case isConceptIndex:
+ m_t << "}\n\\input{concepts}\n";
break;
case isClassHierarchyIndex:
- t << "}\n\\input{hierarchy}\n";
+ m_t << "}\n\\input{hierarchy}\n";
break;
case isCompoundIndex:
- t << "}\n\\input{annotated}\n";
+ m_t << "}\n\\input{annotated}\n";
break;
case isFileIndex:
- t << "}\n\\input{files}\n";
+ m_t << "}\n\\input{files}\n";
break;
case isPageIndex:
- t << "}\n\\input{pages}\n";
+ m_t << "}\n\\input{pages}\n";
break;
case isModuleDocumentation:
{
@@ -906,10 +900,10 @@ void LatexGenerator::endIndexSection(IndexSections is)
{
if (!found)
{
- t << "}\n";
+ m_t << "}\n";
found=TRUE;
}
- t << "\\input{" << gd->getOutputFileBase() << "}\n";
+ m_t << "\\input{" << gd->getOutputFileBase() << "}\n";
}
}
}
@@ -923,10 +917,10 @@ void LatexGenerator::endIndexSection(IndexSections is)
{
if (!found)
{
- t << "}\n";
+ m_t << "}\n";
found = TRUE;
}
- t << "\\input{" << dd->getOutputFileBase() << "}\n";
+ m_t << "\\input{" << dd->getOutputFileBase() << "}\n";
}
}
}
@@ -940,10 +934,27 @@ void LatexGenerator::endIndexSection(IndexSections is)
{
if (!found)
{
- t << "}\n";
+ m_t << "}\n";
found=true;
}
- t << "\\input{" << nd->getOutputFileBase() << "}\n";
+ m_t << "\\input{" << nd->getOutputFileBase() << "}\n";
+ }
+ }
+ }
+ break;
+ case isConceptDocumentation:
+ {
+ bool found=FALSE;
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ if (cd->isLinkableInProject() && !cd->isAlias())
+ {
+ if (!found)
+ {
+ m_t << "}\n";
+ found=true;
+ }
+ m_t << "\\input{" << cd->getOutputFileBase() << "}\n";
}
}
}
@@ -961,10 +972,10 @@ void LatexGenerator::endIndexSection(IndexSections is)
{
if (!found)
{
- t << "}\n"; // end doxysection or chapter title
+ m_t << "}\n"; // end doxysection or chapter title
found=TRUE;
}
- t << "\\input{" << cd->getOutputFileBase() << "}\n";
+ m_t << "\\input{" << cd->getOutputFileBase() << "}\n";
}
}
}
@@ -980,14 +991,14 @@ void LatexGenerator::endIndexSection(IndexSections is)
{
if (isFirst)
{
- t << "}\n"; // end doxysection or chapter title
+ m_t << "}\n"; // end doxysection or chapter title
}
isFirst=FALSE;
- t << "\\input{" << fd->getOutputFileBase() << "}\n";
+ m_t << "\\input{" << fd->getOutputFileBase() << "}\n";
if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
{
- //t << "\\include{" << fd->getSourceFileBase() << "}\n";
- t << "\\input{" << fd->getSourceFileBase() << "}\n";
+ //m_t << "\\include{" << fd->getSourceFileBase() << "}\n";
+ m_t << "\\input{" << fd->getSourceFileBase() << "}\n";
}
}
}
@@ -996,28 +1007,28 @@ void LatexGenerator::endIndexSection(IndexSections is)
break;
case isExampleDocumentation:
{
- t << "}\n";
+ m_t << "}\n";
for (const auto &pd : *Doxygen::exampleLinkedMap)
{
- t << "\\input{" << pd->getOutputFileBase() << "}\n";
+ m_t << "\\input{" << pd->getOutputFileBase() << "}\n";
}
}
break;
case isPageDocumentation:
{
- t << "}\n";
+ m_t << "}\n";
#if 0
bool first=TRUE;
for (const auto *pd : Doxygen::pageLinkedMap)
{
if (!pd->getGroupDef() && !pd->isReference())
{
- if (compactLatex) t << "\\doxysection"; else t << "\\chapter";
- t << "{" << pd->title();
- t << "}\n";
+ if (compactLatex) m_t << "\\doxysection"; else m_t << "\\chapter";
+ m_t << "{" << pd->title();
+ m_t << "}\n";
- if (compactLatex || first) t << "\\input" ; else t << "\\include";
- t << "{" << pd->getOutputFileBase() << "}\n";
+ if (compactLatex || first) m_t << "\\input" ; else m_t << "\\include";
+ m_t << "{" << pd->getOutputFileBase() << "}\n";
first=FALSE;
}
}
@@ -1027,18 +1038,18 @@ void LatexGenerator::endIndexSection(IndexSections is)
case isPageDocumentation2:
break;
case isEndIndex:
- t << substituteLatexKeywords(g_footer,convertToLaTeX(Config_getString(PROJECT_NAME)));
+ m_t << substituteLatexKeywords(g_footer,convertToLaTeX(Config_getString(PROJECT_NAME)));
break;
}
}
-void LatexGenerator::writePageLink(const char *name, bool /*first*/)
+void LatexGenerator::writePageLink(const QCString &name, bool /*first*/)
{
//bool &compactLatex = Config_getBool(COMPACT_LATEX);
// next is remove for bug615957
- //if (compactLatex || first) t << "\\input" ; else t << "\\include";
- t << "\\input" ;
- t << "{" << name << "}\n";
+ //if (compactLatex || first) m_t << "\\input" ; else m_t << "\\include";
+ m_t << "\\input" ;
+ m_t << "{" << name << "}\n";
}
@@ -1048,110 +1059,110 @@ void LatexGenerator::writeStyleInfo(int part)
return;
startPlainFile("doxygen.sty");
- writeDefaultStyleSheet(t);
+ writeDefaultStyleSheet(m_t);
endPlainFile();
// workaround for the problem caused by change in LaTeX in version 2019
// in the unmaintained tabu package
startPlainFile("tabu_doxygen.sty");
- t << ResourceMgr::instance().getAsString("tabu_doxygen.sty");
+ m_t << ResourceMgr::instance().getAsString("tabu_doxygen.sty");
endPlainFile();
startPlainFile("longtable_doxygen.sty");
- t << ResourceMgr::instance().getAsString("longtable_doxygen.sty");
+ m_t << ResourceMgr::instance().getAsString("longtable_doxygen.sty");
endPlainFile();
}
void LatexGenerator::newParagraph()
{
- t << endl << endl;
+ m_t << "\n" << "\n";
}
-void LatexGenerator::startParagraph(const char *)
+void LatexGenerator::startParagraph(const QCString &)
{
- t << endl << endl;
+ m_t << "\n" << "\n";
}
void LatexGenerator::endParagraph()
{
- t << endl << endl;
+ m_t << "\n" << "\n";
}
-void LatexGenerator::writeString(const char *text)
+void LatexGenerator::writeString(const QCString &text)
{
- t << text;
+ m_t << text;
}
-void LatexGenerator::startIndexItem(const char *ref,const char *fn)
+void LatexGenerator::startIndexItem(const QCString &ref,const QCString &fn)
{
- t << "\\item ";
- if (!ref && fn)
+ m_t << "\\item ";
+ if (ref.isEmpty() && !fn.isEmpty())
{
- t << "\\contentsline{section}{";
+ m_t << "\\contentsline{section}{";
}
}
-void LatexGenerator::endIndexItem(const char *ref,const char *fn)
+void LatexGenerator::endIndexItem(const QCString &ref,const QCString &fn)
{
- if (!ref && fn)
+ if (ref.isEmpty() && !fn.isEmpty())
{
- t << "}{\\pageref{" << stripPath(fn) << "}}{}" << endl;
+ m_t << "}{\\pageref{" << stripPath(fn) << "}}{}\n";
}
}
-//void LatexGenerator::writeIndexFileItem(const char *,const char *text)
+//void LatexGenerator::writeIndexFileItem(const QCString &,const QCString &text)
//{
-// t << "\\item\\contentsline{section}{";
+// m_t << "\\item\\contentsline{section}{";
// docify(text);
-// t << "}{\\pageref{" << stripPath(text) << "}}" << endl;
+// m_t << "}{\\pageref{" << stripPath(text) << "}}\n";
//}
-void LatexGenerator::startHtmlLink(const char *url)
+void LatexGenerator::startHtmlLink(const QCString &url)
{
if (Config_getBool(PDF_HYPERLINKS))
{
- t << "\\href{";
- t << latexFilterURL(url);
- t << "}";
+ m_t << "\\href{";
+ m_t << latexFilterURL(url);
+ m_t << "}";
}
- t << "{\\texttt{ ";
+ m_t << "{\\texttt{ ";
}
void LatexGenerator::endHtmlLink()
{
- t << "}}";
+ m_t << "}}";
}
-//void LatexGenerator::writeMailLink(const char *url)
+//void LatexGenerator::writeMailLink(const QCString &url)
//{
// if (Config_getBool(PDF_HYPERLINKS))
// {
-// t << "\\href{mailto:";
-// t << url;
-// t << "}";
+// m_t << "\\href{mailto:";
+// m_t << url;
+// m_t << "}";
// }
-// t << "\\texttt{ ";
+// m_t << "\\texttt{ ";
// docify(url);
-// t << "}";
+// m_t << "}";
//}
-void LatexGenerator::writeStartAnnoItem(const char *,const char *,
- const char *path,const char *name)
+void LatexGenerator::writeStartAnnoItem(const QCString &,const QCString &,
+ const QCString &path,const QCString &name)
{
- t << "\\item\\contentsline{section}\\textbf{ ";
- if (path) docify(path);
+ m_t << "\\item\\contentsline{section}\\textbf{ ";
+ if (!path.isEmpty()) docify(path);
docify(name);
- t << "} ";
+ m_t << "} ";
}
-void LatexGenerator::writeEndAnnoItem(const char *name)
+void LatexGenerator::writeEndAnnoItem(const QCString &name)
{
- t << "}{\\pageref{" << stripPath(name) << "}}{}" << endl;
+ m_t << "}{\\pageref{" << stripPath(name) << "}}{}\n";
}
void LatexGenerator::startIndexKey()
{
- t << "\\item\\contentsline{section}{";
+ m_t << "\\item\\contentsline{section}{";
}
void LatexGenerator::endIndexKey()
@@ -1160,37 +1171,37 @@ void LatexGenerator::endIndexKey()
void LatexGenerator::startIndexValue(bool hasBrief)
{
- t << " ";
- if (hasBrief) t << "\\\\*";
+ m_t << " ";
+ if (hasBrief) m_t << "\\\\*";
}
-void LatexGenerator::endIndexValue(const char *name,bool /*hasBrief*/)
+void LatexGenerator::endIndexValue(const QCString &name,bool /*hasBrief*/)
{
- //if (hasBrief) t << ")";
- t << "}{\\pageref{" << stripPath(name) << "}}{}" << endl;
+ //if (hasBrief) m_t << ")";
+ m_t << "}{\\pageref{" << stripPath(name) << "}}{}\n";
}
-//void LatexGenerator::writeClassLink(const char *,const char *,
-// const char *,const char *name)
+//void LatexGenerator::writeClassLink(const QCString &,const QCString &,
+// const QCString &,const QCString &name)
//{
-// t << "\\textbf{ ";
+// m_t << "\\textbf{ ";
// docify(name);
-// t << "}";
+// m_t << "}";
//}
-void LatexGenerator::startTextLink(const char *f,const char *anchor)
+void LatexGenerator::startTextLink(const QCString &f,const QCString &anchor)
{
bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
if (!m_disableLinks && pdfHyperlinks)
{
- t << "\\mbox{\\hyperlink{";
- if (f) t << stripPath(f);
- if (anchor) t << "_" << anchor;
- t << "}{";
+ m_t << "\\mbox{\\hyperlink{";
+ if (!f.isEmpty()) m_t << stripPath(f);
+ if (!anchor.isEmpty()) m_t << "_" << anchor;
+ m_t << "}{";
}
else
{
- t << "\\textbf{ ";
+ m_t << "\\textbf{ ";
}
}
@@ -1199,75 +1210,75 @@ void LatexGenerator::endTextLink()
bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
if (!m_disableLinks && pdfHyperlinks)
{
- t << "}";
+ m_t << "}";
}
- t << "}";
+ m_t << "}";
}
-void LatexGenerator::writeObjectLink(const char *ref, const char *f,
- const char *anchor, const char *text)
+void LatexGenerator::writeObjectLink(const QCString &ref, const QCString &f,
+ const QCString &anchor, const QCString &text)
{
bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
- if (!m_disableLinks && !ref && pdfHyperlinks)
+ if (!m_disableLinks && ref.isEmpty() && pdfHyperlinks)
{
- t << "\\mbox{\\hyperlink{";
- if (f) t << stripPath(f);
- if (f && anchor) t << "_";
- if (anchor) t << anchor;
- t << "}{";
+ m_t << "\\mbox{\\hyperlink{";
+ if (!f.isEmpty()) m_t << stripPath(f);
+ if (!f.isEmpty() && !anchor.isEmpty()) m_t << "_";
+ if (!anchor.isEmpty()) m_t << anchor;
+ m_t << "}{";
docify(text);
- t << "}}";
+ m_t << "}}";
}
else
{
- t << "\\textbf{ ";
+ m_t << "\\textbf{ ";
docify(text);
- t << "}";
+ m_t << "}";
}
}
void LatexGenerator::startPageRef()
{
- t << " \\doxyref{}{";
+ m_t << " \\doxyref{}{";
}
-void LatexGenerator::endPageRef(const char *clname, const char *anchor)
+void LatexGenerator::endPageRef(const QCString &clname, const QCString &anchor)
{
- t << "}{";
- if (clname) t << clname;
- if (anchor) t << "_" << anchor;
- t << "}";
+ m_t << "}{";
+ if (!clname.isEmpty()) m_t << clname;
+ if (!anchor.isEmpty()) m_t << "_" << anchor;
+ m_t << "}";
}
-void LatexGenerator::startTitleHead(const char *fileName)
+void LatexGenerator::startTitleHead(const QCString &fileName)
{
bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
bool usePDFLatex = Config_getBool(USE_PDFLATEX);
- if (usePDFLatex && pdfHyperlinks && fileName)
+ if (usePDFLatex && pdfHyperlinks && !fileName.isEmpty())
{
- t << "\\hypertarget{" << stripPath(fileName) << "}{}";
+ m_t << "\\hypertarget{" << stripPath(fileName) << "}{}";
}
if (Config_getBool(COMPACT_LATEX))
{
- t << "\\doxysubsection{";
+ m_t << "\\doxysubsection{";
}
else
{
- t << "\\doxysection{";
+ m_t << "\\doxysection{";
}
}
-void LatexGenerator::endTitleHead(const char *fileName,const char *name)
+void LatexGenerator::endTitleHead(const QCString &fileName,const QCString &name)
{
- t << "}" << endl;
- if (name)
+ m_t << "}\n";
+ if (!name.isEmpty())
{
- t << "\\label{" << stripPath(fileName) << "}\\index{";
- t << latexEscapeLabelName(name);
- t << "@{";
- t << latexEscapeIndexChars(name);
- t << "}}" << endl;
+ m_t << "\\label{" << stripPath(fileName) << "}\\index{";
+ m_t << latexEscapeLabelName(name);
+ m_t << "@{";
+ m_t << latexEscapeIndexChars(name);
+ m_t << "}}\n";
}
}
@@ -1275,11 +1286,11 @@ void LatexGenerator::startTitle()
{
if (Config_getBool(COMPACT_LATEX))
{
- t << "\\doxysubsection{";
+ m_t << "\\doxysubsection{";
}
else
{
- t << "\\doxysection{";
+ m_t << "\\doxysection{";
}
}
@@ -1292,19 +1303,19 @@ void LatexGenerator::startGroupHeader(int extraIndentLevel)
if (extraIndentLevel==3)
{
- t << "\\doxysubparagraph*{";
+ m_t << "\\doxysubparagraph*{";
}
else if (extraIndentLevel==2)
{
- t << "\\doxyparagraph{";
+ m_t << "\\doxyparagraph{";
}
else if (extraIndentLevel==1)
{
- t << "\\doxysubsubsection{";
+ m_t << "\\doxysubsubsection{";
}
else // extraIndentLevel==0
{
- t << "\\doxysubsection{";
+ m_t << "\\doxysubsection{";
}
m_disableLinks=TRUE;
}
@@ -1312,18 +1323,18 @@ void LatexGenerator::startGroupHeader(int extraIndentLevel)
void LatexGenerator::endGroupHeader(int)
{
m_disableLinks=FALSE;
- t << "}" << endl;
+ m_t << "}\n";
}
-void LatexGenerator::startMemberHeader(const char *,int)
+void LatexGenerator::startMemberHeader(const QCString &,int)
{
if (Config_getBool(COMPACT_LATEX))
{
- t << "\\doxysubsubsection*{";
+ m_t << "\\doxysubsubsection*{";
}
else
{
- t << "\\doxysubsection*{";
+ m_t << "\\doxysubsection*{";
}
m_disableLinks=TRUE;
}
@@ -1331,46 +1342,46 @@ void LatexGenerator::startMemberHeader(const char *,int)
void LatexGenerator::endMemberHeader()
{
m_disableLinks=FALSE;
- t << "}" << endl;
+ m_t << "}\n";
}
-void LatexGenerator::startMemberDoc(const char *clname,
- const char *memname,
- const char *,
- const char *title,
+void LatexGenerator::startMemberDoc(const QCString &clname,
+ const QCString &memname,
+ const QCString &,
+ const QCString &title,
int memCount,
int memTotal,
bool showInline)
{
- if (memname && memname[0]!='@')
+ if (!memname.isEmpty() && memname[0]!='@')
{
- t << "\\index{";
- if (clname)
+ m_t << "\\index{";
+ if (!clname.isEmpty())
{
- t << latexEscapeLabelName(clname);
- t << "@{";
- t << latexEscapeIndexChars(clname);
- t << "}!";
+ m_t << latexEscapeLabelName(clname);
+ m_t << "@{";
+ m_t << latexEscapeIndexChars(clname);
+ m_t << "}!";
}
- t << latexEscapeLabelName(memname);
- t << "@{";
- t << latexEscapeIndexChars(memname);
- t << "}}" << endl;
-
- t << "\\index{";
- t << latexEscapeLabelName(memname);
- t << "@{";
- t << latexEscapeIndexChars(memname);
- t << "}";
- if (clname)
+ m_t << latexEscapeLabelName(memname);
+ m_t << "@{";
+ m_t << latexEscapeIndexChars(memname);
+ m_t << "}}\n";
+
+ m_t << "\\index{";
+ m_t << latexEscapeLabelName(memname);
+ m_t << "@{";
+ m_t << latexEscapeIndexChars(memname);
+ m_t << "}";
+ if (!clname.isEmpty())
{
- t << "!";
- t << latexEscapeLabelName(clname);
- t << "@{";
- t << latexEscapeIndexChars(clname);
- t << "}";
+ m_t << "!";
+ m_t << latexEscapeLabelName(clname);
+ m_t << "@{";
+ m_t << latexEscapeIndexChars(clname);
+ m_t << "}";
}
- t << "}" << endl;
+ m_t << "}\n";
}
static const char *levelLab[] = { "doxysubsubsection","doxyparagraph","doxysubparagraph", "doxysubparagraph" };
bool compactLatex = Config_getBool(COMPACT_LATEX);
@@ -1378,151 +1389,151 @@ void LatexGenerator::startMemberDoc(const char *clname,
int level=0;
if (showInline) level+=2;
if (compactLatex) level++;
- t << "\\" << levelLab[level];
+ m_t << "\\" << levelLab[level];
- t << "{";
+ m_t << "{";
if (pdfHyperlinks)
{
- t << "\\texorpdfstring{";
+ m_t << "\\texorpdfstring{";
}
- t << latexEscapeIndexChars(title);
+ m_t << latexEscapeIndexChars(title);
if (pdfHyperlinks)
{
- t << "}{" << latexEscapePDFString(title) << "}";
+ m_t << "}{" << latexEscapePDFString(title) << "}";
}
if (memTotal>1)
{
- t << "\\hspace{0.1cm}{\\footnotesize\\ttfamily [" << memCount << "/" << memTotal << "]}";
+ m_t << "\\hspace{0.1cm}{\\footnotesize\\ttfamily [" << memCount << "/" << memTotal << "]}";
}
- t << "}";
- t << "\n{\\footnotesize\\ttfamily ";
+ m_t << "}";
+ m_t << "\n{\\footnotesize\\ttfamily ";
//m_disableLinks=TRUE;
}
void LatexGenerator::endMemberDoc(bool)
{
m_disableLinks=FALSE;
- t << "}\n\n";
- //if (Config_getBool(COMPACT_LATEX)) t << "\\hfill";
+ m_t << "}\n\n";
+ //if (Config_getBool(COMPACT_LATEX)) m_t << "\\hfill";
}
-void LatexGenerator::startDoxyAnchor(const char *fName,const char *,
- const char *anchor, const char *,
- const char *)
+void LatexGenerator::startDoxyAnchor(const QCString &fName,const QCString &,
+ const QCString &anchor, const QCString &,
+ const QCString &)
{
bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
bool usePDFLatex = Config_getBool(USE_PDFLATEX);
- t << "\\mbox{";
+ m_t << "\\mbox{";
if (usePDFLatex && pdfHyperlinks)
{
- t << "\\Hypertarget{";
- if (fName) t << stripPath(fName);
- if (anchor) t << "_" << anchor;
- t << "}";
+ m_t << "\\Hypertarget{";
+ if (!fName.isEmpty()) m_t << stripPath(fName);
+ if (!anchor.isEmpty()) m_t << "_" << anchor;
+ m_t << "}";
}
- t << "\\label{";
- if (fName) t << stripPath(fName);
- if (anchor) t << "_" << anchor;
- t << "}} " << endl;
+ m_t << "\\label{";
+ if (!fName.isEmpty()) m_t << stripPath(fName);
+ if (!anchor.isEmpty()) m_t << "_" << anchor;
+ m_t << "}} \n";
}
-void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor)
+void LatexGenerator::endDoxyAnchor(const QCString &fName,const QCString &anchor)
{
}
-void LatexGenerator::writeAnchor(const char *fName,const char *name)
+void LatexGenerator::writeAnchor(const QCString &fName,const QCString &name)
{
//printf("LatexGenerator::writeAnchor(%s,%s)\n",fName,name);
- t << "\\label{" << stripPath(name) << "}" << endl;
+ m_t << "\\label{" << stripPath(name) << "}\n";
bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
bool usePDFLatex = Config_getBool(USE_PDFLATEX);
if (usePDFLatex && pdfHyperlinks)
{
- if (fName)
+ if (!fName.isEmpty())
{
- t << "\\Hypertarget{" << stripPath(fName) << "_" << stripPath(name) << "}" << endl;
+ m_t << "\\Hypertarget{" << stripPath(fName) << "_" << stripPath(name) << "}\n";
}
else
{
- t << "\\Hypertarget{" << stripPath(name) << "}" << endl;
+ m_t << "\\Hypertarget{" << stripPath(name) << "}\n";
}
}
}
-//void LatexGenerator::writeLatexLabel(const char *clName,const char *anchor)
+//void LatexGenerator::writeLatexLabel(const QCString &clName,const QCString &anchor)
//{
// writeDoxyAnchor(0,clName,anchor,0);
//}
-void LatexGenerator::addIndexItem(const char *s1,const char *s2)
+void LatexGenerator::addIndexItem(const QCString &s1,const QCString &s2)
{
- if (s1)
+ if (!s1.isEmpty())
{
- t << "\\index{";
- t << latexEscapeLabelName(s1);
- t << "@{";
- t << latexEscapeIndexChars(s1);
- t << "}";
- if (s2)
+ m_t << "\\index{";
+ m_t << latexEscapeLabelName(s1);
+ m_t << "@{";
+ m_t << latexEscapeIndexChars(s1);
+ m_t << "}";
+ if (!s2.isEmpty())
{
- t << "!";
- t << latexEscapeLabelName(s2);
- t << "@{";
- t << latexEscapeIndexChars(s2);
- t << "}";
+ m_t << "!";
+ m_t << latexEscapeLabelName(s2);
+ m_t << "@{";
+ m_t << latexEscapeIndexChars(s2);
+ m_t << "}";
}
- t << "}";
+ m_t << "}";
}
}
-void LatexGenerator::startSection(const char *lab,const char *,SectionType type)
+void LatexGenerator::startSection(const QCString &lab,const QCString &,SectionType type)
{
bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
bool usePDFLatex = Config_getBool(USE_PDFLATEX);
if (usePDFLatex && pdfHyperlinks)
{
- t << "\\hypertarget{" << stripPath(lab) << "}{}";
+ m_t << "\\hypertarget{" << stripPath(lab) << "}{}";
}
- t << "\\";
+ m_t << "\\";
if (Config_getBool(COMPACT_LATEX))
{
switch(type)
{
- case SectionType::Page: t << "doxysubsection"; break;
- case SectionType::Section: t << "doxysubsubsection"; break;
- case SectionType::Subsection: t << "doxyparagraph"; break;
- case SectionType::Subsubsection: t << "doxysubparagraph"; break;
- case SectionType::Paragraph: t << "doxysubparagraph"; break;
+ case SectionType::Page: m_t << "doxysubsection"; break;
+ case SectionType::Section: m_t << "doxysubsubsection"; break;
+ case SectionType::Subsection: m_t << "doxyparagraph"; break;
+ case SectionType::Subsubsection: m_t << "doxysubparagraph"; break;
+ case SectionType::Paragraph: m_t << "doxysubparagraph"; break;
default: ASSERT(0); break;
}
- t << "{";
+ m_t << "{";
}
else
{
switch(type)
{
- case SectionType::Page: t << "doxysection"; break;
- case SectionType::Section: t << "doxysubsection"; break;
- case SectionType::Subsection: t << "doxysubsubsection"; break;
- case SectionType::Subsubsection: t << "doxyparagraph"; break;
- case SectionType::Paragraph: t << "doxysubparagraph"; break;
+ case SectionType::Page: m_t << "doxysection"; break;
+ case SectionType::Section: m_t << "doxysubsection"; break;
+ case SectionType::Subsection: m_t << "doxysubsubsection"; break;
+ case SectionType::Subsubsection: m_t << "doxyparagraph"; break;
+ case SectionType::Paragraph: m_t << "doxysubparagraph"; break;
default: ASSERT(0); break;
}
- t << "{";
+ m_t << "{";
}
}
-void LatexGenerator::endSection(const char *lab,SectionType)
+void LatexGenerator::endSection(const QCString &lab,SectionType)
{
- t << "}\\label{" << lab << "}" << endl;
+ m_t << "}\\label{" << lab << "}\n";
}
-void LatexGenerator::docify(const char *str)
+void LatexGenerator::docify(const QCString &str)
{
- filterLatexString(t,str,
+ filterLatexString(m_t,str,
m_insideTabbing, // insideTabbing
false, // insidePre
false, // insideItem
@@ -1541,14 +1552,14 @@ void LatexGenerator::writeChar(char c)
void LatexGenerator::startClassDiagram()
{
- //if (Config_getBool(COMPACT_LATEX)) t << "\\doxysubsubsection"; else t << "\\doxysubsection";
- //t << "{";
+ //if (Config_getBool(COMPACT_LATEX)) m_t << "\\doxysubsubsection"; else m_t << "\\doxysubsection";
+ //m_t << "{";
}
void LatexGenerator::endClassDiagram(const ClassDiagram &d,
- const char *fileName,const char *)
+ const QCString &fileName,const QCString &)
{
- d.writeFigure(t,dir(),fileName);
+ d.writeFigure(m_t,dir(),fileName);
}
@@ -1556,8 +1567,8 @@ void LatexGenerator::startAnonTypeScope(int indent)
{
if (indent==0)
{
- t << "\\begin{tabbing}" << endl;
- t << "xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=\\kill" << endl;
+ m_t << "\\begin{tabbing}\n";
+ m_t << "xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=\\kill\n";
m_insideTabbing=TRUE;
}
m_indent=indent;
@@ -1567,7 +1578,7 @@ void LatexGenerator::endAnonTypeScope(int indent)
{
if (indent==0)
{
- t << endl << "\\end{tabbing}";
+ m_t << "\n" << "\\end{tabbing}";
m_insideTabbing=FALSE;
}
m_indent=indent;
@@ -1577,24 +1588,24 @@ void LatexGenerator::startMemberTemplateParams()
{
if (templateMemberItem)
{
- t << "{\\footnotesize ";
+ m_t << "{\\footnotesize ";
}
}
-void LatexGenerator::endMemberTemplateParams(const char *,const char *)
+void LatexGenerator::endMemberTemplateParams(const QCString &,const QCString &)
{
if (templateMemberItem)
{
- t << "}\\\\";
+ m_t << "}\\\\";
}
}
-void LatexGenerator::startMemberItem(const char *,int annoType,const char *)
+void LatexGenerator::startMemberItem(const QCString &,int annoType,const QCString &)
{
//printf("LatexGenerator::startMemberItem(%d)\n",annType);
if (!m_insideTabbing)
{
- t << "\\item " << endl;
+ m_t << "\\item \n";
templateMemberItem = (annoType == 3);
}
}
@@ -1603,22 +1614,22 @@ void LatexGenerator::endMemberItem()
{
if (m_insideTabbing)
{
- t << "\\\\";
+ m_t << "\\\\";
}
templateMemberItem = FALSE;
- t << endl;
+ m_t << "\n";
}
-void LatexGenerator::startMemberDescription(const char *,const char *,bool)
+void LatexGenerator::startMemberDescription(const QCString &,const QCString &,bool)
{
if (!m_insideTabbing)
{
- t << "\\begin{DoxyCompactList}\\small\\item\\em ";
+ m_t << "\\begin{DoxyCompactList}\\small\\item\\em ";
}
else
{
- for (int i=0;i<m_indent+2;i++) t << "\\>";
- t << "{\\em ";
+ for (int i=0;i<m_indent+2;i++) m_t << "\\>";
+ m_t << "{\\em ";
}
}
@@ -1626,12 +1637,12 @@ void LatexGenerator::endMemberDescription()
{
if (!m_insideTabbing)
{
- //t << "\\item\\end{DoxyCompactList}";
- t << "\\end{DoxyCompactList}";
+ //m_t << "\\item\\end{DoxyCompactList}";
+ m_t << "\\end{DoxyCompactList}";
}
else
{
- t << "}\\\\\n";
+ m_t << "}\\\\\n";
}
}
@@ -1641,11 +1652,11 @@ void LatexGenerator::writeNonBreakableSpace(int)
//printf("writeNonBreakableSpace()\n");
if (m_insideTabbing)
{
- t << "\\>";
+ m_t << "\\>";
}
else
{
- t << "~";
+ m_t << "~";
}
}
@@ -1663,23 +1674,23 @@ void LatexGenerator::writeNonBreakableSpace(int)
// - endDescTableRow()
// endDescTable()
-void LatexGenerator::startDescTable(const char *title)
+void LatexGenerator::startDescTable(const QCString &title)
{
m_codeGen.incUsedTableLevel();
- t << "\\begin{DoxyEnumFields}{" << title << "}" << endl;
+ m_t << "\\begin{DoxyEnumFields}{" << title << "}\n";
}
void LatexGenerator::endDescTable()
{
m_codeGen.decUsedTableLevel();
- t << "\\end{DoxyEnumFields}" << endl;
+ m_t << "\\end{DoxyEnumFields}\n";
}
void LatexGenerator::startDescTableRow()
{
// this is needed to prevent the \hypertarget, \label, and \index commands from messing up
// the row height (based on http://tex.stackexchange.com/a/186102)
- t << "\\raisebox{\\heightof{T}}[0pt][0pt]{";
+ m_t << "\\raisebox{\\heightof{T}}[0pt][0pt]{";
}
void LatexGenerator::endDescTableRow()
@@ -1688,7 +1699,7 @@ void LatexGenerator::endDescTableRow()
void LatexGenerator::startDescTableTitle()
{
- t << "}";
+ m_t << "}";
}
void LatexGenerator::endDescTableTitle()
@@ -1697,12 +1708,12 @@ void LatexGenerator::endDescTableTitle()
void LatexGenerator::startDescTableData()
{
- t << "&";
+ m_t << "&";
}
void LatexGenerator::endDescTableData()
{
- t << "\\\\\n\\hline\n" << endl;
+ m_t << "\\\\\n\\hline\n\n";
}
void LatexGenerator::lastIndexPage()
@@ -1714,7 +1725,7 @@ void LatexGenerator::startMemberList()
{
if (!m_insideTabbing)
{
- t << "\\begin{DoxyCompactItemize}" << endl;
+ m_t << "\\begin{DoxyCompactItemize}\n";
}
}
@@ -1723,41 +1734,41 @@ void LatexGenerator::endMemberList()
//printf("LatexGenerator::endMemberList(%d)\n",m_insideTabbing);
if (!m_insideTabbing)
{
- t << "\\end{DoxyCompactItemize}" << endl;
+ m_t << "\\end{DoxyCompactItemize}\n";
}
}
void LatexGenerator::startMemberGroupHeader(bool hasHeader)
{
- if (hasHeader) t << "\\begin{Indent}";
- t << "\\textbf{ ";
+ if (hasHeader) m_t << "\\begin{Indent}";
+ m_t << "\\textbf{ ";
// changed back to rev 756 due to bug 660501
//if (Config_getBool(COMPACT_LATEX))
//{
- // t << "\\doxysubparagraph*{";
+ // m_t << "\\doxysubparagraph*{";
//}
//else
//{
- // t << "\\doxyparagraph*{";
+ // m_t << "\\doxyparagraph*{";
//}
}
void LatexGenerator::endMemberGroupHeader()
{
// changed back to rev 756 due to bug 660501
- t << "}\\par" << endl;
- //t << "}" << endl;
+ m_t << "}\\par\n";
+ //m_t << "}\n";
}
void LatexGenerator::startMemberGroupDocs()
{
- t << "{\\em ";
+ m_t << "{\\em ";
}
void LatexGenerator::endMemberGroupDocs()
{
- t << "}";
+ m_t << "}";
}
void LatexGenerator::startMemberGroup()
@@ -1766,8 +1777,8 @@ void LatexGenerator::startMemberGroup()
void LatexGenerator::endMemberGroup(bool hasHeader)
{
- if (hasHeader)t << "\\end{Indent}";
- t << endl;
+ if (hasHeader)m_t << "\\end{Indent}";
+ m_t << "\n";
}
void LatexGenerator::startDotGraph()
@@ -1777,7 +1788,7 @@ void LatexGenerator::startDotGraph()
void LatexGenerator::endDotGraph(DotClassGraph &g)
{
- g.writeGraph(t,GOF_EPS,EOF_LaTeX,dir(),fileName(),m_relPath);
+ g.writeGraph(m_t,GOF_EPS,EOF_LaTeX,dir(),fileName(),m_relPath);
}
void LatexGenerator::startInclDepGraph()
@@ -1786,7 +1797,7 @@ void LatexGenerator::startInclDepGraph()
void LatexGenerator::endInclDepGraph(DotInclDepGraph &g)
{
- g.writeGraph(t,GOF_EPS,EOF_LaTeX,dir(),fileName(),m_relPath);
+ g.writeGraph(m_t,GOF_EPS,EOF_LaTeX,dir(),fileName(),m_relPath);
}
void LatexGenerator::startGroupCollaboration()
@@ -1795,7 +1806,7 @@ void LatexGenerator::startGroupCollaboration()
void LatexGenerator::endGroupCollaboration(DotGroupCollaboration &g)
{
- g.writeGraph(t,GOF_EPS,EOF_LaTeX,dir(),fileName(),m_relPath);
+ g.writeGraph(m_t,GOF_EPS,EOF_LaTeX,dir(),fileName(),m_relPath);
}
void LatexGenerator::startCallGraph()
@@ -1804,7 +1815,7 @@ void LatexGenerator::startCallGraph()
void LatexGenerator::endCallGraph(DotCallGraph &g)
{
- g.writeGraph(t,GOF_EPS,EOF_LaTeX,dir(),fileName(),m_relPath);
+ g.writeGraph(m_t,GOF_EPS,EOF_LaTeX,dir(),fileName(),m_relPath);
}
void LatexGenerator::startDirDepGraph()
@@ -1813,31 +1824,31 @@ void LatexGenerator::startDirDepGraph()
void LatexGenerator::endDirDepGraph(DotDirDeps &g)
{
- g.writeGraph(t,GOF_EPS,EOF_LaTeX,dir(),fileName(),m_relPath);
+ g.writeGraph(m_t,GOF_EPS,EOF_LaTeX,dir(),fileName(),m_relPath);
}
void LatexGenerator::startDescription()
{
- t << "\\begin{description}" << endl;
+ m_t << "\\begin{description}\n";
}
void LatexGenerator::endDescription()
{
- t << "\\end{description}" << endl;
+ m_t << "\\end{description}\n";
m_firstDescItem=TRUE;
}
void LatexGenerator::startDescItem()
{
m_firstDescItem=TRUE;
- t << "\\item[";
+ m_t << "\\item[";
}
void LatexGenerator::endDescItem()
{
if (m_firstDescItem)
{
- t << "]" << endl;
+ m_t << "]\n";
m_firstDescItem=FALSE;
}
else
@@ -1848,93 +1859,97 @@ void LatexGenerator::endDescItem()
void LatexGenerator::startExamples()
{
- t << "\\begin{Desc}\n\\item[";
+ m_t << "\\begin{Desc}\n\\item[";
docify(theTranslator->trExamples());
- t << "]";
+ m_t << "]";
}
void LatexGenerator::endExamples()
{
- t << "\\end{Desc}" << endl;
+ m_t << "\\end{Desc}\n";
}
-void LatexGenerator::startParamList(ParamListTypes,const char *title)
+void LatexGenerator::startParamList(ParamListTypes,const QCString &title)
{
- t << "\\begin{Desc}\n\\item[";
+ m_t << "\\begin{Desc}\n\\item[";
docify(title);
- t << "]";
+ m_t << "]";
}
void LatexGenerator::endParamList()
{
- t << "\\end{Desc}" << endl;
+ m_t << "\\end{Desc}\n";
}
void LatexGenerator::startParameterList(bool openBracket)
{
/* start of ParameterType ParameterName list */
- if (openBracket) t << "(";
- t << "\\begin{DoxyParamCaption}";
+ if (openBracket) m_t << "(";
+ m_t << "\\begin{DoxyParamCaption}";
}
void LatexGenerator::endParameterList()
{
}
-void LatexGenerator::startParameterType(bool first,const char *key)
+void LatexGenerator::startParameterType(bool first,const QCString &key)
{
- t << "\\item[{";
- if (!first && key) docify(key);
+ m_t << "\\item[{";
+ if (!first && !key.isEmpty()) docify(key);
}
void LatexGenerator::endParameterType()
{
- t << "}]";
+ m_t << "}]";
}
void LatexGenerator::startParameterName(bool /*oneArgOnly*/)
{
- t << "{";
+ m_t << "{";
}
void LatexGenerator::endParameterName(bool last,bool /*emptyList*/,bool closeBracket)
{
- t << " }";
+ m_t << " }";
if (last)
{
- t << "\\end{DoxyParamCaption}";
- if (closeBracket) t << ")";
+ m_t << "\\end{DoxyParamCaption}";
+ if (closeBracket) m_t << ")";
}
}
-void LatexGenerator::exceptionEntry(const char* prefix,bool closeBracket)
+void LatexGenerator::exceptionEntry(const QCString &prefix,bool closeBracket)
{
- if (prefix)
- t << " " << prefix << "(";
+ if (!prefix.isEmpty())
+ {
+ m_t << " " << prefix << "(";
+ }
else if (closeBracket)
- t << ")";
- t << " ";
+ {
+ m_t << ")";
+ }
+ m_t << " ";
}
void LatexGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *,int)
{
LatexDocVisitor *visitor =
- new LatexDocVisitor(t,m_codeGen,ctx?ctx->getDefFileExtension():QCString(""),m_insideTabbing);
+ new LatexDocVisitor(m_t,m_codeGen,ctx?ctx->getDefFileExtension():QCString(""),m_insideTabbing);
n->accept(visitor);
delete visitor;
}
-void LatexGenerator::startConstraintList(const char *header)
+void LatexGenerator::startConstraintList(const QCString &header)
{
- t << "\\begin{Desc}\n\\item[";
+ m_t << "\\begin{Desc}\n\\item[";
docify(header);
- t << "]";
- t << "\\begin{description}" << endl;
+ m_t << "]";
+ m_t << "\\begin{description}\n";
}
void LatexGenerator::startConstraintParam()
{
- t << "\\item[{\\em ";
+ m_t << "\\item[{\\em ";
}
void LatexGenerator::endConstraintParam()
@@ -1943,12 +1958,12 @@ void LatexGenerator::endConstraintParam()
void LatexGenerator::startConstraintType()
{
- t << "} : {\\em ";
+ m_t << "} : {\\em ";
}
void LatexGenerator::endConstraintType()
{
- t << "}]";
+ m_t << "}]";
}
void LatexGenerator::startConstraintDocs()
@@ -1961,36 +1976,36 @@ void LatexGenerator::endConstraintDocs()
void LatexGenerator::endConstraintList()
{
- t << "\\end{description}" << endl;
- t << "\\end{Desc}" << endl;
+ m_t << "\\end{description}\n";
+ m_t << "\\end{Desc}\n";
}
void LatexGenerator::startInlineHeader()
{
if (Config_getBool(COMPACT_LATEX))
{
- t << "\\doxyparagraph*{";
+ m_t << "\\doxyparagraph*{";
}
else
{
- t << "\\doxysubsubsection*{";
+ m_t << "\\doxysubsubsection*{";
}
}
void LatexGenerator::endInlineHeader()
{
- t << "}" << endl;
+ m_t << "}\n";
}
-void LatexGenerator::lineBreak(const char *)
+void LatexGenerator::lineBreak(const QCString &)
{
if (m_insideTabbing)
{
- t << "\\\\\n";
+ m_t << "\\\\\n";
}
else
{
- t << "\\newline\n";
+ m_t << "\\newline\n";
}
}
@@ -1999,15 +2014,15 @@ void LatexGenerator::startMemberDocSimple(bool isEnum)
m_codeGen.incUsedTableLevel();
if (isEnum)
{
- t << "\\begin{DoxyEnumFields}{";
+ m_t << "\\begin{DoxyEnumFields}{";
docify(theTranslator->trEnumerationValues());
}
else
{
- t << "\\begin{DoxyFields}{";
+ m_t << "\\begin{DoxyFields}{";
docify(theTranslator->trCompoundMembers());
}
- t << "}" << endl;
+ m_t << "}\n";
}
void LatexGenerator::endMemberDocSimple(bool isEnum)
@@ -2015,11 +2030,11 @@ void LatexGenerator::endMemberDocSimple(bool isEnum)
m_codeGen.decUsedTableLevel();
if (isEnum)
{
- t << "\\end{DoxyEnumFields}" << endl;
+ m_t << "\\end{DoxyEnumFields}\n";
}
else
{
- t << "\\end{DoxyFields}" << endl;
+ m_t << "\\end{DoxyFields}\n";
}
}
@@ -2030,7 +2045,7 @@ void LatexGenerator::startInlineMemberType()
void LatexGenerator::endInlineMemberType()
{
- t << "&" << endl;
+ m_t << "&\n";
m_insideTabbing = FALSE;
}
@@ -2041,7 +2056,7 @@ void LatexGenerator::startInlineMemberName()
void LatexGenerator::endInlineMemberName()
{
- t << "&" << endl;
+ m_t << "&\n";
m_insideTabbing = FALSE;
}
@@ -2051,18 +2066,18 @@ void LatexGenerator::startInlineMemberDoc()
void LatexGenerator::endInlineMemberDoc()
{
- t << "\\\\\n\\hline\n" << endl;
+ m_t << "\\\\\n\\hline\n\n";
}
void LatexGenerator::startLabels()
{
- t << "\\hspace{0.3cm}";
+ m_t << "\\hspace{0.3cm}";
}
-void LatexGenerator::writeLabel(const char *l,bool isLast)
+void LatexGenerator::writeLabel(const QCString &l,bool isLast)
{
- t << "{\\ttfamily [" << l << "]}";
- if (!isLast) t << ", ";
+ m_t << "{\\ttfamily [" << l << "]}";
+ if (!isLast) m_t << ", ";
}
void LatexGenerator::endLabels()
diff --git a/src/latexgen.h b/src/latexgen.h
index 6be5de7..f457d79 100644
--- a/src/latexgen.h
+++ b/src/latexgen.h
@@ -21,39 +21,38 @@
#include "config.h"
#include "outputgen.h"
-class QFile;
-
#define LATEX_STYLE_EXTENSION ".sty"
+class TextStream;
+
class LatexCodeGenerator : public CodeOutputInterface
{
public:
- LatexCodeGenerator(FTextStream &t,const QCString &relPath,const QCString &sourceFile);
- LatexCodeGenerator();
- void setTextStream(FTextStream &t);
+ LatexCodeGenerator(TextStream &t,const QCString &relPath,const QCString &sourceFile);
+ LatexCodeGenerator(TextStream &t);
void setRelativePath(const QCString &path);
void setSourceFileName(const QCString &sourceFileName);
- void codify(const char *text);
- void writeCodeLink(const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip);
- void writeTooltip(const char *,
+ void codify(const QCString &text) override;
+ void writeCodeLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip) override;
+ void writeTooltip(const QCString &,
const DocLinkInfo &,
- const char *,
- const char *,
+ const QCString &,
+ const QCString &,
const SourceLinkInfo &,
const SourceLinkInfo &
- ) {}
- void writeLineNumber(const char *,const char *,const char *,int);
- void startCodeLine(bool);
- void endCodeLine();
- void startFontClass(const char *);
- void endFontClass();
- void writeCodeAnchor(const char *) {}
- void setCurrentDoc(const Definition *,const char *,bool) {}
- void addWord(const char *,bool) {}
- void startCodeFragment(const char *style);
- void endCodeFragment(const char *style);
+ ) override{}
+ void writeLineNumber(const QCString &,const QCString &,const QCString &,int) override;
+ void startCodeLine(bool) override;
+ void endCodeLine() override;
+ void startFontClass(const QCString &) override;
+ void endFontClass() override;
+ void writeCodeAnchor(const QCString &) override {}
+ void setCurrentDoc(const Definition *,const QCString &,bool) override {}
+ void addWord(const QCString &,bool) override {}
+ void startCodeFragment(const QCString &style) override;
+ void endCodeFragment(const QCString &style) override;
// extra methods not part of CodeOutputInterface
void incUsedTableLevel() { m_usedTableLevel++; }
@@ -61,13 +60,13 @@ class LatexCodeGenerator : public CodeOutputInterface
int usedTableLevel() const { return m_usedTableLevel; }
private:
- void _writeCodeLink(const char *className,
- const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip);
- void docify(const char *str);
+ void _writeCodeLink(const QCString &className,
+ const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip);
+ void docify(const QCString &str);
bool m_streamSet = false;
- FTextStream m_t;
+ TextStream &m_t;
QCString m_relPath;
QCString m_sourceFileName;
int m_col = 0;
@@ -87,97 +86,97 @@ class LatexGenerator : public OutputGenerator
virtual std::unique_ptr<OutputGenerator> clone() const;
static void init();
- static void writeStyleSheetFile(QFile &f);
- static void writeHeaderFile(QFile &f);
- static void writeFooterFile(QFile &f);
+ static void writeStyleSheetFile(TextStream &t);
+ static void writeHeaderFile(TextStream &t);
+ static void writeFooterFile(TextStream &t);
virtual OutputType type() const { return Latex; }
// --- CodeOutputInterface
- void codify(const char *text)
+ void codify(const QCString &text)
{ m_codeGen.codify(text); }
- void writeCodeLink(const char *ref, const char *file,
- const char *anchor,const char *name,
- const char *tooltip)
+ void writeCodeLink(const QCString &ref, const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip)
{ m_codeGen.writeCodeLink(ref,file,anchor,name,tooltip); }
- void writeLineNumber(const char *ref,const char *file,const char *anchor,int lineNumber)
+ void writeLineNumber(const QCString &ref,const QCString &file,const QCString &anchor,int lineNumber)
{ m_codeGen.writeLineNumber(ref,file,anchor,lineNumber); }
- void writeTooltip(const char *id, const DocLinkInfo &docInfo, const char *decl,
- const char *desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo
+ void writeTooltip(const QCString &id, const DocLinkInfo &docInfo, const QCString &decl,
+ const QCString &desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo
)
{ m_codeGen.writeTooltip(id,docInfo,decl,desc,defInfo,declInfo); }
void startCodeLine(bool hasLineNumbers)
{ m_codeGen.startCodeLine(hasLineNumbers); }
void endCodeLine()
{ m_codeGen.endCodeLine(); }
- void startFontClass(const char *s)
+ void startFontClass(const QCString &s)
{ m_codeGen.startFontClass(s); }
void endFontClass()
{ m_codeGen.endFontClass(); }
- void writeCodeAnchor(const char *anchor)
+ void writeCodeAnchor(const QCString &anchor)
{ m_codeGen.writeCodeAnchor(anchor); }
- void startCodeFragment(const char *style)
+ void startCodeFragment(const QCString &style)
{ m_codeGen.startCodeFragment(style); }
- void endCodeFragment(const char *style)
+ void endCodeFragment(const QCString &style)
{ m_codeGen.endCodeFragment(style); }
// ---------------------------
void writeDoc(DocNode *,const Definition *ctx,const MemberDef *,int id);
- void startFile(const char *name,const char *manName,const char *title,int id);
+ void startFile(const QCString &name,const QCString &manName,const QCString &title,int id);
void writeSearchInfo() {}
- void writeFooter(const char *) {}
+ void writeFooter(const QCString &) {}
void endFile();
void clearBuffer();
void startIndexSection(IndexSections);
void endIndexSection(IndexSections);
- void writePageLink(const char *,bool);
+ void writePageLink(const QCString &,bool);
void startProjectNumber();
void endProjectNumber() {}
void writeStyleInfo(int part);
- void startTitleHead(const char *);
+ void startTitleHead(const QCString &);
void startTitle();
- void endTitleHead(const char *,const char *name);
- void endTitle() { t << "}"; }
+ void endTitleHead(const QCString &,const QCString &name);
+ void endTitle() { m_t << "}"; }
void newParagraph();
- void startParagraph(const char *classDef);
+ void startParagraph(const QCString &classDef);
void endParagraph();
- void writeString(const char *text);
+ void writeString(const QCString &text);
void startIndexListItem() {}
void endIndexListItem() {}
- void startIndexList() { t << "\\begin{DoxyCompactList}" << endl; }
- void endIndexList() { t << "\\end{DoxyCompactList}" << endl; }
+ void startIndexList() { m_t << "\\begin{DoxyCompactList}\n"; }
+ void endIndexList() { m_t << "\\end{DoxyCompactList}\n"; }
void startIndexKey();
void endIndexKey();
void startIndexValue(bool);
- void endIndexValue(const char *,bool);
- void startItemList() { t << "\\begin{DoxyCompactItemize}" << endl; }
- void endItemList() { t << "\\end{DoxyCompactItemize}" << endl; }
- void startIndexItem(const char *ref,const char *file);
- void endIndexItem(const char *ref,const char *file);
- void docify(const char *text);
- void writeObjectLink(const char *ref,const char *file,
- const char *anchor,const char *name);
-
- void startTextLink(const char *,const char *);
+ void endIndexValue(const QCString &,bool);
+ void startItemList() { m_t << "\\begin{DoxyCompactItemize}\n"; }
+ void endItemList() { m_t << "\\end{DoxyCompactItemize}\n"; }
+ void startIndexItem(const QCString &ref,const QCString &file);
+ void endIndexItem(const QCString &ref,const QCString &file);
+ void docify(const QCString &text);
+ void writeObjectLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name);
+
+ void startTextLink(const QCString &,const QCString &);
void endTextLink();
- void startHtmlLink(const char *url);
+ void startHtmlLink(const QCString &url);
void endHtmlLink();
- void startTypewriter() { t << "{\\ttfamily "; }
- void endTypewriter() { t << "}"; }
+ void startTypewriter() { m_t << "{\\ttfamily "; }
+ void endTypewriter() { m_t << "}"; }
void startGroupHeader(int);
void endGroupHeader(int);
- void startItemListItem() { t << "\\item " << endl; }
+ void startItemListItem() { m_t << "\\item \n"; }
void endItemListItem() {}
void startMemberSections() {}
void endMemberSections() {}
void startHeaderSection() {}
void endHeaderSection() {}
- void startMemberHeader(const char *,int);
+ void startMemberHeader(const QCString &,int);
void endMemberHeader();
void startMemberSubtitle() {}
void endMemberSubtitle() {}
@@ -189,10 +188,12 @@ class LatexGenerator : public OutputGenerator
void endInlineHeader();
void startAnonTypeScope(int);
void endAnonTypeScope(int);
- void startMemberItem(const char *,int,const char *);
+ void startMemberItem(const QCString &,int,const QCString &);
void endMemberItem();
void startMemberTemplateParams();
- void endMemberTemplateParams(const char *,const char *);
+ void endMemberTemplateParams(const QCString &,const QCString &);
+ void startCompoundTemplateParams() { startSubsubsection(); }
+ void endCompoundTemplateParams() { endSubsubsection(); }
void startMemberGroupHeader(bool);
void endMemberGroupHeader();
@@ -204,70 +205,70 @@ class LatexGenerator : public OutputGenerator
void insertMemberAlign(bool) {}
void insertMemberAlignLeft(int,bool){}
- void writeRuler() { t << endl << endl; }
- void writeAnchor(const char *fileName,const char *name);
- void startEmphasis() { t << "{\\em "; }
- void endEmphasis() { t << "}"; }
- void startBold() { t << "{\\bfseries "; }
- void endBold() { t << "}"; }
+ void writeRuler() { m_t << "\n\n"; }
+ void writeAnchor(const QCString &fileName,const QCString &name);
+ void startEmphasis() { m_t << "{\\em "; }
+ void endEmphasis() { m_t << "}"; }
+ void startBold() { m_t << "{\\bfseries "; }
+ void endBold() { m_t << "}"; }
void startDescription();
void endDescription();
void startDescItem();
void endDescItem();
- void lineBreak(const char *style=0);
- void startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool);
+ void lineBreak(const QCString &style=QCString());
+ void startMemberDoc(const QCString &,const QCString &,const QCString &,const QCString &,int,int,bool);
void endMemberDoc(bool);
- void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *);
- void endDoxyAnchor(const char *,const char *);
+ void startDoxyAnchor(const QCString &,const QCString &,const QCString &,const QCString &,const QCString &);
+ void endDoxyAnchor(const QCString &,const QCString &);
void writeChar(char c);
- void writeLatexSpacing() { t << "\\hspace{0.3cm}"; }
- void writeStartAnnoItem(const char *type,const char *file,
- const char *path,const char *name);
- void writeEndAnnoItem(const char *name);
- void startSubsection() { t << "\\subsection*{"; }
- void endSubsection() { t << "}" << endl; }
- void startSubsubsection() { t << "\\subsubsection*{"; }
- void endSubsubsection() { t << "}" << endl; }
- void startCenter() { t << "\\begin{center}" << endl; }
- void endCenter() { t << "\\end{center}" << endl; }
- void startSmall() { t << "\\footnotesize "; }
- void endSmall() { t << "\\normalsize "; }
- void startMemberDescription(const char *,const char *,bool);
+ void writeLatexSpacing() { m_t << "\\hspace{0.3cm}"; }
+ void writeStartAnnoItem(const QCString &type,const QCString &file,
+ const QCString &path,const QCString &name);
+ void writeEndAnnoItem(const QCString &name);
+ void startSubsection() { m_t << "\\subsection*{"; }
+ void endSubsection() { m_t << "}\n"; }
+ void startSubsubsection() { m_t << "\\subsubsection*{"; }
+ void endSubsubsection() { m_t << "}\n"; }
+ void startCenter() { m_t << "\\begin{center}\n"; }
+ void endCenter() { m_t << "\\end{center}\n"; }
+ void startSmall() { m_t << "\\footnotesize "; }
+ void endSmall() { m_t << "\\normalsize "; }
+ void startMemberDescription(const QCString &,const QCString &,bool);
void endMemberDescription();
void startMemberDeclaration() {}
- void endMemberDeclaration(const char *,const char *) {}
- void writeInheritedSectionTitle(const char *,const char *,const char *,
- const char *,const char *,const char *) {}
- void startDescList(SectionTypes) { t << "\\begin{Desc}\n\\item["; }
- void endDescList() { t << "\\end{Desc}" << endl; }
+ void endMemberDeclaration(const QCString &,const QCString &) {}
+ void writeInheritedSectionTitle(const QCString &,const QCString &,const QCString &,
+ const QCString &,const QCString &,const QCString &) {}
+ void startDescList(SectionTypes) { m_t << "\\begin{Desc}\n\\item["; }
+ void endDescList() { m_t << "\\end{Desc}\n"; }
void startExamples();
void endExamples();
- void startParamList(ParamListTypes,const char *title);
+ void startParamList(ParamListTypes,const QCString &title);
void endParamList();
- void startDescForItem() { t << "\\par" << endl; }
+ void startDescForItem() { m_t << "\\par\n"; }
void endDescForItem() {}
- void startSection(const char *,const char *,SectionType);
- void endSection(const char *,SectionType);
- void addIndexItem(const char *,const char *);
+ void startSection(const QCString &,const QCString &,SectionType);
+ void endSection(const QCString &,SectionType);
+ void addIndexItem(const QCString &,const QCString &);
void startIndent() {}
void endIndent() {}
void writeSynopsis() {}
void startClassDiagram();
- void endClassDiagram(const ClassDiagram &,const char *,const char *);
+ void endClassDiagram(const ClassDiagram &,const QCString &,const QCString &);
void startPageRef();
- void endPageRef(const char *,const char *);
+ void endPageRef(const QCString &,const QCString &);
void startQuickIndices() {}
void endQuickIndices() {}
- void writeSplitBar(const char *) {}
- void writeNavigationPath(const char *) {}
+ void writeSplitBar(const QCString &) {}
+ void writeNavigationPath(const QCString &) {}
void writeLogo() {}
- void writeQuickLinks(bool,HighlightedItem,const char*) {}
- void writeSummaryLink(const char *,const char *,const char *,bool) {}
+ void writeQuickLinks(bool,HighlightedItem,const QCString &) {}
+ void writeSummaryLink(const QCString &,const QCString &,const QCString &,bool) {}
void startContents() {}
void endContents() {}
void writeNonBreakableSpace(int);
- void startDescTable(const char *title);
+ void startDescTable(const QCString &title);
void endDescTable();
void startDescTableRow();
void endDescTableRow();
@@ -293,18 +294,18 @@ class LatexGenerator : public OutputGenerator
void endTextBlock(bool) {}
void startMemberDocPrefixItem() {}
- void endMemberDocPrefixItem() { t << "\\\\" << endl; }
+ void endMemberDocPrefixItem() { m_t << "\\\\\n"; }
void startMemberDocName(bool) {}
void endMemberDocName() {}
- void startParameterType(bool,const char *);
+ void startParameterType(bool,const QCString &);
void endParameterType();
void startParameterName(bool);
void endParameterName(bool,bool,bool);
void startParameterList(bool);
void endParameterList();
- void exceptionEntry(const char*,bool);
+ void exceptionEntry(const QCString &,bool);
- void startConstraintList(const char *);
+ void startConstraintList(const QCString &);
void startConstraintParam();
void endConstraintParam();
void startConstraintType();
@@ -323,11 +324,11 @@ class LatexGenerator : public OutputGenerator
void endInlineMemberDoc();
void startLabels();
- void writeLabel(const char *l,bool isLast);
+ void writeLabel(const QCString &l,bool isLast);
void endLabels();
- void setCurrentDoc(const Definition *,const char *,bool) {}
- void addWord(const char *,bool) {}
+ void setCurrentDoc(const Definition *,const QCString &,bool) {}
+ void addWord(const QCString &,bool) {}
private:
diff --git a/src/layout.cpp b/src/layout.cpp
index b8984e0..49405aa 100644
--- a/src/layout.cpp
+++ b/src/layout.cpp
@@ -19,8 +19,6 @@
#include <array>
#include <assert.h>
-#include <qfile.h>
-#include <qfileinfo.h>
#include "layout.h"
#include "message.h"
@@ -94,7 +92,7 @@ static bool elemIsVisible(const XMLHandlers::Attributes &attrib,bool defVal=TRUE
else if (!opt)
{
err("found unsupported value %s for visible attribute in layout file\n",
- visible.data());
+ qPrint(visible));
}
}
return visible!="no" && visible!="0";
@@ -103,7 +101,7 @@ static bool elemIsVisible(const XMLHandlers::Attributes &attrib,bool defVal=TRUE
//---------------------------------------------------------------------------------
LayoutNavEntry *LayoutNavEntry::find(LayoutNavEntry::Kind kind,
- const char *file) const
+ const QCString &file) const
{
LayoutNavEntry *result=0;
for (const auto &entry : m_children)
@@ -135,7 +133,7 @@ QCString LayoutNavEntry::url() const
const Definition *d = 0;
QCString anchor;
bool found=FALSE;
- if (resolveLink(0,url.mid(5).stripWhiteSpace(),TRUE,&d,anchor))
+ if (resolveLink(QCString(),url.mid(5).stripWhiteSpace(),TRUE,&d,anchor))
{
if (d && d->isLinkable())
{
@@ -152,7 +150,7 @@ QCString LayoutNavEntry::url() const
msg("explicit link request to '%s' in layout file '%s' could not be resolved\n",qPrint(url.mid(5)),qPrint(Config_getString(LAYOUT_FILE)));
}
}
- //printf("LayoutNavEntry::url()=%s\n",url.data());
+ //printf("LayoutNavEntry::url()=%s\n",qPrint(url));
return url;
}
@@ -197,7 +195,7 @@ class LayoutParser
bool isVisible = elemIsVisible(attrib);
QCString userTitle = XMLHandlers::value(attrib,"title");
//printf("startSectionEntry: title='%s' userTitle='%s'\n",
- // title.data(),userTitle.data());
+ // qPrint(title),qPrint(userTitle));
if (userTitle.isEmpty()) userTitle = title;
if (m_part!=-1 && isVisible)
{
@@ -216,7 +214,7 @@ class LayoutParser
QCString userSubscript = XMLHandlers::value(attrib,"subtitle");
if (userTitle.isEmpty()) userTitle = title;
if (userSubscript.isEmpty()) userSubscript = subscript;
- //printf("memberdecl: %s\n",userTitle.data());
+ //printf("memberdecl: %s\n",qPrint(userTitle));
if (m_part!=-1 /*&& isVisible*/)
{
LayoutDocManager::instance().addEntry((LayoutDocManager::LayoutPart)m_part,
@@ -229,7 +227,7 @@ class LayoutParser
{
QCString userTitle = XMLHandlers::value(attrib,"title");
if (userTitle.isEmpty()) userTitle = title;
- //printf("memberdef: %s\n",userTitle.data());
+ //printf("memberdef: %s\n",qPrint(userTitle));
if (m_part!=-1 /*&& isVisible*/)
{
LayoutDocManager::instance().addEntry((LayoutDocManager::LayoutPart)m_part,
@@ -321,6 +319,13 @@ class LayoutParser
fortranOpt || sliceOpt ? theTranslator->trModulesMemberDescription(extractAll) : theTranslator->trNamespaceMemberDescription(extractAll),
"namespacemembers"
},
+ { "concepts",
+ LayoutNavEntry::Concepts,
+ theTranslator->trConcept(true,false),
+ theTranslator->trConceptList(),
+ theTranslator->trConceptListDescription(extractAll),
+ "concepts"
+ },
{ "classindex",
LayoutNavEntry::ClassIndex,
fortranOpt ? theTranslator->trDataTypes() : vhdlOpt ? theTranslator->trDesignUnits() : theTranslator->trCompoundIndex(),
@@ -512,7 +517,7 @@ class LayoutParser
}
else
{
- ::warn(fileName.c_str(),m_locator->lineNr(),"the type '%s' is not supported for the entry tag within a navindex! Check your layout file!\n",type.data());
+ ::warn(fileName.c_str(),m_locator->lineNr(),"the type '%s' is not supported for the entry tag within a navindex! Check your layout file!\n",qPrint(type));
}
m_invalidEntry=TRUE;
return;
@@ -587,6 +592,19 @@ class LayoutParser
m_part = -1;
}
+ void startConcept(const XMLHandlers::Attributes &)
+ {
+ LayoutDocManager::instance().clear(LayoutDocManager::Concept);
+ m_scope="concept/";
+ m_part = (int)LayoutDocManager::Concept;
+ }
+
+ void endConcept()
+ {
+ m_scope="";
+ m_part = -1;
+ }
+
void startFile(const XMLHandlers::Attributes &)
{
LayoutDocManager::instance().clear(LayoutDocManager::File);
@@ -975,6 +993,31 @@ static const std::map< std::string, ElementCallbacks > g_elementHandlers =
endCb()
} },
+ // concept layout handlers
+ { "concept", { startCb(&LayoutParser::startConcept),
+ endCb(&LayoutParser::endConcept)
+ } },
+
+ { "concept/briefdescription", { startCb(&LayoutParser::startSimpleEntry, LayoutDocEntry::BriefDesc),
+ endCb()
+ } },
+ { "concept/definition", { startCb(&LayoutParser::startSectionEntry, LayoutDocEntry::ConceptDefinition,
+ []() { return compileOptions(theTranslator->trConceptDefinition()); }),
+ endCb()
+ } },
+ { "concept/includes", { startCb(&LayoutParser::startSimpleEntry, LayoutDocEntry::ClassIncludes),
+ endCb()
+ } },
+ { "concept/sourcelink", { startCb(&LayoutParser::startSimpleEntry, LayoutDocEntry::FileSourceLink),
+ endCb()
+ } },
+ { "concept/detaileddescription", { startCb(&LayoutParser::startSectionEntry,LayoutDocEntry::DetailedDesc,
+ []() { return compileOptions(theTranslator->trDetailedDescription()); }),
+ endCb()
+ } },
+ { "concept/authorsection", { startCb(&LayoutParser::startSimpleEntry, LayoutDocEntry::AuthorSection),
+ endCb()
+ } },
// namespace layout handlers
{ "namespace", { startCb(&LayoutParser::startNamespace),
endCb(&LayoutParser::endNamespace)
@@ -1018,6 +1061,10 @@ static const std::map< std::string, ElementCallbacks > g_elementHandlers =
SrcLangExt_Fortran,theTranslator->trDataTypes()); }),
endCb()
} },
+ { "namespace/memberdecl/concepts", { startCb(&LayoutParser::startSectionEntry, LayoutDocEntry::NamespaceConcepts,
+ []() { return compileOptions(theTranslator->trConcept(true,false)); }),
+ endCb()
+ } },
{ "namespace/memberdecl/structs", { startCb(&LayoutParser::startSectionEntry,LayoutDocEntry::NamespaceStructs,
[]() { return compileOptions(theTranslator->trStructs()); }),
endCb()
@@ -1137,6 +1184,10 @@ static const std::map< std::string, ElementCallbacks > g_elementHandlers =
SrcLangExt_Fortran,theTranslator->trDataTypes()); }),
endCb()
} },
+ { "file/memberdecl/concepts", { startCb(&LayoutParser::startSectionEntry, LayoutDocEntry::FileConcepts,
+ []() { return compileOptions(theTranslator->trConcept(true,false)); }),
+ endCb()
+ } },
{ "file/memberdecl/structs", { startCb(&LayoutParser::startSectionEntry,LayoutDocEntry::FileStructs,
[]() { return compileOptions(theTranslator->trStructs()); }),
endCb()
@@ -1257,6 +1308,10 @@ static const std::map< std::string, ElementCallbacks > g_elementHandlers =
[]() { return compileOptions(/* default */ theTranslator->trCompounds(),
SrcLangExt_VHDL, theTranslator->trVhdlType(VhdlDocGen::ENTITY,FALSE),
SrcLangExt_Fortran, theTranslator->trDataTypes()); }),
+ endCb()
+ } },
+ { "group/memberdecl/concepts", { startCb(&LayoutParser::startSectionEntry, LayoutDocEntry::GroupConcepts,
+ []() { return compileOptions(theTranslator->trConcept(true,false)); }),
endCb()
} },
{ "group/memberdecl/namespaces", { startCb(&LayoutParser::startSectionEntry, LayoutDocEntry::GroupNamespaces,
@@ -1442,7 +1497,7 @@ static const std::map< std::string, ElementCallbacks > g_elementHandlers =
void LayoutParser::startElement( const std::string &name, const XMLHandlers::Attributes& attrib )
{
- //printf("startElement [%s]::[%s]\n",m_scope.data(),name.data());
+ //printf("startElement [%s]::[%s]\n",qPrint(m_scope),qPrint(name));
auto it = g_elementHandlers.find(m_scope.str()+name);
if (it!=g_elementHandlers.end())
{
@@ -1452,13 +1507,13 @@ void LayoutParser::startElement( const std::string &name, const XMLHandlers::Att
{
std::string fileName = m_locator->fileName();
::warn(fileName.c_str(),m_locator->lineNr(),"Unexpected start tag '%s' found in scope='%s'!\n",
- name.data(),m_scope.data());
+ qPrint(name),qPrint(m_scope));
}
}
void LayoutParser::endElement( const std::string &name )
{
- //printf("endElement [%s]::[%s]\n",m_scope.data(),name.data());
+ //printf("endElement [%s]::[%s]\n",qPrint(m_scope),qPrint(name));
auto it=g_elementHandlers.end();
if (!m_scope.isEmpty() && m_scope.right(static_cast<uint>(name.length())+1)==name+"/")
@@ -1504,7 +1559,7 @@ void LayoutDocManager::init()
XMLParser parser(handlers);
layoutParser.setDocumentLocator(&parser);
QCString layout_default = ResourceMgr::instance().getAsString("layout_default.xml");
- parser.parse("layout_default.xml",layout_default,Debug::isFlagSet(Debug::Lex));
+ parser.parse("layout_default.xml",qPrint(layout_default),Debug::isFlagSet(Debug::Lex));
}
LayoutDocManager::~LayoutDocManager()
@@ -1538,7 +1593,7 @@ void LayoutDocManager::clear(LayoutDocManager::LayoutPart p)
d->docEntries[(int)p].clear();
}
-void LayoutDocManager::parse(const char *fileName)
+void LayoutDocManager::parse(const QCString &fileName)
{
LayoutParser &layoutParser = LayoutParser::instance();
XMLHandlers handlers;
@@ -1547,23 +1602,26 @@ void LayoutDocManager::parse(const char *fileName)
handlers.error = [&layoutParser](const std::string &fn,int lineNr,const std::string &msg) { layoutParser.error(fn,lineNr,msg); };
XMLParser parser(handlers);
layoutParser.setDocumentLocator(&parser);
- parser.parse(fileName,fileToString(fileName),Debug::isFlagSet(Debug::Lex));
+ parser.parse(fileName.data(),fileToString(fileName).data(),Debug::isFlagSet(Debug::Lex));
}
//---------------------------------------------------------------------------------
-void writeDefaultLayoutFile(const char *fileName)
+void writeDefaultLayoutFile(const QCString &fileName)
{
- QFile f(fileName);
- bool ok = openOutputFile(fileName,f);
- if (!ok)
+ std::ofstream f;
+ if (openOutputFile(fileName,f))
{
- err("Failed to open file %s for writing!\n",fileName);
+ TextStream t(&f);
+ QCString layout_default = ResourceMgr::instance().getAsString("layout_default.xml");
+ t << substitute(layout_default,"$doxygenversion",getDoxygenVersion());
+ }
+ else
+ {
+ err("Failed to open file %s for writing!\n",qPrint(fileName));
return;
}
- FTextStream t(&f);
- QCString layout_default = ResourceMgr::instance().getAsString("layout_default.xml");
- t << substitute(layout_default,"$doxygenversion",getDoxygenVersion());
+ f.close();
}
//----------------------------------------------------------------------------------
diff --git a/src/layout.h b/src/layout.h
index 851af22..04fdf52 100644
--- a/src/layout.h
+++ b/src/layout.h
@@ -45,19 +45,22 @@ struct LayoutDocEntry
ClassCollaborationGraph, ClassAllMembersLink,
ClassUsedFiles,
+ // Concept specific items
+ ConceptDefinition,
+
// Namespace specific items
NamespaceNestedNamespaces, NamespaceNestedConstantGroups,
- NamespaceClasses, NamespaceInterfaces, NamespaceStructs, NamespaceExceptions,
+ NamespaceClasses, NamespaceConcepts, NamespaceInterfaces, NamespaceStructs, NamespaceExceptions,
NamespaceInlineClasses,
// File specific items
- FileClasses, FileInterfaces, FileStructs, FileExceptions, FileConstantGroups, FileNamespaces,
+ FileClasses, FileConcepts, FileInterfaces, FileStructs, FileExceptions, FileConstantGroups, FileNamespaces,
FileIncludes, FileIncludeGraph,
FileIncludedByGraph, FileSourceLink,
FileInlineClasses,
// Group specific items
- GroupClasses, GroupInlineClasses, GroupNamespaces,
+ GroupClasses, GroupConcepts, GroupInlineClasses, GroupNamespaces,
GroupDirs, GroupNestedGroups, GroupFiles,
GroupGraph, GroupPageDocs,
@@ -130,6 +133,7 @@ struct LayoutNavEntry
Namespaces,
NamespaceList,
NamespaceMembers,
+ Concepts,
Classes,
ClassList,
ClassIndex,
@@ -173,7 +177,7 @@ struct LayoutNavEntry
void addChild(LayoutNavEntry *e) { m_children.push_back(std::unique_ptr<LayoutNavEntry>(e)); }
void prependChild(LayoutNavEntry *e) { m_children.insert(m_children.begin(),std::unique_ptr<LayoutNavEntry>(e)); }
const LayoutNavEntryList &children() const { return m_children; }
- LayoutNavEntry *find(LayoutNavEntry::Kind k,const char *file=0) const;
+ LayoutNavEntry *find(LayoutNavEntry::Kind k,const QCString &file=QCString()) const;
private:
LayoutNavEntry() : m_parent(0), m_kind(None), m_visible(FALSE) {}
@@ -196,7 +200,7 @@ class LayoutDocManager
public:
enum LayoutPart
{
- Class, Namespace, File, Group, Directory,
+ Class, Concept, Namespace, File, Group, Directory,
NrParts
};
/** Returns a reference to this singleton. */
@@ -209,7 +213,7 @@ class LayoutDocManager
LayoutNavEntry *rootNavEntry() const;
/** Parses a user provided layout */
- void parse(const char *fileName);
+ void parse(const QCString &fileName);
void init();
private:
void addEntry(LayoutPart p,LayoutDocEntry*e);
@@ -220,7 +224,7 @@ class LayoutDocManager
friend class LayoutParser;
};
-void writeDefaultLayoutFile(const char *fileName);
+void writeDefaultLayoutFile(const QCString &fileName);
#endif
diff --git a/src/lexcode.h b/src/lexcode.h
index 38aec50..b64b691 100644
--- a/src/lexcode.h
+++ b/src/lexcode.h
@@ -33,11 +33,11 @@ class LexCodeParser : public CodeParserInterface
LexCodeParser();
virtual ~LexCodeParser();
void parseCode(CodeOutputInterface &codeOutIntf,
- const char *scopeName,
+ const QCString &scopeName,
const QCString &input,
SrcLangExt,
bool isExampleBlock,
- const char *exampleName=0,
+ const QCString &exampleName=QCString(),
FileDef *fileDef=0,
int startLine=-1,
int endLine=-1,
diff --git a/src/lexcode.l b/src/lexcode.l
index a118703..23b2000 100644
--- a/src/lexcode.l
+++ b/src/lexcode.l
@@ -93,7 +93,7 @@ static void startCodeLine(yyscan_t yyscanner);
static void endFontClass(yyscan_t yyscanner);
static void endCodeLine(yyscan_t yyscanner);
static void nextCodeLine(yyscan_t yyscanner);
-static void codifyLines(yyscan_t yyscanner,const char *text);
+static void codifyLines(yyscan_t yyscanner,const QCString &text);
static void startFontClass(yyscan_t yyscanner,const char *s);
static int countLines(yyscan_t yyscanner);
static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
@@ -393,7 +393,7 @@ NONLopt [^\n]*
if (!yyextra->rulesPatternBuffer.isEmpty())
{
startFontClass(yyscanner,"stringliteral");
- codifyLines(yyscanner,yyextra->rulesPatternBuffer.data());
+ codifyLines(yyscanner,yyextra->rulesPatternBuffer);
yyextra->rulesPatternBuffer.resize(0);
endFontClass(yyscanner);
}
@@ -413,7 +413,7 @@ NONLopt [^\n]*
if (!yyextra->rulesPatternBuffer.isEmpty())
{
startFontClass(yyscanner,"stringliteral");
- codifyLines(yyscanner,yyextra->rulesPatternBuffer.data());
+ codifyLines(yyscanner,yyextra->rulesPatternBuffer);
yyextra->rulesPatternBuffer.resize(0);
endFontClass(yyscanner);
}
@@ -428,7 +428,7 @@ NONLopt [^\n]*
if (!yyextra->rulesPatternBuffer.isEmpty())
{
startFontClass(yyscanner,"stringliteral");
- codifyLines(yyscanner,yyextra->rulesPatternBuffer.data());
+ codifyLines(yyscanner,yyextra->rulesPatternBuffer);
yyextra->rulesPatternBuffer.resize(0);
endFontClass(yyscanner);
}
@@ -500,7 +500,7 @@ NONLopt [^\n]*
}
<SkipCurly>{B}*{RAWBEGIN} {
QCString raw=QCString(yytext).stripWhiteSpace();
- yyextra->delimiter = raw.data()+2;
+ yyextra->delimiter = raw.mid(2);
yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
yyextra->lastRawStringContext = YY_START;
yyextra->CCodeBuffer += yytext;
@@ -930,7 +930,7 @@ static void startCodeLine(yyscan_t yyscanner)
{
yyextra->currentDefinition = d;
yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
- yyextra->classScope = d->name().copy();
+ yyextra->classScope = d->name();
QCString lineAnchor;
lineAnchor.sprintf("l%05d",yyextra->yyLineNr);
if (yyextra->currentMemberDef)
@@ -944,13 +944,13 @@ static void startCodeLine(yyscan_t yyscanner)
{
yyextra->code->writeLineNumber(d->getReference(),
d->getOutputFileBase(),
- 0,yyextra->yyLineNr);
+ QCString(),yyextra->yyLineNr);
setCurrentDoc(yyscanner,lineAnchor);
}
}
else
{
- yyextra->code->writeLineNumber(0,0,0,yyextra->yyLineNr);
+ yyextra->code->writeLineNumber(QCString(),QCString(),QCString(),yyextra->yyLineNr);
}
}
@@ -991,10 +991,11 @@ static void nextCodeLine(yyscan_t yyscanner)
}
}
-static void codifyLines(yyscan_t yyscanner,const char *text)
+static void codifyLines(yyscan_t yyscanner,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- const char *p=text,*sp=p;
+ if (text.isEmpty()) return;
+ const char *p=text.data(),*sp=p;
char c;
bool done=false;
while (!done)
@@ -1148,11 +1149,11 @@ void LexCodeParser::resetCodeParserState()
}
void LexCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
- const char *scopeName,
+ const QCString &scopeName,
const QCString &input,
SrcLangExt,
bool isExampleBlock,
- const char *exampleName,
+ const QCString &exampleName,
FileDef *fileDef,
int startLine,
int endLine,
@@ -1168,10 +1169,10 @@ void LexCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
if (input.isEmpty()) return;
- printlex(yy_flex_debug, true, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
+ printlex(yy_flex_debug, true, __FILE__, fileDef ? qPrint(fileDef->fileName()): NULL);
yyextra->code = &codeOutIntf;
- yyextra->inputString = input;
+ yyextra->inputString = input.data();
yyextra->inputPosition = 0;
yyextra->currentFontClass = 0;
yyextra->needsTermination = false;
@@ -1202,7 +1203,7 @@ void LexCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
if (isExampleBlock && fileDef==0)
{
// create a dummy filedef for the example
- yyextra->sourceFileDef = createFileDef("",(exampleName?exampleName:"generated"));
+ yyextra->sourceFileDef = createFileDef(QCString(),!exampleName.isEmpty() ? exampleName : QCString("generated"));
cleanupSourceDef = true;
}
@@ -1230,7 +1231,7 @@ void LexCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
yyextra->sourceFileDef=0;
}
- printlex(yy_flex_debug, false, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
+ printlex(yy_flex_debug, false, __FILE__, fileDef ? qPrint(fileDef->fileName()): NULL);
}
//---------------------------------------------------------------------------------
diff --git a/src/lexscanner.h b/src/lexscanner.h
index 8734c59..dbb1f56 100644
--- a/src/lexscanner.h
+++ b/src/lexscanner.h
@@ -29,12 +29,12 @@ class LexOutlineParser : public OutlineParserInterface
public:
LexOutlineParser();
~LexOutlineParser();
- void parseInput(const char *fileName,
+ void parseInput(const QCString &fileName,
const char *fileBuf,
const std::shared_ptr<Entry> &root,
ClangTUParser *clangParser);
bool needsPreprocessing(const QCString &extension) const { return TRUE; };
- void parsePrototype(const char *text){}
+ void parsePrototype(const QCString &text){}
private:
struct Private;
diff --git a/src/lexscanner.l b/src/lexscanner.l
index 47d3443..fdb0229 100644
--- a/src/lexscanner.l
+++ b/src/lexscanner.l
@@ -74,7 +74,7 @@ struct lexscannerYY_state
bool nestedComment = false;
QCString prefix = "yy";
- QCString CCodeBuffer;
+ QCString cCodeBuffer;
int roundCount = 0;
int squareCount = 0;
@@ -188,80 +188,80 @@ NONLopt [^\n]*
yyextra->prefix = yyextra->prefix.mid(1,yyleng-2);
}
<OptPrefix>{nl} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
BEGIN (DefSection);
}
<DefSection>^{RulesStart} {
- yyextra->CCodeBuffer += "int " + yyextra->prefix + "lex (yyscan_t yyscanner) {\n";
+ yyextra->cCodeBuffer += "int " + yyextra->prefix + "lex (yyscan_t yyscanner) {\n";
BEGIN (RulesSectionInit);
}
<DefSection>^{TopStart} {
- yyextra->CCodeBuffer += "\n";
+ yyextra->cCodeBuffer += "\n";
yyextra->lastContext = YY_START;
BEGIN (TopSection);
}
<DefSection>^{LiteralStart} {
- yyextra->CCodeBuffer += "\n";
+ yyextra->cCodeBuffer += "\n";
yyextra->lastContext = YY_START;
BEGIN (LiteralSection);
}
<TopSection>^{TopEnd} {
- yyextra->CCodeBuffer += "\n";
+ yyextra->cCodeBuffer += "\n";
BEGIN( yyextra->lastContext ) ;
}
<TopSection>.*{nl} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<LiteralSection>^{LiteralEnd} {
- yyextra->CCodeBuffer += "\n";
+ yyextra->cCodeBuffer += "\n";
BEGIN( yyextra->lastContext ) ;
}
<LiteralSection>.*{nl} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DefSection>^{nws} {
BEGIN(DefSectionLine);
}
<DefSection>{CPPC}.*{nl} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DefSection>^{ws}*{CCS} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->lastContext = YY_START;
BEGIN(COMMENT);
}
<COMMENT>{CCE}{ws}*{nl} {
- yyextra->CCodeBuffer+=yytext;
+ yyextra->cCodeBuffer+=yytext;
BEGIN(yyextra->lastContext);
}
<COMMENT>{CCE} {
- yyextra->CCodeBuffer+=yytext;
+ yyextra->cCodeBuffer+=yytext;
BEGIN(yyextra->lastContext);
}
<COMMENT>[^*\n]+ {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<COMMENT>{CPPC}|{CCS} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<COMMENT>{nl} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<COMMENT>. {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DefSection>^{nl} {
- yyextra->CCodeBuffer += "\n";
+ yyextra->cCodeBuffer += "\n";
}
<DefSection>^{ws}.*{nl} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DefSectionLine>.*{nl} {
- yyextra->CCodeBuffer += "\n";
+ yyextra->cCodeBuffer += "\n";
BEGIN(DefSection);
}
<RulesSectionInit,RulesPattern>^{RulesEnd} {
- yyextra->CCodeBuffer += "}\n";
+ yyextra->cCodeBuffer += "}\n";
BEGIN (UserSection);
}
<RulesSectionInit>^{nws} {
@@ -269,116 +269,116 @@ NONLopt [^\n]*
BEGIN(RulesPattern);
}
<RulesSectionInit>^{ws}.*{nl} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<RulesSectionInit>^{nl} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<RulesPattern>"<<EOF>>" {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesPattern>{EscapeRulesChar} {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesPattern>{RulesSharp} {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesPattern>{RulesCurly} {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesPattern>{StartDouble} {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
yyextra->lastContext = YY_START;
BEGIN(RulesDouble);
}
<RulesDouble,RulesRoundDouble>"\\\\" {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesDouble,RulesRoundDouble>"\\\"" {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesDouble>"\"" {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
BEGIN( yyextra->lastContext ) ;
}
<RulesRoundDouble>"\"" {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
BEGIN(RulesRound) ;
}
<RulesDouble,RulesRoundDouble>. {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesPattern>{StartSquare} {
yyextra->squareCount++;
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
yyextra->lastContext = YY_START;
BEGIN(RulesSquare);
}
<RulesSquare,RulesRoundSquare>"\\[" |
<RulesSquare,RulesRoundSquare>"\\]" {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesSquare,RulesRoundSquare>"[" {
yyextra->squareCount++;
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesSquare>"]" {
yyextra->squareCount--;
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
if (!yyextra->squareCount) BEGIN(RulesPattern);
}
<RulesRoundSquare>"]" {
yyextra->squareCount--;
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
if (!yyextra->squareCount) BEGIN(RulesRound) ;
}
<RulesSquare,RulesRoundSquare>"\\\\" {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesSquare,RulesRoundSquare>. {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesPattern>{StartRound} {
yyextra->roundCount++;
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
yyextra->lastContext = YY_START;
BEGIN(RulesRound);
}
<RulesRound>{RulesCurly} {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesRound>{StartSquare} {
yyextra->squareCount++;
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
BEGIN(RulesRoundSquare);
}
<RulesRound>{StartDouble} {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
BEGIN(RulesRoundDouble);
}
<RulesRound>"\\(" |
<RulesRound>"\\)" {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesRound>"(" {
yyextra->roundCount++;
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesRound>")" {
yyextra->roundCount--;
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
if (!yyextra->roundCount) BEGIN( yyextra->lastContext ) ;
}
<RulesRound>. {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesPattern>{ws}+"|" {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
yyextra->curlyCount = 0;
BEGIN(SkipCurly);
}
<RulesPattern>^{ws}*{nl} {
- yyextra->CCodeBuffer += "\n";
+ yyextra->cCodeBuffer += "\n";
}
<RulesPattern>^{ws}+ {
}
@@ -389,45 +389,45 @@ NONLopt [^\n]*
BEGIN(SkipCurly);
}
<RulesPattern>"\\\\" {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<RulesPattern>{CCS} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->lastContext = YY_START;
BEGIN(COMMENT);
}
<RulesPattern>. {
- yyextra->CCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
}
<SkipCurly>{B}*"#"{B}+[0-9]+{B}+/"\"" { /* line control directive */
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->lastPreLineCtrlContext = YY_START;
BEGIN( PreLineCtrl );
}
<PreLineCtrl>"\""[^\n\"]*"\"" {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<PreLineCtrl>. {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<PreLineCtrl>\n {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
BEGIN( yyextra->lastPreLineCtrlContext );
}
<SkipCurly>"{" {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
++yyextra->curlyCount ;
}
<SkipCurly>"}"/{BN}*{DCOMM}"<!--" | /* see bug710917 */
<SkipCurly>"}" {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
if( yyextra->curlyCount )
{
--yyextra->curlyCount ;
}
}
<SkipCurly>"}"{BN}*{DCOMM}"<" {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
if ( yyextra->curlyCount )
{
--yyextra->curlyCount ;
@@ -446,53 +446,53 @@ NONLopt [^\n]*
}
}
<SkipCurly>\" {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->lastStringContext=SkipCurly;
BEGIN( SkipString );
}
<SkipCurly>^{B}*"#" {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->lastPreLineCtrlContext = YY_START;
BEGIN( PreLineCtrl );
}
<SkipCurly>{B}*{RAWBEGIN} {
QCString raw=QCString(yytext).stripWhiteSpace();
- yyextra->delimiter = raw.data()+2;
+ yyextra->delimiter = raw.mid(2);
yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
yyextra->lastRawStringContext = YY_START;
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
BEGIN(RawString);
}
<SkipCurly>[^\n#"'@\\/{}<]+ {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<SkipCurly>{CCS} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->lastCContext = YY_START;
BEGIN(SkipComment);
}
<SkipCurly>{CPPC} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->lastCContext = YY_START;
BEGIN(SkipCxxComment);
}
<SkipCurly>{CHARLIT} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<SkipCurly>\' {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<SkipCurly>. {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<SkipCurly>({CPPC}{B}*)?{CCS}"!" {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->docBlockContext = YY_START;
BEGIN( DocBlock );
}
<SkipCurly>{CCS}"*"[*]+{BL} {
bool javadocBanner = Config_getBool(JAVADOC_BANNER);
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
if( javadocBanner )
{
yyextra->docBlockContext = YY_START;
@@ -504,88 +504,88 @@ NONLopt [^\n]*
}
}
<SkipCurly>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->docBlockContext = YY_START;
BEGIN( DocBlock );
}
<SkipCurly>{CPPC}"!" {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->docBlockContext = YY_START;
BEGIN( DocLine );
}
<SkipCurly>{CPPC}"/"/[^/] {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->docBlockContext = YY_START;
BEGIN( DocLine );
}
<SkipCurly>\n {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
if (yyextra->curlyCount<=0)
{
BEGIN(RulesPattern);
}
}
<SkipString>\\. {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<SkipString>\" {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
BEGIN( yyextra->lastStringContext );
}
<SkipString>{CCS}|{CCE}|{CPPC} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<SkipString>\n {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<SkipString>. {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<SkipCxxComment>.*"\\\n" { // line continuation
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<SkipCxxComment>{ANYopt}/\n {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
BEGIN( yyextra->lastCContext ) ;
}
<Comment>{BN}+ {
- yyextra->CCodeBuffer += yytext ;
+ yyextra->cCodeBuffer += yytext ;
}
-<Comment>{CCS} { yyextra->CCodeBuffer += yytext ; }
-<Comment>{CPPC} { yyextra->CCodeBuffer += yytext ; }
+<Comment>{CCS} { yyextra->cCodeBuffer += yytext ; }
+<Comment>{CPPC} { yyextra->cCodeBuffer += yytext ; }
<Comment>{CMD}("code"|"verbatim") {
yyextra->insideCode=TRUE;
- yyextra->CCodeBuffer += yytext ;
+ yyextra->cCodeBuffer += yytext ;
}
<Comment>{CMD}("endcode"|"endverbatim") {
yyextra->insideCode=FALSE;
- yyextra->CCodeBuffer += yytext ;
+ yyextra->cCodeBuffer += yytext ;
}
-<Comment>[^ \.\t\r\n\/\*]+ { yyextra->CCodeBuffer += yytext ; }
-<Comment>{CCE} { yyextra->CCodeBuffer += yytext ;
+<Comment>[^ \.\t\r\n\/\*]+ { yyextra->cCodeBuffer += yytext ; }
+<Comment>{CCE} { yyextra->cCodeBuffer += yytext ;
if (!yyextra->insideCode) BEGIN( yyextra->lastContext ) ;
}
-<Comment>. { yyextra->CCodeBuffer += *yytext ; }
+<Comment>. { yyextra->cCodeBuffer += *yytext ; }
<SkipComment>{CPPC}|{CCS} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<SkipComment>[^\*\n]+ {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<SkipComment>\n {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<SkipComment>{B}*{CCE} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
BEGIN( yyextra->lastCContext );
}
<SkipComment>"*" {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<RawString>{RAWEND} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
QCString delimiter = yytext+1;
delimiter=delimiter.left(delimiter.length()-1);
if (delimiter==yyextra->delimiter)
@@ -594,60 +594,60 @@ NONLopt [^\n]*
}
}
<RawString>[^)\n]+ {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<RawString>. {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<RawString>\n {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
/* ---- Single line comments ------ */
<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? { // continuation of multiline C++-style comment
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" { // ignore marker line (see bug700345)
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
BEGIN( yyextra->docBlockContext );
}
<DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" { // next line is an end group marker, see bug 752712
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
BEGIN( yyextra->docBlockContext );
}
<DocLine>{NONLopt}/"\n" { // whole line
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
BEGIN( yyextra->docBlockContext );
}
/* ---- Comments blocks ------ */
<DocBlock>"*"*{CCE} { // end of comment block
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
BEGIN(yyextra->docBlockContext);
}
<DocBlock>^{B}*"*"+/[^/] {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] { // start of a comment line
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DocBlock>^{B}*({CPPC}){B}* { // strip embedded C++ comments if at the start of a line
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DocBlock>{CPPC} { // slashes in the middle of a comment block
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DocBlock>{CCS} { // start of a new comment in the
// middle of a comment block
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] { // escaped command
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DocBlock>{CMD}("f$"|"f["|"f{") {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->docBlockName=&yytext[1];
if (yyextra->docBlockName.at(1)=='{')
{
@@ -658,21 +658,21 @@ NONLopt [^\n]*
BEGIN(DocCopyBlock);
}
<DocBlock>{B}*"<"{PRE}">" {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->docBlockName="<pre>";
yyextra->fencedSize=0;
yyextra->nestedComment=FALSE;
BEGIN(DocCopyBlock);
}
<DocBlock>{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
yyextra->docBlockName=&yytext[1];
yyextra->fencedSize=0;
yyextra->nestedComment=FALSE;
BEGIN(DocCopyBlock);
}
<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
QCString pat = substitute(yytext,"*"," ");
yyextra->docBlockName="~~~";
yyextra->fencedSize=pat.stripWhiteSpace().length();
@@ -680,7 +680,7 @@ NONLopt [^\n]*
BEGIN(DocCopyBlock);
}
<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
QCString pat = substitute(yytext,"*"," ");
yyextra->docBlockName="```";
yyextra->fencedSize=pat.stripWhiteSpace().length();
@@ -691,43 +691,43 @@ NONLopt [^\n]*
REJECT;
}
<DocBlock>[^@*~\/\\\n]+ { // any character that isn't special
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DocBlock>\n { // newline
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DocBlock>. { // command block
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
/* ---- Copy verbatim sections ------ */
<DocCopyBlock>"</"{PRE}">" { // end of a <pre> block
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
if (yyextra->docBlockName=="<pre>")
{
BEGIN(DocBlock);
}
}
<DocCopyBlock>"</"{CODE}">" { // end of a <code> block
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
if (yyextra->docBlockName=="<code>")
{
BEGIN(DocBlock);
}
}
<DocCopyBlock>[\\@]("f$"|"f]"|"f}") {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
BEGIN(DocBlock);
}
<DocCopyBlock>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
if (&yytext[4]==yyextra->docBlockName)
{
BEGIN(DocBlock);
}
}
<DocCopyBlock>^{B}*"*"+/{BN}+ { // start of a comment line
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
if (yyextra->docBlockName=="verbatim")
{
REJECT;
@@ -738,13 +738,13 @@ NONLopt [^\n]*
}
else
{
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
}
<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* { // start of a comment line with two *'s
if (yyextra->docBlockName=="code")
{
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
else
{
@@ -754,7 +754,7 @@ NONLopt [^\n]*
<DocCopyBlock>^{B}*"*"+/({ID}|"(") { // Assume *var or *(... is part of source code (see bug723516)
if (yyextra->docBlockName=="code")
{
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
else
{
@@ -766,11 +766,11 @@ NONLopt [^\n]*
{
if (yyextra->nestedComment) // keep * it is part of the code
{
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
else // remove * it is part of the comment block
{
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
}
else
@@ -779,7 +779,7 @@ NONLopt [^\n]*
}
}
<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
QCString pat = substitute(yytext,"*"," ");
if (yyextra->fencedSize==pat.stripWhiteSpace().length())
{
@@ -787,7 +787,7 @@ NONLopt [^\n]*
}
}
<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
QCString pat = substitute(yytext,"*"," ");
if (yyextra->fencedSize==pat.stripWhiteSpace().length())
{
@@ -795,7 +795,7 @@ NONLopt [^\n]*
}
}
<DocCopyBlock>[^\<@/\*\]~\$\\\n]+ { // any character that is not special
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
if (yytext[1]=='*')
@@ -806,17 +806,17 @@ NONLopt [^\n]*
{
yyextra->nestedComment=FALSE;
}
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DocCopyBlock>\n { // newline
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<DocCopyBlock>. { // any other character
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" { // desc is followed by another one
yyextra->docBlockContext = SkipCurlyEndDoc;
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
if (yytext[yyleng-3]=='/')
{
BEGIN( DocLine );
@@ -827,12 +827,12 @@ NONLopt [^\n]*
}
}
<SkipCurlyEndDoc>"}" {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
BEGIN(SkipCurly);
}
<UserSection>.*{nl} {
- yyextra->CCodeBuffer += yytext;
+ yyextra->cCodeBuffer += yytext;
}
/*
@@ -861,7 +861,7 @@ static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size)
//-----------------------------------------------------------------------------
static void parseMain(yyscan_t yyscanner,
- const char *fileName,
+ const QCString &fileName,
const char *fileBuf,
const std::shared_ptr<Entry> &rt,
ClangTUParser *clangParser)
@@ -877,7 +877,7 @@ static void parseMain(yyscan_t yyscanner,
yyextra->clangParser = clangParser;
yyextra->language = getLanguageFromFileName(yyextra->yyFileName);
rt->lang = yyextra->language;
- msg("Parsing file %s...\n",yyextra->yyFileName.data());
+ msg("Parsing file %s...\n",qPrint(yyextra->yyFileName));
yyextra->current_root = rt;
yyextra->current = std::make_shared<Entry>();
@@ -893,7 +893,7 @@ static void parseMain(yyscan_t yyscanner,
lexscannerYYlex(yyscanner);
- rt->program.resize(0);
+ rt->program.str(std::string());
}
//----------------------------------------------------------------------------
@@ -903,13 +903,12 @@ static void handleCCode(yyscan_t yyscanner)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- if (yyextra->CCodeBuffer.isEmpty()) return;
+ if (yyextra->cCodeBuffer.isEmpty()) return;
yyextra->cOutlineParser.parseInput(yyextra->yyFileName,
- yyextra->CCodeBuffer,
+ yyextra->cCodeBuffer.data(),
yyextra->current_root,
yyextra->clangParser);
- // SrcLangExt_Cpp,
- yyextra->CCodeBuffer.resize(0);
+ yyextra->cCodeBuffer.resize(0);
return;
}
//----------------------------------------------------------------------------
@@ -933,18 +932,18 @@ LexOutlineParser::~LexOutlineParser()
lexscannerYYlex_destroy(p->yyscanner);
}
-void LexOutlineParser::parseInput(const char *fileName,
+void LexOutlineParser::parseInput(const QCString &fileName,
const char *fileBuf,
const std::shared_ptr<Entry> &root,
ClangTUParser *clangParser)
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
- printlex(yy_flex_debug, TRUE, __FILE__, fileName);
+ printlex(yy_flex_debug, TRUE, __FILE__, qPrint(fileName));
::parseMain(p->yyscanner,fileName,fileBuf,root,clangParser);
- printlex(yy_flex_debug, FALSE, __FILE__, fileName);
+ printlex(yy_flex_debug, FALSE, __FILE__, qPrint(fileName));
}
diff --git a/src/linkedmap.h b/src/linkedmap.h
index f09b6d8..db3f7b1 100644
--- a/src/linkedmap.h
+++ b/src/linkedmap.h
@@ -23,6 +23,8 @@
#include <algorithm>
#include <cctype>
+#include "qcstring.h"
+
//! @brief Container class representing a vector of objects with keys.
//! @details Objects can efficiently be looked up given the key.
//! Objects are owned by the container.
@@ -42,19 +44,45 @@ class LinkedMap
//! Find an object given the key.
//! Returns a pointer to the element if found or nullptr if it is not found.
- const T *find(const char *key_) const
+ const T *find(const std::string &key) const
{
- std::string key(key_ ? key_ : "");
auto it = m_lookup.find(key);
return it!=m_lookup.end() ? it->second : nullptr;
}
+ //! Find an object given the key.
+ //! Returns a pointer to the element if found or nullptr if it is not found.
+ const T *find(const QCString &key) const
+ {
+ auto it = m_lookup.find(key.str());
+ return it!=m_lookup.end() ? it->second : nullptr;
+ }
+
+ //! Find an object given the key.
+ //! Returns a pointer to the element if found or nullptr if it is not found.
+ const T *find(const char *key) const
+ {
+ return find(std::string(key ? key : ""));
+ }
+
//! A non-const wrapper for find() const
T* find(const char *key)
{
return const_cast<T*>(static_cast<const LinkedMap&>(*this).find(key));
}
+ //! A non-const wrapper for find() const
+ T* find(const QCString &key)
+ {
+ return const_cast<T*>(static_cast<const LinkedMap&>(*this).find(key));
+ }
+
+ //! A non-const wrapper for find() const
+ T* find(const std::string &key)
+ {
+ return const_cast<T*>(static_cast<const LinkedMap&>(*this).find(key));
+ }
+
//! Adds a new object to the ordered vector if it was not added already.
//! Return a non-owning pointer to the newly added object, or to the existing object if
//! it was already inserted before under the given key.
@@ -65,7 +93,22 @@ class LinkedMap
if (result==nullptr)
{
std::string key(k ? k : "");
- Ptr ptr = std::make_unique<T>(key.c_str(),std::forward<Args>(args)...);
+ Ptr ptr = std::make_unique<T>(QCString(k),std::forward<Args>(args)...);
+ result = ptr.get();
+ m_lookup.insert({key,result});
+ m_entries.push_back(std::move(ptr));
+ }
+ return result;
+ }
+
+ template<class...Args>
+ T *add(const QCString &k, Args&&... args)
+ {
+ std::string key = k.str();
+ T *result = find(key);
+ if (result==nullptr)
+ {
+ Ptr ptr = std::make_unique<T>(k,std::forward<Args>(args)...);
result = ptr.get();
m_lookup.insert({key,result});
m_entries.push_back(std::move(ptr));
@@ -90,6 +133,19 @@ class LinkedMap
return result;
}
+ T *add(const QCString &k, Ptr &&ptr)
+ {
+ std::string key = k.str();
+ T *result = find(key);
+ if (result==nullptr)
+ {
+ result = ptr.get();
+ m_lookup.insert({key,result});
+ m_entries.push_back(std::move(ptr));
+ }
+ return result;
+ }
+
//! Prepends a new object to the ordered vector if it was not added already.
//! Return a non-owning pointer to the newly added object, or to the existing object if
//! it was already inserted before under the given key.
@@ -108,12 +164,25 @@ class LinkedMap
return result;
}
+ template<class...Args>
+ T *prepend(const QCString &key, Args&&... args)
+ {
+ T *result = find(key);
+ if (result==nullptr)
+ {
+ Ptr ptr = std::make_unique<T>(key,std::forward<Args>(args)...);
+ result = ptr.get();
+ m_lookup.insert({key.str(),result});
+ m_entries.push_front(std::move(ptr));
+ }
+ return result;
+ }
+
//! Removes an object from the container and deletes it.
//! Returns true if the object was deleted or false it is was not found.
- bool del(const char *key_)
+ bool del(const QCString &key)
{
- std::string key(key_ ? key_ : "");
- auto it = m_lookup.find(key);
+ auto it = m_lookup.find(key.str());
if (it!=m_lookup.end())
{
auto vecit = std::find_if(m_entries.begin(),m_entries.end(),[obj=it->second](auto &el) { return el.get()==obj; });
@@ -171,19 +240,44 @@ class LinkedRefMap
//! find an object given the key.
//! Returns a pointer to the object if found or nullptr if it is not found.
- const T *find(const char *key_) const
+ const T *find(const std::string &key) const
{
- std::string key(key_ ? key_ : "");
auto it = m_lookup.find(key);
return it!=m_lookup.end() ? it->second : nullptr;
}
+ //! find an object given the key.
+ //! Returns a pointer to the object if found or nullptr if it is not found.
+ const T *find(const QCString &key) const
+ {
+ auto it = m_lookup.find(key.str());
+ return it!=m_lookup.end() ? it->second : nullptr;
+ }
+
+ //! find an object given the key.
+ //! Returns a pointer to the object if found or nullptr if it is not found.
+ const T *find(const char *key) const
+ {
+ return find(std::string(key ? key : ""));
+ }
+
//! non-const wrapper for find() const
T* find(const char *key)
{
return const_cast<T*>(static_cast<const LinkedRefMap&>(*this).find(key));
}
+ T* find(const QCString &key)
+ {
+ return const_cast<T*>(static_cast<const LinkedRefMap&>(*this).find(key));
+ }
+
+ //! non-const wrapper for find() const
+ T* find(const std::string &key)
+ {
+ return const_cast<T*>(static_cast<const LinkedRefMap&>(*this).find(key));
+ }
+
//! Adds an object reference to the ordered vector if it was not added already.
//! Return true if the reference was added, and false if an object with the same key
//! was already added before
@@ -202,6 +296,21 @@ class LinkedRefMap
}
}
+ bool add(const QCString &k, T* obj)
+ {
+ std::string key = k.str();
+ if (find(key)==nullptr) // new element
+ {
+ m_lookup.insert({key,obj});
+ m_entries.push_back(obj);
+ return true;
+ }
+ else // already existing, don't add
+ {
+ return false;
+ }
+ }
+
//! Prepends an object reference to the ordered vector if it was not added already.
//! Return true if the reference was added, and false if an object with the same key
//! was already added before
@@ -220,12 +329,25 @@ class LinkedRefMap
}
}
+ bool prepend(const QCString &key, T* obj)
+ {
+ if (find(key)==nullptr) // new element
+ {
+ m_lookup.insert({key.str(),obj});
+ m_entries.insert(m_entries.begin(),obj);
+ return true;
+ }
+ else // already existing, don't add
+ {
+ return false;
+ }
+ }
+
//! Removes an object from the container and deletes it.
//! Returns true if the object was deleted or false it is was not found.
- bool del(const char *key_)
+ bool del(const QCString &key)
{
- std::string key(key_ ? key_ : "");
- auto it = m_lookup.find(key);
+ auto it = m_lookup.find(key.str());
if (it!=m_lookup.end())
{
auto vecit = std::find_if(m_entries.begin(),m_entries.end(),[obj=it->second](auto &el) { return el.get()==obj; });
diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp
index bc219cd..d565648 100644
--- a/src/mandocvisitor.cpp
+++ b/src/mandocvisitor.cpp
@@ -13,8 +13,6 @@
*
*/
-#include <qfileinfo.h>
-
#include "mandocvisitor.h"
#include "docparser.h"
#include "language.h"
@@ -28,9 +26,10 @@
#include "filedef.h"
#include "htmlentity.h"
#include "emoji.h"
+#include "fileinfo.h"
-ManDocVisitor::ManDocVisitor(FTextStream &t,CodeOutputInterface &ci,
- const char *langExt)
+ManDocVisitor::ManDocVisitor(TextStream &t,CodeOutputInterface &ci,
+ const QCString &langExt)
: DocVisitor(DocVisitor_Man), m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE), m_firstCol(FALSE),
m_indent(0), m_langExt(langExt)
{
@@ -112,15 +111,15 @@ void ManDocVisitor::visit(DocURL *u)
void ManDocVisitor::visit(DocLineBreak *)
{
if (m_hide) return;
- m_t << endl << ".br" << endl;
+ m_t << "\n.br\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visit(DocHorRuler *)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -168,17 +167,17 @@ void ManDocVisitor::visit(DocStyleChange *s)
case DocStyleChange::Preformatted:
if (s->enable())
{
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
m_insidePre=TRUE;
}
else
{
m_insidePre=FALSE;
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
break;
@@ -199,25 +198,25 @@ void ManDocVisitor::visit(DocVerbatim *s)
switch (s->type())
{
case DocVerbatim::Code: // fall though
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
getCodeParser(lang).parseCode(m_ci,s->context(),s->text(),
langExt,
s->isExample(),s->exampleFile());
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
break;
case DocVerbatim::Verbatim:
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
m_t << s->text();
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
break;
case DocVerbatim::ManOnly:
@@ -249,11 +248,11 @@ void ManDocVisitor::visit(DocInclude *inc)
{
case DocInclude::IncWithLines:
{
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
getCodeParser(inc->extension()).parseCode(m_ci,inc->context(),
inc->text(),
langExt,
@@ -267,16 +266,16 @@ void ManDocVisitor::visit(DocInclude *inc)
TRUE
);
delete fd;
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
break;
case DocInclude::Include:
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
getCodeParser(inc->extension()).parseCode(m_ci,inc->context(),
inc->text(),
langExt,
@@ -289,9 +288,9 @@ void ManDocVisitor::visit(DocInclude *inc)
0, // memberDef
FALSE
);
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
break;
case DocInclude::DontInclude:
@@ -306,19 +305,19 @@ void ManDocVisitor::visit(DocInclude *inc)
m_t << inc->text();
break;
case DocInclude::VerbInclude:
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
m_t << inc->text();
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
break;
case DocInclude::Snippet:
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
getCodeParser(inc->extension()).parseCode(m_ci,
inc->context(),
extractBlock(inc->text(),inc->blockId()),
@@ -326,18 +325,18 @@ void ManDocVisitor::visit(DocInclude *inc)
inc->isExample(),
inc->exampleFile()
);
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
break;
case DocInclude::SnipWithLines:
{
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
getCodeParser(inc->extension()).parseCode(m_ci,
inc->context(),
extractBlock(inc->text(),inc->blockId()),
@@ -352,9 +351,9 @@ void ManDocVisitor::visit(DocInclude *inc)
TRUE // show line number
);
delete fd;
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
break;
@@ -372,14 +371,14 @@ void ManDocVisitor::visit(DocIncOperator *op)
if (locLangExt.isEmpty()) locLangExt = m_langExt;
SrcLangExt langExt = getLanguageFromFileName(locLangExt);
//printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
- // op->type(),op->isFirst(),op->isLast(),op->text().data());
+ // op->type(),op->isFirst(),op->isLast(),qPrint(op->text()));
if (op->isFirst())
{
if (!m_hide)
{
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
}
pushHidden(m_hide);
m_hide = TRUE;
@@ -392,8 +391,8 @@ void ManDocVisitor::visit(DocIncOperator *op)
FileDef *fd = 0;
if (!op->includeFileName().isEmpty())
{
- QFileInfo cfi( op->includeFileName() );
- fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( op->includeFileName().str() );
+ fd = createFileDef( cfi.dirPath(), cfi.fileName() );
}
getCodeParser(locLangExt).parseCode(m_ci,op->context(),op->text(),langExt,
@@ -415,15 +414,15 @@ void ManDocVisitor::visit(DocIncOperator *op)
m_hide = popHidden();
if (!m_hide)
{
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
}
else
{
- if (!m_hide) m_t << endl;
+ if (!m_hide) m_t << "\n";
}
}
@@ -466,7 +465,7 @@ void ManDocVisitor::visitPost(DocAutoList *)
{
if (m_hide) return;
m_indent-=2;
- m_t << ".PP" << endl;
+ m_t << ".PP\n";
}
void ManDocVisitor::visitPre(DocAutoListItem *li)
@@ -474,7 +473,7 @@ void ManDocVisitor::visitPre(DocAutoListItem *li)
if (m_hide) return;
QCString ws;
ws.fill(' ',m_indent-2);
- if (!m_firstCol) m_t << endl;
+ if (!m_firstCol) m_t << "\n";
m_t << ".IP \"" << ws;
if (((DocAutoList *)li->parent())->isEnumList())
{
@@ -484,14 +483,14 @@ void ManDocVisitor::visitPre(DocAutoListItem *li)
{
m_t << "\\(bu\" " << m_indent;
}
- m_t << endl;
+ m_t << "\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visitPost(DocAutoListItem *)
{
if (m_hide) return;
- m_t << endl;
+ m_t << "\n";
m_firstCol=TRUE;
}
@@ -508,8 +507,8 @@ void ManDocVisitor::visitPost(DocPara *p)
)
)
{
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
}
@@ -527,8 +526,8 @@ void ManDocVisitor::visitPre(DocSimpleSect *s)
if (m_hide) return;
if (!m_firstCol)
{
- m_t << endl;
- m_t << ".PP" << endl;
+ m_t << "\n";
+ m_t << ".PP\n";
}
m_t << "\\fB";
switch(s->type())
@@ -571,17 +570,17 @@ void ManDocVisitor::visitPre(DocSimpleSect *s)
// special case 1: user defined title
if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs)
{
- m_t << "\\fP" << endl;
- m_t << ".RS 4" << endl;
+ m_t << "\\fP\n";
+ m_t << ".RS 4\n";
}
}
void ManDocVisitor::visitPost(DocSimpleSect *)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
- m_t << ".RE" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".RE\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -592,23 +591,23 @@ void ManDocVisitor::visitPre(DocTitle *)
void ManDocVisitor::visitPost(DocTitle *)
{
if (m_hide) return;
- m_t << "\\fP" << endl;
- m_t << ".RS 4" << endl;
+ m_t << "\\fP\n";
+ m_t << ".RS 4\n";
}
void ManDocVisitor::visitPre(DocSimpleList *)
{
if (m_hide) return;
m_indent+=2;
- if (!m_firstCol) m_t << endl;
- m_t << ".PD 0" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PD 0\n";
}
void ManDocVisitor::visitPost(DocSimpleList *)
{
if (m_hide) return;
m_indent-=2;
- m_t << ".PP" << endl;
+ m_t << ".PP\n";
}
void ManDocVisitor::visitPre(DocSimpleListItem *)
@@ -616,27 +615,27 @@ void ManDocVisitor::visitPre(DocSimpleListItem *)
if (m_hide) return;
QCString ws;
ws.fill(' ',m_indent-2);
- if (!m_firstCol) m_t << endl;
- m_t << ".IP \"" << ws << "\\(bu\" " << m_indent << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".IP \"" << ws << "\\(bu\" " << m_indent << "\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visitPost(DocSimpleListItem *)
{
if (m_hide) return;
- m_t << endl;
+ m_t << "\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visitPre(DocSection *s)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
+ if (!m_firstCol) m_t << "\n";
if (s->level()==1) m_t << ".SH"; else m_t << ".SS";
m_t << " \"";
filter(s->title());
- m_t << "\"" << endl;
- if (s->level()==1) m_t << ".PP" << endl;
+ m_t << "\"\n";
+ if (s->level()==1) m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -648,16 +647,16 @@ void ManDocVisitor::visitPre(DocHtmlList *)
{
if (m_hide) return;
m_indent+=2;
- if (!m_firstCol) m_t << endl;
- m_t << ".PD 0" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PD 0\n";
}
void ManDocVisitor::visitPost(DocHtmlList *)
{
if (m_hide) return;
m_indent-=2;
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
}
void ManDocVisitor::visitPre(DocHtmlListItem *li)
@@ -665,7 +664,7 @@ void ManDocVisitor::visitPre(DocHtmlListItem *li)
if (m_hide) return;
QCString ws;
ws.fill(' ',m_indent-2);
- if (!m_firstCol) m_t << endl;
+ if (!m_firstCol) m_t << "\n";
m_t << ".IP \"" << ws;
if (((DocHtmlList *)li->parent())->type()==DocHtmlList::Ordered)
{
@@ -675,31 +674,31 @@ void ManDocVisitor::visitPre(DocHtmlListItem *li)
{
m_t << "\\(bu\" " << m_indent;
}
- m_t << endl;
+ m_t << "\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visitPost(DocHtmlListItem *)
{
if (m_hide) return;
- m_t << endl;
+ m_t << "\n";
m_firstCol=TRUE;
}
//void ManDocVisitor::visitPre(DocHtmlPre *)
//{
-// if (!m_firstCol) m_t << endl;
-// m_t << ".PP" << endl;
-// m_t << ".nf" << endl;
+// if (!m_firstCol) m_t << "\n";
+// m_t << ".PP\n";
+// m_t << ".nf\n";
// m_insidePre=TRUE;
//}
//
//void ManDocVisitor::visitPost(DocHtmlPre *)
//{
// m_insidePre=FALSE;
-// if (!m_firstCol) m_t << endl;
-// m_t << ".fi" << endl;
-// m_t << ".PP" << endl;
+// if (!m_firstCol) m_t << "\n";
+// m_t << ".fi\n";
+// m_t << ".PP\n";
// m_firstCol=TRUE;
//}
@@ -710,15 +709,15 @@ void ManDocVisitor::visitPre(DocHtmlDescList *)
void ManDocVisitor::visitPost(DocHtmlDescList *)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visitPre(DocHtmlDescTitle *)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
+ if (!m_firstCol) m_t << "\n";
m_t << ".IP \"\\fB";
m_firstCol=FALSE;
}
@@ -726,7 +725,7 @@ void ManDocVisitor::visitPre(DocHtmlDescTitle *)
void ManDocVisitor::visitPost(DocHtmlDescTitle *)
{
if (m_hide) return;
- m_t << "\\fP\" 1c" << endl;
+ m_t << "\\fP\" 1c\n";
m_firstCol=TRUE;
}
@@ -773,18 +772,18 @@ void ManDocVisitor::visitPost(DocHtmlCell *)
void ManDocVisitor::visitPre(DocInternal *)
{
if (m_hide) return;
- //if (!m_firstCol) m_t << endl;
- //m_t << ".PP" << endl;
- //m_t << "\\fB" << theTranslator->trForInternalUseOnly() << "\\fP" << endl;
- //m_t << ".RS 4" << endl;
+ //if (!m_firstCol) m_t << "\n";
+ //m_t << ".PP\n";
+ //m_t << "\\fB" << theTranslator->trForInternalUseOnly() << "\\fP\n";
+ //m_t << ".RS 4\n";
}
void ManDocVisitor::visitPost(DocInternal *)
{
if (m_hide) return;
- //if (!m_firstCol) m_t << endl;
- //m_t << ".RE" << endl;
- //m_t << ".PP" << endl;
+ //if (!m_firstCol) m_t << "\n";
+ //m_t << ".RE\n";
+ //m_t << ".PP\n";
//m_firstCol=TRUE;
}
@@ -803,7 +802,7 @@ void ManDocVisitor::visitPost(DocHRef *)
void ManDocVisitor::visitPre(DocHtmlHeader *header)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
+ if (!m_firstCol) m_t << "\n";
if (header->level()==1) m_t << ".SH"; else m_t << ".SS";
m_t << " \"";
}
@@ -811,8 +810,8 @@ void ManDocVisitor::visitPre(DocHtmlHeader *header)
void ManDocVisitor::visitPost(DocHtmlHeader *header)
{
if (m_hide) return;
- m_t << "\"" << endl;
- if (header->level()==1) m_t << ".PP" << endl;
+ m_t << "\"\n";
+ if (header->level()==1) m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -877,15 +876,15 @@ void ManDocVisitor::visitPre(DocSecRefItem *)
if (m_hide) return;
QCString ws;
ws.fill(' ',m_indent-2);
- if (!m_firstCol) m_t << endl;
- m_t << ".IP \"" << ws << "\\(bu\" " << m_indent << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".IP \"" << ws << "\\(bu\" " << m_indent << "\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visitPost(DocSecRefItem *)
{
if (m_hide) return;
- m_t << endl;
+ m_t << "\n";
m_firstCol=TRUE;
}
@@ -899,8 +898,8 @@ void ManDocVisitor::visitPost(DocSecRefList *)
{
if (m_hide) return;
m_indent-=2;
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
}
void ManDocVisitor::visitPre(DocParamSect *s)
@@ -908,8 +907,8 @@ void ManDocVisitor::visitPre(DocParamSect *s)
if (m_hide) return;
if (!m_firstCol)
{
- m_t << endl;
- m_t << ".PP" << endl;
+ m_t << "\n";
+ m_t << ".PP\n";
}
m_t << "\\fB";
switch(s->type())
@@ -925,16 +924,16 @@ void ManDocVisitor::visitPre(DocParamSect *s)
default:
ASSERT(0);
}
- m_t << "\\fP" << endl;
- m_t << ".RS 4" << endl;
+ m_t << "\\fP\n";
+ m_t << ".RS 4\n";
}
void ManDocVisitor::visitPost(DocParamSect *)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
- m_t << ".RE" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".RE\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -963,8 +962,8 @@ void ManDocVisitor::visitPost(DocParamList *pl)
if (m_hide) return;
if (!pl->isLast())
{
- if (!m_firstCol) m_t << endl;
- m_t << ".br" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".br\n";
}
}
@@ -974,22 +973,22 @@ void ManDocVisitor::visitPre(DocXRefItem *x)
if (x->title().isEmpty()) return;
if (!m_firstCol)
{
- m_t << endl;
- m_t << ".PP" << endl;
+ m_t << "\n";
+ m_t << ".PP\n";
}
m_t << "\\fB";
filter(x->title());
- m_t << "\\fP" << endl;
- m_t << ".RS 4" << endl;
+ m_t << "\\fP\n";
+ m_t << ".RS 4\n";
}
void ManDocVisitor::visitPost(DocXRefItem *x)
{
if (m_hide) return;
if (x->title().isEmpty()) return;
- if (!m_firstCol) m_t << endl;
- m_t << ".RE" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".RE\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -1018,18 +1017,18 @@ void ManDocVisitor::visitPre(DocHtmlBlockQuote *)
if (m_hide) return;
if (!m_firstCol)
{
- m_t << endl;
- m_t << ".PP" << endl;
+ m_t << "\n";
+ m_t << ".PP\n";
}
- m_t << ".RS 4" << endl; // TODO: add support for nested block quotes
+ m_t << ".RS 4\n"; // TODO: add support for nested block quotes
}
void ManDocVisitor::visitPost(DocHtmlBlockQuote *)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
- m_t << ".RE" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".RE\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -1050,11 +1049,11 @@ void ManDocVisitor::visitPost(DocParBlock *)
}
-void ManDocVisitor::filter(const char *str)
+void ManDocVisitor::filter(const QCString &str)
{
- if (str)
+ if (!str.isEmpty())
{
- const char *p=str;
+ const char *p=str.data();
char c=0;
while ((c=*p++))
{
diff --git a/src/mandocvisitor.h b/src/mandocvisitor.h
index 7c5dc8d..341f37a 100644
--- a/src/mandocvisitor.h
+++ b/src/mandocvisitor.h
@@ -19,17 +19,19 @@
#ifndef _MANDOCVISITOR_H
#define _MANDOCVISITOR_H
+#include <iostream>
+
+#include "qcstring.h"
#include "docvisitor.h"
-#include <qcstring.h>
-class FTextStream;
class CodeOutputInterface;
+class TextStream;
/*! @brief Concrete visitor implementation for LaTeX output. */
class ManDocVisitor : public DocVisitor
{
public:
- ManDocVisitor(FTextStream &t,CodeOutputInterface &ci,const char *langExt);
+ ManDocVisitor(TextStream &t,CodeOutputInterface &ci,const QCString &langExt);
//--------------------------------------
// visitor functions for leaf nodes
@@ -142,13 +144,13 @@ class ManDocVisitor : public DocVisitor
// helper functions
//--------------------------------------
- void filter(const char *str);
+ void filter(const QCString &str);
//--------------------------------------
// state variables
//--------------------------------------
- FTextStream &m_t;
+ TextStream &m_t;
CodeOutputInterface &m_ci;
bool m_insidePre;
bool m_hide;
diff --git a/src/mangen.cpp b/src/mangen.cpp
index 9139aa8..05c5e77 100644
--- a/src/mangen.cpp
+++ b/src/mangen.cpp
@@ -20,7 +20,6 @@
#include <stdlib.h>
-#include <qdir.h>
#include "message.h"
#include "mangen.h"
#include "config.h"
@@ -30,6 +29,8 @@
#include "docparser.h"
#include "mandocvisitor.h"
#include "language.h"
+#include "dir.h"
+#include "utf8.h"
static QCString getExtension()
{
@@ -101,25 +102,25 @@ void ManGenerator::init()
{
QCString manOutput = Config_getString(MAN_OUTPUT);
- QDir d(manOutput);
- if (!d.exists() && !d.mkdir(manOutput))
+ Dir d(manOutput.str());
+ if (!d.exists() && !d.mkdir(manOutput.str()))
{
- term("Could not create output directory %s\n",manOutput.data());
+ term("Could not create output directory %s\n",qPrint(manOutput));
}
- d.setPath(manOutput + "/" + getSubdir());
- if (!d.exists() && !d.mkdir(manOutput + "/" + getSubdir()))
+ std::string manDir = manOutput.str()+"/"+getSubdir().str();
+ if (!d.exists(manDir) && !d.mkdir(manDir))
{
- term("Could not create output directory %s/%s\n",manOutput.data(), getSubdir().data());
+ term("Could not create output directory %s/%s\n",qPrint(manOutput), qPrint(getSubdir()));
}
createSubDirs(d);
}
-static QCString buildFileName(const char *name)
+static QCString buildFileName(const QCString &name)
{
QCString fileName;
- if (name==0) return "noname";
+ if (name.isEmpty()) return "noname";
- const char *p=name;
+ const char *p=name.data();
char c;
while ((c=*p++))
{
@@ -155,7 +156,7 @@ static QCString buildFileName(const char *name)
return fileName;
}
-void ManGenerator::startFile(const char *,const char *manName,const char *,int)
+void ManGenerator::startFile(const QCString &,const QCString &manName,const QCString &,int)
{
startPlainFile( buildFileName( manName ) );
m_firstCol=TRUE;
@@ -163,25 +164,25 @@ void ManGenerator::startFile(const char *,const char *manName,const char *,int)
void ManGenerator::endFile()
{
- t << endl;
+ m_t << "\n";
endPlainFile();
}
-void ManGenerator::endTitleHead(const char *,const char *name)
+void ManGenerator::endTitleHead(const QCString &,const QCString &name)
{
- t << ".TH \"" << name << "\" " << getExtension() << " \""
+ m_t << ".TH \"" << name << "\" " << getExtension() << " \""
<< dateToString(FALSE) << "\" \"";
if (!Config_getString(PROJECT_NUMBER).isEmpty())
- t << "Version " << Config_getString(PROJECT_NUMBER) << "\" \"";
+ m_t << "Version " << Config_getString(PROJECT_NUMBER) << "\" \"";
if (Config_getString(PROJECT_NAME).isEmpty())
- t << "Doxygen";
+ m_t << "Doxygen";
else
- t << Config_getString(PROJECT_NAME);
- t << "\" \\\" -*- nroff -*-" << endl;
- t << ".ad l" << endl;
- t << ".nh" << endl;
- t << ".SH NAME" << endl;
- t << name;
+ m_t << Config_getString(PROJECT_NAME);
+ m_t << "\" \\\" -*- nroff -*-\n";
+ m_t << ".ad l\n";
+ m_t << ".nh\n";
+ m_t << ".SH NAME\n";
+ m_t << name;
m_firstCol=FALSE;
m_paragraph=TRUE;
m_inHeader=TRUE;
@@ -191,19 +192,19 @@ void ManGenerator::newParagraph()
{
if (!m_paragraph)
{
- if (!m_firstCol) t << endl;
- t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
m_paragraph=TRUE;
}
-void ManGenerator::startParagraph(const char *)
+void ManGenerator::startParagraph(const QCString &)
{
if (!m_paragraph)
{
- if (!m_firstCol) t << endl;
- t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
m_paragraph=TRUE;
@@ -213,38 +214,38 @@ void ManGenerator::endParagraph()
{
}
-void ManGenerator::writeString(const char *text)
+void ManGenerator::writeString(const QCString &text)
{
docify(text);
}
-void ManGenerator::startIndexItem(const char *,const char *)
+void ManGenerator::startIndexItem(const QCString &,const QCString &)
{
}
-void ManGenerator::endIndexItem(const char *,const char *)
+void ManGenerator::endIndexItem(const QCString &,const QCString &)
{
}
-void ManGenerator::writeStartAnnoItem(const char *,const char *,
- const char *,const char *)
+void ManGenerator::writeStartAnnoItem(const QCString &,const QCString &,
+ const QCString &,const QCString &)
{
}
-void ManGenerator::writeObjectLink(const char *,const char *,
- const char *, const char *name)
+void ManGenerator::writeObjectLink(const QCString &,const QCString &,
+ const QCString &, const QCString &name)
{
startBold(); docify(name); endBold();
}
-void ManGenerator::writeCodeLink(const char *,const char *,
- const char *, const char *name,
- const char *)
+void ManGenerator::writeCodeLink(const QCString &,const QCString &,
+ const QCString &, const QCString &name,
+ const QCString &)
{
docify(name);
}
-void ManGenerator::startHtmlLink(const char *)
+void ManGenerator::startHtmlLink(const QCString &)
{
}
@@ -252,56 +253,56 @@ void ManGenerator::endHtmlLink()
{
}
-//void ManGenerator::writeMailLink(const char *url)
+//void ManGenerator::writeMailLink(const QCString &url)
//{
// docify(url);
//}
void ManGenerator::startGroupHeader(int)
{
- if (!m_firstCol) t << endl;
- t << ".SH \"";
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".SH \"";
m_upperCase=TRUE;
m_firstCol=FALSE;
}
void ManGenerator::endGroupHeader(int)
{
- t << "\"\n.PP " << endl;
+ m_t << "\"\n.PP \n";
m_firstCol=TRUE;
m_paragraph=TRUE;
m_upperCase=FALSE;
}
-void ManGenerator::startMemberHeader(const char *,int)
+void ManGenerator::startMemberHeader(const QCString &,int)
{
- if (!m_firstCol) t << endl;
- t << ".SS \"";
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".SS \"";
}
void ManGenerator::endMemberHeader()
{
- t << "\"\n";
+ m_t << "\"\n";
m_firstCol=TRUE;
m_paragraph=FALSE;
}
-void ManGenerator::docify(const char *str)
+void ManGenerator::docify(const QCString &str)
{
- if (str)
+ if (!str.isEmpty())
{
- const char *p=str;
+ const char *p=str.data();
char c=0;
while ((c=*p++))
{
switch(c)
{
- case '-': t << "\\-"; break; // see bug747780
- case '.': t << "\\&."; break; // see bug652277
- case '\\': t << "\\\\"; m_col++; break;
- case '\n': t << "\n"; m_col=0; break;
+ case '-': m_t << "\\-"; break; // see bug747780
+ case '.': m_t << "\\&."; break; // see bug652277
+ case '\\': m_t << "\\\\"; m_col++; break;
+ case '\n': m_t << "\n"; m_col=0; break;
case '\"': c = '\''; // no break!
- default: t << c; m_col++; break;
+ default: m_t << c; m_col++; break;
}
}
m_firstCol=(c=='\n');
@@ -310,12 +311,12 @@ void ManGenerator::docify(const char *str)
m_paragraph=FALSE;
}
-void ManGenerator::codify(const char *str)
+void ManGenerator::codify(const QCString &str)
{
//static char spaces[]=" ";
- if (str)
+ if (!str.isEmpty())
{
- const char *p=str;
+ const char *p=str.data();
char c;
int spacesToNextTabStop;
while (*p)
@@ -323,16 +324,16 @@ void ManGenerator::codify(const char *str)
c=*p++;
switch(c)
{
- case '.': t << "\\&."; break; // see bug652277
+ case '.': m_t << "\\&."; break; // see bug652277
case '\t': spacesToNextTabStop =
Config_getInt(TAB_SIZE) - (m_col%Config_getInt(TAB_SIZE));
- t << Doxygen::spaces.left(spacesToNextTabStop);
+ m_t << Doxygen::spaces.left(spacesToNextTabStop);
m_col+=spacesToNextTabStop;
break;
- case '\n': t << "\n"; m_firstCol=TRUE; m_col=0; break;
- case '\\': t << "\\"; m_col++; break;
+ case '\n': m_t << "\n"; m_firstCol=TRUE; m_col=0; break;
+ case '\\': m_t << "\\"; m_col++; break;
case '\"': // no break!
- default: p=writeUtf8Char(t,p-1); m_firstCol=FALSE; m_col++; break;
+ default: p=writeUTF8Char(m_t,p-1); m_firstCol=FALSE; m_col++; break;
}
}
//printf("%s",str);fflush(stdout);
@@ -346,9 +347,9 @@ void ManGenerator::writeChar(char c)
if (m_firstCol) m_col=0; else m_col++;
switch (c)
{
- case '\\': t << "\\\\"; break;
+ case '\\': m_t << "\\\\"; break;
case '\"': c = '\''; // no break!
- default: t << c; break;
+ default: m_t << c; break;
}
//printf("%c",c);fflush(stdout);
m_paragraph=FALSE;
@@ -357,7 +358,7 @@ void ManGenerator::writeChar(char c)
void ManGenerator::startDescList(SectionTypes)
{
if (!m_firstCol)
- { t << endl << ".PP" << endl;
+ { m_t << "\n" << ".PP\n";
m_firstCol=TRUE; m_paragraph=TRUE;
m_col=0;
}
@@ -367,21 +368,21 @@ void ManGenerator::startDescList(SectionTypes)
void ManGenerator::startTitle()
{
- if (!m_firstCol) t << endl;
- t << ".SH \"";
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".SH \"";
m_firstCol=FALSE;
m_paragraph=FALSE;
}
void ManGenerator::endTitle()
{
- t << "\"";
+ m_t << "\"";
}
void ManGenerator::startItemListItem()
{
- if (!m_firstCol) t << endl;
- t << ".TP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".TP\n";
m_firstCol=TRUE;
m_paragraph=FALSE;
m_col=0;
@@ -391,34 +392,34 @@ void ManGenerator::endItemListItem()
{
}
-void ManGenerator::startCodeFragment(const char *)
+void ManGenerator::startCodeFragment(const QCString &)
{
newParagraph();
- t << ".nf" << endl;
+ m_t << ".nf\n";
m_firstCol=TRUE;
m_paragraph=FALSE;
}
-void ManGenerator::endCodeFragment(const char *)
+void ManGenerator::endCodeFragment(const QCString &)
{
- if (!m_firstCol) t << endl;
- t << ".fi" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
m_firstCol=TRUE;
m_paragraph=FALSE;
m_col=0;
}
-void ManGenerator::startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool)
+void ManGenerator::startMemberDoc(const QCString &,const QCString &,const QCString &,const QCString &,int,int,bool)
{
- if (!m_firstCol) t << endl;
- t << ".SS \"";
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".SS \"";
m_firstCol=FALSE;
m_paragraph=FALSE;
}
-void ManGenerator::startDoxyAnchor(const char *,const char *manName,
- const char *, const char *name,
- const char *)
+void ManGenerator::startDoxyAnchor(const QCString &,const QCString &manName,
+ const QCString &, const QCString &name,
+ const QCString &)
{
// something to be done?
if( !Config_getBool(MAN_LINKS) )
@@ -433,68 +434,65 @@ void ManGenerator::startDoxyAnchor(const char *,const char *manName,
if (i!=-1) baseName=baseName.right(baseName.length()-i-2);
//printf("Converting man link '%s'->'%s'->'%s'\n",
- // name,baseName.data(),buildFileName(baseName).data());
+ // name,qPrint(baseName),qPrint(buildFileName(baseName)));
// - remove dangerous characters and append suffix, then add dir prefix
QCString fileName=dir()+"/"+buildFileName( baseName );
- QFile linkfile( fileName );
- // - only create file if it doesn't exist already
- if ( !linkfile.open( IO_ReadOnly ) )
+ FileInfo fi(fileName.str());
+ if (!fi.exists())
{
- if ( linkfile.open( IO_WriteOnly ) )
- {
- FTextStream linkstream;
- linkstream.setDevice(&linkfile);
- linkstream << ".so " << getSubdir() << "/" << buildFileName( manName ) << endl;
- }
+ std::ofstream linkStream(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (linkStream.is_open())
+ {
+ linkStream << ".so " << getSubdir() << "/" << buildFileName( manName ) << "\n";
+ }
}
- linkfile.close();
}
void ManGenerator::endMemberDoc(bool)
{
- t << "\"\n";
+ m_t << "\"\n";
}
void ManGenerator::startSubsection()
{
- if (!m_firstCol) t << endl;
- t << ".SS \"";
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".SS \"";
m_firstCol=FALSE;
m_paragraph=FALSE;
}
void ManGenerator::endSubsection()
{
- t << "\"";
+ m_t << "\"";
}
void ManGenerator::startSubsubsection()
{
- if (!m_firstCol) t << endl;
- t << "\n.SS \"";
+ if (!m_firstCol) m_t << "\n";
+ m_t << "\n.SS \"";
m_firstCol=FALSE;
m_paragraph=FALSE;
}
void ManGenerator::endSubsubsection()
{
- t << "\"";
+ m_t << "\"";
}
void ManGenerator::writeSynopsis()
{
- if (!m_firstCol) t << endl;
- t << ".SH SYNOPSIS\n.br\n.PP\n";
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".SH SYNOPSIS\n.br\n.PP\n";
m_firstCol=TRUE;
m_paragraph=FALSE;
}
void ManGenerator::startDescItem()
{
- if (!m_firstCol) t << endl;
- t << ".IP \"";
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".IP \"";
m_firstCol=FALSE;
}
@@ -506,9 +504,9 @@ void ManGenerator::startDescItem()
void ManGenerator::startDescForItem()
{
- if (!m_firstCol) t << endl;
- if (!m_paragraph) t << ".in -1c" << endl;
- t << ".in +1c" << endl;
+ if (!m_firstCol) m_t << "\n";
+ if (!m_paragraph) m_t << ".in -1c\n";
+ m_t << ".in +1c\n";
m_firstCol=TRUE;
m_paragraph=FALSE;
m_col=0;
@@ -520,7 +518,7 @@ void ManGenerator::endDescForItem()
void ManGenerator::endDescItem()
{
- t << "\" 1c" << endl;
+ m_t << "\" 1c\n";
m_firstCol=TRUE;
}
@@ -541,23 +539,23 @@ void ManGenerator::endAnonTypeScope(int indentLevel)
}
-void ManGenerator::startMemberItem(const char *,int,const char *)
+void ManGenerator::startMemberItem(const QCString &,int,const QCString &)
{
- if (m_firstCol && !m_insideTabbing) t << ".in +1c\n";
- t << "\n.ti -1c\n.RI \"";
+ if (m_firstCol && !m_insideTabbing) m_t << ".in +1c\n";
+ m_t << "\n.ti -1c\n.RI \"";
m_firstCol=FALSE;
}
void ManGenerator::endMemberItem()
{
- t << "\"\n.br";
+ m_t << "\"\n.br";
}
void ManGenerator::startMemberList()
{
if (!m_insideTabbing)
{
- t << "\n.in +1c"; m_firstCol=FALSE;
+ m_t << "\n.in +1c"; m_firstCol=FALSE;
}
}
@@ -565,18 +563,18 @@ void ManGenerator::endMemberList()
{
if (!m_insideTabbing)
{
- t << "\n.in -1c"; m_firstCol=FALSE;
+ m_t << "\n.in -1c"; m_firstCol=FALSE;
}
}
void ManGenerator::startMemberGroupHeader(bool)
{
- t << "\n.PP\n.RI \"\\fB";
+ m_t << "\n.PP\n.RI \"\\fB";
}
void ManGenerator::endMemberGroupHeader()
{
- t << "\\fP\"\n.br\n";
+ m_t << "\\fP\"\n.br\n";
m_firstCol=TRUE;
}
@@ -586,21 +584,21 @@ void ManGenerator::startMemberGroupDocs()
void ManGenerator::endMemberGroupDocs()
{
- t << "\n.PP";
+ m_t << "\n.PP";
}
void ManGenerator::startMemberGroup()
{
- t << "\n.in +1c";
+ m_t << "\n.in +1c";
}
void ManGenerator::endMemberGroup(bool)
{
- t << "\n.in -1c";
+ m_t << "\n.in -1c";
m_firstCol=FALSE;
}
-void ManGenerator::startSection(const char *,const char *,SectionType type)
+void ManGenerator::startSection(const QCString &,const QCString &,SectionType type)
{
if( !m_inHeader )
{
@@ -608,15 +606,15 @@ void ManGenerator::startSection(const char *,const char *,SectionType type)
{
case SectionType::Page: startGroupHeader(FALSE); break;
case SectionType::Section: startGroupHeader(FALSE); break;
- case SectionType::Subsection: startMemberHeader(0, -1); break;
- case SectionType::Subsubsection: startMemberHeader(0, -1); break;
- case SectionType::Paragraph: startMemberHeader(0, -1); break;
+ case SectionType::Subsection: startMemberHeader(QCString(), -1); break;
+ case SectionType::Subsubsection: startMemberHeader(QCString(), -1); break;
+ case SectionType::Paragraph: startMemberHeader(QCString(), -1); break;
default: ASSERT(0); break;
}
}
}
-void ManGenerator::endSection(const char *,SectionType type)
+void ManGenerator::endSection(const QCString &,SectionType type)
{
if( !m_inHeader )
{
@@ -632,7 +630,7 @@ void ManGenerator::endSection(const char *,SectionType type)
}
else
{
- t << "\n";
+ m_t << "\n";
m_firstCol=TRUE;
m_paragraph=FALSE;
m_inHeader=FALSE;
@@ -642,7 +640,7 @@ void ManGenerator::endSection(const char *,SectionType type)
void ManGenerator::startExamples()
{
if (!m_firstCol)
- { t << endl << ".PP" << endl;
+ { m_t << "\n" << ".PP\n";
m_firstCol=TRUE; m_paragraph=TRUE;
m_col=0;
}
@@ -657,10 +655,10 @@ void ManGenerator::endExamples()
{
}
-void ManGenerator::startDescTable(const char *title)
+void ManGenerator::startDescTable(const QCString &title)
{
if (!m_firstCol)
- { t << endl << ".PP" << endl;
+ { m_t << "\n.PP\n";
m_firstCol=TRUE; m_paragraph=TRUE;
m_col=0;
}
@@ -677,10 +675,10 @@ void ManGenerator::endDescTable()
endDescForItem();
}
-void ManGenerator::startParamList(ParamListTypes,const char *title)
+void ManGenerator::startParamList(ParamListTypes,const QCString &title)
{
if (!m_firstCol)
- { t << endl << ".PP" << endl;
+ { m_t << "\n.PP\n";
m_firstCol=TRUE; m_paragraph=TRUE;
m_col=0;
}
@@ -697,17 +695,17 @@ void ManGenerator::endParamList()
void ManGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *,int)
{
- ManDocVisitor *visitor = new ManDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""));
+ ManDocVisitor *visitor = new ManDocVisitor(m_t,*this,ctx?ctx->getDefFileExtension():QCString(""));
n->accept(visitor);
delete visitor;
m_firstCol=FALSE;
m_paragraph = FALSE;
}
-void ManGenerator::startConstraintList(const char *header)
+void ManGenerator::startConstraintList(const QCString &header)
{
if (!m_firstCol)
- { t << endl << ".PP" << endl;
+ { m_t << "\n.PP\n";
m_firstCol=TRUE; m_paragraph=TRUE;
m_col=0;
}
@@ -728,7 +726,7 @@ void ManGenerator::endConstraintParam()
{
endEmphasis();
endItemListItem();
- t << " : ";
+ m_t << " : ";
}
void ManGenerator::startConstraintType()
@@ -747,7 +745,7 @@ void ManGenerator::startConstraintDocs()
void ManGenerator::endConstraintDocs()
{
- t << endl; m_firstCol=TRUE;
+ m_t << "\n"; m_firstCol=TRUE;
}
void ManGenerator::endConstraintList()
@@ -759,14 +757,14 @@ void ManGenerator::startInlineHeader()
{
if (!m_firstCol)
{
- t << endl << ".PP" << endl << ".in -1c" << endl;
+ m_t << "\n.PP\n" << ".in -1c\n";
}
- t << ".RI \"\\fB";
+ m_t << ".RI \"\\fB";
}
void ManGenerator::endInlineHeader()
{
- t << "\\fP\"" << endl << ".in +1c" << endl;
+ m_t << "\\fP\"\n" << ".in +1c\n";
m_firstCol = FALSE;
}
@@ -774,9 +772,9 @@ void ManGenerator::startMemberDocSimple(bool isEnum)
{
if (!m_firstCol)
{
- t << endl << ".PP" << endl;
+ m_t << "\n.PP\n";
}
- t << "\\fB";
+ m_t << "\\fB";
if (isEnum)
{
docify(theTranslator->trEnumerationValues());
@@ -785,15 +783,15 @@ void ManGenerator::startMemberDocSimple(bool isEnum)
{
docify(theTranslator->trCompoundMembers());
}
- t << ":\\fP" << endl;
- t << ".RS 4" << endl;
+ m_t << ":\\fP\n";
+ m_t << ".RS 4\n";
}
void ManGenerator::endMemberDocSimple(bool)
{
- if (!m_firstCol) t << endl;
- t << ".RE" << endl;
- t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".RE\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -803,17 +801,17 @@ void ManGenerator::startInlineMemberType()
void ManGenerator::endInlineMemberType()
{
- t << " ";
+ m_t << " ";
}
void ManGenerator::startInlineMemberName()
{
- t << "\\fI";
+ m_t << "\\fI";
}
void ManGenerator::endInlineMemberName()
{
- t << "\\fP ";
+ m_t << "\\fP ";
}
void ManGenerator::startInlineMemberDoc()
@@ -822,9 +820,9 @@ void ManGenerator::startInlineMemberDoc()
void ManGenerator::endInlineMemberDoc()
{
- if (!m_firstCol) t << endl;
- t << ".br" << endl;
- t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".br\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -832,10 +830,10 @@ void ManGenerator::startLabels()
{
}
-void ManGenerator::writeLabel(const char *l,bool isLast)
+void ManGenerator::writeLabel(const QCString &l,bool isLast)
{
- t << "\\fC [" << l << "]\\fP";
- if (!isLast) t << ", ";
+ m_t << "\\fC [" << l << "]\\fP";
+ if (!isLast) m_t << ", ";
}
void ManGenerator::endLabels()
diff --git a/src/mangen.h b/src/mangen.h
index 052c5ee..c552580 100644
--- a/src/mangen.h
+++ b/src/mangen.h
@@ -20,8 +20,6 @@
#include "outputgen.h"
-class QFile;
-
/** Generator for Man page output. */
class ManGenerator : public OutputGenerator
{
@@ -37,27 +35,27 @@ class ManGenerator : public OutputGenerator
void writeDoc(DocNode *,const Definition *,const MemberDef *,int);
static void init();
- void startFile(const char *name,const char *manName,const char *title,int);
+ void startFile(const QCString &name,const QCString &manName,const QCString &title,int);
void writeSearchInfo() {}
- void writeFooter(const char *) {}
+ void writeFooter(const QCString &) {}
void endFile();
void clearBuffer();
void startIndexSection(IndexSections) {}
void endIndexSection(IndexSections) {}
- void writePageLink(const char *,bool) {}
+ void writePageLink(const QCString &,bool) {}
void startProjectNumber() {}
void endProjectNumber() {}
void writeStyleInfo(int) {}
- void startTitleHead(const char *) {}
- void endTitleHead(const char *,const char *);
+ void startTitleHead(const QCString &) {}
+ void endTitleHead(const QCString &,const QCString &);
void startTitle();
void endTitle();
void newParagraph();
- void startParagraph(const char *classDef);
+ void startParagraph(const QCString &classDef);
void endParagraph();
- void writeString(const char *text);
+ void writeString(const QCString &text);
void startIndexListItem() {}
void endIndexListItem() {}
void startIndexList() {}
@@ -65,34 +63,34 @@ class ManGenerator : public OutputGenerator
void startIndexKey() {}
void endIndexKey() {}
void startIndexValue(bool) {}
- void endIndexValue(const char *,bool) {}
+ void endIndexValue(const QCString &,bool) {}
void startItemList() {}
void endItemList() { newParagraph(); }
- void startIndexItem(const char *ref,const char *file);
- void endIndexItem(const char *ref,const char *file);
- void docify(const char *text);
- void codify(const char *text);
- void writeObjectLink(const char *ref,const char *file,
- const char *anchor,const char *name);
- void writeCodeLink(const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip);
- void writeTooltip(const char *, const DocLinkInfo &, const char *,
- const char *, const SourceLinkInfo &, const SourceLinkInfo &
+ void startIndexItem(const QCString &ref,const QCString &file);
+ void endIndexItem(const QCString &ref,const QCString &file);
+ void docify(const QCString &text);
+ void codify(const QCString &text);
+ void writeObjectLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name);
+ void writeCodeLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip);
+ void writeTooltip(const QCString &, const DocLinkInfo &, const QCString &,
+ const QCString &, const SourceLinkInfo &, const SourceLinkInfo &
) {}
- void startTextLink(const char *,const char *) {}
+ void startTextLink(const QCString &,const QCString &) {}
void endTextLink() {}
- void startHtmlLink(const char *url);
+ void startHtmlLink(const QCString &url);
void endHtmlLink();
- void startTypewriter() { t << "\\fC"; m_firstCol=FALSE; }
- void endTypewriter() { t << "\\fP"; m_firstCol=FALSE; }
+ void startTypewriter() { m_t << "\\fC"; m_firstCol=FALSE; }
+ void endTypewriter() { m_t << "\\fP"; m_firstCol=FALSE; }
void startGroupHeader(int);
void endGroupHeader(int);
void startMemberSections() {}
void endMemberSections() {}
void startHeaderSection() {}
void endHeaderSection();
- void startMemberHeader(const char *,int);
+ void startMemberHeader(const QCString &,int);
void endMemberHeader();
void insertMemberAlign(bool) {}
void insertMemberAlignLeft(int,bool){}
@@ -109,10 +107,12 @@ class ManGenerator : public OutputGenerator
void endInlineHeader();
void startAnonTypeScope(int);
void endAnonTypeScope(int);
- void startMemberItem(const char *,int,const char *);
+ void startMemberItem(const QCString &,int,const QCString &);
void endMemberItem();
void startMemberTemplateParams() {}
- void endMemberTemplateParams(const char *,const char *) {}
+ void endMemberTemplateParams(const QCString &,const QCString &) {}
+ void startCompoundTemplateParams() { startSubsubsection(); }
+ void endCompoundTemplateParams() { endSubsubsection(); }
void startMemberGroupHeader(bool);
void endMemberGroupHeader();
@@ -122,30 +122,30 @@ class ManGenerator : public OutputGenerator
void endMemberGroup(bool);
void writeRuler() {}
- void writeAnchor(const char *,const char *) {}
- void startCodeFragment(const char *);
- void endCodeFragment(const char *);
- void writeLineNumber(const char *,const char *,const char *,int l) { t << l << " "; m_col=0; }
+ void writeAnchor(const QCString &,const QCString &) {}
+ void startCodeFragment(const QCString &);
+ void endCodeFragment(const QCString &);
+ void writeLineNumber(const QCString &,const QCString &,const QCString &,int l) { m_t << l << " "; m_col=0; }
void startCodeLine(bool) {}
void endCodeLine() { codify("\n"); m_col=0; }
- void startEmphasis() { t << "\\fI"; m_firstCol=FALSE; }
- void endEmphasis() { t << "\\fP"; m_firstCol=FALSE; }
- void startBold() { t << "\\fB"; m_firstCol=FALSE; }
- void endBold() { t << "\\fP"; m_firstCol=FALSE; }
+ void startEmphasis() { m_t << "\\fI"; m_firstCol=FALSE; }
+ void endEmphasis() { m_t << "\\fP"; m_firstCol=FALSE; }
+ void startBold() { m_t << "\\fB"; m_firstCol=FALSE; }
+ void endBold() { m_t << "\\fP"; m_firstCol=FALSE; }
void startDescription() {}
void endDescription() {}
void startDescItem();
void endDescItem();
- void lineBreak(const char *) { t << "\n.br" << endl; }
+ void lineBreak(const QCString &) { m_t << "\n.br\n"; }
void writeChar(char c);
- void startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool);
+ void startMemberDoc(const QCString &,const QCString &,const QCString &,const QCString &,int,int,bool);
void endMemberDoc(bool);
- void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *);
- void endDoxyAnchor(const char *,const char *) {}
+ void startDoxyAnchor(const QCString &,const QCString &,const QCString &,const QCString &,const QCString &);
+ void endDoxyAnchor(const QCString &,const QCString &) {}
void writeLatexSpacing() {}
- void writeStartAnnoItem(const char *type,const char *file,
- const char *path,const char *name);
- void writeEndAnnoItem(const char *) { t << endl; m_firstCol=TRUE; }
+ void writeStartAnnoItem(const QCString &type,const QCString &file,
+ const QCString &path,const QCString &name);
+ void writeEndAnnoItem(const QCString &) { m_t << "\n"; m_firstCol=TRUE; }
void startSubsection();
void endSubsection();
void startSubsubsection();
@@ -154,49 +154,49 @@ class ManGenerator : public OutputGenerator
void endCenter() {}
void startSmall() {}
void endSmall() {}
- void startMemberDescription(const char *,const char *,bool) { t << "\n.RI \""; m_firstCol=FALSE; }
- void endMemberDescription() { t << "\""; m_firstCol=FALSE; }
+ void startMemberDescription(const QCString &,const QCString &,bool) { m_t << "\n.RI \""; m_firstCol=FALSE; }
+ void endMemberDescription() { m_t << "\""; m_firstCol=FALSE; }
void startMemberDeclaration() {}
- void endMemberDeclaration(const char *,const char *) {}
- void writeInheritedSectionTitle(const char *,const char *,const char *,
- const char *,const char *,const char *) {}
+ void endMemberDeclaration(const QCString &,const QCString &) {}
+ void writeInheritedSectionTitle(const QCString &,const QCString &,const QCString &,
+ const QCString &,const QCString &,const QCString &) {}
void startDescList(SectionTypes);
void endDescList() {}
void startExamples();
void endExamples();
- void startParamList(ParamListTypes,const char *title);
+ void startParamList(ParamListTypes,const QCString &title);
void endParamList();
//void writeDescItem();
void startDescForItem();
void endDescForItem();
- void startSection(const char *,const char *,SectionType);
- void endSection(const char *,SectionType);
- void addIndexItem(const char *,const char *) {}
+ void startSection(const QCString &,const QCString &,SectionType);
+ void endSection(const QCString &,SectionType);
+ void addIndexItem(const QCString &,const QCString &) {}
void startIndent() {}
void endIndent() {}
void writeSynopsis();
void startClassDiagram() {}
- void endClassDiagram(const ClassDiagram &,const char *,const char *) {}
+ void endClassDiagram(const ClassDiagram &,const QCString &,const QCString &) {}
void startPageRef() {}
- void endPageRef(const char *,const char *) {}
+ void endPageRef(const QCString &,const QCString &) {}
void startQuickIndices() {}
void endQuickIndices() {}
- void writeSplitBar(const char *) {}
- void writeNavigationPath(const char *) {}
+ void writeSplitBar(const QCString &) {}
+ void writeNavigationPath(const QCString &) {}
void writeLogo() {}
- void writeQuickLinks(bool,HighlightedItem,const char *) {}
- void writeSummaryLink(const char *,const char *,const char *,bool) {}
+ void writeQuickLinks(bool,HighlightedItem,const QCString &) {}
+ void writeSummaryLink(const QCString &,const QCString &,const QCString &,bool) {}
void startContents() {}
void endContents() {}
- void writeNonBreakableSpace(int n) { int i; for (i=0;i<n;i++) t << " "; }
+ void writeNonBreakableSpace(int n) { int i; for (i=0;i<n;i++) m_t << " "; }
- void startDescTable(const char *t);
+ void startDescTable(const QCString &t);
void endDescTable();
void startDescTableRow() {}
void endDescTableRow() {}
void startDescTableTitle() { startItemListItem(); startBold(); startEmphasis(); endItemListItem(); }
void endDescTableTitle() { endEmphasis(); endBold(); }
- void startDescTableData() { t << endl; m_firstCol=TRUE; }
+ void startDescTableData() { m_t << "\n"; m_firstCol=TRUE; }
void endDescTableData() {}
void startDotGraph() {}
@@ -219,18 +219,18 @@ class ManGenerator : public OutputGenerator
void endMemberDocPrefixItem() {}
void startMemberDocName(bool) {}
void endMemberDocName() {}
- void startParameterType(bool,const char *) {}
+ void startParameterType(bool,const QCString &) {}
void endParameterType() {}
void startParameterName(bool) {}
void endParameterName(bool,bool,bool) {}
void startParameterList(bool) {}
void endParameterList() {}
- void exceptionEntry(const char*,bool) {}
+ void exceptionEntry(const QCString &,bool) {}
- void startFontClass(const char *) {}
+ void startFontClass(const QCString &) {}
void endFontClass() {}
- void startConstraintList(const char *);
+ void startConstraintList(const QCString &);
void startConstraintParam();
void endConstraintParam();
void startConstraintType();
@@ -249,12 +249,12 @@ class ManGenerator : public OutputGenerator
void endInlineMemberDoc();
void startLabels();
- void writeLabel(const char *l,bool isLast);
+ void writeLabel(const QCString &l,bool isLast);
void endLabels();
- void writeCodeAnchor(const char *) {}
- void setCurrentDoc(const Definition *,const char *,bool) {}
- void addWord(const char *,bool) {}
+ void writeCodeAnchor(const QCString &) {}
+ void setCurrentDoc(const Definition *,const QCString &,bool) {}
+ void addWord(const QCString &,bool) {}
private:
bool m_firstCol = true;
diff --git a/src/markdown.cpp b/src/markdown.cpp
index eaa9ef7..8426c36 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -32,10 +32,10 @@
*/
#include <stdio.h>
-#include <qfileinfo.h>
#include <unordered_map>
#include <functional>
+#include <atomic>
#include "markdown.h"
#include "growbuf.h"
@@ -50,6 +50,8 @@
#include "message.h"
#include "portable.h"
#include "regex.h"
+#include "fileinfo.h"
+#include "utf8.h"
#if !defined(NDEBUG)
#define ENABLE_TRACING
@@ -67,22 +69,22 @@
class Trace
{
public:
- Trace(const char *func) : m_func(func)
+ Trace(const QCString &func) : m_func(func)
{
if (Debug::isFlagSet(Debug::Markdown))
{
- fprintf(IOSTREAM,"> %s\n",func);
+ fprintf(IOSTREAM,"> %s\n",qPrint(func));
s_indent++;
}
}
- Trace(const char *func,const char *data) : m_func(func)
+ Trace(const QCString &func,const QCString &data) : m_func(func)
{
if (Debug::isFlagSet(Debug::Markdown))
{
indent();
char data_s[DATA_BUFSIZE*2+1] = ""; // worst case each input char outputs 2 chars + 0 terminator.
int j=0;
- if (data)
+ if (!data.isEmpty())
{
for (int i=0;i<DATA_BUFSIZE;i++)
{
@@ -96,7 +98,7 @@ class Trace
}
}
data_s[j++]=0;
- fprintf(IOSTREAM,"> %s data=[%s…]\n",func,data_s);
+ fprintf(IOSTREAM,"> %s data=[%s…]\n",qPrint(func),data_s);
s_indent++;
}
}
@@ -106,7 +108,7 @@ class Trace
{
s_indent--;
indent();
- fprintf(IOSTREAM,"< %s\n",m_func);
+ fprintf(IOSTREAM,"< %s\n",qPrint(m_func));
}
}
void trace(const char *fmt,...)
@@ -114,7 +116,7 @@ class Trace
if (Debug::isFlagSet(Debug::Markdown))
{
indent();
- fprintf(IOSTREAM,": %s: ",m_func);
+ fprintf(IOSTREAM,": %s: ",qPrint(m_func));
va_list args;
va_start(args,fmt);
vfprintf(IOSTREAM, fmt, args);
@@ -123,7 +125,7 @@ class Trace
}
private:
void indent() { for (int i=0;i<s_indent;i++) fputs(" ",IOSTREAM); }
- const char *m_func;
+ QCString m_func;
static int s_indent;
};
@@ -171,7 +173,7 @@ struct TableCell
bool colSpan;
};
-Markdown::Markdown(const char *fileName,int lineNr,int indentLevel)
+Markdown::Markdown(const QCString &fileName,int lineNr,int indentLevel)
: m_fileName(fileName), m_lineNr(lineNr), m_indentLevel(indentLevel)
{
using namespace std::placeholders;
@@ -215,10 +217,10 @@ inline int isNewline(const char *data)
// escape double quotes in string
static QCString escapeDoubleQuotes(const QCString &s)
{
- TRACE(s.data());
- if (s.isEmpty()) return "";
+ TRACE(s);
+ if (s.isEmpty()) return s;
GrowBuf growBuf;
- const char *p=s;
+ const char *p=s.data();
char c,pc='\0';
while ((c=*p++))
{
@@ -235,11 +237,11 @@ static QCString escapeDoubleQuotes(const QCString &s)
// escape characters that have a special meaning later on.
static QCString escapeSpecialChars(const QCString &s)
{
- TRACE(s.data());
- if (s.isEmpty()) return "";
+ TRACE(s);
+ if (s.isEmpty()) return s;
bool insideQuote=FALSE;
GrowBuf growBuf;
- const char *p=s;
+ const char *p=s.data();
char c,pc='\0';
while ((c=*p++))
{
@@ -261,7 +263,7 @@ static QCString escapeSpecialChars(const QCString &s)
static void convertStringFragment(QCString &result,const char *data,int size)
{
- TRACE(result.data());
+ TRACE(result);
if (size<0) size=0;
result.resize(size+1);
memcpy(result.rawData(),data,size);
@@ -433,7 +435,7 @@ int Markdown::findEmphasisChar(const char *data, int size, char c, int c_size)
if ((data[i]=='\\' || data[i]=='@') && // command
data[i-1]!='\\' && data[i-1]!='@') // not escaped
{
- if (qstrncmp(&data[i+1],endBlockName,l)==0)
+ if (qstrncmp(&data[i+1],endBlockName.data(),l)==0)
{
break;
}
@@ -695,13 +697,13 @@ int Markdown::processHtmlTagWrite(const char *data,int offset,int size,bool doWr
{
if (data[i]=='/' && i<size-1 && data[i+1]=='>') // <bla/>
{
- //printf("Found htmlTag={%s}\n",QCString(data).left(i+2).data());
+ //printf("Found htmlTag={%s}\n",qPrint(QCString(data).left(i+2)));
if (doWrite) m_out.addStr(data,i+2);
return i+2;
}
else if (data[i]=='>') // <bla>
{
- //printf("Found htmlTag={%s}\n",QCString(data).left(i+1).data());
+ //printf("Found htmlTag={%s}\n",qPrint(QCString(data).left(i+1)));
if (doWrite) m_out.addStr(data,i+1);
return i+1;
}
@@ -721,7 +723,7 @@ int Markdown::processHtmlTagWrite(const char *data,int offset,int size,bool doWr
}
else if (!insideAttr && data[i]=='>') // found end of tag
{
- //printf("Found htmlTag={%s}\n",QCString(data).left(i+1).data());
+ //printf("Found htmlTag={%s}\n",qPrint(QCString(data).left(i+1)));
if (doWrite) m_out.addStr(data,i+1);
return i+1;
}
@@ -860,7 +862,7 @@ int Markdown::processLink(const char *data,int,int size)
if (i>=size) return 0; // premature end of comment -> no link
contentEnd=i;
convertStringFragment(content,data+contentStart,contentEnd-contentStart);
- //printf("processLink: content={%s}\n",content.data());
+ //printf("processLink: content={%s}\n",qPrint(content));
if (!isImageLink && content.isEmpty()) return 0; // no link text
i++; // skip over ]
@@ -909,7 +911,7 @@ int Markdown::processLink(const char *data,int,int size)
if (i>=size || data[i]=='\n') return 0;
convertStringFragment(link,data+linkStart,i-linkStart);
link = link.stripWhiteSpace();
- //printf("processLink: link={%s}\n",link.data());
+ //printf("processLink: link={%s}\n",qPrint(link));
if (link.isEmpty()) return 0;
if (link.at(link.length()-1)=='>') link=link.left(link.length()-1);
@@ -939,7 +941,7 @@ int Markdown::processLink(const char *data,int,int size)
if (data[titleEnd]==c) // found it
{
convertStringFragment(title,data+titleStart,titleEnd-titleStart);
- //printf("processLink: title={%s}\n",title.data());
+ //printf("processLink: title={%s}\n",qPrint(title));
}
else
{
@@ -966,7 +968,7 @@ int Markdown::processLink(const char *data,int,int size)
if (i>=size) return 0;
// extract link
convertStringFragment(link,data+linkStart,i-linkStart);
- //printf("processLink: link={%s}\n",link.data());
+ //printf("processLink: link={%s}\n",qPrint(link));
link = link.stripWhiteSpace();
if (link.isEmpty()) // shortcut link
{
@@ -979,11 +981,11 @@ int Markdown::processLink(const char *data,int,int size)
{
link = lr_it->second.link;
title = lr_it->second.title;
- //printf("processLink: ref: link={%s} title={%s}\n",link.data(),title.data());
+ //printf("processLink: ref: link={%s} title={%s}\n",qPrint(link),qPrint(title));
}
else // reference not found!
{
- //printf("processLink: ref {%s} do not exist\n",link.lower().data());
+ //printf("processLink: ref {%s} do not exist\n",link.qPrint(lower()));
return 0;
}
i++;
@@ -992,7 +994,7 @@ int Markdown::processLink(const char *data,int,int size)
{
QCString content_lower = content.lower();
auto lr_it = m_linkRefs.find(content_lower.str());
- //printf("processLink: minimal link {%s} lr=%p",content.data(),lr);
+ //printf("processLink: minimal link {%s} lr=%p",qPrint(content),lr);
if (lr_it!=m_linkRefs.end()) // found it
{
link = lr_it->second.link;
@@ -1068,16 +1070,16 @@ int Markdown::processLink(const char *data,int,int size)
m_out.addStr("@ref ");
if (!(Portable::isAbsolutePath(link) || isURL(link)))
{
- QFileInfo forg(link);
+ FileInfo forg(link.str());
if (forg.exists() && forg.isReadable())
{
- link = forg.absFilePath().data();
+ link = forg.absFilePath();
}
else if (!(forg.exists() && forg.isReadable()))
{
- QFileInfo fi(m_fileName);
- QCString mdFile = m_fileName.left(m_fileName.length()-fi.fileName().length()) + link;
- QFileInfo fmd(mdFile);
+ FileInfo fi(m_fileName.str());
+ QCString mdFile = m_fileName.left(m_fileName.length()-(uint)fi.fileName().length()) + link;
+ FileInfo fmd(mdFile.str());
if (fmd.exists() && fmd.isReadable())
{
link = fmd.absFilePath().data();
@@ -1111,12 +1113,12 @@ int Markdown::processLink(const char *data,int,int size)
}
m_out.addStr(">");
content = content.simplifyWhiteSpace();
- processInline(content,content.length());
+ processInline(content.data(),content.length());
m_out.addStr("</a>");
}
else // avoid link to e.g. F[x](y)
{
- //printf("no link for '%s'\n",link.data());
+ //printf("no link for '%s'\n",qPrint(link));
return 0;
}
}
@@ -1184,7 +1186,7 @@ int Markdown::processCodeSpan(const char *data, int /*offset*/, int size)
f_end--;
}
- //printf("found code span '%s'\n",QCString(data+f_begin).left(f_end-f_begin).data());
+ //printf("found code span '%s'\n",qPrint(QCString(data+f_begin).left(f_end-f_begin)));
/* real code span */
if (f_begin < f_end)
@@ -1226,7 +1228,7 @@ int Markdown::processSpecialCommand(const char *data, int offset, int size)
if ((data[i]=='\\' || data[i]=='@') && // command
data[i-1]!='\\' && data[i-1]!='@') // not escaped
{
- if (qstrncmp(&data[i+1],endBlockName,l)==0)
+ if (qstrncmp(&data[i+1],endBlockName.data(),l)==0)
{
//printf("found end at %d\n",i);
addStrEscapeUtf8Nbsp(data,i+1+l);
@@ -1363,7 +1365,7 @@ static int isLinkRef(const char *data,int size,
if (i>=size || data[i]!=']') return 0;
convertStringFragment(refid,data+refIdStart,i-refIdStart);
if (refid.isEmpty()) return 0;
- //printf(" isLinkRef: found refid='%s'\n",refid.data());
+ //printf(" isLinkRef: found refid='%s'\n",qPrint(refid));
i++;
if (i>=size || data[i]!=':') return 0;
i++;
@@ -1384,7 +1386,7 @@ static int isLinkRef(const char *data,int size,
if (i<size && data[i]=='>') i++;
if (linkStart==linkEnd) return 0; // empty link
convertStringFragment(link,data+linkStart,linkEnd-linkStart);
- //printf(" isLinkRef: found link='%s'\n",link.data());
+ //printf(" isLinkRef: found link='%s'\n",qPrint(link));
if (link=="@ref" || link=="\\ref")
{
int argStart=i;
@@ -1429,7 +1431,7 @@ static int isLinkRef(const char *data,int size,
{
convertStringFragment(title,data+titleStart,end-titleStart);
}
- //printf(" title found: '%s'\n",title.data());
+ //printf(" title found: '%s'\n",qPrint(title));
}
while (i<size && data[i]==' ') i++;
//printf("end of isLinkRef: i=%d size=%d data[i]='%c' eol=%d\n",
@@ -1469,7 +1471,7 @@ static int isHRuler(const char *data,int size)
static QCString extractTitleId(QCString &title, int level)
{
- TRACE(title.data());
+ TRACE(title);
// match e.g. '{#id-b11} ' and capture 'id-b11'
static const reg::Ex r2(R"({#(\a[\w-]*)}\s*$)");
reg::Match match;
@@ -1478,7 +1480,7 @@ static QCString extractTitleId(QCString &title, int level)
{
std::string id = match[1].str();
title = title.left((int)match.position());
- //printf("found match id='%s' title=%s\n",id.c_str(),title.data());
+ //printf("found match id='%s' title=%s\n",id.c_str(),qPrint(title));
return id;
}
if ((level > 0) && (level <= Config_getInt(TOC_INCLUDE_HEADINGS)))
@@ -1486,10 +1488,10 @@ static QCString extractTitleId(QCString &title, int level)
static AtomicInt autoId { 0 };
QCString id;
id.sprintf("autotoc_md%d",autoId++);
- //printf("auto-generated id='%s' title='%s'\n",id.data(),title.data());
+ //printf("auto-generated id='%s' title='%s'\n",qPrint(id),qPrint(title));
return id;
}
- //printf("no id found in title '%s'\n",title.data());
+ //printf("no id found in title '%s'\n",qPrint(title));
return "";
}
@@ -1639,7 +1641,7 @@ static int computeIndentExcludingListMarkers(const char *data,int size)
}
indent++,i++;
}
- //printf("{%s}->%d\n",QCString(data).left(size).data(),indent);
+ //printf("{%s}->%d\n",QCString(data).qPrint(left(size)),indent);
return indent;
}
@@ -1729,8 +1731,8 @@ static bool isCodeBlock(const char *data,int offset,int size,int &indent)
{
//printf(" positions: nl_pos=[%d,%d,%d] line[-2]='%s' line[-1]='%s'\n",
// nl_pos[0],nl_pos[1],nl_pos[2],
- // QCString(data+nl_pos[1]).left(nl_pos[0]-nl_pos[1]-1).data(),
- // QCString(data+nl_pos[2]).left(nl_pos[1]-nl_pos[2]-1).data());
+ // qPrint(QCString(data+nl_pos[1]).left(nl_pos[0]-nl_pos[1]-1)),
+ // qPrint(QCString(data+nl_pos[2]).left(nl_pos[1]-nl_pos[2]-1)));
// check that line -1 is empty
if (!isEmptyLine(data+nl_pos[1],nl_pos[0]-nl_pos[1]-1))
@@ -2175,7 +2177,7 @@ int Markdown::writeCodeBlock(const char *data,int size,int refIndent)
{
TRACE(data);
int i=0,end;
- //printf("writeCodeBlock: data={%s}\n",QCString(data).left(size).data());
+ //printf("writeCodeBlock: data={%s}\n",qPrint(QCString(data).left(size)));
// no need for \ilinebr here as the previous line was empty and was skipped
m_out.addStr("@verbatim\n");
int emptyLines=0;
@@ -2188,7 +2190,7 @@ int Markdown::writeCodeBlock(const char *data,int size,int refIndent)
int indent=0;
while (j<end && data[j]==' ') j++,indent++;
//printf("j=%d end=%d indent=%d refIndent=%d tabSize=%d data={%s}\n",
- // j,end,indent,refIndent,Config_getInt(TAB_SIZE),QCString(data+i).left(end-i-1).data());
+ // j,end,indent,refIndent,Config_getInt(TAB_SIZE),qPrint(QCString(data+i).left(end-i-1)));
if (j==end-1) // empty line
{
emptyLines++;
@@ -2252,10 +2254,10 @@ void Markdown::findEndOfLine(const char *data,int size,
data[end-1]!='\\' && data[end-1]!='@'
)
{
- if (qstrncmp(&data[end+1],endBlockName,l)==0)
+ if (qstrncmp(&data[end+1],endBlockName.data(),l)==0)
{
// found end marker, skip over this block
- //printf("feol.block m_out={%s}\n",QCString(data+i).left(end+l+1-i).data());
+ //printf("feol.block m_out={%s}\n",qPrint(QCString(data+i).left(end+l+1-i)));
end = end + l + 2;
break;
}
@@ -2295,7 +2297,7 @@ void Markdown::findEndOfLine(const char *data,int size,
}
}
if (j>0) end+=j-1;
- //printf("findEndOfLine pi=%d i=%d end=%d {%s}\n",pi,i,end,QCString(data+i).left(end-i).data());
+ //printf("findEndOfLine pi=%d i=%d end=%d {%s}\n",pi,i,end,qPrint(QCString(data+i).left(end-i)));
}
void Markdown::writeFencedCodeBlock(const char *data,const char *lng,
@@ -2315,7 +2317,7 @@ void Markdown::writeFencedCodeBlock(const char *data,const char *lng,
QCString Markdown::processQuotations(const QCString &s,int refIndent)
{
- TRACE(s.data());
+ TRACE(s);
m_out.clear();
const char *data = s.data();
int size = s.length();
@@ -2331,7 +2333,7 @@ QCString Markdown::processQuotations(const QCString &s,int refIndent)
{
if (isFencedCodeBlock(data+pi,size-pi,refIndent,lang,blockStart,blockEnd,blockOffset))
{
- writeFencedCodeBlock(data+pi,lang,blockStart,blockEnd);
+ writeFencedCodeBlock(data+pi,lang.data(),blockStart,blockEnd);
i=pi+blockOffset;
pi=-1;
end=i+1;
@@ -2367,14 +2369,14 @@ QCString Markdown::processQuotations(const QCString &s,int refIndent)
m_out.addChar(0);
//printf("Process quotations\n---- input ----\n%s\n---- output ----\n%s\n------------\n",
- // s.data(),m_out.get());
+ // qPrint(s),m_out.get());
return m_out.get();
}
QCString Markdown::processBlocks(const QCString &s,int indent)
{
- TRACE(s.data());
+ TRACE(s);
m_out.clear();
const char *data = s.data();
int size = s.length();
@@ -2439,7 +2441,7 @@ QCString Markdown::processBlocks(const QCString &s,int indent)
if ((data[i]=='\\' || data[i]=='@') && // command
data[i-1]!='\\' && data[i-1]!='@') // not escaped
{
- if (qstrncmp(&data[i+1],endBlockName,l)==0)
+ if (qstrncmp(&data[i+1],endBlockName.data(),l)==0)
{
m_out.addChar(data[i]);
m_out.addStr(endBlockName);
@@ -2459,7 +2461,7 @@ QCString Markdown::processBlocks(const QCString &s,int indent)
QCString header;
convertStringFragment(header,data+pi,i-pi-1);
id = extractTitleId(header, level);
- //printf("header='%s' is='%s'\n",header.data(),id.data());
+ //printf("header='%s' is='%s'\n",qPrint(header),qPrint(id));
if (!header.isEmpty())
{
if (!id.isEmpty())
@@ -2489,7 +2491,7 @@ QCString Markdown::processBlocks(const QCString &s,int indent)
else if ((ref=isLinkRef(data+pi,size-pi,id,link,title)))
{
//printf("found link ref: id='%s' link='%s' title='%s'\n",
- // id.data(),link.data(),title.data());
+ // qPrint(id),qPrint(link),qPrint(title));
m_linkRefs.insert({id.lower().str(),LinkRef(link,title)});
i=ref+pi;
pi=-1;
@@ -2498,8 +2500,8 @@ QCString Markdown::processBlocks(const QCString &s,int indent)
else if (isFencedCodeBlock(data+pi,size-pi,indent,lang,blockStart,blockEnd,blockOffset))
{
//printf("Found FencedCodeBlock lang='%s' start=%d end=%d code={%s}\n",
- // lang.data(),blockStart,blockEnd,QCString(data+pi+blockStart).left(blockEnd-blockStart).data());
- writeFencedCodeBlock(data+pi,lang,blockStart,blockEnd);
+ // qPrint(lang),blockStart,blockEnd,QCString(data+pi+blockStart).left(blockEnd-blockStart).data());
+ writeFencedCodeBlock(data+pi,lang.data(),blockStart,blockEnd);
i=pi+blockOffset;
pi=-1;
end=i+1;
@@ -2534,7 +2536,7 @@ QCString Markdown::processBlocks(const QCString &s,int indent)
if (isLinkRef(data+pi,size-pi,id,link,title))
{
//printf("found link ref: id='%s' link='%s' title='%s'\n",
- // id.data(),link.data(),title.data());
+ // qPrint(id),qPrint(link),qPrint(title));
m_linkRefs.insert({id.lower().str(),LinkRef(link,title)});
}
else
@@ -2550,7 +2552,7 @@ QCString Markdown::processBlocks(const QCString &s,int indent)
/** returns TRUE if input string docs starts with \@page or \@mainpage command */
static bool isExplicitPage(const QCString &docs)
{
- TRACE(docs.data());
+ TRACE(docs);
int i=0;
const char *data = docs.data();
if (data)
@@ -2573,7 +2575,7 @@ static bool isExplicitPage(const QCString &docs)
QCString Markdown::extractPageTitle(QCString &docs,QCString &id, int &prepend)
{
- TRACE(docs.data());
+ TRACE(docs);
// first first non-empty line
prepend = 0;
QCString title;
@@ -2616,13 +2618,13 @@ QCString Markdown::extractPageTitle(QCString &docs,QCString &id, int &prepend)
docs=docs_org;
id = extractTitleId(title, 0);
}
- //printf("extractPageTitle(title='%s' docs='%s' id='%s')\n",title.data(),docs.data(),id.data());
+ //printf("extractPageTitle(title='%s' docs='%s' id='%s')\n",qPrint(title),qPrint(docs),qPrint(id));
return title;
}
QCString Markdown::detab(const QCString &s,int &refIndent)
{
- TRACE(s.data());
+ TRACE(s);
int tabSize = Config_getInt(TAB_SIZE);
int size = s.length();
m_out.clear();
@@ -2657,23 +2659,21 @@ QCString Markdown::detab(const QCString &s,int &refIndent)
if (c<0 && i<size) // multibyte sequence
{
// special handling of the UTF-8 nbsp character 0xC2 0xA0
- if ((uchar)c == 0xC2 && (uchar)(data[i]) == 0xA0)
+ int nb = isUTF8NonBreakableSpace(data);
+ if (nb>0)
{
m_out.addStr(g_doxy_nsbp);
- i++;
+ i+=nb-1;
}
else
{
- m_out.addChar(c);
- m_out.addChar(data[i++]); // >= 2 bytes
- if (((uchar)c&0xE0)==0xE0 && i<size)
- {
- m_out.addChar(data[i++]); // 3 bytes
- }
- if (((uchar)c&0xF0)==0xF0 && i<size)
+ int bytes = getUTF8CharNumBytes(c);
+ for (int j=0;j<bytes-1 && c;j++)
{
- m_out.addChar(data[i++]); // 4 byres
+ m_out.addChar(c);
+ c = data[i++];
}
+ m_out.addChar(c);
}
}
else
@@ -2701,19 +2701,19 @@ QCString Markdown::process(const QCString &input, int &startNewlines)
QCString s = input;
if (s.at(s.length()-1)!='\n') s += "\n"; // see PR #6766
s = detab(s,refIndent);
- //printf("======== DeTab =========\n---- output -----\n%s\n---------\n",s.data());
+ //printf("======== DeTab =========\n---- output -----\n%s\n---------\n",qPrint(s));
// then process quotation blocks (as these may contain other blocks)
s = processQuotations(s,refIndent);
- //printf("======== Quotations =========\n---- output -----\n%s\n---------\n",s.data());
+ //printf("======== Quotations =========\n---- output -----\n%s\n---------\n",qPrint(s));
// then process block items (headers, rules, and code blocks, references)
s = processBlocks(s,refIndent);
- //printf("======== Blocks =========\n---- output -----\n%s\n---------\n",s.data());
+ //printf("======== Blocks =========\n---- output -----\n%s\n---------\n",qPrint(s));
// finally process the inline markup (links, emphasis and code spans)
m_out.clear();
- processInline(s,s.length());
+ processInline(s.data(),s.length());
m_out.addChar(0);
Debug::print(Debug::Markdown,0,"======== Markdown =========\n---- input ------- \n%s\n---- output -----\n%s\n=========\n",qPrint(input),qPrint(m_out.get()));
@@ -2729,7 +2729,7 @@ QCString Markdown::process(const QCString &input, int &startNewlines)
if (p>result.data())
{
// strip part of the input
- result = result.mid(p-result.data());
+ result = result.mid(static_cast<int>(p-result.data()));
}
return result;
}
@@ -2738,8 +2738,9 @@ QCString Markdown::process(const QCString &input, int &startNewlines)
QCString markdownFileNameToId(const QCString &fileName)
{
- TRACE(fileName.data());
- QCString baseFn = stripFromPath(QFileInfo(fileName).absFilePath().utf8());
+ TRACE(fileName);
+ std::string absFileName = FileInfo(fileName.str()).absFilePath();
+ QCString baseFn = stripFromPath(absFileName.c_str());
int i = baseFn.findRev('.');
if (i!=-1) baseFn = baseFn.left(i);
QCString baseName = baseFn;
@@ -2769,7 +2770,7 @@ MarkdownOutlineParser::~MarkdownOutlineParser()
{
}
-void MarkdownOutlineParser::parseInput(const char *fileName,
+void MarkdownOutlineParser::parseInput(const QCString &fileName,
const char *fileBuf,
const std::shared_ptr<Entry> &root,
ClangTUParser* /*clangParser*/)
@@ -2787,7 +2788,7 @@ void MarkdownOutlineParser::parseInput(const char *fileName,
if (id.startsWith("autotoc_md")) id = "";
int indentLevel=title.isEmpty() ? 0 : -1;
markdown.setIndentLevel(indentLevel);
- QCString fn = QFileInfo(fileName).fileName().utf8();
+ QCString fn = FileInfo(fileName.str()).fileName();
QCString titleFn = stripExtensionGeneral(fn,getFileNameExtension(fn));
QCString mdfileAsMainPage = Config_getString(USE_MDFILE_AS_MAINPAGE);
bool wasEmpty = id.isEmpty();
@@ -2796,8 +2797,8 @@ void MarkdownOutlineParser::parseInput(const char *fileName,
{
if (!mdfileAsMainPage.isEmpty() &&
(fn==mdfileAsMainPage || // name reference
- QFileInfo(fileName).absFilePath()==
- QFileInfo(mdfileAsMainPage).absFilePath()) // file reference with path
+ FileInfo(fileName.str()).absFilePath()==
+ FileInfo(mdfileAsMainPage.str()).absFilePath()) // file reference with path
)
{
docs.prepend("@anchor " + id + "\\ilinebr ");
@@ -2854,7 +2855,7 @@ void MarkdownOutlineParser::parseInput(const char *fileName,
p->commentScanner.leaveFile(fileName,lineNr);
}
-void MarkdownOutlineParser::parsePrototype(const char *text)
+void MarkdownOutlineParser::parsePrototype(const QCString &text)
{
Doxygen::parserManager->getOutlineParser("*.cpp")->parsePrototype(text);
}
diff --git a/src/markdown.h b/src/markdown.h
index dd4ff73..afed003 100644
--- a/src/markdown.h
+++ b/src/markdown.h
@@ -18,7 +18,7 @@
#include <functional>
-#include <qcstring.h>
+#include "qcstring.h"
#include "parserintf.h"
#include "growbuf.h"
@@ -32,7 +32,7 @@ QCString markdownFileNameToId(const QCString &fileName);
class Markdown
{
public:
- Markdown(const char *fileName,int lineNr,int indentLevel=0);
+ Markdown(const QCString &fileName,int lineNr,int indentLevel=0);
QCString process(const QCString &input, int &startNewlines);
QCString extractPageTitle(QCString &docs,QCString &id,int &prepend);
void setIndentLevel(int level) { m_indentLevel = level; }
@@ -73,7 +73,7 @@ class Markdown
private:
struct LinkRef
{
- LinkRef(const char *l,const char *t) : link(l), title(t) {}
+ LinkRef(const QCString &l,const QCString &t) : link(l), title(t) {}
QCString link;
QCString title;
};
@@ -93,12 +93,12 @@ class MarkdownOutlineParser : public OutlineParserInterface
public:
MarkdownOutlineParser();
virtual ~MarkdownOutlineParser();
- void parseInput(const char *fileName,
+ void parseInput(const QCString &fileName,
const char *fileBuf,
const std::shared_ptr<Entry> &root,
ClangTUParser *clangParser);
bool needsPreprocessing(const QCString &) const { return FALSE; }
- void parsePrototype(const char *text);
+ void parsePrototype(const QCString &text);
private:
struct Private;
std::unique_ptr<Private> p;
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index 81520a2..243f3fb 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -50,11 +50,11 @@
class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
{
public:
- MemberDefImpl(const char *defFileName,int defLine,int defColumn,
- const char *type,const char *name,const char *args,
- const char *excp,Protection prot,Specifier virt,bool stat,
+ MemberDefImpl(const QCString &defFileName,int defLine,int defColumn,
+ const QCString &type,const QCString &name,const QCString &args,
+ const QCString &excp,Protection prot,Specifier virt,bool stat,
Relationship related,MemberType t,const ArgumentList &tal,
- const ArgumentList &al,const char *metaData);
+ const ArgumentList &al,const QCString &metaData);
virtual ~MemberDefImpl();
virtual DefType definitionType() const { return TypeMember; }
@@ -65,13 +65,13 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
virtual QCString getOutputFileBase() const;
virtual QCString getReference() const;
virtual QCString anchor() const;
- virtual const char *declaration() const;
- virtual const char *definition() const;
- virtual const char *typeString() const;
- virtual const char *argsString() const;
- virtual const char *excpString() const;
- virtual const char *bitfieldString() const;
- virtual const char *extraTypeChars() const;
+ virtual QCString declaration() const;
+ virtual QCString definition() const;
+ virtual QCString typeString() const;
+ virtual QCString argsString() const;
+ virtual QCString excpString() const;
+ virtual QCString bitfieldString() const;
+ virtual QCString extraTypeChars() const;
virtual const QCString &initializer() const;
virtual int initializerLines() const;
virtual uint64 getMemberSpecifiers() const;
@@ -82,10 +82,10 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
virtual const NamespaceDef* getNamespaceDef() const;
virtual const GroupDef *getGroupDef() const;
virtual ClassDef *accessorClass() const;
- virtual const char *getReadAccessor() const;
- virtual const char *getWriteAccessor() const;
+ virtual QCString getReadAccessor() const;
+ virtual QCString getWriteAccessor() const;
virtual Grouping::GroupPri_t getGroupPri() const;
- virtual const char *getGroupFileName() const;
+ virtual QCString getGroupFileName() const;
virtual int getGroupStartLine() const;
virtual bool getGroupHasDocs() const;
virtual QCString qualifiedName() const;
@@ -93,7 +93,7 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
virtual Protection protection() const;
virtual Specifier virtualness(int count=0) const;
virtual MemberType memberType() const;
- virtual QCString memberTypeName() const;
+ virtual QCString memberTypeName() const;
virtual bool isSignal() const;
virtual bool isSlot() const;
virtual bool isVariable() const;
@@ -227,8 +227,9 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
virtual const MemberDef *categoryRelation() const;
virtual QCString displayName(bool=TRUE) const;
virtual QCString getDeclType() const;
- virtual void getLabels(QStrList &sl,const Definition *container) const;
+ virtual StringVector getLabels(const Definition *container) const;
virtual const ArgumentList &typeConstraints() const;
+ virtual QCString requiresClause() const;
virtual QCString documentation() const;
virtual QCString briefDescription(bool abbr=FALSE) const;
virtual QCString fieldType() const;
@@ -237,28 +238,28 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
virtual int getDeclLine() const;
virtual int getDeclColumn() const;
virtual void setMemberType(MemberType t);
- virtual void setDefinition(const char *d);
+ virtual void setDefinition(const QCString &d);
virtual void setFileDef(const FileDef *fd);
virtual void setAnchor();
virtual void setProtection(Protection p);
virtual void setMemberSpecifiers(uint64 s);
virtual void mergeMemberSpecifiers(uint64 s);
- virtual void setInitializer(const char *i);
- virtual void setBitfields(const char *s);
+ virtual void setInitializer(const QCString &i);
+ virtual void setBitfields(const QCString &s);
virtual void setMaxInitLines(int lines);
virtual void setMemberClass(const ClassDef *cd);
virtual void setSectionList(const Definition *container,const MemberList *sl);
virtual void setGroupDef(const GroupDef *gd,Grouping::GroupPri_t pri,
const QCString &fileName,int startLine,bool hasDocs,
MemberDef *member=0);
- virtual void setReadAccessor(const char *r);
- virtual void setWriteAccessor(const char *w);
+ virtual void setReadAccessor(const QCString &r);
+ virtual void setWriteAccessor(const QCString &w);
virtual void setTemplateSpecialization(bool b);
virtual void makeRelated();
virtual void makeForeign();
virtual void setInheritsDocsFrom(const MemberDef *md);
virtual void setTagInfo(const TagInfo *i);
- virtual void setArgsString(const char *as);
+ virtual void setArgsString(const QCString &as);
virtual void setReimplements(const MemberDef *md);
virtual void insertReimplementedBy(const MemberDef *md);
virtual void setRelatedAlso(ClassDef *cd);
@@ -267,7 +268,7 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
virtual void setEnumClassScope(const ClassDef *cd);
virtual void setDocumentedEnumValues(bool value);
virtual void setAnonymousEnumType(const MemberDef *md);
- virtual bool addExample(const char *anchor,const char *name,const char *file);
+ virtual bool addExample(const QCString &anchor,const QCString &name,const QCString &file);
virtual void setPrototype(bool p,const QCString &df,int line, int column);
virtual void setExplicitExternal(bool b,const QCString &df,int line,int column);
virtual void setDeclFile(const QCString &df,int line,int column);
@@ -275,8 +276,8 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
virtual void moveDeclArgumentList(std::unique_ptr<ArgumentList> al);
virtual void setDefinitionTemplateParameterLists(const ArgumentLists &lists);
virtual void setTypeConstraints(const ArgumentList &al);
- virtual void setType(const char *t);
- virtual void setAccessorType(ClassDef *cd,const char *t);
+ virtual void setType(const QCString &t);
+ virtual void setAccessorType(ClassDef *cd,const QCString &t);
virtual void setNamespace(const NamespaceDef *nd);
virtual void setMemberGroup(MemberGroup *grp);
virtual void setMemberGroupId(int id);
@@ -300,22 +301,23 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
virtual void copyArgumentNames(const MemberDef *bmd);
virtual void setCategory(ClassDef *);
virtual void setCategoryRelation(const MemberDef *);
- virtual void setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace=TRUE);
- virtual void setBriefDescription(const char *b,const char *briefFile,int briefLine);
- virtual void setInbodyDocumentation(const char *d,const char *inbodyFile,int inbodyLine);
+ virtual void setDocumentation(const QCString &d,const QCString &docFile,int docLine,bool stripWhiteSpace=TRUE);
+ virtual void setBriefDescription(const QCString &b,const QCString &briefFile,int briefLine);
+ virtual void setInbodyDocumentation(const QCString &d,const QCString &inbodyFile,int inbodyLine);
virtual void setHidden(bool b);
+ virtual void setRequiresClause(const QCString &req);
virtual void incrementFlowKeyWordCount();
virtual void writeDeclaration(OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
- bool inGroup, const ClassDef *inheritFrom=0,const char *inheritId=0) const;
+ bool inGroup, const ClassDef *inheritFrom=0,const QCString &inheritId=QCString()) const;
virtual void writeDocumentation(const MemberList *ml,int memCount,int memTotal,OutputList &ol,
- const char *scopeName,const Definition *container,
+ const QCString &scopeName,const Definition *container,
bool inGroup,bool showEnumValues=FALSE,bool
showInline=FALSE) const;
virtual void writeMemberDocSimple(OutputList &ol,const Definition *container) const;
virtual void writeEnumDeclaration(OutputList &typeDecl,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd) const;
- virtual void writeTagFile(FTextStream &) const;
+ virtual void writeTagFile(TextStream &) const;
virtual void warnIfUndocumented() const;
virtual void warnIfUndocumentedParams() const;
virtual void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const;
@@ -344,6 +346,8 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
const QCString &cname) const;
void _writeCategoryRelation(OutputList &ol) const;
void _writeTagData(const DefType) const;
+ void _writeTemplatePrefix(OutputList &ol, const Definition *def,
+ const ArgumentList &al, bool writeReqClause=true) const;
static int s_indentLevel;
@@ -360,11 +364,11 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
uchar m_isDestructorCached; // 1 = not cached, 1=FALSE, 2=TRUE
};
-MemberDefMutable *createMemberDef(const char *defFileName,int defLine,int defColumn,
- const char *type,const char *name,const char *args,
- const char *excp,Protection prot,Specifier virt,bool stat,
+MemberDefMutable *createMemberDef(const QCString &defFileName,int defLine,int defColumn,
+ const QCString &type,const QCString &name,const QCString &args,
+ const QCString &excp,Protection prot,Specifier virt,bool stat,
Relationship related,MemberType t,const ArgumentList &tal,
- const ArgumentList &al,const char *metaData)
+ const ArgumentList &al,const QCString &metaData)
{
return new MemberDefImpl(defFileName,defLine,defColumn,type,name,args,excp,prot,virt,
stat,related,t,tal,al,metaData);
@@ -397,19 +401,19 @@ class MemberDefAliasImpl : public DefinitionAliasMixin<MemberDef>
{ return getMdAlias()->getReference(); }
virtual QCString anchor() const
{ return getMdAlias()->anchor(); }
- virtual const char *declaration() const
+ virtual QCString declaration() const
{ return getMdAlias()->declaration(); }
- virtual const char *definition() const
+ virtual QCString definition() const
{ return getMdAlias()->definition(); }
- virtual const char *typeString() const
+ virtual QCString typeString() const
{ return getMdAlias()->typeString(); }
- virtual const char *argsString() const
+ virtual QCString argsString() const
{ return getMdAlias()->argsString(); }
- virtual const char *excpString() const
+ virtual QCString excpString() const
{ return getMdAlias()->excpString(); }
- virtual const char *bitfieldString() const
+ virtual QCString bitfieldString() const
{ return getMdAlias()->bitfieldString(); }
- virtual const char *extraTypeChars() const
+ virtual QCString extraTypeChars() const
{ return getMdAlias()->extraTypeChars(); }
virtual const QCString &initializer() const
{ return getMdAlias()->initializer(); }
@@ -429,15 +433,15 @@ class MemberDefAliasImpl : public DefinitionAliasMixin<MemberDef>
{ return getMdAlias()->getNamespaceDef(); }
virtual const ClassDef *accessorClass() const
{ return getMdAlias()->accessorClass(); }
- virtual const char *getReadAccessor() const
+ virtual QCString getReadAccessor() const
{ return getMdAlias()->getReadAccessor(); }
- virtual const char *getWriteAccessor() const
+ virtual QCString getWriteAccessor() const
{ return getMdAlias()->getWriteAccessor(); }
virtual const GroupDef *getGroupDef() const
{ return getMdAlias()->getGroupDef(); }
virtual Grouping::GroupPri_t getGroupPri() const
{ return getMdAlias()->getGroupPri(); }
- virtual const char *getGroupFileName() const
+ virtual QCString getGroupFileName() const
{ return getMdAlias()->getGroupFileName(); }
virtual int getGroupStartLine() const
{ return getMdAlias()->getGroupStartLine(); }
@@ -717,8 +721,8 @@ class MemberDefAliasImpl : public DefinitionAliasMixin<MemberDef>
{ return getMdAlias()->displayName(b); }
virtual QCString getDeclType() const
{ return getMdAlias()->getDeclType(); }
- virtual void getLabels(QStrList &sl,const Definition *container) const
- { return getMdAlias()->getLabels(sl,container); }
+ virtual StringVector getLabels(const Definition *container) const
+ { return getMdAlias()->getLabels(container); }
virtual const ArgumentList &typeConstraints() const
{ return getMdAlias()->typeConstraints(); }
virtual QCString documentation() const
@@ -735,6 +739,8 @@ class MemberDefAliasImpl : public DefinitionAliasMixin<MemberDef>
{ return getMdAlias()->getDeclLine(); }
virtual int getDeclColumn() const
{ return getMdAlias()->getDeclColumn(); }
+ virtual QCString requiresClause() const
+ { return getMdAlias()->requiresClause(); }
virtual void warnIfUndocumented() const {}
virtual void warnIfUndocumentedParams() const {}
@@ -746,7 +752,7 @@ class MemberDefAliasImpl : public DefinitionAliasMixin<MemberDef>
virtual void writeDeclaration(OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
- bool inGroup, const ClassDef *inheritFrom=0,const char *inheritId=0) const
+ bool inGroup, const ClassDef *inheritFrom=0,const QCString &inheritId=QCString()) const
{
getMdAlias()->writeDeclaration(ol,cd,nd,fd,gd,inGroup,inheritFrom,inheritId);
}
@@ -763,7 +769,7 @@ class MemberDefAliasImpl : public DefinitionAliasMixin<MemberDef>
MemberDef *createMemberDefAlias(const Definition *newScope,const MemberDef *aliasMd)
{
MemberDef *amd = new MemberDefAliasImpl(newScope,aliasMd);
- //printf("amd: name=%s displayName=%s\n",amd->name().data(),amd->displayName().data());
+ //printf("amd: name=%s displayName=%s\n",qPrint(amd->name()),qPrint(amd->displayName()));
return amd;
}
@@ -792,18 +798,18 @@ static QCString addTemplateNames(const QCString &s,const QCString &n,const QCStr
uint j=clRealName.length()+i;
if (s.length()==j || (s.at(j)!='<' && !isId(s.at(j))))
{ // add template names
- //printf("Adding %s+%s\n",clRealName.data(),t.data());
+ //printf("Adding %s+%s\n",qPrint(clRealName),qPrint(t));
result+=clRealName+t;
}
else
{ // template names already present
- //printf("Adding %s\n",clRealName.data());
+ //printf("Adding %s\n",qPrint(clRealName));
result+=clRealName;
}
p=i+clRealName.length();
}
result+=s.right(s.length()-p);
- //printf("addTemplateNames(%s,%s,%s)=%s\n",s.data(),n.data(),t.data(),result.data());
+ //printf("addTemplateNames(%s,%s,%s)=%s\n",qPrint(s),qPrint(n),qPrint(t),qPrint(result));
return result;
}
@@ -844,7 +850,7 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
{
const ArgumentList &defArgList=(md->isDocsForDefinition()) ?
md->argumentList() : md->declArgumentList();
- //printf("writeDefArgumentList '%s' isDocsForDefinition()=%d\n",md->name().data(),md->isDocsForDefinition());
+ //printf("writeDefArgumentList '%s' isDocsForDefinition()=%d\n",qPrint(md->name()),md->isDocsForDefinition());
if (!defArgList.hasParameters() || md->isProperty() || md->isTypedef())
{
return FALSE; // member has no function like argument list
@@ -877,7 +883,7 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
ol.endMemberDocName();
}
ol.popGeneratorState();
- //printf("===> name=%s isDefine=%d\n",md->name().data(),md->isDefine());
+ //printf("===> name=%s isDefine=%d\n",qPrint(md->name()),md->isDefine());
QCString cName;
if (scope)
@@ -888,20 +894,20 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
if (il!=-1 && ir!=-1 && ir>il)
{
cName=cName.mid(il,ir-il+1);
- //printf("1. cName=%s\n",cName.data());
+ //printf("1. cName=%s\n",qPrint(cName));
}
else if (scope->definitionType()==Definition::TypeClass)
{
cName=tempArgListToString((toClassDef(scope))->templateArguments(),
scope->getLanguage());
- //printf("2. cName=%s\n",cName.data());
+ //printf("2. cName=%s\n",qPrint(cName));
}
else // no template specifier
{
cName.resize(0);
}
}
- //printf("~~~ %s cName=%s\n",md->name().data(),cName.data());
+ //printf("~~~ %s cName=%s\n",qPrint(md->name()),qPrint(cName));
bool first=TRUE;
bool paramTypeStarted=FALSE;
@@ -912,7 +918,7 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
Argument a = *alIt;
if (isDefine || first)
{
- ol.startParameterType(first,0);
+ ol.startParameterType(first,QCString());
paramTypeStarted=TRUE;
if (isDefine)
{
@@ -991,7 +997,7 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
QCString key;
if (md->isObjCMethod() && a.attrib.length()>=2)
{
- //printf("Found parameter keyword %s\n",a.attrib.data());
+ //printf("Found parameter keyword %s\n",a.qPrint(attrib));
// strip [ and ]
key=a.attrib.mid(1,a.attrib.length()-2);
if (key!=",") key+=":"; // for normal keywords add colon
@@ -1023,7 +1029,7 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
if (first) ol.startParameterName(defArgList.size()<2);
ol.endParameterName(TRUE,defArgList.size()<2,!md->isObjCMethod());
ol.popGeneratorState();
- if (md->extraTypeChars())
+ if (!md->extraTypeChars().isEmpty())
{
ol.docify(md->extraTypeChars());
}
@@ -1061,7 +1067,7 @@ static void writeExceptionListImpl(
OutputList &ol, const ClassDef *cd, const MemberDef *md, QCString const& exception)
{
// this is ordinary exception spec - there must be a '('
- //printf("exception='%s'\n",exception.data());
+ //printf("exception='%s'\n",qPrint(exception));
int index = exception.find('(');
if (index!=-1)
{
@@ -1072,7 +1078,7 @@ static void writeExceptionListImpl(
++comma; // include comma
linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md,
exception.mid(index,comma-index));
- ol.exceptionEntry(0,false);
+ ol.exceptionEntry(QCString(),false);
index=comma;
comma = exception.find(',', index);
}
@@ -1081,7 +1087,7 @@ static void writeExceptionListImpl(
{
QCString type=removeRedundantWhiteSpace(exception.mid(index,close-index));
linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md,type);
- ol.exceptionEntry(0,true);
+ ol.exceptionEntry(QCString(),true);
}
else
{
@@ -1119,26 +1125,6 @@ static void writeExceptionList(OutputList &ol, const ClassDef *cd, const MemberD
}
}
-static void writeTemplatePrefix(OutputList &ol,const ArgumentList &al)
-{
- ol.docify("template<");
- for (auto it = al.begin(); it!=al.end();)
- {
- Argument a = *it;
- ol.docify(a.type);
- ol.docify(" ");
- ol.docify(a.name);
- if (a.defval.length()!=0)
- {
- ol.docify(" = ");
- ol.docify(a.defval);
- }
- ++it;
- if (it!=al.end()) ol.docify(", ");
- }
- ol.docify("> ");
-}
-
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
@@ -1148,10 +1134,10 @@ class MemberDefImpl::IMPL
public:
IMPL();
~IMPL();
- void init(Definition *def,const char *t,const char *a,const char *e,
+ void init(Definition *def,const QCString &t,const QCString &a,const QCString &e,
Protection p,Specifier v,bool s,Relationship r,
MemberType mt,const ArgumentList &tal,
- const ArgumentList &al,const char *meta
+ const ArgumentList &al,const QCString &meta
);
const ClassDef *classDef = 0; // member of or related to
@@ -1189,6 +1175,7 @@ class MemberDefImpl::IMPL
QCString initializer; // initializer
QCString extraTypeChars; // extra type info found after the argument list
QCString enumBaseType; // base type of the enum (C++11)
+ QCString requiresClause; // requires clause (C++20)
int initLines = 0; // number of lines in the initializer
uint64 memSpec = 0; // The specifiers present for this member
@@ -1280,10 +1267,10 @@ MemberDefImpl::IMPL::~IMPL()
}
void MemberDefImpl::IMPL::init(Definition *d,
- const char *t,const char *a,const char *e,
+ const QCString &t,const QCString &a,const QCString &e,
Protection p,Specifier v,bool s,Relationship r,
MemberType mt,const ArgumentList &tal,
- const ArgumentList &al,const char *meta
+ const ArgumentList &al,const QCString &meta
)
{
classDef=0;
@@ -1342,8 +1329,8 @@ void MemberDefImpl::IMPL::init(Definition *d,
if (!args.isEmpty())
{
declArgList = *stringToArgumentList(d->getLanguage(),args,&extraTypeChars);
- //printf("setDeclArgList %s to %s const=%d\n",args.data(),
- // argListToString(declArgList).data(),declArgList->constSpecifier);
+ //printf("setDeclArgList %s to %s const=%d\n",qPrint(args),
+ // qPrint(argListToString(declArgList)),declArgList->constSpecifier);
}
metaData = meta;
templateMaster = 0;
@@ -1387,10 +1374,10 @@ void MemberDefImpl::IMPL::init(Definition *d,
* \param meta Slice metadata.
*/
-MemberDefImpl::MemberDefImpl(const char *df,int dl,int dc,
- const char *t,const char *na,const char *a,const char *e,
+MemberDefImpl::MemberDefImpl(const QCString &df,int dl,int dc,
+ const QCString &t,const QCString &na,const QCString &a,const QCString &e,
Protection p,Specifier v,bool s,Relationship r,MemberType mt,
- const ArgumentList &tal,const ArgumentList &al,const char *meta
+ const ArgumentList &tal,const ArgumentList &al,const QCString &meta
) : DefinitionMixin(df,dl,dc,removeRedundantWhiteSpace(na))
{
//printf("MemberDefImpl::MemberDef(%s)\n",na);
@@ -1506,9 +1493,9 @@ void MemberDefImpl::insertEnumField(const MemberDef *md)
m_impl->enumFields.push_back(md);
}
-bool MemberDefImpl::addExample(const char *anchor,const char *nameStr, const char *file)
+bool MemberDefImpl::addExample(const QCString &anchor,const QCString &nameStr, const QCString &file)
{
- //printf("%s::addExample(%s,%s,%s)\n",name().data(),anchor,nameStr,file);
+ //printf("%s::addExample(%s,%s,%s)\n",qPrint(name()),anchor,nameStr,file);
return m_impl->examples.inSort(Example(anchor,nameStr,file));
}
@@ -1524,7 +1511,7 @@ QCString MemberDefImpl::getOutputFileBase() const
QCString baseName;
//printf("Member: %s: templateMaster=%p group=%p classDef=%p nspace=%p fileDef=%p\n",
- // name().data(),m_impl->templateMaster,m_impl->group,m_impl->classDef,
+ // qPrint(name()),m_impl->templateMaster,m_impl->group,m_impl->classDef,
// m_impl->nspace,m_impl->fileDef);
const NamespaceDef *nspace = getNamespaceDef();
const FileDef *fileDef = getFileDef();
@@ -1643,7 +1630,7 @@ void MemberDefImpl::_computeLinkableInProject()
static bool extractStatic = Config_getBool(EXTRACT_STATIC);
static bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
m_isLinkableCached = 2; // linkable
- //printf("MemberDefImpl::isLinkableInProject(name=%s)\n",name().data());
+ //printf("MemberDefImpl::isLinkableInProject(name=%s)\n",qPrint(name()));
if (isHidden())
{
//printf("is hidden\n");
@@ -1716,19 +1703,19 @@ void MemberDefImpl::_computeLinkableInProject()
return; // linkable!
}
-void MemberDefImpl::setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace)
+void MemberDefImpl::setDocumentation(const QCString &d,const QCString &docFile,int docLine,bool stripWhiteSpace)
{
DefinitionMixin::setDocumentation(d,docFile,docLine,stripWhiteSpace);
m_isLinkableCached = 0;
}
-void MemberDefImpl::setBriefDescription(const char *b,const char *briefFile,int briefLine)
+void MemberDefImpl::setBriefDescription(const QCString &b,const QCString &briefFile,int briefLine)
{
DefinitionMixin::setBriefDescription(b,briefFile,briefLine);
m_isLinkableCached = 0;
}
-void MemberDefImpl::setInbodyDocumentation(const char *d,const char *inbodyFile,int inbodyLine)
+void MemberDefImpl::setInbodyDocumentation(const QCString &d,const QCString &inbodyFile,int inbodyLine)
{
DefinitionMixin::setInbodyDocumentation(d,inbodyFile,inbodyLine);
m_isLinkableCached = 0;
@@ -1827,8 +1814,8 @@ void MemberDefImpl::writeLink(OutputList &ol,
*/
ClassDef *MemberDefImpl::getClassDefOfAnonymousType() const
{
- //printf("%s:getClassDefOfAnonymousType() cache=%s\n",name().data(),
- // m_impl->cachedAnonymousType?m_impl->cachedAnonymousType->name().data():"<empty>");
+ //printf("%s:getClassDefOfAnonymousType() cache=%s\n",qPrint(name()),
+ // m_impl->cachedAnonymousType?qPrint(m_impl->cachedAnonymousType->name()):"<empty>");
if (m_impl->cachedAnonymousType) return m_impl->cachedAnonymousType;
QCString cname;
@@ -1888,9 +1875,9 @@ bool MemberDefImpl::isBriefSectionVisible() const
static bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS);
//printf("Member %s grpId=%d docs=%s file=%s args=%s\n",
- // name().data(),
+ // qPrint(name()),
// 0,"", //grpId,grpId==-1?"<none>":Doxygen::memberDocDict[grpId]->data(),
- // "", //getFileDef()->name().data(),
+ // "", //qPrint(getFileDef()->name()),
// argsString());
auto it = Doxygen::memberGroupInfoMap.find(m_impl->grpId);
@@ -1898,7 +1885,7 @@ bool MemberDefImpl::isBriefSectionVisible() const
if (it!=Doxygen::memberGroupInfoMap.end())
{
auto &info = it->second;
- //printf("name=%s m_impl->grpId=%d info=%p\n",name().data(),m_impl->grpId,info);
+ //printf("name=%s m_impl->grpId=%d info=%p\n",qPrint(name()),m_impl->grpId,info);
//QCString *pMemGrp = Doxygen::memberDocDict[grpId];
hasDocs = hasDocs ||
// part of a documented member group
@@ -2008,11 +1995,51 @@ QCString MemberDefImpl::getDeclType() const
return ltype;
}
+void MemberDefImpl::_writeTemplatePrefix(OutputList &ol, const Definition *def,
+ const ArgumentList &al, bool writeReqClause) const
+{
+ ol.docify("template<");
+ for (auto it = al.begin(); it!=al.end();)
+ {
+ Argument a = *it;
+ linkifyText(TextGeneratorOLImpl(ol), // out
+ def, // scope
+ getFileDef(), // fileScope
+ this, // self
+ a.type, // text
+ FALSE // autoBreak
+ );
+ ol.docify(" ");
+ ol.docify(a.name);
+ if (a.defval.length()!=0)
+ {
+ ol.docify(" = ");
+ ol.docify(a.defval);
+ }
+ ++it;
+ if (it!=al.end()) ol.docify(", ");
+ }
+ ol.docify("> ");
+ if (writeReqClause && !m_impl->requiresClause.isEmpty())
+ {
+ ol.lineBreak();
+ ol.docify("requires ");
+ linkifyText(TextGeneratorOLImpl(ol), // out
+ def, // scope
+ getFileDef(), // fileScope
+ this, // self
+ m_impl->requiresClause, // text
+ FALSE // autoBreak
+ );
+ }
+}
+
+
void MemberDefImpl::writeDeclaration(OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
- bool inGroup, const ClassDef *inheritedFrom,const char *inheritId) const
+ bool inGroup, const ClassDef *inheritedFrom,const QCString &inheritId) const
{
- //printf("%s MemberDefImpl::writeDeclaration() inGroup=%d\n",qualifiedName().data(),inGroup);
+ //printf("%s MemberDefImpl::writeDeclaration() inGroup=%d\n",qPrint(qualifiedName()),inGroup);
// hide enum value, since they appear already as part of the enum, unless they
// are explicitly grouped.
@@ -2042,7 +2069,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
// start a new member declaration
bool isAnonType = annoClassDef || m_impl->annMemb || m_impl->annEnumType;
- ///printf("startMemberItem for %s\n",name().data());
+ ///printf("startMemberItem for %s\n",qPrint(name()));
ol.startMemberItem(anchor(),
isAnonType ? 1 : !m_impl->tArgList.empty() ? 3 : 0,
inheritId
@@ -2086,10 +2113,11 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
if (m_impl->tArgList.hasParameters() && getLanguage()==SrcLangExt_Cpp)
{
if (!isAnonType) ol.startMemberTemplateParams();
- writeTemplatePrefix(ol,m_impl->tArgList);
+ _writeTemplatePrefix(ol,d,m_impl->tArgList);
if (!isAnonType) ol.endMemberTemplateParams(anchor(),inheritId);
}
+
// *** write type
QCString ltype(m_impl->type);
if (isTypedef() && getLanguage() != SrcLangExt_Slice)
@@ -2111,7 +2139,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
int i = (int)match.position();
int l = (int)match.length();
//printf("annoClassDef=%p annMemb=%p scopeName='%s' anonymous='%s'\n",
- // annoClassDef,annMemb,cname.data(),ltype.mid(i,l).data());
+ // annoClassDef,annMemb,qPrint(cname),qPrint(ltype.mid(i,l)));
if (annoClassDef) // type is an anonymous compound
{
@@ -2127,7 +2155,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
ol.writeNonBreakableSpace(3);
}
QCString varName=ltype.right(ltype.length()-ir).stripWhiteSpace();
- //printf(">>>>>> ltype='%s' varName='%s'\n",ltype.data(),varName.data());
+ //printf(">>>>>> ltype='%s' varName='%s'\n",qPrint(ltype),qPrint(varName));
ol.docify("}");
if (varName.isEmpty() && isAnonymous())
{
@@ -2217,7 +2245,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
static bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
static bool extractStatic = Config_getBool(EXTRACT_STATIC);
MemberDefMutable *annMemb = toMemberDefMutable(m_impl->annMemb);
- //printf("Member name=`%s gd=%p md->groupDef=%p inGroup=%d isLinkable()=%d hasDocumentation=%d\n",name().data(),gd,getGroupDef(),inGroup,isLinkable(),hasDocumentation());
+ //printf("Member name=`%s gd=%p md->groupDef=%p inGroup=%d isLinkable()=%d hasDocumentation=%d\n",qPrint(name()),gd,getGroupDef(),inGroup,isLinkable(),hasDocumentation());
if (!name().isEmpty() && // name valid
(hasDocumentation() || isReference()) && // has docs
!(m_impl->prot==Private && !extractPrivate && (m_impl->virt==Normal || !extractPrivateVirtual) && m_impl->mtype!=MemberType_Friend) && // hidden due to protection
@@ -2237,7 +2265,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
}
else
{
- //printf("writeLink %s->%d\n",name.data(),hasDocumentation());
+ //printf("writeLink %s->%d\n",qPrint(name),hasDocumentation());
const ClassDef *rcd = cd;
if (isReference() && getClassDef()) rcd = getClassDef();
writeLink(ol,rcd,nd,fd,gd);
@@ -2285,7 +2313,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
}
// *** write arguments
- if (argsString() && !isObjCMethod())
+ if (!argsString().isEmpty() && !isObjCMethod())
{
if (!isDefine() && !isTypedef()) ol.writeString(" ");
linkifyText(TextGeneratorOLImpl(ol), // out
@@ -2293,9 +2321,9 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
getBodyDef(), // fileScope
this, // self
isDefine() ?
- (const char*)substitute(argsString(),",",", ") :
+ substitute(argsString(),",",", ") :
isTypedef() ?
- (const char*)substitute(argsString(),")(",") (") :
+ substitute(argsString(),")(",") (") :
argsString(), // text
m_impl->annMemb, // autoBreak
TRUE, // external
@@ -2304,7 +2332,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
);
}
// *** write exceptions
- if (excpString())
+ if (!excpString().isEmpty())
{
ol.writeString(" ");
ol.docify(excpString());
@@ -2355,23 +2383,26 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
ol.writeLatexSpacing();
ol.startTypewriter();
ol.docify(" [");
- QStrList sl;
+ StringVector sl;
- if (isGettable()) sl.append("get");
- if (isProtectedGettable()) sl.append("protected get");
- if (isSettable()) sl.append("set");
- if (isProtectedSettable()) sl.append("protected set");
+ if (isGettable()) sl.push_back("get");
+ if (isProtectedGettable()) sl.push_back("protected get");
+ if (isSettable()) sl.push_back("set");
+ if (isProtectedSettable()) sl.push_back("protected set");
if (extractPrivate)
{
- if (isPrivateGettable()) sl.append("private get");
- if (isPrivateSettable()) sl.append("private set");
+ if (isPrivateGettable()) sl.push_back("private get");
+ if (isPrivateSettable()) sl.push_back("private set");
}
- const char *s=sl.first();
- while (s)
+ bool first=true;
+ for (const auto &s : sl)
{
- ol.docify(s);
- s=sl.next();
- if (s) ol.docify(", ");
+ if (!first)
+ {
+ ol.docify(", ");
+ first=false;
+ }
+ ol.docify(s.c_str());
}
ol.docify("]");
ol.endTypewriter();
@@ -2382,16 +2413,19 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
ol.writeLatexSpacing();
ol.startTypewriter();
ol.docify(" [");
- QStrList sl;
- if (isAddable()) sl.append("add");
- if (isRemovable()) sl.append("remove");
- if (isRaisable()) sl.append("raise");
- const char *s=sl.first();
- while (s)
+ StringVector sl;
+ if (isAddable()) sl.push_back("add");
+ if (isRemovable()) sl.push_back("remove");
+ if (isRaisable()) sl.push_back("raise");
+ bool first=true;
+ for (const auto &s : sl)
{
- ol.docify(s);
- s=sl.next();
- if (s) ol.docify(", ");
+ if (!first)
+ {
+ ol.docify(", ");
+ first=false;
+ }
+ ol.docify(s.c_str());
}
ol.docify("]");
ol.endTypewriter();
@@ -2403,7 +2437,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
}
//printf("endMember %s annoClassDef=%p annEnumType=%p\n",
- // name().data(),annoClassDef,annEnumType);
+ // qPrint(name()),annoClassDef,annEnumType);
ol.endMemberItem();
if (endAnonScopeNeeded)
{
@@ -2418,7 +2452,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
{
DocRoot *rootNode = validatingParseDoc(briefFile(),briefLine(),
getOuterScope()?getOuterScope():d,this,briefDescription(),TRUE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
if (rootNode && !rootNode->isEmpty())
{
@@ -2530,12 +2564,13 @@ bool MemberDefImpl::isDetailedSectionVisible(bool inGroup,bool inFile) const
!isReference();
bool result = visible || simpleFilter;
//printf("%s::isDetailedSectionVisible: %d groupFilter=%d fileFilter=%d\n",
- // name().data(),result,groupFilter,fileFilter);
+ // qPrint(name()),result,groupFilter,fileFilter);
return result;
}
-void MemberDefImpl::getLabels(QStrList &sl,const Definition *container) const
+StringVector MemberDefImpl::getLabels(const Definition *container) const
{
+ StringVector sl;
static bool inlineInfo = Config_getBool(INLINE_INFO);
Specifier lvirt=virtualness();
@@ -2559,82 +2594,82 @@ void MemberDefImpl::getLabels(QStrList &sl,const Definition *container) const
static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
if (optVhdl)
{
- sl.append(theTranslator->trVhdlType(getMemberSpecifiers(),TRUE));
+ sl.push_back(theTranslator->trVhdlType(getMemberSpecifiers(),TRUE).str());
}
else
{
- if (isFriend()) sl.append("friend");
- else if (isRelated()) sl.append("related");
+ if (isFriend()) sl.push_back("friend");
+ else if (isRelated()) sl.push_back("related");
else
{
- if (isExternal()) sl.append("extern");
- if (inlineInfo && isInline()) sl.append("inline");
- if (isExplicit()) sl.append("explicit");
- if (isMutable()) sl.append("mutable");
- if (isStatic()) sl.append("static");
- if (isGettable()) sl.append("get");
- if (isProtectedGettable()) sl.append("protected get");
- if (isSettable()) sl.append("set");
- if (isProtectedSettable()) sl.append("protected set");
+ if (isExternal()) sl.push_back("extern");
+ if (inlineInfo && isInline()) sl.push_back("inline");
+ if (isExplicit()) sl.push_back("explicit");
+ if (isMutable()) sl.push_back("mutable");
+ if (isStatic()) sl.push_back("static");
+ if (isGettable()) sl.push_back("get");
+ if (isProtectedGettable()) sl.push_back("protected get");
+ if (isSettable()) sl.push_back("set");
+ if (isProtectedSettable()) sl.push_back("protected set");
if (extractPrivate)
{
- if (isPrivateGettable()) sl.append("private get");
- if (isPrivateSettable()) sl.append("private set");
+ if (isPrivateGettable()) sl.push_back("private get");
+ if (isPrivateSettable()) sl.push_back("private set");
}
- if (isConstExpr()) sl.append("constexpr");
- if (isAddable()) sl.append("add");
- if (!isUNOProperty() && isRemovable()) sl.append("remove");
- if (isRaisable()) sl.append("raise");
- if (isReadable()) sl.append("read");
- if (isWritable()) sl.append("write");
- if (isFinal()) sl.append("final");
- if (isAbstract()) sl.append("abstract");
- if (isOverride()) sl.append("override");
- if (isInitonly()) sl.append("initonly");
- if (isSealed()) sl.append("sealed");
- if (isNew()) sl.append("new");
- if (isOptional()) sl.append("optional");
- if (isRequired()) sl.append("required");
-
- if (isNonAtomic()) sl.append("nonatomic");
- else if (isObjCProperty()) sl.append("atomic");
+ if (isConstExpr()) sl.push_back("constexpr");
+ if (isAddable()) sl.push_back("add");
+ if (!isUNOProperty() && isRemovable()) sl.push_back("remove");
+ if (isRaisable()) sl.push_back("raise");
+ if (isReadable()) sl.push_back("read");
+ if (isWritable()) sl.push_back("write");
+ if (isFinal()) sl.push_back("final");
+ if (isAbstract()) sl.push_back("abstract");
+ if (isOverride()) sl.push_back("override");
+ if (isInitonly()) sl.push_back("initonly");
+ if (isSealed()) sl.push_back("sealed");
+ if (isNew()) sl.push_back("new");
+ if (isOptional()) sl.push_back("optional");
+ if (isRequired()) sl.push_back("required");
+
+ if (isNonAtomic()) sl.push_back("nonatomic");
+ else if (isObjCProperty()) sl.push_back("atomic");
// mutual exclusive Objective 2.0 property attributes
- if (isAssign()) sl.append("assign");
- else if (isCopy()) sl.append("copy");
- else if (isRetain()) sl.append("retain");
- else if (isWeak()) sl.append("weak");
- else if (isStrong()) sl.append("strong");
- else if (isUnretained()) sl.append("unsafe_unretained");
+ if (isAssign()) sl.push_back("assign");
+ else if (isCopy()) sl.push_back("copy");
+ else if (isRetain()) sl.push_back("retain");
+ else if (isWeak()) sl.push_back("weak");
+ else if (isStrong()) sl.push_back("strong");
+ else if (isUnretained()) sl.push_back("unsafe_unretained");
if (!isObjCMethod())
{
- if (protection()==Protected) sl.append("protected");
- else if (protection()==Private) sl.append("private");
- else if (protection()==Package) sl.append("package");
-
- if (lvirt==Virtual) sl.append("virtual");
- else if (lvirt==Pure) sl.append("pure virtual");
- if (isSignal()) sl.append("signal");
- if (isSlot()) sl.append("slot");
- if (isDefault()) sl.append("default");
- if (isDelete()) sl.append("delete");
- if (isNoExcept()) sl.append("noexcept");
- if (isAttribute()) sl.append("attribute");
- if (isUNOProperty()) sl.append("property");
- if (isReadonly()) sl.append("readonly");
- if (isBound()) sl.append("bound");
- if (isUNOProperty() && isRemovable()) sl.append("removable");
- if (isConstrained()) sl.append("constrained");
- if (isTransient()) sl.append("transient");
- if (isMaybeVoid()) sl.append("maybevoid");
- if (isMaybeDefault()) sl.append("maybedefault");
- if (isMaybeAmbiguous()) sl.append("maybeambiguous");
- if (isPublished()) sl.append("published"); // enum
+ if (protection()==Protected) sl.push_back("protected");
+ else if (protection()==Private) sl.push_back("private");
+ else if (protection()==Package) sl.push_back("package");
+
+ if (lvirt==Virtual) sl.push_back("virtual");
+ else if (lvirt==Pure) sl.push_back("pure virtual");
+ if (isSignal()) sl.push_back("signal");
+ if (isSlot()) sl.push_back("slot");
+ if (isDefault()) sl.push_back("default");
+ if (isDelete()) sl.push_back("delete");
+ if (isNoExcept()) sl.push_back("noexcept");
+ if (isAttribute()) sl.push_back("attribute");
+ if (isUNOProperty()) sl.push_back("property");
+ if (isReadonly()) sl.push_back("readonly");
+ if (isBound()) sl.push_back("bound");
+ if (isUNOProperty() && isRemovable()) sl.push_back("removable");
+ if (isConstrained()) sl.push_back("constrained");
+ if (isTransient()) sl.push_back("transient");
+ if (isMaybeVoid()) sl.push_back("maybevoid");
+ if (isMaybeDefault()) sl.push_back("maybedefault");
+ if (isMaybeAmbiguous()) sl.push_back("maybeambiguous");
+ if (isPublished()) sl.push_back("published"); // enum
}
if (isObjCProperty() && isImplementation())
{
- sl.append("implementation");
+ sl.push_back("implementation");
}
}
if (getClassDef() &&
@@ -2643,14 +2678,15 @@ void MemberDefImpl::getLabels(QStrList &sl,const Definition *container) const
!isRelated()
)
{
- sl.append("inherited");
+ sl.push_back("inherited");
}
}
}
else if (isObjCMethod() && isImplementation())
{
- sl.append("implementation");
+ sl.push_back("implementation");
}
+ return sl;
}
void MemberDefImpl::_writeCallGraph(OutputList &ol) const
@@ -2742,7 +2778,7 @@ void MemberDefImpl::_writeReimplements(OutputList &ol) const
else
{
ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
- 0,bcd->displayName());
+ QCString(),bcd->displayName());
if (bcd->isLinkableInProject()/* && !Config_getBool(PDF_HYPERLINKS)*/ )
{
writePageRef(ol,bcd->getOutputFileBase(),bcd->anchor());
@@ -2835,11 +2871,11 @@ void MemberDefImpl::_writeCategoryRelation(OutputList &ol) const
if (getClassDef()) // this should be a member of a class/category
{
//printf("%s: category %s relation %s class=%s categoryOf=%s\n",
- // name().data(),
- // m_impl->category ? m_impl->category->name().data() : "<none>",
- // m_impl->categoryRelation ? m_impl->categoryRelation->name().data() : "<none>",
- // m_impl->classDef->name().data(),
- // m_impl->classDef->categoryOf() ? m_impl->classDef->categoryOf()->name().data() : "<none>"
+ // qPrint(name()),
+ // m_impl->category ? qPrint(m_impl->category->name()) : "<none>",
+ // m_impl->categoryRelation ? qPrint(m_impl->categoryRelation->name()) : "<none>",
+ // qPrint(m_impl->classDef->name()),
+ // m_impl->classDef->categoryOf() ? qPrint(m_impl->classDef->categoryOf()->name()) : "<none>"
// );
QCString text;
QCString ref;
@@ -2912,7 +2948,7 @@ void MemberDefImpl::_writeEnumValues(OutputList &ol,const Definition *container,
if (isEnumerate())
{
bool first=TRUE;
- //printf("** %s: enum values=%zu\n",name().data(),enumFieldList().size());
+ //printf("** %s: enum values=%zu\n",qPrint(name()),enumFieldList().size());
for (const auto &fmd : enumFieldList())
{
//printf("Enum %p: isLinkable()=%d\n",fmd,fmd->isLinkable());
@@ -2948,7 +2984,7 @@ void MemberDefImpl::_writeEnumValues(OutputList &ol,const Definition *container,
ol.generateDoc(fmd->briefFile(),fmd->briefLine(),
getOuterScope()?getOuterScope():container,
fmd,fmd->briefDescription(),TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
// FIXME:PARA
//if (!fmd->briefDescription().isEmpty() &&
@@ -2961,7 +2997,7 @@ void MemberDefImpl::_writeEnumValues(OutputList &ol,const Definition *container,
ol.generateDoc(fmd->docFile(),fmd->docLine(),
getOuterScope()?getOuterScope():container,
fmd,fmd->documentation()+"\n",TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
ol.endDescTableData();
ol.endDescTableRow();
@@ -3035,7 +3071,7 @@ QCString MemberDefImpl::displayDefinition() const
ldef=ldef.left(dp+1);
}
int l=ldef.length();
- //printf("start >%s<\n",ldef.data());
+ //printf("start >%s<\n",qPrint(ldef));
int i=l-1;
while (i>=0 && (isId(ldef.at(i)) || ldef.at(i)==':')) i--;
while (i>=0 && isspace((uchar)ldef.at(i))) i--;
@@ -3045,7 +3081,7 @@ QCString MemberDefImpl::displayDefinition() const
QCString tmp("("+ldef.left(i+1)+")"+ldef.mid(i+1));
ldef=tmp;
}
- //printf("end >%s< i=%d\n",ldef.data(),i);
+ //printf("end >%s< i=%d\n",qPrint(ldef),i);
if (isStatic()) ldef.prepend("+ "); else ldef.prepend("- ");
}
SrcLangExt lang = getLanguage();
@@ -3100,7 +3136,7 @@ void MemberDefImpl::_writeGroupInclude(OutputList &ol,bool inGroup) const
void MemberDefImpl::writeDocumentation(const MemberList *ml,
int memCount,int memTotal,
OutputList &ol,
- const char *scName,
+ const QCString &scName,
const Definition *container,
bool inGroup,
bool showEnumValues,
@@ -3111,13 +3147,13 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
bool hasParameterList = FALSE;
//printf("MemberDefImpl::writeDocumentation(): name='%s' hasDocs='%d' containerType=%d inGroup=%d sectionLinkable=%d\n",
- // name().data(),hasDocs,container->definitionType(),inGroup,isDetailedSectionLinkable());
+ // qPrint(name()),hasDocs,container->definitionType(),inGroup,isDetailedSectionLinkable());
//if ( !hasDocs ) return;
//if (isEnumValue() && !showEnumValues) return;
SrcLangExt lang = getLanguage();
- //printf("member=%s lang=%d\n",name().data(),lang);
+ //printf("member=%s lang=%d\n",qPrint(name()),lang);
bool optVhdl = lang==SrcLangExt_VHDL;
QCString sep = getLanguageSpecificSeparator(lang,TRUE);
@@ -3152,7 +3188,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
QCString ldef = definition();
QCString title = name();
- //printf("member '%s' def='%s'\n",name().data(),ldef.data());
+ //printf("member '%s' def='%s'\n",qPrint(name()),qPrint(ldef));
if (isEnumerate())
{
if (title.at(0)=='@')
@@ -3199,8 +3235,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
ol.pushGeneratorState();
bool htmlEndLabelTable=FALSE;
- QStrList sl;
- getLabels(sl,scopedContainer);
+ StringVector sl = getLabels(scopedContainer);
static const reg::Ex r(R"(@\d+)");
reg::Match match;
@@ -3227,7 +3262,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
}
if (!found) // anonymous compound
{
- //printf("Anonymous compound '%s'\n",cname.data());
+ //printf("Anonymous compound '%s'\n",qPrint(cname));
ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs);
ol.startMemberDoc(ciname,name(),memAnchor,"",memCount,memTotal,showInline);
// search for the last anonymous compound name in the definition
@@ -3273,7 +3308,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
{
if (!first) ol.docify(" ");
ol.startMemberDocPrefixItem();
- writeTemplatePrefix(ol,tal);
+ _writeTemplatePrefix(ol,scopedContainer,tal);
ol.endMemberDocPrefixItem();
}
}
@@ -3289,7 +3324,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
{
if (!first) ol.docify(" ");
ol.startMemberDocPrefixItem();
- writeTemplatePrefix(ol,tal);
+ _writeTemplatePrefix(ol,scopedContainer,tal,false);
ol.endMemberDocPrefixItem();
}
}
@@ -3297,13 +3332,13 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
if (m_impl->tArgList.hasParameters() && lang==SrcLangExt_Cpp) // function template prefix
{
ol.startMemberDocPrefixItem();
- writeTemplatePrefix(ol,m_impl->tArgList);
+ _writeTemplatePrefix(ol,scopedContainer,m_impl->tArgList);
ol.endMemberDocPrefixItem();
}
}
}
- if (sl.count()>0)
+ if (!sl.empty())
{
ol.pushGeneratorState();
ol.disableAll();
@@ -3337,7 +3372,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
ldef=ldef.left(dp+1);
}
int dl=ldef.length();
- //printf("start >%s<\n",ldef.data());
+ //printf("start >%s<\n",qPrint(ldef));
int i=dl-1;
while (i>=0 && (isId(ldef.at(i)) || ldef.at(i)==':')) i--;
while (i>=0 && isspace((uchar)ldef.at(i))) i--;
@@ -3347,7 +3382,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
QCString tmp("("+ldef.left(i+1)+")"+ldef.mid(i+1));
ldef=tmp;
}
- //printf("end >%s< i=%d\n",ldef.data(),i);
+ //printf("end >%s< i=%d\n",qPrint(ldef),i);
if (isStatic()) ldef.prepend("+ "); else ldef.prepend("- ");
}
@@ -3398,7 +3433,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,m_impl->initializer);
}
}
- if (excpString()) // add exception list
+ if (!excpString().isEmpty()) // add exception list
{
writeExceptionList(ol,cd,this);
hasParameterList=true; // call endParameterList below
@@ -3407,15 +3442,14 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
ol.pushGeneratorState();
ol.disable(OutputGenerator::Html);
- if (sl.count()>0)
+ if (!sl.empty())
{
ol.startLabels();
- const char *s=sl.first();
- while (s)
+ size_t count=0;
+ for (const auto &s : sl)
{
- const char *ns = sl.next();
- ol.writeLabel(s,ns==0);
- s=ns;
+ count++;
+ ol.writeLabel(s.c_str(),count==sl.size());
}
ol.endLabels();
}
@@ -3441,12 +3475,11 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
ol.writeString(" </td>\n");
ol.writeString(" <td class=\"mlabels-right\">\n");
ol.startLabels();
- const char *s=sl.first();
- while (s)
+ size_t count=0;
+ for (const auto &s : sl)
{
- const char *ns = sl.next();
- ol.writeLabel(s,ns==0);
- s=ns;
+ count++;
+ ol.writeLabel(s.c_str(),count==sl.size());
}
ol.endLabels();
ol.writeString(" </td>\n");
@@ -3469,7 +3502,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
// )
)
{
- //printf("md=%s initLines=%d init='%s'\n",name().data(),initLines,init.data());
+ //printf("md=%s initLines=%d init='%s'\n",qPrint(name()),initLines,qPrint(init));
ol.startBold();
if (m_impl->mtype==MemberType_Define)
ol.parseText(theTranslator->trDefineValue());
@@ -3486,7 +3519,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
auto intf = Doxygen::parserManager->getCodeParser(langCorrected);
intf->resetCodeParserState();
ol.startCodeFragment("DoxyCode");
- intf->parseCode(ol,scopeName,m_impl->initializer,srcLangExt,FALSE,0,const_cast<FileDef*>(getFileDef()),
+ intf->parseCode(ol,scopeName,m_impl->initializer,srcLangExt,FALSE,QCString(),const_cast<FileDef*>(getFileDef()),
-1,-1,TRUE,this,FALSE,this);
ol.endCodeFragment("DoxyCode");
}
@@ -3512,7 +3545,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
ol.generateDoc(briefFile(),briefLine(),
scopedContainer,this,
brief,FALSE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endParagraph();
}
@@ -3529,7 +3562,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
else
{
ol.generateDoc(docFile(),docLine(),scopedContainer,this,detailed+"\n",TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
if (!inbodyDocumentation().isEmpty())
@@ -3537,7 +3570,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
ol.generateDoc(inbodyFile(),inbodyLine(),
scopedContainer,this,
inbodyDocumentation()+"\n",TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
}
else if (!brief.isEmpty() && (Config_getBool(REPEAT_BRIEF) ||
@@ -3546,7 +3579,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
if (!inbodyDocumentation().isEmpty())
{
ol.generateDoc(inbodyFile(),inbodyLine(),scopedContainer,this,inbodyDocumentation()+"\n",TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
}
@@ -3574,7 +3607,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
paramDocs, // docStr
TRUE, // indexWords
FALSE, // isExample
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT)
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT)
);
}
@@ -3626,7 +3659,7 @@ static QCString simplifyTypeForTable(const QCString &s)
{
ts = match[1].str(); // take the identifier after the last ::
}
- //printf("simplifyTypeForTable(%s)->%s\n",s.data(),ts.data());
+ //printf("simplifyTypeForTable(%s)->%s\n",qPrint(s),qPrint(ts));
return ts;
}
@@ -3657,7 +3690,7 @@ void MemberDefImpl::writeMemberDocSimple(OutputList &ol, const Definition *conta
}
ClassDef *cd = m_impl->accessorClass;
- //printf("===> %s::anonymous: %s\n",name().data(),cd?cd->name().data():"<none>");
+ //printf("===> %s::anonymous: %s\n",qPrint(name()),cd?qPrint(cd->name()):"<none>");
if (container && container->definitionType()==Definition::TypeClass &&
!(toClassDef(container))->isJavaEnum())
@@ -3702,7 +3735,7 @@ void MemberDefImpl::writeMemberDocSimple(OutputList &ol, const Definition *conta
ol.startInlineMemberName();
ol.docify(doxyName);
- if (isVariable() && argsString() && !isObjCMethod())
+ if (isVariable() && !argsString().isEmpty() && !isObjCMethod())
{
linkifyText(TextGeneratorOLImpl(ol),getOuterScope(),getBodyDef(),this,argsString());
}
@@ -3723,7 +3756,7 @@ void MemberDefImpl::writeMemberDocSimple(OutputList &ol, const Definition *conta
ol.generateDoc(briefFile(),briefLine(),
getOuterScope()?getOuterScope():container,this,
brief,FALSE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
/* write detailed description */
@@ -3732,7 +3765,7 @@ void MemberDefImpl::writeMemberDocSimple(OutputList &ol, const Definition *conta
ol.generateDoc(docFile(),docLine(),
getOuterScope()?getOuterScope():container,this,
detailed+"\n",FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
@@ -3789,7 +3822,7 @@ void MemberDefImpl::warnIfUndocumented() const
static bool extractAll = Config_getBool(EXTRACT_ALL);
//printf("%s:warnIfUndoc: hasUserDocs=%d isFriendClass=%d protection=%d isRef=%d isDel=%d\n",
- // name().data(),
+ // qPrint(name()),
// hasUserDocumentation(),isFriendClass(),protectionLevelVisible(m_impl->prot),isReference(),isDeleted());
if ((!hasUserDocumentation() && !extractAll) &&
!isFriendClass() &&
@@ -3806,7 +3839,7 @@ void MemberDefImpl::warnIfUndocumented() const
warnIfUndocumentedParams();
}
}
-static QCString stripTrailingReturn(const QCString trailRet)
+static QCString stripTrailingReturn(const QCString &trailRet)
{
QCString ret = trailRet;
@@ -3840,7 +3873,7 @@ void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturn
if (!m_impl->hasDocumentedParams && hasParamCommand)
{
- //printf("%s:hasDocumentedParams=TRUE;\n",name().data());
+ //printf("%s:hasDocumentedParams=TRUE;\n",qPrint(name()));
m_impl->hasDocumentedParams = TRUE;
}
else if (!m_impl->hasDocumentedParams)
@@ -3863,7 +3896,7 @@ void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturn
allDoc = !a.docs.isEmpty();
}
//printf("a->type=%s a->name=%s doc=%s\n",
- // a->type.data(),a->name.data(),a->docs.data());
+ // qPrint(a->type),qPrint(a->name),qPrint(a->docs));
}
if (!allDoc && declAl.empty()) // try declaration arguments as well
{
@@ -3877,19 +3910,19 @@ void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturn
{
allDoc = !a.docs.isEmpty();
}
- //printf("a->name=%s doc=%s\n",a->name.data(),a->docs.data());
+ //printf("a->name=%s doc=%s\n",qPrint(a->name),qPrint(a->docs));
}
}
}
if (allDoc)
{
- //printf("%s:hasDocumentedParams=TRUE;\n",name().data());
+ //printf("%s:hasDocumentedParams=TRUE;\n",qPrint(name()));
m_impl->hasDocumentedParams = TRUE;
}
}
//printf("Member %s hasDocumentedReturnType=%d hasReturnCommand=%d\n",
- // name().data(),m_impl->hasDocumentedReturnType,hasReturnCommand);
+ // qPrint(name()),m_impl->hasDocumentedReturnType,hasReturnCommand);
if (!m_impl->hasDocumentedReturnType && // docs not yet found
hasReturnCommand)
{
@@ -3906,7 +3939,7 @@ void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturn
)
{
warn_doc_error(getDefFileName(),getDefLine(),"documented empty return type of %s",
- qualifiedName().data());
+ qPrint(qualifiedName()));
}
else if ( // see if return needs to documented
m_impl->hasDocumentedReturnType ||
@@ -4041,6 +4074,10 @@ void MemberDefImpl::setAnchor()
buf[19]='\0';
memAnchor.prepend(buf);
}
+ if (!m_impl->requiresClause.isEmpty())
+ {
+ memAnchor+=" "+m_impl->requiresClause;
+ }
// convert to md5 hash
uchar md5_sig[16];
@@ -4054,7 +4091,7 @@ void MemberDefImpl::setGroupDef(const GroupDef *gd,Grouping::GroupPri_t pri,
const QCString &fileName,int startLine,
bool hasDocs,MemberDef *member)
{
- //printf("%s MemberDefImpl::setGroupDef(%s)\n",name().data(),gd->name().data());
+ //printf("%s MemberDefImpl::setGroupDef(%s)\n",qPrint(name()),qPrint(gd->name()));
m_impl->group=gd;
m_impl->grouppri=pri;
m_impl->groupFileName=fileName;
@@ -4096,36 +4133,36 @@ void MemberDefImpl::setNamespace(const NamespaceDef *nd)
MemberDefMutable *MemberDefImpl::createTemplateInstanceMember(
const ArgumentList &formalArgs,const std::unique_ptr<ArgumentList> &actualArgs) const
{
- //printf(" Member %s %s %s\n",typeString(),name().data(),argsString());
+ //printf(" Member %s %s %s\n",typeString(),qPrint(name()),argsString());
std::unique_ptr<ArgumentList> actualArgList = std::make_unique<ArgumentList>(m_impl->defArgList);
if (!m_impl->defArgList.empty())
{
// replace formal arguments with actuals
for (Argument &arg : *actualArgList)
{
- arg.type = substituteTemplateArgumentsInString(arg.type.str(),formalArgs,actualArgs);
+ arg.type = substituteTemplateArgumentsInString(arg.type,formalArgs,actualArgs);
}
actualArgList->setTrailingReturnType(
- substituteTemplateArgumentsInString(actualArgList->trailingReturnType().str(),formalArgs,actualArgs));
+ substituteTemplateArgumentsInString(actualArgList->trailingReturnType(),formalArgs,actualArgs));
}
QCString methodName=name();
if (methodName.left(9)=="operator ") // conversion operator
{
- methodName=substituteTemplateArgumentsInString(methodName.str(),formalArgs,actualArgs);
+ methodName=substituteTemplateArgumentsInString(methodName,formalArgs,actualArgs);
}
MemberDefMutable *imd = createMemberDef(
getDefFileName(),getDefLine(),getDefColumn(),
- substituteTemplateArgumentsInString(m_impl->type.str(),formalArgs,actualArgs),
+ substituteTemplateArgumentsInString(m_impl->type,formalArgs,actualArgs),
methodName,
- substituteTemplateArgumentsInString(m_impl->args.str(),formalArgs,actualArgs),
+ substituteTemplateArgumentsInString(m_impl->args,formalArgs,actualArgs),
m_impl->exception, m_impl->prot,
m_impl->virt, m_impl->stat, m_impl->related, m_impl->mtype,
ArgumentList(), ArgumentList(), ""
);
imd->moveArgumentList(std::move(actualArgList));
- imd->setDefinition(substituteTemplateArgumentsInString(m_impl->def.str(),formalArgs,actualArgs));
+ imd->setDefinition(substituteTemplateArgumentsInString(m_impl->def,formalArgs,actualArgs));
imd->setBodyDef(getBodyDef());
imd->setBodySegment(getDefLine(),getStartBodyLine(),getEndBodyLine());
//imd->setBodyMember(this);
@@ -4138,7 +4175,7 @@ MemberDefMutable *MemberDefImpl::createTemplateInstanceMember(
bool MemberDefImpl::hasOneLineInitializer() const
{
//printf("%s: init=%s, initLines=%d maxInitLines=%d userInitLines=%d\n",
- // name().data(),m_impl->initializer.data(),m_impl->initLines,
+ // qPrint(name()),qPrint(m_impl->initializer),m_impl->initLines,
// m_impl->maxInitLines,m_impl->userInitLines);
return !m_impl->initializer.isEmpty() && m_impl->initLines==0 && // one line initializer
((m_impl->maxInitLines>0 && m_impl->userInitLines==-1) || m_impl->userInitLines>0); // enabled by default or explicitly
@@ -4154,7 +4191,7 @@ bool MemberDefImpl::hasMultiLineInitializer() const
);
}
-void MemberDefImpl::setInitializer(const char *initializer)
+void MemberDefImpl::setInitializer(const QCString &initializer)
{
m_impl->initializer=initializer;
int l=m_impl->initializer.length();
@@ -4162,7 +4199,7 @@ void MemberDefImpl::setInitializer(const char *initializer)
while (p>=0 && isspace((uchar)m_impl->initializer.at(p))) p--;
m_impl->initializer=m_impl->initializer.left(p+1);
m_impl->initLines=m_impl->initializer.contains('\n');
- //printf("%s::setInitializer(%s)\n",name().data(),m_impl->initializer.data());
+ //printf("%s::setInitializer(%s)\n",qPrint(name()),qPrint(m_impl->initializer));
}
void MemberDefImpl::addListReference(Definition *)
@@ -4229,7 +4266,7 @@ const MemberList *MemberDefImpl::getSectionList(const Definition *container) con
void MemberDefImpl::setSectionList(const Definition *container,const MemberList *sl)
{
- //printf("MemberDefImpl::setSectionList(%s,%p) name=%s\n",d->name().data(),sl,name().data());
+ //printf("MemberDefImpl::setSectionList(%s,%p) name=%s\n",qPrint(d->name()),sl,qPrint(name()));
m_impl->sectionMap.insert(std::make_pair(container,sl));
}
@@ -4253,7 +4290,7 @@ Specifier MemberDefImpl::virtualness(int count) const
return v;
}
-void MemberDefImpl::writeTagFile(FTextStream &tagFile) const
+void MemberDefImpl::writeTagFile(TextStream &tagFile) const
{
if (!isLinkableInProject()) return;
tagFile << " <member kind=\"";
@@ -4293,20 +4330,20 @@ void MemberDefImpl::writeTagFile(FTextStream &tagFile) const
{
tagFile << "\" static=\"yes";
}
- tagFile << "\">" << endl;
+ tagFile << "\">\n";
if (typeString()!=QCString("@"))
{
- tagFile << " <type>" << convertToXML(typeString()) << "</type>" << endl;
+ tagFile << " <type>" << convertToXML(typeString()) << "</type>\n";
}
- tagFile << " <name>" << convertToXML(name()) << "</name>" << endl;
- tagFile << " <anchorfile>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</anchorfile>" << endl;
- tagFile << " <anchor>" << convertToXML(anchor()) << "</anchor>" << endl;
+ tagFile << " <name>" << convertToXML(name()) << "</name>\n";
+ tagFile << " <anchorfile>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</anchorfile>\n";
+ tagFile << " <anchor>" << convertToXML(anchor()) << "</anchor>\n";
QCString idStr = id();
if (!idStr.isEmpty())
{
- tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>" << endl;
+ tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
}
- tagFile << " <arglist>" << convertToXML(argsString()) << "</arglist>" << endl;
+ tagFile << " <arglist>" << convertToXML(argsString()) << "</arglist>\n";
if (isStrong())
{
for (const auto &fmd : m_impl->enumFields)
@@ -4320,12 +4357,12 @@ void MemberDefImpl::writeTagFile(FTextStream &tagFile) const
{
tagFile << "\" clangid=\"" << convertToXML(idStr);
}
- tagFile << "\">" << convertToXML(fmd->name()) << "</enumvalue>" << endl;
+ tagFile << "\">" << convertToXML(fmd->name()) << "</enumvalue>\n";
}
}
}
writeDocAnchorsToTagFile(tagFile);
- tagFile << " </member>" << endl;
+ tagFile << " </member>\n";
}
void MemberDefImpl::_computeIsConstructor()
@@ -4557,12 +4594,12 @@ void MemberDefImpl::setTypeConstraints(const ArgumentList &al)
m_impl->typeConstraints = al;
}
-void MemberDefImpl::setType(const char *t)
+void MemberDefImpl::setType(const QCString &t)
{
m_impl->type = t;
}
-void MemberDefImpl::setAccessorType(ClassDef *cd,const char *t)
+void MemberDefImpl::setAccessorType(ClassDef *cd,const QCString &t)
{
m_impl->accessorClass = cd;
m_impl->accessorType = t;
@@ -4614,8 +4651,8 @@ bool MemberDefImpl::protectionVisible() const
#endif
#if 0
-void MemberDefImpl::setInbodyDocumentation(const char *docs,
- const char *docFile,int docLine)
+void MemberDefImpl::setInbodyDocumentation(const QCString &docs,
+ const QCString &docFile,int docLine)
{
m_impl->inbodyDocs = docs;
m_impl->inbodyDocs = m_impl->inbodyDocs.stripWhiteSpace();
@@ -4664,7 +4701,7 @@ void MemberDefImpl::setTagInfo(const TagInfo *ti)
{
if (ti)
{
- //printf("%s: Setting tag name=%s anchor=%s\n",name().data(),ti->tagName.data(),ti->anchor.data());
+ //printf("%s: Setting tag name=%s anchor=%s\n",qPrint(name()),qPrint(ti->tagName),qPrint(ti->anchor));
m_impl->anc=ti->anchor;
setReference(ti->tagName);
m_impl->explicitOutputFileBase = stripExtension(ti->fileName);
@@ -4688,37 +4725,37 @@ QCString MemberDefImpl::objCMethodName(bool localLink,bool showStatic) const
return qm;
}
-const char *MemberDefImpl::declaration() const
+QCString MemberDefImpl::declaration() const
{
return m_impl->decl;
}
-const char *MemberDefImpl::definition() const
+QCString MemberDefImpl::definition() const
{
return m_impl->def;
}
-const char *MemberDefImpl::extraTypeChars() const
+QCString MemberDefImpl::extraTypeChars() const
{
return m_impl->extraTypeChars;
}
-const char *MemberDefImpl::typeString() const
+QCString MemberDefImpl::typeString() const
{
return m_impl->type;
}
-const char *MemberDefImpl::argsString() const
+QCString MemberDefImpl::argsString() const
{
return m_impl->args;
}
-const char *MemberDefImpl::excpString() const
+QCString MemberDefImpl::excpString() const
{
return m_impl->exception;
}
-const char *MemberDefImpl::bitfieldString() const
+QCString MemberDefImpl::bitfieldString() const
{
return m_impl->bitfields;
}
@@ -4753,12 +4790,12 @@ const NamespaceDef* MemberDefImpl::getNamespaceDef() const
return m_impl->nspace;
}
-const char *MemberDefImpl::getReadAccessor() const
+QCString MemberDefImpl::getReadAccessor() const
{
return m_impl->read;
}
-const char *MemberDefImpl::getWriteAccessor() const
+QCString MemberDefImpl::getWriteAccessor() const
{
return m_impl->write;
}
@@ -4773,7 +4810,7 @@ Grouping::GroupPri_t MemberDefImpl::getGroupPri() const
return m_impl->grouppri;
}
-const char *MemberDefImpl::getGroupFileName() const
+QCString MemberDefImpl::getGroupFileName() const
{
return m_impl->groupFileName;
}
@@ -5330,7 +5367,7 @@ QCString MemberDefImpl::getCachedTypedefTemplSpec() const
QCString MemberDefImpl::getCachedResolvedTypedef() const
{
- //printf("MemberDefImpl::getCachedResolvedTypedef()=%s m_impl=%p\n",m_impl->cachedResolvedType.data(),m_impl);
+ //printf("MemberDefImpl::getCachedResolvedTypedef()=%s m_impl=%p\n",qPrint(m_impl->cachedResolvedType),m_impl);
return m_impl->cachedResolvedType;
}
@@ -5378,7 +5415,7 @@ void MemberDefImpl::setMemberType(MemberType t)
m_isLinkableCached = 0;
}
-void MemberDefImpl::setDefinition(const char *d)
+void MemberDefImpl::setDefinition(const QCString &d)
{
m_impl->def=d;
}
@@ -5407,7 +5444,7 @@ void MemberDefImpl::mergeMemberSpecifiers(uint64 s)
m_impl->memSpec|=s;
}
-void MemberDefImpl::setBitfields(const char *s)
+void MemberDefImpl::setBitfields(const QCString &s)
{
m_impl->bitfields = QCString(s).simplifyWhiteSpace();
}
@@ -5420,12 +5457,12 @@ void MemberDefImpl::setMaxInitLines(int lines)
}
}
-void MemberDefImpl::setReadAccessor(const char *r)
+void MemberDefImpl::setReadAccessor(const QCString &r)
{
m_impl->read=r;
}
-void MemberDefImpl::setWriteAccessor(const char *w)
+void MemberDefImpl::setWriteAccessor(const QCString &w)
{
m_impl->write=w;
}
@@ -5452,7 +5489,7 @@ void MemberDefImpl::setInheritsDocsFrom(const MemberDef *md)
m_impl->docProvider = md;
}
-void MemberDefImpl::setArgsString(const char *as)
+void MemberDefImpl::setArgsString(const QCString &as)
{
m_impl->args = as;
}
@@ -5599,6 +5636,15 @@ QCString MemberDefImpl::enumBaseType() const
return m_impl->enumBaseType;
}
+void MemberDefImpl::setRequiresClause(const QCString &req)
+{
+ m_impl->requiresClause = req;
+}
+
+QCString MemberDefImpl::requiresClause() const
+{
+ return m_impl->requiresClause;
+}
void MemberDefImpl::cacheTypedefVal(const ClassDef*val, const QCString & templSpec, const QCString &resolvedType)
{
@@ -5606,7 +5652,7 @@ void MemberDefImpl::cacheTypedefVal(const ClassDef*val, const QCString & templSp
m_impl->cachedTypedefValue=val;
m_impl->cachedTypedefTemplSpec=templSpec;
m_impl->cachedResolvedType=resolvedType;
- //printf("MemberDefImpl::cacheTypedefVal=%s m_impl=%p\n",m_impl->cachedResolvedType.data(),m_impl);
+ //printf("MemberDefImpl::cacheTypedefVal=%s m_impl=%p\n",qPrint(m_impl->cachedResolvedType),m_impl);
}
void MemberDefImpl::copyArgumentNames(const MemberDef *bmd)
@@ -5735,15 +5781,15 @@ static void transferArgumentDocumentation(ArgumentList &decAl,ArgumentList &defA
void combineDeclarationAndDefinition(MemberDefMutable *mdec,MemberDefMutable *mdef)
{
- //printf("mdec=%s isPrototype()=%d\n",mdec->name().data(),mdec->isPrototype());
+ //printf("mdec=%s isPrototype()=%d\n",qPrint(mdec->name()),mdec->isPrototype());
if (
(mdef->isFunction() && !mdef->isStatic() && !mdef->isPrototype()) ||
(mdef->isVariable() && !mdef->isExternal() && !mdef->isStatic())
)
{
//printf("mdef=(%p,%s) mdec=(%p,%s)\n",
- // mdef, mdef ? mdef->name().data() : "",
- // mdec, mdec ? mdec->name().data() : "");
+ // mdef, mdef ? qPrint(mdef->name()) : "",
+ // mdec, mdec ? qPrint(mdec->name()) : "");
ArgumentList &mdefAl = const_cast<ArgumentList&>(mdef->argumentList());
ArgumentList &mdecAl = const_cast<ArgumentList&>(mdec->argumentList());
@@ -5755,8 +5801,8 @@ void combineDeclarationAndDefinition(MemberDefMutable *mdec,MemberDefMutable *md
{
//printf("Found member %s: definition in %s (doc='%s') and declaration in %s (doc='%s')\n",
// mn->memberName(),
- // mdef->getFileDef()->name().data(),mdef->documentation().data(),
- // mdec->getFileDef()->name().data(),mdec->documentation().data()
+ // qPrint(mdef->getFileDef()->name()),qPrint(mdef->documentation()),
+ // qPrint(mdec->getFileDef()->name()),qPrint(mdec->documentation())
// );
if (Config_getBool(RESOLVE_UNNAMED_PARAMS))
@@ -5941,7 +5987,7 @@ bool MemberDefImpl::isReference() const
void addDocCrossReference(MemberDefMutable *src,MemberDefMutable *dst)
{
if (src==0 || dst==0) return;
- //printf("--> addDocCrossReference src=%s,dst=%s\n",src->name().data(),dst->name().data());
+ //printf("--> addDocCrossReference src=%s,dst=%s\n",qPrint(src->name()),qPrint(dst->name()));
if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types
if ((dst->hasReferencedByRelation() || dst->hasCallerGraph()) &&
src->showInCallGraph()
diff --git a/src/memberdef.h b/src/memberdef.h
index abaf3ff..91b0c6d 100644
--- a/src/memberdef.h
+++ b/src/memberdef.h
@@ -36,7 +36,6 @@ class MemberGroup;
class ExampleList;
class OutputList;
class GroupDef;
-class QStrList;
struct TagInfo;
class MemberDefMutable;
class MemberGroupList;
@@ -65,13 +64,13 @@ class MemberDef : public Definition
virtual QCString getReference() const = 0;
virtual QCString anchor() const = 0;
- virtual const char *declaration() const = 0;
- virtual const char *definition() const = 0;
- virtual const char *typeString() const = 0;
- virtual const char *argsString() const = 0;
- virtual const char *excpString() const = 0;
- virtual const char *bitfieldString() const = 0;
- virtual const char *extraTypeChars() const = 0;
+ virtual QCString declaration() const = 0;
+ virtual QCString definition() const = 0;
+ virtual QCString typeString() const = 0;
+ virtual QCString argsString() const = 0;
+ virtual QCString excpString() const = 0;
+ virtual QCString bitfieldString() const = 0;
+ virtual QCString extraTypeChars() const = 0;
virtual const QCString &initializer() const = 0;
virtual int initializerLines() const = 0;
virtual uint64 getMemberSpecifiers() const = 0;
@@ -85,15 +84,16 @@ class MemberDef : public Definition
virtual const ClassDef *accessorClass() const = 0;
// grabbing the property read/write accessor names
- virtual const char *getReadAccessor() const = 0;
- virtual const char *getWriteAccessor() const = 0;
+ virtual QCString getReadAccessor() const = 0;
+ virtual QCString getWriteAccessor() const = 0;
// querying the grouping definition
virtual const GroupDef *getGroupDef() const = 0;
virtual Grouping::GroupPri_t getGroupPri() const = 0;
- virtual const char *getGroupFileName() const = 0;
+ virtual QCString getGroupFileName() const = 0;
virtual int getGroupStartLine() const = 0;
virtual bool getGroupHasDocs() const = 0;
+
virtual QCString qualifiedName() const = 0;
virtual QCString objCMethodName(bool localLink,bool showStatic) const = 0;
@@ -258,10 +258,12 @@ class MemberDef : public Definition
virtual QCString displayName(bool=TRUE) const = 0;
virtual QCString getDeclType() const = 0;
- virtual void getLabels(QStrList &sl,const Definition *container) const = 0;
+ virtual StringVector getLabels(const Definition *container) const = 0;
virtual const ArgumentList &typeConstraints() const = 0;
+ virtual QCString requiresClause() const = 0;
+
// overrules
virtual QCString documentation() const = 0;
virtual QCString briefDescription(bool abbr=FALSE) const = 0;
@@ -276,7 +278,7 @@ class MemberDef : public Definition
const std::unique_ptr<ArgumentList> &actualArgs) const = 0;
virtual void writeDeclaration(OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
- bool inGroup, const ClassDef *inheritFrom=0,const char *inheritId=0) const = 0;
+ bool inGroup, const ClassDef *inheritFrom=0,const QCString &inheritId=QCString()) const = 0;
virtual void writeEnumDeclaration(OutputList &typeDecl, const ClassDef *cd,
const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd) const = 0;
virtual void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const = 0;
@@ -297,29 +299,29 @@ class MemberDefMutable : public DefinitionMutable, public MemberDef
// set functions
virtual void setMemberType(MemberType t) = 0;
- virtual void setDefinition(const char *d) = 0;
+ virtual void setDefinition(const QCString &d) = 0;
virtual void setFileDef(const FileDef *fd) = 0;
virtual void setAnchor() = 0;
virtual void setProtection(Protection p) = 0;
virtual void setMemberSpecifiers(uint64 s) = 0;
virtual void mergeMemberSpecifiers(uint64 s) = 0;
- virtual void setInitializer(const char *i) = 0;
- virtual void setBitfields(const char *s) = 0;
+ virtual void setInitializer(const QCString &i) = 0;
+ virtual void setBitfields(const QCString &s) = 0;
virtual void setMaxInitLines(int lines) = 0;
virtual void setMemberClass(const ClassDef *cd) = 0;
virtual void setSectionList(const Definition *container,const MemberList *sl) = 0;
virtual void setGroupDef(const GroupDef *gd,Grouping::GroupPri_t pri,
const QCString &fileName,int startLine,bool hasDocs,
MemberDef *member=0) = 0;
- virtual void setReadAccessor(const char *r) = 0;
- virtual void setWriteAccessor(const char *w) = 0;
+ virtual void setReadAccessor(const QCString &r) = 0;
+ virtual void setWriteAccessor(const QCString &w) = 0;
virtual void setTemplateSpecialization(bool b) = 0;
virtual void makeRelated() = 0;
virtual void makeForeign() = 0;
virtual void setInheritsDocsFrom(const MemberDef *md) = 0;
virtual void setTagInfo(const TagInfo *i) = 0;
- virtual void setArgsString(const char *as) = 0;
+ virtual void setArgsString(const QCString &as) = 0;
virtual void incrementFlowKeyWordCount() = 0;
virtual void setEnumBaseType(const QCString &type) = 0;
@@ -337,7 +339,7 @@ class MemberDefMutable : public DefinitionMutable, public MemberDef
virtual void setAnonymousEnumType(const MemberDef *md) = 0;
// example related members
- virtual bool addExample(const char *anchor,const char *name,const char *file) = 0;
+ virtual bool addExample(const QCString &anchor,const QCString &name,const QCString &file) = 0;
// prototype related members
virtual void setPrototype(bool p,const QCString &df,int line, int column) = 0;
@@ -350,8 +352,8 @@ class MemberDefMutable : public DefinitionMutable, public MemberDef
virtual void resolveUnnamedParameters(const MemberDef *md) = 0;
virtual void setDefinitionTemplateParameterLists(const ArgumentLists &lists) = 0;
virtual void setTypeConstraints(const ArgumentList &al) = 0;
- virtual void setType(const char *t) = 0;
- virtual void setAccessorType(ClassDef *cd,const char *t) = 0;
+ virtual void setType(const QCString &t) = 0;
+ virtual void setAccessorType(ClassDef *cd,const QCString &t) = 0;
// namespace related members
virtual void setNamespace(const NamespaceDef *nd) = 0;
@@ -388,12 +390,14 @@ class MemberDefMutable : public DefinitionMutable, public MemberDef
virtual void setCategory(ClassDef *) = 0;
virtual void setCategoryRelation(const MemberDef *) = 0;
- virtual void setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace=TRUE) = 0;
- virtual void setBriefDescription(const char *b,const char *briefFile,int briefLine) = 0;
- virtual void setInbodyDocumentation(const char *d,const char *inbodyFile,int inbodyLine) = 0;
+ virtual void setDocumentation(const QCString &d,const QCString &docFile,int docLine,bool stripWhiteSpace=TRUE) = 0;
+ virtual void setBriefDescription(const QCString &b,const QCString &briefFile,int briefLine) = 0;
+ virtual void setInbodyDocumentation(const QCString &d,const QCString &inbodyFile,int inbodyLine) = 0;
virtual void setHidden(bool b) = 0;
+ virtual void setRequiresClause(const QCString &req) = 0;
+
//-----------------------------------------------------------------------------------
// --- actions ----
//-----------------------------------------------------------------------------------
@@ -406,11 +410,11 @@ class MemberDefMutable : public DefinitionMutable, public MemberDef
//-----------------------------------------------------------------------------------
virtual void writeDocumentation(const MemberList *ml,int memCount,int memTotal,OutputList &ol,
- const char *scopeName,const Definition *container,
+ const QCString &scopeName,const Definition *container,
bool inGroup,bool showEnumValues=FALSE,bool
showInline=FALSE) const = 0;
virtual void writeMemberDocSimple(OutputList &ol,const Definition *container) const = 0;
- virtual void writeTagFile(FTextStream &) const = 0;
+ virtual void writeTagFile(TextStream &) const = 0;
virtual void writeLink(OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
bool onlyText=FALSE) const = 0;
@@ -438,11 +442,11 @@ MemberDefMutable *toMemberDefMutable(const Definition *d);
/** Factory method to create a new instance of a MemberDef */
-MemberDefMutable *createMemberDef(const char *defFileName,int defLine,int defColumn,
- const char *type,const char *name,const char *args,
- const char *excp,Protection prot,Specifier virt,bool stat,
+MemberDefMutable *createMemberDef(const QCString &defFileName,int defLine,int defColumn,
+ const QCString &type,const QCString &name,const QCString &args,
+ const QCString &excp,Protection prot,Specifier virt,bool stat,
Relationship related,MemberType t,const ArgumentList &tal,
- const ArgumentList &al,const char *metaData);
+ const ArgumentList &al,const QCString &metaData);
MemberDef *createMemberDefAlias(const Definition *newScope,const MemberDef *aliasMd);
diff --git a/src/membergroup.cpp b/src/membergroup.cpp
index 77f5842..9f7f6ef 100644
--- a/src/membergroup.cpp
+++ b/src/membergroup.cpp
@@ -29,14 +29,14 @@
#include "entry.h"
#include "md5.h"
-MemberGroup::MemberGroup(const Definition *container,int id,const char *hdr,const char *d,const char *docFile,int docLine)
+MemberGroup::MemberGroup(const Definition *container,int id,const QCString &hdr,const QCString &d,const QCString &docFile,int docLine)
: m_container(container),
memberList(std::make_unique<MemberList>(MemberListType_memberGroup)),
grpId(id), grpHeader(hdr), doc(d), m_docFile(docFile), m_docLine(docLine)
{
//printf("New member group id=%d header=%s desc=%s\n",id,hdr,d);
memberList->setNeedsSorting(Config_getBool(SORT_BRIEF_DOCS)); // detailed sections are already sorted elsewhere.
- //printf("Member group docs='%s'\n",doc.data());
+ //printf("Member group docs='%s'\n",qPrint(doc));
}
MemberGroup::~MemberGroup()
@@ -50,7 +50,7 @@ void MemberGroup::insertMember(const MemberDef *md)
// memberList->first() ? memberList->first()->getSectionList() : 0,
// memberList->count(),
// md->getSectionList(),
- // md,md->name().data());
+ // md,qPrint(md->name()));
const MemberDef *firstMd = memberList->empty() ? 0 : memberList->front();
if (inSameSection && firstMd &&
@@ -91,7 +91,7 @@ void MemberGroup::writeDeclarations(OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
bool showInline) const
{
- //printf("MemberGroup::writeDeclarations() %s\n",grpHeader.data());
+ //printf("MemberGroup::writeDeclarations() %s\n",qPrint(grpHeader));
QCString ldoc = doc;
if (!ldoc.isEmpty()) ldoc.prepend("<a name=\""+anchor()+"\" id=\""+anchor()+"\"></a>");
memberList->writeDeclarations(ol,cd,nd,fd,gd,grpHeader,ldoc,FALSE,showInline);
@@ -99,21 +99,21 @@ void MemberGroup::writeDeclarations(OutputList &ol,
void MemberGroup::writePlainDeclarations(OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
- const ClassDef *inheritedFrom,const char *inheritId
+ const ClassDef *inheritedFrom,const QCString &inheritId
) const
{
//printf("MemberGroup::writePlainDeclarations() memberList->count()=%d\n",memberList->count());
memberList->writePlainDeclarations(ol,cd,nd,fd,gd,inheritedFrom,inheritId);
}
-void MemberGroup::writeDocumentation(OutputList &ol,const char *scopeName,
+void MemberGroup::writeDocumentation(OutputList &ol,const QCString &scopeName,
const Definition *container,bool showEnumValues,bool showInline) const
{
- //printf("MemberGroup::writeDocumentation() %s\n",grpHeader.data());
- memberList->writeDocumentation(ol,scopeName,container,0,showEnumValues,showInline);
+ //printf("MemberGroup::writeDocumentation() %s\n",qPrint(grpHeader));
+ memberList->writeDocumentation(ol,scopeName,container,QCString(),showEnumValues,showInline);
}
-void MemberGroup::writeDocumentationPage(OutputList &ol,const char *scopeName,
+void MemberGroup::writeDocumentationPage(OutputList &ol,const QCString &scopeName,
const DefinitionMutable *container) const
{
memberList->writeDocumentationPage(ol,scopeName,container);
@@ -196,11 +196,11 @@ int MemberGroup::countInheritableMembers(const ClassDef *inheritedFrom) const
void MemberGroup::distributeMemberGroupDocumentation()
{
- //printf("MemberGroup::distributeMemberGroupDocumentation() %s\n",grpHeader.data());
+ //printf("MemberGroup::distributeMemberGroupDocumentation() %s\n",qPrint(grpHeader));
const MemberDef *md = 0;
for (const auto &smd : *memberList)
{
- //printf("checking md=%s\n",md->name().data());
+ //printf("checking md=%s\n",qPrint(md->name()));
// find the first member of the group with documentation
if (!smd->documentation().isEmpty() ||
!smd->briefDescription().isEmpty() ||
@@ -214,7 +214,7 @@ void MemberGroup::distributeMemberGroupDocumentation()
}
if (md) // distribute docs of md to other members of the list
{
- //printf("Member %s has documentation!\n",md->name().data());
+ //printf("Member %s has documentation!\n",qPrint(md->name()));
for (const auto &iomd : *memberList)
{
MemberDefMutable *omd = toMemberDefMutable(iomd);
@@ -223,7 +223,7 @@ void MemberGroup::distributeMemberGroupDocumentation()
omd->inbodyDocumentation().isEmpty()
)
{
- //printf("Copying documentation to member %s\n",omd->name().data());
+ //printf("Copying documentation to member %s\n",qPrint(omd->name()));
omd->setBriefDescription(md->briefDescription(),md->briefFile(),md->briefLine());
omd->setDocumentation(md->documentation(),md->docFile(),md->docLine());
omd->setInbodyDocumentation(md->inbodyDocumentation(),md->inbodyFile(),md->inbodyLine());
@@ -280,7 +280,7 @@ void MemberGroup::addListReferences(Definition *def)
name,
theTranslator->trGroup(TRUE,TRUE),
name,
- grpHeader,0,def);
+ grpHeader,QCString(),def);
}
}
@@ -295,7 +295,7 @@ void MemberGroup::setRefItems(const RefItemVector &sli)
m_xrefListItems.insert(m_xrefListItems.end(), sli.cbegin(), sli.cend());
}
-void MemberGroup::writeTagFile(FTextStream &tagFile)
+void MemberGroup::writeTagFile(TextStream &tagFile)
{
memberList->writeTagFile(tagFile);
}
diff --git a/src/membergroup.h b/src/membergroup.h
index b258a04..31705c0 100644
--- a/src/membergroup.h
+++ b/src/membergroup.h
@@ -36,16 +36,16 @@ class GroupDef;
class OutputList;
class Definition;
class DefinitionMutable;
-class FTextStream;
class RefItem;
+class TextStream;
/** A class representing a group of members. */
class MemberGroup
{
public:
//MemberGroup();
- MemberGroup(const Definition *container,int id,const char *header,
- const char *docs,const char *docFile,int docLine);
+ MemberGroup(const Definition *container,int id,const QCString &header,
+ const QCString &docs,const QCString &docFile,int docLine);
~MemberGroup();
QCString header() const { return grpHeader; }
int groupId() const { return grpId; }
@@ -53,15 +53,15 @@ class MemberGroup
void setAnchors();
void writePlainDeclarations(OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
- const ClassDef *inheritedFrom,const char *inheritId) const;
+ const ClassDef *inheritedFrom,const QCString &inheritId) const;
void writeDeclarations(OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
bool showInline=FALSE) const;
- void writeDocumentation(OutputList &ol,const char *scopeName,
+ void writeDocumentation(OutputList &ol,const QCString &scopeName,
const Definition *container,bool showEnumValues,bool showInline) const;
- void writeDocumentationPage(OutputList &ol,const char *scopeName,
+ void writeDocumentationPage(OutputList &ol,const QCString &scopeName,
const DefinitionMutable *container) const;
- void writeTagFile(FTextStream &);
+ void writeTagFile(TextStream &);
void addGroupedInheritedMembers(OutputList &ol,const ClassDef *cd,
MemberListType lt,
const ClassDef *inheritedFrom,const QCString &inheritId) const;
diff --git a/src/memberlist.cpp b/src/memberlist.cpp
index 8d07ae4..bd89739 100644
--- a/src/memberlist.cpp
+++ b/src/memberlist.cpp
@@ -73,7 +73,7 @@ int genericCompareMembers(const MemberDef *c1,const MemberDef *c2)
// sort on name
int cmp = qstricmp(c1->name(),c2->name());
// then on argument list
- if (cmp==0 && c1->argsString() && c2->argsString())
+ if (cmp==0 && !c1->argsString().isEmpty() && !c2->argsString().isEmpty())
{
cmp = qstricmp(c1->argsString(),c2->argsString());
}
@@ -100,8 +100,8 @@ int MemberList::countInheritableMembers(const ClassDef *inheritedFrom) const
if (md->memberType()!=MemberType_Friend &&
md->memberType()!=MemberType_EnumValue)
{
- //printf("member %s: isReimplementedBy(%s)=%d\n",md->name().data(),
- // inheritedFrom->name().data(),
+ //printf("member %s: isReimplementedBy(%s)=%d\n",qPrint(md->name()),
+ // qPrint(inheritedFrom->name()),
// md->isReimplementedBy(inheritedFrom));
if (md->memberType()==MemberType_Function)
{
@@ -119,8 +119,8 @@ int MemberList::countInheritableMembers(const ClassDef *inheritedFrom) const
count+=mg->countInheritableMembers(inheritedFrom);
}
//printf("%s::countInheritableMembers(%s)=%d\n",
- // listTypeAsString().data(),
- // inheritedFrom->name().data(),count);
+ // qPrint(listTypeAsString()),
+ // qPrint(inheritedFrom->name()),count);
return count;
}
@@ -139,7 +139,7 @@ void MemberList::countDecMembers()
m_numDecMembers=0;
for (const auto &md : m_members)
{
- //printf("MemberList::countDecMembers(md=%s,%d)\n",md->name().data(),md->isBriefSectionVisible());
+ //printf("MemberList::countDecMembers(md=%s,%d)\n",qPrint(md->name()),md->isBriefSectionVisible());
if (md->isBriefSectionVisible())
{
switch(md->memberType())
@@ -176,7 +176,7 @@ void MemberList::countDecMembers()
break;
//case MemberType_Prototype: m_protoCnt++,m_numDecMembers++; break;
case MemberType_Define: if (Config_getBool(EXTRACT_ALL) ||
- md->argsString() ||
+ !md->argsString().isEmpty() ||
!md->initializer().isEmpty() ||
md->hasDocumentation()
) /*m_defCnt++,*/ m_numDecMembers++;
@@ -185,7 +185,7 @@ void MemberList::countDecMembers()
m_numDecMembers++;
break;
default:
- err("Unknown member type found for member '%s'\n!",md->name().data());
+ err("Unknown member type found for member '%s'\n!",qPrint(md->name()));
}
}
}
@@ -340,7 +340,7 @@ bool MemberList::declVisible() const
void MemberList::writePlainDeclarations(OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,
- const GroupDef *gd,const ClassDef *inheritedFrom,const char *inheritId
+ const GroupDef *gd,const ClassDef *inheritedFrom,const QCString &inheritId
) const
{
//printf("----- writePlainDeclaration() ----\n");
@@ -363,7 +363,7 @@ void MemberList::writePlainDeclarations(OutputList &ol,
for (const auto &md : m_members)
{
//printf(">>> Member '%s' type=%d visible=%d\n",
- // md->name().data(),md->memberType(),md->isBriefSectionVisible());
+ // qPrint(md->name()),md->memberType(),md->isBriefSectionVisible());
if ((inheritedFrom==0 || !md->isReimplementedBy(inheritedFrom)) &&
md->isBriefSectionVisible())
{
@@ -406,7 +406,7 @@ void MemberList::writePlainDeclarations(OutputList &ol,
bool detailsLinkable = md->isDetailedSectionLinkable();
if (!detailsLinkable)
{
- ol.startDoxyAnchor(md->getOutputFileBase(),0,md->anchor(),md->name(),QCString());
+ ol.startDoxyAnchor(md->getOutputFileBase(),QCString(),md->anchor(),md->name(),QCString());
}
if (md->isSliceLocal())
{
@@ -431,7 +431,7 @@ void MemberList::writePlainDeclarations(OutputList &ol,
cd,md,
md->briefDescription(),
TRUE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)
);
if (rootNode && !rootNode->isEmpty())
{
@@ -532,7 +532,7 @@ void MemberList::writePlainDeclarations(OutputList &ol,
*/
void MemberList::writeDeclarations(OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
- const char *title,const char *subtitle, bool showEnumValues,
+ const QCString &title,const QCString &subtitle, bool showEnumValues,
bool showInline,const ClassDef *inheritedFrom,MemberListType lt) const
{
(void)showEnumValues; // unused
@@ -561,7 +561,7 @@ void MemberList::writeDeclarations(OutputList &ol,
ol.disableAllBut(OutputGenerator::Html);
inheritId = substitute(listTypeAsString(lt),"-","_")+"_"+
stripPath(cd->getOutputFileBase());
- if (title)
+ if (!title.isEmpty())
{
ol.writeInheritedSectionTitle(inheritId,cd->getReference(),
cd->getOutputFileBase(),
@@ -572,7 +572,7 @@ void MemberList::writeDeclarations(OutputList &ol,
}
else if (num>numEnumValues)
{
- if (title)
+ if (!title.isEmpty())
{
if (showInline)
{
@@ -592,17 +592,12 @@ void MemberList::writeDeclarations(OutputList &ol,
ol.endMemberHeader();
}
}
- if (subtitle)
+ if (!subtitle.stripWhiteSpace().isEmpty())
{
- QCString st=subtitle;
- st = st.stripWhiteSpace();
- if (!st.isEmpty())
- {
- ol.startMemberSubtitle();
- ol.generateDoc("[generated]",-1,ctx,0,subtitle,FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
- ol.endMemberSubtitle();
- }
+ ol.startMemberSubtitle();
+ ol.generateDoc("[generated]",-1,ctx,0,subtitle,FALSE,FALSE,
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ ol.endMemberSubtitle();
}
}
if (num>numEnumValues)
@@ -628,7 +623,7 @@ void MemberList::writeDeclarations(OutputList &ol,
bool hasHeader=!mg->header().isEmpty() && mg->header()!="[NOHEADER]";
if (inheritId.isEmpty())
{
- //printf("mg->header=%s hasHeader=%d\n",mg->header().data(),hasHeader);
+ //printf("mg->header=%s hasHeader=%d\n",qPrint(mg->header()),hasHeader);
ol.startMemberGroupHeader(hasHeader);
if (hasHeader)
{
@@ -640,7 +635,7 @@ void MemberList::writeDeclarations(OutputList &ol,
//printf("Member group has docs!\n");
ol.startMemberGroupDocs();
ol.generateDoc(mg->docFile(),mg->docLine(),ctx,0,mg->documentation()+"\n",FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endMemberGroupDocs();
}
ol.startMemberGroup();
@@ -667,8 +662,8 @@ void MemberList::writeDeclarations(OutputList &ol,
}
void MemberList::writeDocumentation(OutputList &ol,
- const char *scopeName, const Definition *container,
- const char *title,bool showEnumValues,bool showInline) const
+ const QCString &scopeName, const Definition *container,
+ const QCString &title,bool showEnumValues,bool showInline) const
{
if (numDocMembers()==-1)
{
@@ -679,7 +674,7 @@ void MemberList::writeDocumentation(OutputList &ol,
if (numDocMembers()==0) return;
if (!showEnumValues && numDocMembers()<=numDocEnumValues()) return;
- if (title)
+ if (!title.isEmpty())
{
ol.pushGeneratorState();
ol.disable(OutputGenerator::Html);
@@ -703,7 +698,7 @@ void MemberList::writeDocumentation(OutputList &ol,
if (md->isDetailedSectionVisible(m_inGroup,container->definitionType()==Definition::TypeFile) &&
!(md->isEnumValue() && !showInline))
{
- auto it = overloadInfo.insert(std::make_pair(md->name(),OverloadInfo())).first;
+ auto it = overloadInfo.insert(std::make_pair(md->name().str(),OverloadInfo())).first;
it->second.total++;
}
}
@@ -758,7 +753,7 @@ void MemberList::writeSimpleDocumentation(OutputList &ol,
// separate member pages
void MemberList::writeDocumentationPage(OutputList &ol,
- const char *scopeName, const DefinitionMutable *container) const
+ const QCString &scopeName, const DefinitionMutable *container) const
{
static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
@@ -774,9 +769,9 @@ void MemberList::writeDocumentationPage(OutputList &ol,
{
MemberDefMutable *md = toMemberDefMutable(imd);
- if (md->isDetailedSectionLinkable())
+ if (md && md->isDetailedSectionLinkable())
{
- auto it = overloadInfo.insert(std::make_pair(md->name(),OverloadInfo())).first;
+ auto it = overloadInfo.insert(std::make_pair(md->name().str(),OverloadInfo())).first;
it->second.total++;
}
}
@@ -785,7 +780,7 @@ void MemberList::writeDocumentationPage(OutputList &ol,
{
Definition *container_d = toDefinition(const_cast<DefinitionMutable*>(container));
MemberDefMutable *md = toMemberDefMutable(imd);
- if (md->isDetailedSectionLinkable())
+ if (md && md->isDetailedSectionLinkable())
{
auto it = overloadInfo.find(md->name().str());
uint overloadCount = it->second.total;
@@ -856,7 +851,7 @@ void MemberList::addListReferences(Definition *def)
MemberDefMutable *vmdm = toMemberDefMutable(vmd);
if (vmdm)
{
- //printf(" adding %s\n",vmd->name().data());
+ //printf(" adding %s\n",qPrint(vmd->name()));
vmdm->addListReference(def);
}
}
@@ -948,7 +943,7 @@ QCString MemberList::listTypeAsString(MemberListType type)
return "";
}
-void MemberList::writeTagFile(FTextStream &tagFile)
+void MemberList::writeTagFile(TextStream &tagFile)
{
for (const auto &imd : m_members)
{
diff --git a/src/memberlist.h b/src/memberlist.h
index aef227a..33920d5 100644
--- a/src/memberlist.h
+++ b/src/memberlist.h
@@ -88,19 +88,19 @@ class MemberList
int countInheritableMembers(const ClassDef *inheritedFrom) const;
void writePlainDeclarations(OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd, const GroupDef *gd,
- const ClassDef *inheritedFrom,const char *inheritId) const;
+ const ClassDef *inheritedFrom,const QCString &inheritId) const;
void writeDeclarations(OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
- const char *title,const char *subtitle,
+ const QCString &title,const QCString &subtitle,
bool showEnumValues=FALSE,bool showInline=FALSE,
const ClassDef *inheritedFrom=0,MemberListType lt=MemberListType_pubMethods) const;
- void writeDocumentation(OutputList &ol,const char *scopeName,
- const Definition *container,const char *title,
+ void writeDocumentation(OutputList &ol,const QCString &scopeName,
+ const Definition *container,const QCString &title,
bool showEnumValues=FALSE,bool showInline=FALSE) const;
void writeSimpleDocumentation(OutputList &ol,const Definition *container) const;
void writeDocumentationPage(OutputList &ol,
- const char *scopeName, const DefinitionMutable *container) const;
- void writeTagFile(FTextStream &);
+ const QCString &scopeName, const DefinitionMutable *container) const;
+ void writeTagFile(TextStream &);
bool declVisible() const;
void addMemberGroup(MemberGroup *mg);
void setInGroup(bool inGroup) { m_inGroup=inGroup; }
diff --git a/src/membername.h b/src/membername.h
index 2141d22..f600c8b 100644
--- a/src/membername.h
+++ b/src/membername.h
@@ -31,8 +31,8 @@ class MemberName
using reverse_iterator = typename Vec::reverse_iterator;
using const_reverse_iterator = typename Vec::const_reverse_iterator;
- MemberName(const char *name) : m_name(name) {}
- const char *memberName() const { return m_name; }
+ MemberName(const QCString &name) : m_name(name) {}
+ QCString memberName() const { return m_name; }
iterator begin() { return m_members.begin(); }
iterator end() { return m_members.end(); }
@@ -103,8 +103,8 @@ class MemberNameInfo
using iterator = typename Vec::iterator;
using const_iterator = typename Vec::const_iterator;
- MemberNameInfo(const char *name) : m_name(name) {}
- const char *memberName() const { return m_name; }
+ MemberNameInfo(const QCString &name) : m_name(name) {}
+ QCString memberName() const { return m_name; }
iterator begin() { return m_members.begin(); }
iterator end() { return m_members.end(); }
diff --git a/src/message.cpp b/src/message.cpp
index 6c7c8ac..c973de6 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -45,7 +45,7 @@ void initWarningFormat()
if (!Config_getString(WARN_LOGFILE).isEmpty())
{
- warnFile = Portable::fopen(Config_getString(WARN_LOGFILE),"w");
+ warnFile = Portable::fopen(Config_getString(WARN_LOGFILE).data(),"w");
}
if (!warnFile) // point it to something valid, because warn() relies on it
{
@@ -79,9 +79,9 @@ void msg(const char *fmt, ...)
}
}
-static void format_warn(const char *file,int line,const char *text)
+static void format_warn(const QCString &file,int line,const QCString &text)
{
- QCString fileSubst = file==0 ? "<unknown>" : file;
+ QCString fileSubst = file.isEmpty() ? "<unknown>" : file;
QCString lineSubst; lineSubst.setNum(line);
QCString textSubst = text;
QCString versionSubst;
@@ -122,15 +122,17 @@ static void handle_warn_as_error()
{
if (warnBehavior == WARN_YES)
{
- std::unique_lock<std::mutex> lock(g_mutex);
- QCString msgText = " (warning treated as error, aborting now)\n";
- fwrite(msgText.data(),1,msgText.length(),warnFile);
+ {
+ std::unique_lock<std::mutex> lock(g_mutex);
+ QCString msgText = " (warning treated as error, aborting now)\n";
+ fwrite(msgText.data(),1,msgText.length(),warnFile);
+ }
exit(1);
}
warnStat = true;
}
-static void do_warn(bool enabled, const char *file, int line, const char *prefix, const char *fmt, va_list args)
+static void do_warn(bool enabled, const QCString &file, int line, const char *prefix, const char *fmt, va_list args)
{
if (!enabled) return; // warning type disabled
@@ -147,18 +149,17 @@ static void do_warn(bool enabled, const char *file, int line, const char *prefix
// prefix
// 1 position for `\0`
int bufSize = vsnprintf(NULL, 0, fmt, args) + l + 1;
- char *text = (char *)malloc(sizeof(char) * bufSize);
+ QCString text(bufSize);
if (prefix)
{
- qstrncpy(text,prefix,bufSize);
+ qstrncpy(text.rawData(),prefix,bufSize);
}
- vsnprintf(text+l, bufSize-l, fmt, argsCopy);
+ vsnprintf(text.rawData()+l, bufSize-l, fmt, argsCopy);
text[bufSize-1]='\0';
format_warn(file,line,text);
- free(text);
}
-void warn(const char *file,int line,const char *fmt, ...)
+void warn(const QCString &file,int line,const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
@@ -166,18 +167,18 @@ void warn(const char *file,int line,const char *fmt, ...)
va_end(args);
}
-void va_warn(const char *file,int line,const char *fmt,va_list args)
+void va_warn(const QCString &file,int line,const char *fmt,va_list args)
{
do_warn(Config_getBool(WARNINGS), file, line, warning_str, fmt, args);
}
-void warn_simple(const char *file,int line,const char *text)
+void warn_simple(const QCString &file,int line,const char *text)
{
if (!Config_getBool(WARNINGS)) return; // warning type disabled
format_warn(file,line,QCString(warning_str) + text);
}
-void warn_undoc(const char *file,int line,const char *fmt, ...)
+void warn_undoc(const QCString &file,int line,const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
@@ -185,7 +186,7 @@ void warn_undoc(const char *file,int line,const char *fmt, ...)
va_end(args);
}
-void warn_incomplete_doc(const char *file,int line,const char *fmt, ...)
+void warn_incomplete_doc(const QCString &file,int line,const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
@@ -193,7 +194,7 @@ void warn_incomplete_doc(const char *file,int line,const char *fmt, ...)
va_end(args);
}
-void warn_doc_error(const char *file,int line,const char *fmt, ...)
+void warn_doc_error(const QCString &file,int line,const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
@@ -219,7 +220,7 @@ void err(const char *fmt, ...)
handle_warn_as_error();
}
-extern void err_full(const char *file,int line,const char *fmt, ...)
+extern void err_full(const QCString &file,int line,const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
diff --git a/src/message.h b/src/message.h
index aa63ecb..3c3ccd9 100644
--- a/src/message.h
+++ b/src/message.h
@@ -17,6 +17,7 @@
#define MESSAGE_H
#include <cstdarg>
+#include "qcstring.h"
#ifdef __GNUC__
#define PRINTFLIKE(FORMAT, PARAM ) __attribute__((format(printf, FORMAT, PARAM)))
@@ -25,15 +26,15 @@
#endif
extern void msg(const char *fmt, ...) PRINTFLIKE(1,2);
-extern void warn(const char *file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
-extern void va_warn(const char* file, int line, const char* fmt, va_list args);
-extern void warn_simple(const char *file,int line,const char *text);
-extern void warn_undoc(const char *file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
-extern void warn_incomplete_doc(const char *file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
-extern void warn_doc_error(const char *file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
+extern void warn(const QCString &file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
+extern void va_warn(const QCString &file, int line, const char* fmt, va_list args);
+extern void warn_simple(const QCString &file,int line,const char *text);
+extern void warn_undoc(const QCString &file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
+extern void warn_incomplete_doc(const QCString &file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
+extern void warn_doc_error(const QCString &file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
extern void warn_uncond(const char *fmt, ...) PRINTFLIKE(1, 2);
extern void err(const char *fmt, ...) PRINTFLIKE(1, 2);
-extern void err_full(const char *file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
+extern void err_full(const QCString &file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
extern void term(const char *fmt, ...) PRINTFLIKE(1, 2);
void initWarningFormat();
void warn_flush();
diff --git a/src/msc.cpp b/src/msc.cpp
index 29c9334..b486389 100644
--- a/src/msc.cpp
+++ b/src/msc.cpp
@@ -1,12 +1,10 @@
/******************************************************************************
*
- *
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2021 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
+ * 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.
*
@@ -15,6 +13,8 @@
*
*/
+#include <sstream>
+
#include "msc.h"
#include "portable.h"
#include "config.h"
@@ -23,44 +23,41 @@
#include "doxygen.h"
#include "index.h"
#include "util.h"
-#include "ftextstream.h"
#include "mscgen_api.h"
-
-#include <qdir.h>
+#include "dir.h"
+#include "textstream.h"
static const int maxCmdLine = 40960;
-static bool convertMapFile(FTextStream &t,const char *mapName,const QCString relPath,
+static bool convertMapFile(TextStream &t,const QCString &mapName,const QCString &relPath,
const QCString &context)
{
- QFile f(mapName);
- if (!f.open(IO_ReadOnly))
+ std::ifstream f(mapName.str(),std::ifstream::in);
+ if (!f.is_open())
{
err("failed to open map file %s for inclusion in the docs!\n"
"If you installed Graphviz/dot after a previous failing run, \n"
- "try deleting the output directory and rerun doxygen.\n",mapName);
- return FALSE;
+ "try deleting the output directory and rerun doxygen.\n",qPrint(mapName));
+ return false;
}
const int maxLineLen=1024;
- char buf[maxLineLen];
char url[maxLineLen];
char ref[maxLineLen];
int x1,y1,x2,y2;
- while (!f.atEnd())
+ std::string line;
+ while (getline(f,line))
{
- bool isRef = FALSE;
- int numBytes = f.readLine(buf,maxLineLen);
- buf[numBytes-1]='\0';
- //printf("ReadLine '%s'\n",buf);
- if (qstrncmp(buf,"rect",4)==0)
+ bool isRef = false;
+ //printf("ReadLine '%s'\n",line.c_str());
+ if (qstrncmp(line.c_str(),"rect",4)==0)
{
// obtain the url and the coordinates in the order used by graphviz-1.5
- sscanf(buf,"rect %s %d,%d %d,%d",url,&x1,&y1,&x2,&y2);
+ sscanf(line.c_str(),"rect %s %d,%d %d,%d",url,&x1,&y1,&x2,&y2);
if (qstrcmp(url,"\\ref")==0 || qstrcmp(url,"@ref")==0)
{
- isRef = TRUE;
- sscanf(buf,"rect %s %s %d,%d %d,%d",ref,url,&x1,&y1,&x2,&y2);
+ isRef = true;
+ sscanf(line.c_str(),"rect %s %s %d,%d %d,%d",ref,url,&x1,&y1,&x2,&y2);
}
// sanity checks
@@ -84,15 +81,15 @@ static bool convertMapFile(FTextStream &t,const char *mapName,const QCString rel
}
t << "\" shape=\"rect\" coords=\""
<< x1 << "," << y1 << "," << x2 << "," << y2 << "\""
- << " alt=\"\"/>" << endl;
+ << " alt=\"\"/>\n";
}
}
- return TRUE;
+ return true;
}
-void writeMscGraphFromFile(const char *inFile,const char *outDir,
- const char *outFile,MscOutputFormat format)
+void writeMscGraphFromFile(const QCString &inFile,const QCString &outDir,
+ const QCString &outFile,MscOutputFormat format)
{
QCString absOutFile = outDir;
absOutFile+=Portable::pathSeparator();
@@ -118,10 +115,10 @@ void writeMscGraphFromFile(const char *inFile,const char *outDir,
return;
}
int code;
- if ((code=mscgen_generate(inFile,imgName,msc_format))!=0)
+ if ((code=mscgen_generate(inFile.data(),imgName.data(),msc_format))!=0)
{
err("Problems generating msc output (error=%s). Look for typos in you msc file %s\n",
- mscgen_error2str(code),inFile);
+ mscgen_error2str(code),qPrint(inFile));
return;
}
@@ -129,7 +126,7 @@ void writeMscGraphFromFile(const char *inFile,const char *outDir,
{
QCString epstopdfArgs(maxCmdLine);
epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
- absOutFile.data(),absOutFile.data());
+ qPrint(absOutFile),qPrint(absOutFile));
Portable::sysTimerStart();
if (Portable::system("epstopdf",epstopdfArgs)!=0)
{
@@ -149,23 +146,23 @@ static QCString getMscImageMapFromFile(const QCString& inFile, const QCString& o
QCString outFile = inFile + ".map";
int code;
- if ((code=mscgen_generate(inFile,outFile,
+ if ((code=mscgen_generate(inFile.data(),outFile.data(),
writeSVGMap ? mscgen_format_svgmap : mscgen_format_pngmap))!=0)
{
err("Problems generating msc output (error=%s). Look for typos in you msc file %s\n",
- mscgen_error2str(code),inFile.data());
+ mscgen_error2str(code),qPrint(inFile));
return "";
}
- QGString result;
- FTextStream tmpout(&result);
- convertMapFile(tmpout, outFile, relPath, context);
- QDir().remove(outFile);
+ TextStream t;
+ convertMapFile(t, outFile, relPath, context);
+
+ Dir().remove(outFile.str());
- return result.data();
+ return t.str();
}
-void writeMscImageMapFromFile(FTextStream &t,const QCString &inFile,
+void writeMscImageMapFromFile(TextStream &t,const QCString &inFile,
const QCString &outDir,
const QCString &relPath,
const QCString &baseName,
@@ -193,12 +190,12 @@ void writeMscImageMapFromFile(FTextStream &t,const QCString &inFile,
if (!imap.isEmpty())
{
t << "\" alt=\""
- << baseName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>" << endl;
- t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">" << imap << "</map>" << endl;
+ << baseName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>\n";
+ t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">" << imap << "</map>\n";
}
else
{
- t << "\" alt=\"" << baseName << "\" border=\"0\"/>" << endl;
+ t << "\" alt=\"" << baseName << "\" border=\"0\"/>\n";
}
}
diff --git a/src/msc.h b/src/msc.h
index 58fada5..2e8e111 100644
--- a/src/msc.h
+++ b/src/msc.h
@@ -1,12 +1,10 @@
/******************************************************************************
*
- *
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2021 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
+ * 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.
*
@@ -19,17 +17,17 @@
#define _MSC_H
class QCString;
-class FTextStream;
+class TextStream;
enum MscOutputFormat { MSC_BITMAP , MSC_EPS, MSC_SVG };
-void writeMscGraphFromFile(const char *inFile,const char *outDir,
- const char *outFile,MscOutputFormat format);
+void writeMscGraphFromFile(const QCString &inFile,const QCString &outDir,
+ const QCString &outFile,MscOutputFormat format);
QCString getMscImageMapFromFile(const QCString& inFile, const QCString& outDir,
const QCString& relPath,const QCString& context);
-void writeMscImageMapFromFile(FTextStream &t,const QCString &inFile,
+void writeMscImageMapFromFile(TextStream &t,const QCString &inFile,
const QCString &outDir, const QCString &relPath,
const QCString &baseName, const QCString &context,
MscOutputFormat format
diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp
index 4b44f5c..db855ba 100644
--- a/src/namespacedef.cpp
+++ b/src/namespacedef.cpp
@@ -32,6 +32,7 @@
#include "config.h"
#include "definitionimpl.h"
#include "membername.h"
+#include "conceptdef.h"
//------------------------------------------------------------------
static QCString makeDisplayName(const NamespaceDef *nd,bool includeScope)
@@ -43,7 +44,7 @@ static QCString makeDisplayName(const NamespaceDef *nd,bool includeScope)
{
result = substitute(result,"::",sep);
}
- //printf("makeDisplayName() %s->%s lang=%d\n",name().data(),result.data(),lang);
+ //printf("makeDisplayName() %s->%s lang=%d\n",qPrint(name()),qPrint(result),lang);
return result;
}
//------------------------------------------------------------------
@@ -51,9 +52,9 @@ static QCString makeDisplayName(const NamespaceDef *nd,bool includeScope)
class NamespaceDefImpl : public DefinitionMixin<NamespaceDefMutable>
{
public:
- NamespaceDefImpl(const char *defFileName,int defLine,int defColumn,
- const char *name,const char *ref=0,
- const char *refFile=0,const char*type=0,
+ NamespaceDefImpl(const QCString &defFileName,int defLine,int defColumn,
+ const QCString &name,const QCString &ref=QCString(),
+ const QCString &refFile=QCString(),const QCString &type=QCString(),
bool isPublished=false);
virtual ~NamespaceDefImpl();
virtual DefType definitionType() const { return TypeNamespace; }
@@ -63,8 +64,9 @@ class NamespaceDefImpl : public DefinitionMixin<NamespaceDefMutable>
virtual void writeDocumentation(OutputList &ol);
virtual void writeMemberPages(OutputList &ol);
virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const;
- virtual void writeTagFile(FTextStream &);
+ virtual void writeTagFile(TextStream &);
virtual void insertClass(const ClassDef *cd);
+ virtual void insertConcept(const ConceptDef *cd);
virtual void insertNamespace(const NamespaceDef *nd);
virtual void insertMember(MemberDef *md);
virtual void computeAnchors();
@@ -89,7 +91,7 @@ class NamespaceDefImpl : public DefinitionMixin<NamespaceDefMutable>
virtual void distributeMemberGroupDocumentation();
virtual void findSectionsInDocumentation();
virtual void sortMemberLists();
- virtual const Definition *findInnerCompound(const char *name) const;
+ virtual const Definition *findInnerCompound(const QCString &name) const;
virtual void addInnerCompound(const Definition *d);
virtual void addListReferences();
virtual void setFileName(const QCString &fn);
@@ -103,6 +105,7 @@ class NamespaceDefImpl : public DefinitionMixin<NamespaceDefMutable>
virtual ClassLinkedRefMap getStructs() const { return structs; }
virtual ClassLinkedRefMap getExceptions() const { return exceptions; }
virtual NamespaceLinkedRefMap getNamespaces() const { return namespaces; }
+ virtual ConceptLinkedRefMap getConcepts() const { return m_concepts; }
virtual QCString title() const;
virtual QCString compoundTypeString() const;
@@ -118,6 +121,7 @@ class NamespaceDefImpl : public DefinitionMixin<NamespaceDefMutable>
void startMemberDeclarations(OutputList &ol);
void endMemberDeclarations(OutputList &ol);
void writeClassDeclarations(OutputList &ol,const QCString &title,const ClassLinkedRefMap &d);
+ void writeConcepts(OutputList &ol,const QCString &title);
void writeInlineClasses(OutputList &ol);
void writeMemberGroups(OutputList &ol);
void writeAuthorSection(OutputList &ol);
@@ -125,7 +129,8 @@ class NamespaceDefImpl : public DefinitionMixin<NamespaceDefMutable>
void endMemberDocumentation(OutputList &ol);
void writeSummaryLinks(OutputList &ol) const;
void addNamespaceAttributes(OutputList &ol);
- void writeClassesToTagFile(FTextStream &,const ClassLinkedRefMap &d);
+ void writeClassesToTagFile(TextStream &,const ClassLinkedRefMap &d);
+ void writeConceptsToTagFile(TextStream &);
void writeNamespaceDeclarations(OutputList &ol,const QCString &title,
bool isConstantGroup=false);
@@ -144,6 +149,7 @@ class NamespaceDefImpl : public DefinitionMixin<NamespaceDefMutable>
ClassLinkedRefMap interfaces;
ClassLinkedRefMap structs;
ClassLinkedRefMap exceptions;
+ ConceptLinkedRefMap m_concepts;
NamespaceLinkedRefMap namespaces;
bool m_subGrouping = false;
enum { NAMESPACE, MODULE, CONSTANT_GROUP, LIBRARY } m_type;
@@ -152,9 +158,9 @@ class NamespaceDefImpl : public DefinitionMixin<NamespaceDefMutable>
bool m_inline = false;
};
-NamespaceDefMutable *createNamespaceDef(const char *defFileName,int defLine,int defColumn,
- const char *name,const char *ref,
- const char *refFile,const char*type,
+NamespaceDefMutable *createNamespaceDef(const QCString &defFileName,int defLine,int defColumn,
+ const QCString &name,const QCString &ref,
+ const QCString &refFile,const QCString &type,
bool isPublished)
{
return new NamespaceDefImpl(defFileName,defLine,defColumn,name,ref,refFile,type,isPublished);
@@ -201,7 +207,7 @@ class NamespaceDefAliasImpl : public DefinitionAliasMixin<NamespaceDef>
{ return getNSAlias()->isLinkable(); }
virtual bool hasDetailedDescription() const
{ return getNSAlias()->hasDetailedDescription(); }
- virtual const Definition *findInnerCompound(const char *name) const
+ virtual const Definition *findInnerCompound(const QCString &name) const
{ return getNSAlias()->findInnerCompound(name); }
virtual bool subGrouping() const
{ return getNSAlias()->subGrouping(); }
@@ -223,6 +229,8 @@ class NamespaceDefAliasImpl : public DefinitionAliasMixin<NamespaceDef>
{ return getNSAlias()->getExceptions(); }
virtual NamespaceLinkedRefMap getNamespaces() const
{ return getNSAlias()->getNamespaces(); }
+ virtual ConceptLinkedRefMap getConcepts() const
+ { return getNSAlias()->getConcepts(); }
virtual QCString title() const
{ return getNSAlias()->title(); }
virtual QCString compoundTypeString() const
@@ -233,23 +241,23 @@ NamespaceDef *createNamespaceDefAlias(const Definition *newScope,const Namespace
{
NamespaceDef *alnd = new NamespaceDefAliasImpl(newScope,nd);
//printf("alnd name=%s localName=%s qualifiedName=%s displayName()=%s\n",
- // alnd->name().data(),alnd->localName().data(),alnd->qualifiedName().data(),
- // alnd->displayName().data());
+ // qPrint(alnd->name()),qPrint(alnd->localName()),qPrint(alnd->qualifiedName()),
+ // qPrint(alnd->displayName()));
return alnd;
}
//------------------------------------------------------------------
-NamespaceDefImpl::NamespaceDefImpl(const char *df,int dl,int dc,
- const char *name,const char *lref,
- const char *fName, const char*type,
+NamespaceDefImpl::NamespaceDefImpl(const QCString &df,int dl,int dc,
+ const QCString &name,const QCString &lref,
+ const QCString &fName, const QCString &type,
bool isPublished) :
DefinitionMixin(df,dl,dc,name)
,m_isPublished(isPublished)
{
- if (fName)
+ if (!fName.isEmpty())
{
- if (lref)
+ if (!lref.isEmpty())
{
fileName = stripExtension(fName);
}
@@ -265,15 +273,15 @@ NamespaceDefImpl::NamespaceDefImpl(const char *df,int dl,int dc,
setReference(lref);
m_inline=FALSE;
m_subGrouping=Config_getBool(SUBGROUPING);
- if (type && !strcmp("module", type))
+ if (type=="module")
{
m_type = MODULE;
}
- else if (type && !strcmp("constants", type))
+ else if (type=="constants")
{
m_type = CONSTANT_GROUP;
}
- else if (type && !strcmp("library", type))
+ else if (type=="library")
{
m_type = LIBRARY;
}
@@ -345,6 +353,10 @@ void NamespaceDefImpl::addInnerCompound(const Definition *d)
{
insertClass(toClassDef(d));
}
+ else if (d->definitionType()==Definition::TypeConcept)
+ {
+ insertConcept(toConceptDef(d));
+ }
}
void NamespaceDefImpl::insertClass(const ClassDef *cd)
@@ -370,6 +382,11 @@ void NamespaceDefImpl::insertClass(const ClassDef *cd)
d.add(cd->name(),cd);
}
+void NamespaceDefImpl::insertConcept(const ConceptDef *cd)
+{
+ m_concepts.add(cd->name(),cd);
+}
+
void NamespaceDefImpl::insertNamespace(const NamespaceDef *nd)
{
namespaces.add(nd->name(),nd);
@@ -391,7 +408,7 @@ void NamespaceDefImpl::addMembersToMemberGroup()
{
if (mg->allMembersInSameSection() && m_subGrouping)
{
- //printf("----> addToDeclarationSection(%s)\n",mg->header().data());
+ //printf("----> addToDeclarationSection(%s)\n",qPrint(mg->header()));
mg->addToDeclarationSection();
}
}
@@ -444,7 +461,7 @@ void NamespaceDefImpl::insertMember(MemberDef *md)
allMemberList = m_memberLists.back().get();
}
allMemberList->push_back(md);
- //printf("%s::m_allMembersDict->append(%s)\n",name().data(),md->localName().data());
+ //printf("%s::m_allMembersDict->append(%s)\n",qPrint(name()),qPrint(md->localName()));
m_allMembers.add(md->localName(),md);
//::addNamespaceMemberNameToIndex(md);
//static bool sortBriefDocs=Config_getBool(SORT_BRIEF_DOCS);
@@ -483,9 +500,9 @@ void NamespaceDefImpl::insertMember(MemberDef *md)
default:
err("NamespaceDefImpl::insertMembers(): "
"member '%s' with class scope '%s' inserted in namespace scope '%s'!\n",
- md->name().data(),
- md->getClassDef() ? md->getClassDef()->name().data() : "",
- name().data());
+ qPrint(md->name()),
+ md->getClassDef() ? qPrint(md->getClassDef()->name()) : "",
+ qPrint(name()));
}
// if this is an inline namespace, then insert an alias of this member in the outer scope.
if (isInline())
@@ -533,15 +550,15 @@ bool NamespaceDefImpl::hasDetailedDescription() const
!documentation().isEmpty());
}
-void NamespaceDefImpl::writeTagFile(FTextStream &tagFile)
+void NamespaceDefImpl::writeTagFile(TextStream &tagFile)
{
- tagFile << " <compound kind=\"namespace\">" << endl;
- tagFile << " <name>" << convertToXML(name()) << "</name>" << endl;
- tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>" << endl;
+ tagFile << " <compound kind=\"namespace\">\n";
+ tagFile << " <name>" << convertToXML(name()) << "</name>\n";
+ tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>\n";
QCString idStr = id();
if (!idStr.isEmpty())
{
- tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>" << endl;
+ tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
}
for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
{
@@ -553,7 +570,7 @@ void NamespaceDefImpl::writeTagFile(FTextStream &tagFile)
{
if (nd->isLinkableInProject())
{
- tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>" << endl;
+ tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>\n";
}
}
}
@@ -578,6 +595,11 @@ void NamespaceDefImpl::writeTagFile(FTextStream &tagFile)
writeClassesToTagFile(tagFile, exceptions);
}
break;
+ case LayoutDocEntry::NamespaceConcepts:
+ {
+ writeConceptsToTagFile(tagFile);
+ }
+ break;
case LayoutDocEntry::MemberDecl:
{
const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
@@ -601,7 +623,7 @@ void NamespaceDefImpl::writeTagFile(FTextStream &tagFile)
}
}
writeDocAnchorsToTagFile(tagFile);
- tagFile << " </compound>" << endl;
+ tagFile << " </compound>\n";
}
void NamespaceDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
@@ -614,7 +636,7 @@ void NamespaceDefImpl::writeDetailedDescription(OutputList &ol,const QCString &t
ol.popGeneratorState();
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- ol.writeAnchor(0,"details");
+ ol.writeAnchor(QCString(),"details");
ol.popGeneratorState();
ol.startGroupHeader();
ol.parseText(title);
@@ -624,7 +646,7 @@ void NamespaceDefImpl::writeDetailedDescription(OutputList &ol,const QCString &t
if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF))
{
ol.generateDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF) &&
!documentation().isEmpty())
@@ -642,7 +664,7 @@ void NamespaceDefImpl::writeDetailedDescription(OutputList &ol,const QCString &t
if (!documentation().isEmpty())
{
ol.generateDoc(docFile(),docLine(),this,0,documentation()+"\n",TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
ol.endTextBlock();
}
@@ -654,7 +676,7 @@ void NamespaceDefImpl::writeBriefDescription(OutputList &ol)
{
DocRoot *rootNode = validatingParseDoc(briefFile(),briefLine(),this,0,
briefDescription(),TRUE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
if (rootNode && !rootNode->isEmpty())
{
ol.startParagraph();
@@ -740,6 +762,11 @@ void NamespaceDefImpl::writeClassDeclarations(OutputList &ol,const QCString &tit
d.writeDeclaration(ol,0,title,TRUE);
}
+void NamespaceDefImpl::writeConcepts(OutputList &ol,const QCString &title)
+{
+ m_concepts.writeDeclaration(ol,title,TRUE);
+}
+
void NamespaceDefImpl::writeInlineClasses(OutputList &ol)
{
classes.writeDocumentation(ol,this);
@@ -788,35 +815,42 @@ void NamespaceDefImpl::writeSummaryLinks(OutputList &ol) const
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
QCString label = "nested-classes";
- ol.writeSummaryLink(0,label,ls->title(lang),first);
+ ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
first=FALSE;
}
else if (lde->kind()==LayoutDocEntry::NamespaceInterfaces && interfaces.declVisible())
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
QCString label = "interfaces";
- ol.writeSummaryLink(0,label,ls->title(lang),first);
+ ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
first=FALSE;
}
else if (lde->kind()==LayoutDocEntry::NamespaceStructs && structs.declVisible())
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
QCString label = "structs";
- ol.writeSummaryLink(0,label,ls->title(lang),first);
+ ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
first=FALSE;
}
else if (lde->kind()==LayoutDocEntry::NamespaceExceptions && exceptions.declVisible())
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
QCString label = "exceptions";
- ol.writeSummaryLink(0,label,ls->title(lang),first);
+ ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
first=FALSE;
}
else if (lde->kind()==LayoutDocEntry::NamespaceNestedNamespaces && namespaces.declVisible())
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
QCString label = "namespaces";
- ol.writeSummaryLink(0,label,ls->title(lang),first);
+ ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
+ first=FALSE;
+ }
+ else if (lde->kind()==LayoutDocEntry::NamespaceConcepts && m_concepts.declVisible())
+ {
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
+ QCString label = "concepts";
+ ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
first=FALSE;
}
else if (lde->kind()== LayoutDocEntry::MemberDecl)
@@ -825,7 +859,7 @@ void NamespaceDefImpl::writeSummaryLinks(OutputList &ol) const
MemberList * ml = getMemberList(lmd->type);
if (ml && ml->declVisible())
{
- ol.writeSummaryLink(0,MemberList::listTypeAsString(ml->listType()),lmd->title(lang),first);
+ ol.writeSummaryLink(QCString(),MemberList::listTypeAsString(ml->listType()),lmd->title(lang),first);
first=FALSE;
}
}
@@ -851,14 +885,25 @@ void NamespaceDefImpl::addNamespaceAttributes(OutputList &ol)
}
}
-void NamespaceDefImpl::writeClassesToTagFile(FTextStream &tagFile,const ClassLinkedRefMap &list)
+void NamespaceDefImpl::writeClassesToTagFile(TextStream &tagFile,const ClassLinkedRefMap &list)
{
for (const auto &cd : list)
{
if (cd->isLinkableInProject())
{
tagFile << " <class kind=\"" << cd->compoundTypeString()
- << "\">" << convertToXML(cd->name()) << "</class>" << endl;
+ << "\">" << convertToXML(cd->name()) << "</class>\n";
+ }
+ }
+}
+
+void NamespaceDefImpl::writeConceptsToTagFile(TextStream &tagFile)
+{
+ for (const auto &cd : m_concepts)
+ {
+ if (cd->isLinkableInProject())
+ {
+ tagFile << " <concept>" << convertToXML(cd->name()) << "</concept>\n";
}
}
}
@@ -933,6 +978,12 @@ void NamespaceDefImpl::writeDocumentation(OutputList &ol)
writeClassDeclarations(ol,ls->title(lang),exceptions);
}
break;
+ case LayoutDocEntry::NamespaceConcepts:
+ {
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
+ writeConcepts(ol,ls->title(lang));
+ }
+ break;
case LayoutDocEntry::NamespaceNestedNamespaces:
{
const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
@@ -988,7 +1039,9 @@ void NamespaceDefImpl::writeDocumentation(OutputList &ol)
case LayoutDocEntry::ClassAllMembersLink:
case LayoutDocEntry::ClassUsedFiles:
case LayoutDocEntry::ClassInlineClasses:
+ case LayoutDocEntry::ConceptDefinition:
case LayoutDocEntry::FileClasses:
+ case LayoutDocEntry::FileConcepts:
case LayoutDocEntry::FileInterfaces:
case LayoutDocEntry::FileStructs:
case LayoutDocEntry::FileExceptions:
@@ -1000,6 +1053,7 @@ void NamespaceDefImpl::writeDocumentation(OutputList &ol)
case LayoutDocEntry::FileSourceLink:
case LayoutDocEntry::FileInlineClasses:
case LayoutDocEntry::GroupClasses:
+ case LayoutDocEntry::GroupConcepts:
case LayoutDocEntry::GroupInlineClasses:
case LayoutDocEntry::GroupNamespaces:
case LayoutDocEntry::GroupDirs:
@@ -1109,7 +1163,7 @@ int NamespaceDefImpl::numDocMembers() const
void NamespaceDefImpl::addUsingDirective(const NamespaceDef *nd)
{
m_usingDirList.add(nd->qualifiedName(),nd);
- //printf("%p: NamespaceDefImpl::addUsingDirective: %s:%d\n",this,name().data(),m_usingDirList->count());
+ //printf("%p: NamespaceDefImpl::addUsingDirective: %s:%d\n",this,qPrint(name()),m_usingDirList->count());
}
void NamespaceDefImpl::addUsingDeclaration(const ClassDef *cd)
@@ -1122,7 +1176,7 @@ QCString NamespaceDefImpl::getOutputFileBase() const
return fileName;
}
-const Definition *NamespaceDefImpl::findInnerCompound(const char *n) const
+const Definition *NamespaceDefImpl::findInnerCompound(const QCString &n) const
{
if (n==0) return 0;
const Definition *d = m_innerCompounds.find(n);
@@ -1151,7 +1205,7 @@ void NamespaceDefImpl::addListReferences()
theTranslator->trModule(TRUE,TRUE) :
theTranslator->trNamespace(TRUE,TRUE),
getOutputFileBase(),displayName(),
- 0,
+ QCString(),
this
);
}
@@ -1228,7 +1282,7 @@ bool NamespaceLinkedRefMap::declVisible() const
return FALSE;
}
-void NamespaceLinkedRefMap::writeDeclaration(OutputList &ol,const char *title,
+void NamespaceLinkedRefMap::writeDeclaration(OutputList &ol,const QCString &title,
bool const isConstantGroup,bool localName)
{
@@ -1293,16 +1347,16 @@ void NamespaceLinkedRefMap::writeDeclaration(OutputList &ol,const char *title,
{
name = nd->displayName();
}
- ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(),0,name);
+ ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(),QCString(),name);
ol.endMemberItem();
if (!nd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
{
ol.startMemberDescription(nd->getOutputFileBase());
ol.generateDoc(nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription(),FALSE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endMemberDescription();
}
- ol.endMemberDeclaration(0,0);
+ ol.endMemberDeclaration(QCString(),QCString());
}
}
ol.endMemberList();
@@ -1373,7 +1427,7 @@ MemberList *NamespaceDefImpl::getMemberList(MemberListType lt) const
void NamespaceDefImpl::writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title)
{
MemberList * ml = getMemberList(lt);
- if (ml) ml->writeDeclarations(ol,0,this,0,0,title,0);
+ if (ml) ml->writeDeclarations(ol,0,this,0,0,title,QCString());
}
void NamespaceDefImpl::writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title)
@@ -1445,7 +1499,7 @@ QCString NamespaceDefImpl::compoundTypeString() const
}
else if(lang==SrcLangExt_CSharp)
{
- return "namespace";
+ return "namespace";
}
else if (lang==SrcLangExt_Fortran)
{
@@ -1470,7 +1524,7 @@ QCString NamespaceDefImpl::compoundTypeString() const
err_full(getDefFileName(),getDefLine(),"Internal inconsistency: namespace in IDL not module, library or constant group");
}
}
- return "";
+ return "namespace";
}
void NamespaceDefImpl::setMetaData(const QCString &m)
diff --git a/src/namespacedef.h b/src/namespacedef.h
index d41cc20..93fff75 100644
--- a/src/namespacedef.h
+++ b/src/namespacedef.h
@@ -25,11 +25,12 @@
class MemberList;
class ClassDef;
+class ConceptDef;
class OutputList;
class ClassLinkedRefMap;
+class ConceptLinkedRefMap;
class MemberDef;
class NamespaceDef;
-class FTextStream;
class NamespaceDef;
class NamespaceDefMutable;
@@ -44,7 +45,7 @@ class NamespaceLinkedMap : public LinkedMap<NamespaceDef>
class NamespaceLinkedRefMap : public LinkedRefMap<const NamespaceDef>
{
public:
- void writeDeclaration(OutputList &ol,const char *title,
+ void writeDeclaration(OutputList &ol,const QCString &title,
bool isConstantGroup=false, bool localName=FALSE);
bool declVisible() const;
};
@@ -71,7 +72,7 @@ class NamespaceDef : public Definition
virtual bool isLinkableInProject() const = 0;
virtual bool isLinkable() const = 0;
virtual bool hasDetailedDescription() const = 0;
- virtual const Definition *findInnerCompound(const char *name) const = 0;
+ virtual const Definition *findInnerCompound(const QCString &name) const = 0;
virtual bool subGrouping() const = 0;
virtual MemberList *getMemberList(MemberListType lt) const = 0;
virtual const MemberLists &getMemberLists() const = 0;
@@ -95,6 +96,9 @@ class NamespaceDef : public Definition
/*! Returns the namespaces contained in this namespace */
virtual NamespaceLinkedRefMap getNamespaces() const = 0;
+ /*! Returns the concepts contained in this namespace */
+ virtual ConceptLinkedRefMap getConcepts() const = 0;
+
virtual QCString title() const = 0;
virtual QCString compoundTypeString() const = 0;
};
@@ -109,8 +113,9 @@ class NamespaceDefMutable : public DefinitionMutable, public NamespaceDef
virtual void writeDocumentation(OutputList &ol) = 0;
virtual void writeMemberPages(OutputList &ol) = 0;
virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const = 0;
- virtual void writeTagFile(FTextStream &) = 0;
+ virtual void writeTagFile(TextStream &) = 0;
virtual void insertClass(const ClassDef *cd) = 0;
+ virtual void insertConcept(const ConceptDef *cd) = 0;
virtual void insertNamespace(const NamespaceDef *nd) = 0;
virtual void insertMember(MemberDef *md) = 0; // md cannot be const, since setSectionList is called on it
virtual void computeAnchors() = 0;
@@ -129,9 +134,9 @@ class NamespaceDefMutable : public DefinitionMutable, public NamespaceDef
};
/** Factory method to create new NamespaceDef instance */
-NamespaceDefMutable *createNamespaceDef(const char *defFileName,int defLine,int defColumn,
- const char *name,const char *ref=0,
- const char *refFile=0,const char*type=0,
+NamespaceDefMutable *createNamespaceDef(const QCString &defFileName,int defLine,int defColumn,
+ const QCString &name,const QCString &ref=QCString(),
+ const QCString &refFile=QCString(),const QCString &type=QCString(),
bool isPublished=false);
/** Factory method to create an alias of an existing namespace. Used for inline namespaces. */
diff --git a/src/outputgen.cpp b/src/outputgen.cpp
index 5be6817..82c470c 100644
--- a/src/outputgen.cpp
+++ b/src/outputgen.cpp
@@ -19,14 +19,12 @@
#include <stdlib.h>
-#include <qfile.h>
-
#include "doxygen.h"
#include "outputgen.h"
#include "message.h"
#include "portable.h"
-OutputGenerator::OutputGenerator(const char *dir) : m_dir(dir)
+OutputGenerator::OutputGenerator(const QCString &dir) : m_t(nullptr), m_dir(dir)
{
//printf("OutputGenerator::OutputGenerator()\n");
}
@@ -36,12 +34,12 @@ OutputGenerator::~OutputGenerator()
//printf("OutputGenerator::~OutputGenerator()\n");
}
-OutputGenerator::OutputGenerator(const OutputGenerator &og)
+OutputGenerator::OutputGenerator(const OutputGenerator &og) : m_t(nullptr)
{
m_dir = og.m_dir;
// we don't copy the other fields.
// after copying startPlainFile() should be called
- if (og.t.device()!=nullptr)
+ if (og.m_t.stream()!=nullptr)
{
throw std::runtime_error("OutputGenerator copy constructor called while a file is processing");
}
@@ -52,28 +50,29 @@ OutputGenerator &OutputGenerator::operator=(const OutputGenerator &og)
m_dir = og.m_dir;
// we don't copy the other fields.
// after assignment startPlainFile() should be called
- if (og.t.device()!=nullptr)
+ if (og.m_t.stream()!=nullptr)
{
throw std::runtime_error("OutputGenerator assignment operator called while a file is processing");
}
return *this;
}
-void OutputGenerator::startPlainFile(const char *name)
+void OutputGenerator::startPlainFile(const QCString &name)
{
//printf("startPlainFile(%s)\n",name);
m_fileName=m_dir+"/"+name;
- m_file.setName(m_fileName);
- if (!m_file.open(IO_WriteOnly))
+ m_file.open(m_fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!m_file.is_open())
{
term("Could not open file %s for writing\n",m_fileName.data());
}
- t.setDevice(&m_file);
+ m_t.setStream(&m_file);
}
void OutputGenerator::endPlainFile()
{
- t.unsetDevice();
+ m_t.flush();
+ m_t.setStream(nullptr);
m_file.close();
m_fileName.resize(0);
}
diff --git a/src/outputgen.h b/src/outputgen.h
index 0d64833..2af9fcb 100644
--- a/src/outputgen.h
+++ b/src/outputgen.h
@@ -20,12 +20,12 @@
#include <memory>
#include <stack>
-
-#include <qfile.h>
+#include <iostream>
+#include <fstream>
#include "index.h"
#include "section.h"
-#include "ftextstream.h"
+#include "textstream.h"
class ClassDiagram;
class DotClassGraph;
@@ -69,7 +69,7 @@ class CodeOutputInterface
* spaces visible, should break lines at a newline and should convert
* tabs to the right number of spaces.
*/
- virtual void codify(const char *s) = 0;
+ virtual void codify(const QCString &s) = 0;
/*! Writes a link to an object in a code fragment.
* \param ref If this is non-zero, the object is to be found in
@@ -80,9 +80,9 @@ class CodeOutputInterface
* \param name The text to display as a placeholder for the link.
* \param tooltip The tooltip to display when the mouse is on the link.
*/
- virtual void writeCodeLink(const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip) = 0;
+ virtual void writeCodeLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip) = 0;
/*! Writes the line number of a source listing
* \param ref External reference (when imported from a tag file)
@@ -90,8 +90,8 @@ class CodeOutputInterface
* \param anchor The anchor part of the URL pointing to the docs.
* \param lineNumber The line number to write
*/
- virtual void writeLineNumber(const char *ref,const char *file,
- const char *anchor,int lineNumber) = 0;
+ virtual void writeLineNumber(const QCString &ref,const QCString &file,
+ const QCString &anchor,int lineNumber) = 0;
/*! Writes a tool tip definition
* \param id unique identifier for the tooltip
@@ -101,10 +101,10 @@ class CodeOutputInterface
* \param defInfo Info about the symbol's definition in the source code
* \param declInfo Info about the symbol's declaration in the source code
*/
- virtual void writeTooltip(const char *id,
+ virtual void writeTooltip(const QCString &id,
const DocLinkInfo &docInfo,
- const char *decl,
- const char *desc,
+ const QCString &decl,
+ const QCString &desc,
const SourceLinkInfo &defInfo,
const SourceLinkInfo &declInfo
) = 0;
@@ -118,7 +118,7 @@ class CodeOutputInterface
* which elements of the same type are rendered using the same 'font class'.
* \param clsName The category name.
*/
- virtual void startFontClass(const char *clsName) = 0;
+ virtual void startFontClass(const QCString &clsName) = 0;
/*! Ends a block started with startFontClass() */
virtual void endFontClass() = 0;
@@ -126,10 +126,10 @@ class CodeOutputInterface
/*! Write an anchor to a source listing.
* \param name The name of the anchor.
*/
- virtual void writeCodeAnchor(const char *name) = 0;
+ virtual void writeCodeAnchor(const QCString &name) = 0;
- virtual void setCurrentDoc(const Definition *context,const char *anchor,bool isSourceFile) = 0;
- virtual void addWord(const char *word,bool hiPriority) = 0;
+ virtual void setCurrentDoc(const Definition *context,const QCString &anchor,bool isSourceFile) = 0;
+ virtual void addWord(const QCString &word,bool hiPriority) = 0;
/*! Starts a source code fragment. The fragment will be
* fed to the code parser (see code.h) for syntax highlighting
@@ -137,9 +137,9 @@ class CodeOutputInterface
* endCodeFragment()
* @param style The kind of code fragment.
*/
- virtual void startCodeFragment(const char *style) = 0;
+ virtual void startCodeFragment(const QCString &style) = 0;
/*! Ends a block of code */
- virtual void endCodeFragment(const char *style) = 0;
+ virtual void endCodeFragment(const QCString &style) = 0;
};
/** Base Interface used for generating output outside of the
@@ -187,7 +187,7 @@ class BaseOutputDocInterface : public CodeOutputInterface
/*! Writes an ASCII string to the output. Converts characters that have
* A special meaning, like \c & in html.
*/
- virtual void docify(const char *s) = 0;
+ virtual void docify(const QCString &s) = 0;
/*! Writes a single ASCII character to the output. Converts characters
* that have a special meaning.
@@ -197,13 +197,13 @@ class BaseOutputDocInterface : public CodeOutputInterface
/*! Writes an ASCII string to the output, \e without converting
* special characters.
*/
- virtual void writeString(const char *text) = 0;
+ virtual void writeString(const QCString &text) = 0;
/*! Starts a new paragraph */
//virtual void newParagraph() = 0;
/*! Starts a new paragraph */
- virtual void startParagraph(const char *classDef) = 0;
+ virtual void startParagraph(const QCString &classDef) = 0;
/*! Ends a paragraph */
virtual void endParagraph() = 0;
@@ -215,14 +215,14 @@ class BaseOutputDocInterface : public CodeOutputInterface
* the file.
* \param name The text to display as a placeholder for the link.
*/
- virtual void writeObjectLink(const char *ref,const char *file,
- const char *anchor, const char *name) = 0;
+ virtual void writeObjectLink(const QCString &ref,const QCString &file,
+ const QCString &anchor, const QCString &name) = 0;
/*! Starts a (link to an) URL found in the documentation.
* \param url The URL to link to.
*/
- virtual void startHtmlLink(const char *url) = 0;
+ virtual void startHtmlLink(const QCString &url) = 0;
/*! Ends a link started by startHtmlLink().
*/
@@ -282,22 +282,22 @@ class BaseOutputDocInterface : public CodeOutputInterface
virtual void startExamples() = 0;
virtual void endExamples() = 0;
- virtual void startParamList(ParamListTypes t,const char *title) = 0;
+ virtual void startParamList(ParamListTypes t,const QCString &title) = 0;
virtual void endParamList() = 0;
//virtual void writeDescItem() = 0;
virtual void startTitle() = 0;
virtual void endTitle() = 0;
- virtual void writeAnchor(const char *fileName,const char *name) = 0;
- virtual void startSection(const char *,const char *,SectionType) = 0;
- virtual void endSection(const char *,SectionType) = 0;
+ virtual void writeAnchor(const QCString &fileName,const QCString &name) = 0;
+ virtual void startSection(const QCString &,const QCString &,SectionType) = 0;
+ virtual void endSection(const QCString &,SectionType) = 0;
- virtual void lineBreak(const char *style) = 0;
- virtual void addIndexItem(const char *s1,const char *s2) = 0;
+ virtual void lineBreak(const QCString &style) = 0;
+ virtual void addIndexItem(const QCString &s1,const QCString &s2) = 0;
virtual void writeNonBreakableSpace(int) = 0;
- virtual void startDescTable(const char *title) = 0;
+ virtual void startDescTable(const QCString &title) = 0;
virtual void endDescTable() = 0;
virtual void startDescTableRow() = 0;
virtual void endDescTableRow() = 0;
@@ -305,10 +305,10 @@ class BaseOutputDocInterface : public CodeOutputInterface
virtual void endDescTableTitle() = 0;
virtual void startDescTableData() = 0;
virtual void endDescTableData() = 0;
- virtual void startTextLink(const char *file,const char *anchor) = 0;
+ virtual void startTextLink(const QCString &file,const QCString &anchor) = 0;
virtual void endTextLink() = 0;
virtual void startPageRef() = 0;
- virtual void endPageRef(const char *,const char *) = 0;
+ virtual void endPageRef(const QCString &,const QCString &) = 0;
virtual void startSubsection() = 0;
virtual void endSubsection() = 0;
virtual void startSubsubsection() = 0;
@@ -324,7 +324,7 @@ class OutputGenerator : public BaseOutputDocInterface
public:
enum OutputType { Html, Latex, Man, RTF, XML, DEF, Perl , Docbook};
- OutputGenerator(const char *dir);
+ OutputGenerator(const QCString &dir);
OutputGenerator(const OutputGenerator &o);
OutputGenerator &operator=(const OutputGenerator &o);
virtual ~OutputGenerator();
@@ -345,7 +345,7 @@ class OutputGenerator : public BaseOutputDocInterface
QCString dir() const;
QCString fileName() const;
- void startPlainFile(const char *name);
+ void startPlainFile(const QCString &name);
void endPlainFile();
//QCString getContents() const;
bool isEnabled() const { return m_active; }
@@ -359,19 +359,19 @@ class OutputGenerator : public BaseOutputDocInterface
///////////////////////////////////////////////////////////////
// structural output interface
///////////////////////////////////////////////////////////////
- virtual void startFile(const char *name,const char *manName,
- const char *title,int id=0) = 0;
+ virtual void startFile(const QCString &name,const QCString &manName,
+ const QCString &title,int id=0) = 0;
virtual void writeSearchInfo() = 0;
- virtual void writeFooter(const char *navPath) = 0;
+ virtual void writeFooter(const QCString &navPath) = 0;
virtual void endFile() = 0;
virtual void startIndexSection(IndexSections) = 0;
virtual void endIndexSection(IndexSections) = 0;
- virtual void writePageLink(const char *,bool) = 0;
+ virtual void writePageLink(const QCString &,bool) = 0;
virtual void startProjectNumber() = 0;
virtual void endProjectNumber() = 0;
virtual void writeStyleInfo(int part) = 0;
- virtual void startTitleHead(const char *) = 0;
- virtual void endTitleHead(const char *fileName,const char *name) = 0;
+ virtual void startTitleHead(const QCString &) = 0;
+ virtual void endTitleHead(const QCString &fileName,const QCString &name) = 0;
virtual void startIndexListItem() = 0;
virtual void endIndexListItem() = 0;
virtual void startIndexList() = 0;
@@ -379,16 +379,16 @@ class OutputGenerator : public BaseOutputDocInterface
virtual void startIndexKey() = 0;
virtual void endIndexKey() = 0;
virtual void startIndexValue(bool) = 0;
- virtual void endIndexValue(const char *,bool) = 0;
- virtual void startIndexItem(const char *ref,const char *file) = 0;
- virtual void endIndexItem(const char *ref,const char *file) = 0;
+ virtual void endIndexValue(const QCString &,bool) = 0;
+ virtual void startIndexItem(const QCString &ref,const QCString &file) = 0;
+ virtual void endIndexItem(const QCString &ref,const QCString &file) = 0;
virtual void startGroupHeader(int) = 0;
virtual void endGroupHeader(int) = 0;
virtual void startMemberSections() = 0;
virtual void endMemberSections() = 0;
virtual void startHeaderSection() = 0;
virtual void endHeaderSection() = 0;
- virtual void startMemberHeader(const char *anchor, int typ) = 0;
+ virtual void startMemberHeader(const QCString &anchor, int typ) = 0;
virtual void endMemberHeader() = 0;
virtual void startMemberSubtitle() = 0;
virtual void endMemberSubtitle() = 0;
@@ -400,10 +400,12 @@ class OutputGenerator : public BaseOutputDocInterface
virtual void endInlineHeader() = 0;
virtual void startAnonTypeScope(int) = 0;
virtual void endAnonTypeScope(int) = 0;
- virtual void startMemberItem(const char *,int,const char *) = 0;
+ virtual void startMemberItem(const QCString &,int,const QCString &) = 0;
virtual void endMemberItem() = 0;
virtual void startMemberTemplateParams() = 0;
- virtual void endMemberTemplateParams(const char *,const char *) = 0;
+ virtual void endMemberTemplateParams(const QCString &,const QCString &) = 0;
+ virtual void startCompoundTemplateParams() = 0;
+ virtual void endCompoundTemplateParams() = 0;
virtual void startMemberGroupHeader(bool) = 0;
virtual void endMemberGroupHeader() = 0;
virtual void startMemberGroupDocs() = 0;
@@ -412,29 +414,29 @@ class OutputGenerator : public BaseOutputDocInterface
virtual void endMemberGroup(bool) = 0;
virtual void insertMemberAlign(bool) = 0;
virtual void insertMemberAlignLeft(int,bool) = 0;
- virtual void startMemberDoc(const char *,const char *,
- const char *,const char *,int,int,bool) = 0;
+ virtual void startMemberDoc(const QCString &,const QCString &,
+ const QCString &,const QCString &,int,int,bool) = 0;
virtual void endMemberDoc(bool) = 0;
- virtual void startDoxyAnchor(const char *fName,const char *manName,
- const char *anchor,const char *name,
- const char *args) = 0;
- virtual void endDoxyAnchor(const char *fileName,const char *anchor) = 0;
+ virtual void startDoxyAnchor(const QCString &fName,const QCString &manName,
+ const QCString &anchor,const QCString &name,
+ const QCString &args) = 0;
+ virtual void endDoxyAnchor(const QCString &fileName,const QCString &anchor) = 0;
virtual void writeLatexSpacing() = 0;
- virtual void writeStartAnnoItem(const char *type,const char *file,
- const char *path,const char *name) = 0;
- virtual void writeEndAnnoItem(const char *name) = 0;
- virtual void startMemberDescription(const char *anchor,const char *inheritId, bool typ) = 0;
+ virtual void writeStartAnnoItem(const QCString &type,const QCString &file,
+ const QCString &path,const QCString &name) = 0;
+ virtual void writeEndAnnoItem(const QCString &name) = 0;
+ virtual void startMemberDescription(const QCString &anchor,const QCString &inheritId, bool typ) = 0;
virtual void endMemberDescription() = 0;
virtual void startMemberDeclaration() = 0;
- virtual void endMemberDeclaration(const char *anchor,const char *inheritId) = 0;
- virtual void writeInheritedSectionTitle(const char *id,const char *ref,
- const char *file,const char *anchor,
- const char *title,const char *name) = 0;
+ virtual void endMemberDeclaration(const QCString &anchor,const QCString &inheritId) = 0;
+ virtual void writeInheritedSectionTitle(const QCString &id,const QCString &ref,
+ const QCString &file,const QCString &anchor,
+ const QCString &title,const QCString &name) = 0;
virtual void startIndent() = 0;
virtual void endIndent() = 0;
virtual void writeSynopsis() = 0;
virtual void startClassDiagram() = 0;
- virtual void endClassDiagram(const ClassDiagram &,const char *,const char *) = 0;
+ virtual void endClassDiagram(const ClassDiagram &,const QCString &,const QCString &) = 0;
virtual void startDotGraph() = 0;
virtual void endDotGraph(DotClassGraph &g) = 0;
virtual void startInclDepGraph() = 0;
@@ -448,14 +450,14 @@ class OutputGenerator : public BaseOutputDocInterface
virtual void writeGraphicalHierarchy(DotGfxHierarchyTable &g) = 0;
virtual void startQuickIndices() = 0;
virtual void endQuickIndices() = 0;
- virtual void writeSplitBar(const char *) = 0;
- virtual void writeNavigationPath(const char *) = 0;
+ virtual void writeSplitBar(const QCString &) = 0;
+ virtual void writeNavigationPath(const QCString &) = 0;
virtual void writeLogo() = 0;
- virtual void writeQuickLinks(bool compact,HighlightedItem hli,const char *file) = 0;
- virtual void writeSummaryLink(const char *file,const char *anchor,const char *title,bool first) = 0;
+ virtual void writeQuickLinks(bool compact,HighlightedItem hli,const QCString &file) = 0;
+ virtual void writeSummaryLink(const QCString &file,const QCString &anchor,const QCString &title,bool first) = 0;
virtual void startContents() = 0;
virtual void endContents() = 0;
- virtual void startPageDoc(const char *) {}
+ virtual void startPageDoc(const QCString &) {}
virtual void endPageDoc() {}
virtual void startTextBlock(bool) = 0;
virtual void endTextBlock(bool) = 0;
@@ -464,15 +466,15 @@ class OutputGenerator : public BaseOutputDocInterface
virtual void endMemberDocPrefixItem() = 0;
virtual void startMemberDocName(bool) = 0;
virtual void endMemberDocName() = 0;
- virtual void startParameterType(bool,const char *key) = 0;
+ virtual void startParameterType(bool,const QCString &key) = 0;
virtual void endParameterType() = 0;
virtual void startParameterName(bool) = 0;
virtual void endParameterName(bool,bool,bool) = 0;
virtual void startParameterList(bool) = 0;
virtual void endParameterList() = 0;
- virtual void exceptionEntry(const char*,bool) = 0;
+ virtual void exceptionEntry(const QCString &,bool) = 0;
- virtual void startConstraintList(const char *) = 0;
+ virtual void startConstraintList(const QCString &) = 0;
virtual void startConstraintParam() = 0;
virtual void endConstraintParam() = 0;
virtual void startConstraintType() = 0;
@@ -492,15 +494,15 @@ class OutputGenerator : public BaseOutputDocInterface
virtual void startLabels() = 0;
- virtual void writeLabel(const char *,bool) = 0;
+ virtual void writeLabel(const QCString &,bool) = 0;
virtual void endLabels() = 0;
protected:
- FTextStream t;
+ TextStream m_t;
private:
QCString m_dir;
QCString m_fileName;
- QFile m_file;
+ std::ofstream m_file;
bool m_active = true;
std::stack<bool> m_genStack;
};
diff --git a/src/outputlist.cpp b/src/outputlist.cpp
index f968c8b..e4f0fe2 100644
--- a/src/outputlist.cpp
+++ b/src/outputlist.cpp
@@ -22,6 +22,8 @@
* the call to all output generators.
*/
+#include <atomic>
+
#include "outputlist.h"
#include "outputgen.h"
#include "config.h"
@@ -137,10 +139,10 @@ void OutputList::popGeneratorState()
}
}
-void OutputList::generateDoc(const char *fileName,int startLine,
+void OutputList::generateDoc(const QCString &fileName,int startLine,
const Definition *ctx,const MemberDef * md,
const QCString &docStr,bool indexWords,
- bool isExample,const char *exampleName,
+ bool isExample,const QCString &exampleName,
bool singleLine,bool linkFromIndex,
bool markdownSupport)
{
@@ -169,7 +171,7 @@ void OutputList::writeDoc(DocRoot *root,const Definition *ctx,const MemberDef *m
for (const auto &og : m_outputs)
{
//printf("og->printDoc(extension=%s)\n",
- // ctx?ctx->getDefFileExtension().data():"<null>");
+ // ctx?qPrint(ctx->getDefFileExtension()):"<null>");
if (og->isEnabled()) og->writeDoc(root,ctx,md,m_id);
}
VhdlDocGen::setFlowMember(0);
diff --git a/src/outputlist.h b/src/outputlist.h
index 7baef7a..eadf85f 100644
--- a/src/outputlist.h
+++ b/src/outputlist.h
@@ -65,9 +65,9 @@ class OutputList : public OutputDocInterface
// OutputDocInterface implementation
//////////////////////////////////////////////////
- void generateDoc(const char *fileName,int startLine,
+ void generateDoc(const QCString &fileName,int startLine,
const Definition *ctx,const MemberDef *md,const QCString &docStr,
- bool indexWords,bool isExample,const char *exampleName /*=0*/,
+ bool indexWords,bool isExample,const QCString &exampleName /*=0*/,
bool singleLine /*=FALSE*/,bool linkFromIndex /*=FALSE*/,
bool markdownSupport /*=FALSE*/);
void writeDoc(DocRoot *root,const Definition *ctx,const MemberDef *md,int id=0);
@@ -77,7 +77,7 @@ class OutputList : public OutputDocInterface
{ forall(&OutputGenerator::startIndexSection,is); }
void endIndexSection(IndexSections is)
{ forall(&OutputGenerator::endIndexSection,is); }
- void writePageLink(const char *name,bool first)
+ void writePageLink(const QCString &name,bool first)
{ forall(&OutputGenerator::writePageLink,name,first); }
void startProjectNumber()
{ forall(&OutputGenerator::startProjectNumber); }
@@ -85,30 +85,30 @@ class OutputList : public OutputDocInterface
{ forall(&OutputGenerator::endProjectNumber); }
void writeStyleInfo(int part)
{ forall(&OutputGenerator::writeStyleInfo,part); }
- void startFile(const char *name,const char *manName,const char *title)
+ void startFile(const QCString &name,const QCString &manName,const QCString &title)
{
newId();
forall(&OutputGenerator::startFile,name,manName,title,m_id);
}
void writeSearchInfo()
{ forall(&OutputGenerator::writeSearchInfo); }
- void writeFooter(const char *navPath)
+ void writeFooter(const QCString &navPath)
{ forall(&OutputGenerator::writeFooter,navPath); }
void endFile()
{ forall(&OutputGenerator::endFile); }
- void startTitleHead(const char *fileName)
+ void startTitleHead(const QCString &fileName)
{ forall(&OutputGenerator::startTitleHead,fileName); }
- void endTitleHead(const char *fileName,const char *name)
+ void endTitleHead(const QCString &fileName,const QCString &name)
{ forall(&OutputGenerator::endTitleHead,fileName,name); }
void startTitle()
{ forall(&OutputGenerator::startTitle); }
void endTitle()
{ forall(&OutputGenerator::endTitle); }
- void startParagraph(const char *classDef=0)
+ void startParagraph(const QCString &classDef=QCString())
{ forall(&OutputGenerator::startParagraph,classDef); }
void endParagraph()
{ forall(&OutputGenerator::endParagraph); }
- void writeString(const char *text)
+ void writeString(const QCString &text)
{ forall(&OutputGenerator::writeString,text); }
void startIndexListItem()
{ forall(&OutputGenerator::startIndexListItem); }
@@ -124,42 +124,42 @@ class OutputList : public OutputDocInterface
{ forall(&OutputGenerator::endIndexKey); }
void startIndexValue(bool b)
{ forall(&OutputGenerator::startIndexValue,b); }
- void endIndexValue(const char *name,bool b)
+ void endIndexValue(const QCString &name,bool b)
{ forall(&OutputGenerator::endIndexValue,name,b); }
void startItemList()
{ forall(&OutputGenerator::startItemList); }
void endItemList()
{ forall(&OutputGenerator::endItemList); }
- void startIndexItem(const char *ref,const char *file)
+ void startIndexItem(const QCString &ref,const QCString &file)
{ forall(&OutputGenerator::startIndexItem,ref,file); }
- void endIndexItem(const char *ref,const char *file)
+ void endIndexItem(const QCString &ref,const QCString &file)
{ forall(&OutputGenerator::endIndexItem,ref,file); }
- void docify(const char *s)
+ void docify(const QCString &s)
{ forall(&OutputGenerator::docify,s); }
- void codify(const char *s)
+ void codify(const QCString &s)
{ forall(&OutputGenerator::codify,s); }
- void writeObjectLink(const char *ref,const char *file,
- const char *anchor, const char *name)
+ void writeObjectLink(const QCString &ref,const QCString &file,
+ const QCString &anchor, const QCString &name)
{ forall(&OutputGenerator::writeObjectLink,ref,file,anchor,name); }
- void writeCodeLink(const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip)
+ void writeCodeLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip)
{ forall(&OutputGenerator::writeCodeLink,ref,file,anchor,name,tooltip); }
- void writeTooltip(const char *id, const DocLinkInfo &docInfo, const char *decl,
- const char *desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo)
+ void writeTooltip(const QCString &id, const DocLinkInfo &docInfo, const QCString &decl,
+ const QCString &desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo)
{ forall(&OutputGenerator::writeTooltip,id,docInfo,decl,desc,defInfo,declInfo); }
- void startTextLink(const char *file,const char *anchor)
+ void startTextLink(const QCString &file,const QCString &anchor)
{ forall(&OutputGenerator::startTextLink,file,anchor); }
void endTextLink()
{ forall(&OutputGenerator::endTextLink); }
- void startHtmlLink(const char *url)
+ void startHtmlLink(const QCString &url)
{ forall(&OutputGenerator::startHtmlLink,url); }
void endHtmlLink()
{ forall(&OutputGenerator::endHtmlLink); }
- void writeStartAnnoItem(const char *type,const char *file,
- const char *path,const char *name)
+ void writeStartAnnoItem(const QCString &type,const QCString &file,
+ const QCString &path,const QCString &name)
{ forall(&OutputGenerator::writeStartAnnoItem,type,file,path,name); }
- void writeEndAnnoItem(const char *name)
+ void writeEndAnnoItem(const QCString &name)
{ forall(&OutputGenerator::writeEndAnnoItem,name); }
void startTypewriter()
{ forall(&OutputGenerator::startTypewriter); }
@@ -181,7 +181,7 @@ class OutputList : public OutputDocInterface
{ forall(&OutputGenerator::startHeaderSection); }
void endHeaderSection()
{ forall(&OutputGenerator::endHeaderSection); }
- void startMemberHeader(const char *anchor, int typ = 2)
+ void startMemberHeader(const QCString &anchor, int typ = 2)
{ forall(&OutputGenerator::startMemberHeader,anchor,typ); }
void endMemberHeader()
{ forall(&OutputGenerator::endMemberHeader); }
@@ -205,14 +205,18 @@ class OutputList : public OutputDocInterface
{ forall(&OutputGenerator::startAnonTypeScope,i1); }
void endAnonTypeScope(int i1)
{ forall(&OutputGenerator::endAnonTypeScope,i1); }
- void startMemberItem(const char *anchor,int i1,const char *id=0)
+ void startMemberItem(const QCString &anchor,int i1,const QCString &id=QCString())
{ forall(&OutputGenerator::startMemberItem,anchor,i1,id); }
void endMemberItem()
{ forall(&OutputGenerator::endMemberItem); }
void startMemberTemplateParams()
{ forall(&OutputGenerator::startMemberTemplateParams); }
- void endMemberTemplateParams(const char *anchor,const char *inheritId)
+ void endMemberTemplateParams(const QCString &anchor,const QCString &inheritId)
{ forall(&OutputGenerator::endMemberTemplateParams,anchor,inheritId); }
+ void startCompoundTemplateParams()
+ { forall(&OutputGenerator::startCompoundTemplateParams); }
+ void endCompoundTemplateParams()
+ { forall(&OutputGenerator::endCompoundTemplateParams); }
void startMemberGroupHeader(bool b)
{ forall(&OutputGenerator::startMemberGroupHeader,b); }
void endMemberGroupHeader()
@@ -231,17 +235,17 @@ class OutputList : public OutputDocInterface
{ forall(&OutputGenerator::insertMemberAlignLeft,typ,templ); }
void writeRuler()
{ forall(&OutputGenerator::writeRuler); }
- void writeAnchor(const char *fileName,const char *name)
+ void writeAnchor(const QCString &fileName,const QCString &name)
{ forall(&OutputGenerator::writeAnchor,fileName,name); }
- void startCodeFragment(const char *style)
+ void startCodeFragment(const QCString &style)
{ forall(&OutputGenerator::startCodeFragment,style); }
- void endCodeFragment(const char *style)
+ void endCodeFragment(const QCString &style)
{ forall(&OutputGenerator::endCodeFragment,style); }
void startCodeLine(bool hasLineNumbers)
{ forall(&OutputGenerator::startCodeLine,hasLineNumbers); }
void endCodeLine()
{ forall(&OutputGenerator::endCodeLine); }
- void writeLineNumber(const char *ref,const char *file,const char *anchor,
+ void writeLineNumber(const QCString &ref,const QCString &file,const QCString &anchor,
int lineNumber)
{ forall(&OutputGenerator::writeLineNumber,ref,file,anchor,lineNumber); }
void startEmphasis()
@@ -250,17 +254,17 @@ class OutputList : public OutputDocInterface
{ forall(&OutputGenerator::endEmphasis); }
void writeChar(char c)
{ forall(&OutputGenerator::writeChar,c); }
- void startMemberDoc(const char *clName,const char *memName,
- const char *anchor,const char *title,
+ void startMemberDoc(const QCString &clName,const QCString &memName,
+ const QCString &anchor,const QCString &title,
int memCount,int memTotal,bool showInline)
{ forall(&OutputGenerator::startMemberDoc,clName,memName,anchor,title,memCount,memTotal,showInline); }
void endMemberDoc(bool hasArgs)
{ forall(&OutputGenerator::endMemberDoc,hasArgs); }
- void startDoxyAnchor(const char *fName,const char *manName,
- const char *anchor, const char *name,
- const char *args)
+ void startDoxyAnchor(const QCString &fName,const QCString &manName,
+ const QCString &anchor, const QCString &name,
+ const QCString &args)
{ forall(&OutputGenerator::startDoxyAnchor,fName,manName,anchor,name,args); }
- void endDoxyAnchor(const char *fn,const char *anchor)
+ void endDoxyAnchor(const QCString &fn,const QCString &anchor)
{ forall(&OutputGenerator::endDoxyAnchor,fn,anchor); }
void writeLatexSpacing()
{ forall(&OutputGenerator::writeLatexSpacing); }
@@ -292,30 +296,30 @@ class OutputList : public OutputDocInterface
{ forall(&OutputGenerator::startSmall); }
void endSmall()
{ forall(&OutputGenerator::endSmall); }
- void lineBreak(const char *style=0)
+ void lineBreak(const QCString &style=QCString())
{ forall(&OutputGenerator::lineBreak,style); }
void startBold()
{ forall(&OutputGenerator::startBold); }
void endBold()
{ forall(&OutputGenerator::endBold); }
- void startMemberDescription(const char *anchor,const char *inheritId=0, bool typ = false)
+ void startMemberDescription(const QCString &anchor,const QCString &inheritId=QCString(), bool typ = false)
{ forall(&OutputGenerator::startMemberDescription,anchor,inheritId, typ); }
void endMemberDescription()
{ forall(&OutputGenerator::endMemberDescription); }
void startMemberDeclaration()
{ forall(&OutputGenerator::startMemberDeclaration); }
- void endMemberDeclaration(const char *anchor,const char *inheritId)
+ void endMemberDeclaration(const QCString &anchor,const QCString &inheritId)
{ forall(&OutputGenerator::endMemberDeclaration,anchor,inheritId); }
- void writeInheritedSectionTitle(const char *id, const char *ref,
- const char *file, const char *anchor,
- const char *title,const char *name)
+ void writeInheritedSectionTitle(const QCString &id, const QCString &ref,
+ const QCString &file, const QCString &anchor,
+ const QCString &title,const QCString &name)
{ forall(&OutputGenerator::writeInheritedSectionTitle,id,ref,
file,anchor,title,name); }
void startExamples()
{ forall(&OutputGenerator::startExamples); }
void endExamples()
{ forall(&OutputGenerator::endExamples); }
- void startParamList(ParamListTypes t,const char *title)
+ void startParamList(ParamListTypes t,const QCString &title)
{ forall(&OutputGenerator::startParamList,t,title); }
void endParamList()
{ forall(&OutputGenerator::endParamList); }
@@ -323,47 +327,47 @@ class OutputList : public OutputDocInterface
{ forall(&OutputGenerator::startIndent); }
void endIndent()
{ forall(&OutputGenerator::endIndent); }
- void startSection(const char *lab,const char *title,SectionType t)
+ void startSection(const QCString &lab,const QCString &title,SectionType t)
{ forall(&OutputGenerator::startSection,lab,title,t); }
- void endSection(const char *lab,SectionType t)
+ void endSection(const QCString &lab,SectionType t)
{ forall(&OutputGenerator::endSection,lab,t); }
- void addIndexItem(const char *s1,const char *s2)
+ void addIndexItem(const QCString &s1,const QCString &s2)
{ forall(&OutputGenerator::addIndexItem,s1,s2); }
void writeSynopsis()
{ forall(&OutputGenerator::writeSynopsis); }
void startClassDiagram()
{ forall(&OutputGenerator::startClassDiagram); }
- void endClassDiagram(const ClassDiagram &d,const char *f,const char *n)
+ void endClassDiagram(const ClassDiagram &d,const QCString &f,const QCString &n)
{ forall(&OutputGenerator::endClassDiagram,d,f,n); }
void startPageRef()
{ forall(&OutputGenerator::startPageRef); }
- void endPageRef(const char *c,const char *a)
+ void endPageRef(const QCString &c,const QCString &a)
{ forall(&OutputGenerator::endPageRef,c,a); }
void startQuickIndices()
{ forall(&OutputGenerator::startQuickIndices); }
void endQuickIndices()
{ forall(&OutputGenerator::endQuickIndices); }
- void writeSplitBar(const char *name)
+ void writeSplitBar(const QCString &name)
{ forall(&OutputGenerator::writeSplitBar,name); }
- void writeNavigationPath(const char *s)
+ void writeNavigationPath(const QCString &s)
{ forall(&OutputGenerator::writeNavigationPath,s); }
void writeLogo()
{ forall(&OutputGenerator::writeLogo); }
- void writeQuickLinks(bool compact,HighlightedItem hli,const char *file)
+ void writeQuickLinks(bool compact,HighlightedItem hli,const QCString &file)
{ forall(&OutputGenerator::writeQuickLinks,compact,hli,file); }
- void writeSummaryLink(const char *file,const char *anchor,const char *title,bool first)
+ void writeSummaryLink(const QCString &file,const QCString &anchor,const QCString &title,bool first)
{ forall(&OutputGenerator::writeSummaryLink,file,anchor,title,first); }
void startContents()
{ forall(&OutputGenerator::startContents); }
void endContents()
{ forall(&OutputGenerator::endContents); }
- void startPageDoc(const char *pageTitle)
+ void startPageDoc(const QCString &pageTitle)
{ forall(&OutputGenerator::startPageDoc, pageTitle); }
void endPageDoc()
{ forall(&OutputGenerator::endPageDoc); }
void writeNonBreakableSpace(int num)
{ forall(&OutputGenerator::writeNonBreakableSpace,num); }
- void startDescTable(const char *title)
+ void startDescTable(const QCString &title)
{ forall(&OutputGenerator::startDescTable,title); }
void endDescTable()
{ forall(&OutputGenerator::endDescTable); }
@@ -415,7 +419,7 @@ class OutputList : public OutputDocInterface
{ forall(&OutputGenerator::startMemberDocName,align); }
void endMemberDocName()
{ forall(&OutputGenerator::endMemberDocName); }
- void startParameterType(bool first,const char *key)
+ void startParameterType(bool first,const QCString &key)
{ forall(&OutputGenerator::startParameterType,first,key); }
void endParameterType()
{ forall(&OutputGenerator::endParameterType); }
@@ -427,10 +431,10 @@ class OutputList : public OutputDocInterface
{ forall(&OutputGenerator::startParameterList,openBracket); }
void endParameterList()
{ forall(&OutputGenerator::endParameterList); }
- void exceptionEntry(const char* prefix,bool closeBracket)
+ void exceptionEntry(const QCString &prefix,bool closeBracket)
{ forall(&OutputGenerator::exceptionEntry,prefix,closeBracket); }
- void startConstraintList(const char *header)
+ void startConstraintList(const QCString &header)
{ forall(&OutputGenerator::startConstraintList,header); }
void startConstraintParam()
{ forall(&OutputGenerator::startConstraintParam); }
@@ -466,23 +470,23 @@ class OutputList : public OutputDocInterface
void startLabels()
{ forall(&OutputGenerator::startLabels); }
- void writeLabel(const char *l,bool isLast)
+ void writeLabel(const QCString &l,bool isLast)
{ forall(&OutputGenerator::writeLabel,l,isLast); }
void endLabels()
{ forall(&OutputGenerator::endLabels); }
- void startFontClass(const char *c)
+ void startFontClass(const QCString &c)
{ forall(&OutputGenerator::startFontClass,c); }
void endFontClass()
{ forall(&OutputGenerator::endFontClass); }
- void writeCodeAnchor(const char *name)
+ void writeCodeAnchor(const QCString &name)
{ forall(&OutputGenerator::writeCodeAnchor,name); }
- void setCurrentDoc(const Definition *context,const char *anchor,bool isSourceFile)
+ void setCurrentDoc(const Definition *context,const QCString &anchor,bool isSourceFile)
{ forall(&OutputGenerator::setCurrentDoc,context,anchor,isSourceFile); }
- void addWord(const char *word,bool hiPriority)
+ void addWord(const QCString &word,bool hiPriority)
{ forall(&OutputGenerator::addWord,word,hiPriority); }
- void startPlainFile(const char *name)
+ void startPlainFile(const QCString &name)
{ forall(&OutputGenerator::startPlainFile,name); }
void endPlainFile()
{ forall(&OutputGenerator::endPlainFile); }
diff --git a/src/pagedef.cpp b/src/pagedef.cpp
index 4634be7..07a1f9e 100644
--- a/src/pagedef.cpp
+++ b/src/pagedef.cpp
@@ -30,10 +30,10 @@
class PageDefImpl : public DefinitionMixin<PageDef>
{
public:
- PageDefImpl(const char *f,int l,const char *n,const char *d,const char *t);
+ PageDefImpl(const QCString &f,int l,const QCString &n,const QCString &d,const QCString &t);
virtual ~PageDefImpl();
- virtual void setFileName(const char *name);
+ virtual void setFileName(const QCString &name);
virtual void setLocalToc(const LocalToc &tl);
virtual void setShowLineNo(bool);
virtual DefType definitionType() const { return TypePage; }
@@ -57,7 +57,7 @@ class PageDefImpl : public DefinitionMixin<PageDef>
virtual QCString displayName(bool=TRUE) const { return hasTitle() ? m_title : DefinitionMixin::name(); }
virtual bool showLineNo() const;
virtual void writeDocumentation(OutputList &ol);
- virtual void writeTagFile(FTextStream &);
+ virtual void writeTagFile(TextStream &);
virtual void setNestingLevel(int l);
virtual void writePageDocumentation(OutputList &ol) const;
@@ -71,16 +71,16 @@ class PageDefImpl : public DefinitionMixin<PageDef>
bool m_showLineNo;
};
-PageDef *createPageDef(const char *f,int l,const char *n,const char *d,const char *t)
+PageDef *createPageDef(const QCString &f,int l,const QCString &n,const QCString &d,const QCString &t)
{
return new PageDefImpl(f,l,n,d,t);
}
//------------------------------------------------------------------------------------------
-PageDefImpl::PageDefImpl(const char *f,int l,const char *n,
- const char *d,const char *t)
- : DefinitionMixin(f,l,1,n), m_title(t?t:n)
+PageDefImpl::PageDefImpl(const QCString &f,int l,const QCString &n,
+ const QCString &d,const QCString &t)
+ : DefinitionMixin(f,l,1,n), m_title(!t.isEmpty() ? t : n)
{
setDocumentation(d,f,l);
m_pageScope = 0;
@@ -112,7 +112,7 @@ QCString PageDefImpl::getOutputFileBase() const
return m_fileName;
}
-void PageDefImpl::setFileName(const char *name)
+void PageDefImpl::setFileName(const QCString &name)
{
m_fileName = name;
}
@@ -144,7 +144,7 @@ bool PageDefImpl::hasParentPage() const
getOuterScope()->definitionType()==Definition::TypePage;
}
-void PageDefImpl::writeTagFile(FTextStream &tagFile)
+void PageDefImpl::writeTagFile(TextStream &tagFile)
{
bool found = name()=="citelist";
for (RefListManager::Ptr &rl : RefListManager::instance())
@@ -157,12 +157,12 @@ void PageDefImpl::writeTagFile(FTextStream &tagFile)
}
if (!found) // not one of the generated related pages
{
- tagFile << " <compound kind=\"page\">" << endl;
- tagFile << " <name>" << name() << "</name>" << endl;
- tagFile << " <title>" << convertToXML(title()) << "</title>" << endl;
- tagFile << " <filename>" << convertToXML(getOutputFileBase())<< Doxygen::htmlFileExtension << "</filename>" << endl;
+ tagFile << " <compound kind=\"page\">\n";
+ tagFile << " <name>" << name() << "</name>\n";
+ tagFile << " <title>" << convertToXML(title()) << "</title>\n";
+ tagFile << " <filename>" << convertToXML(getOutputFileBase())<< Doxygen::htmlFileExtension << "</filename>\n";
writeDocAnchorsToTagFile(tagFile);
- tagFile << " </compound>" << endl;
+ tagFile << " </compound>\n";
}
}
@@ -232,7 +232,7 @@ void PageDefImpl::writeDocumentation(OutputList &ol)
if (si->title() != manPageName)
{
ol.generateDoc(docFile(),getStartBodyLine(),this,0,si->title(),TRUE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endSection(si->label(),si->type());
}
}
@@ -252,7 +252,7 @@ void PageDefImpl::writeDocumentation(OutputList &ol)
//ol.startSection(si->label,si->title,si->type);
startTitle(ol,getOutputFileBase(),this);
ol.generateDoc(docFile(),getStartBodyLine(),this,0,si->title(),TRUE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
//stringToSearchIndex(getOutputFileBase(),
// theTranslator->trPage(TRUE,TRUE)+" "+si->title,
// si->title);
@@ -286,7 +286,7 @@ void PageDefImpl::writeDocumentation(OutputList &ol)
ol.popGeneratorState();
//1.}
- Doxygen::indexList->addIndexItem(this,0,0,filterTitle(title().str()));
+ Doxygen::indexList->addIndexItem(this,0,QCString(),filterTitle(title().str()));
}
void PageDefImpl::writePageDocumentation(OutputList &ol) const
@@ -308,7 +308,7 @@ void PageDefImpl::writePageDocumentation(OutputList &ol) const
docStr, // docStr
TRUE, // index words
FALSE, // not an example
- 0, // exampleName
+ QCString(), // exampleName
FALSE, // singleLine
FALSE, // linkFromIndex
TRUE // markdown support
diff --git a/src/pagedef.h b/src/pagedef.h
index dba30dc..1a7b301 100644
--- a/src/pagedef.h
+++ b/src/pagedef.h
@@ -20,7 +20,6 @@
class PageLinkedRefMap;
class OutputList;
-class FTextStream;
/** @brief A model of a page symbol. */
class PageDef : public DefinitionMutable, public Definition
@@ -29,7 +28,7 @@ class PageDef : public DefinitionMutable, public Definition
virtual ~PageDef() {}
// setters
- virtual void setFileName(const char *name) = 0;
+ virtual void setFileName(const QCString &name) = 0;
virtual void setLocalToc(const LocalToc &tl) = 0;
virtual void setShowLineNo(bool) = 0;
@@ -56,13 +55,13 @@ class PageDef : public DefinitionMutable, public Definition
virtual bool showLineNo() const = 0;
virtual void writeDocumentation(OutputList &) = 0;
- virtual void writeTagFile(FTextStream &) = 0;
+ virtual void writeTagFile(TextStream &) = 0;
virtual void setNestingLevel(int) = 0;
virtual void writePageDocumentation(OutputList &) const = 0;
};
-PageDef *createPageDef(const char *f,int l,const char *n,const char *d,const char *t);
+PageDef *createPageDef(const QCString &f,int l,const QCString &n,const QCString &d,const QCString &t);
// --- Cast functions
diff --git a/src/parserintf.h b/src/parserintf.h
index 05b3adf..ccb4359 100644
--- a/src/parserintf.h
+++ b/src/parserintf.h
@@ -52,7 +52,7 @@ class OutlineParserInterface
* @param[in] clangParser The clang translation unit parser object
* or nullptr if disabled.
*/
- virtual void parseInput(const char *fileName,
+ virtual void parseInput(const QCString &fileName,
const char *fileBuf,
const std::shared_ptr<Entry> &root,
ClangTUParser *clangParser) = 0;
@@ -70,7 +70,7 @@ class OutlineParserInterface
* in the Entry node that corresponds with the node for which the
* comment block parser was invoked.
*/
- virtual void parsePrototype(const char *text) = 0;
+ virtual void parsePrototype(const QCString &text) = 0;
};
@@ -88,9 +88,9 @@ class CodeParserInterface
/** Parses a source file or fragment with the goal to produce
* highlighted and cross-referenced output.
* @param[in] codeOutIntf Abstract interface for writing the result.
- * @param[in] lang The programming language of the code fragment.
* @param[in] scopeName Name of scope to which the code belongs.
* @param[in] input Actual code in the form of a string
+ * @param[in] lang The programming language of the code fragment.
* @param[in] isExampleBlock TRUE iff the code is part of an example.
* @param[in] exampleName Name of the example.
* @param[in] fileDef File definition to which the code
@@ -108,11 +108,11 @@ class CodeParserInterface
* @param[in] collectXRefs collect cross-reference relations.
*/
virtual void parseCode(CodeOutputInterface &codeOutIntf,
- const char *scopeName,
+ const QCString &scopeName,
const QCString &input,
SrcLangExt lang,
bool isExampleBlock,
- const char *exampleName=0,
+ const QCString &exampleName=QCString(),
FileDef *fileDef=0,
int startLine=-1,
int endLine=-1,
@@ -147,7 +147,7 @@ class ParserManager
struct ParserPair
{
- ParserPair(OutlineParserFactory opf, CodeParserFactory cpf, const QCString pn)
+ ParserPair(OutlineParserFactory opf, CodeParserFactory cpf, const QCString &pn)
: outlineParserFactory(opf), codeParserFactory(cpf), parserName(pn)
{
}
@@ -164,7 +164,7 @@ class ParserManager
*/
ParserManager(OutlineParserFactory outlineParserFactory,
CodeParserFactory codeParserFactory)
- : m_defaultParsers(outlineParserFactory,codeParserFactory, "")
+ : m_defaultParsers(outlineParserFactory,codeParserFactory, QCString())
{
}
@@ -176,28 +176,28 @@ class ParserManager
* @param[in] codeParserFactory A factory method to create a code parser that is to be used
* for the given name.
*/
- void registerParser(const char *name,OutlineParserFactory outlineParserFactory,
+ void registerParser(const QCString &name,OutlineParserFactory outlineParserFactory,
CodeParserFactory codeParserFactory)
{
- m_parsers.emplace(std::string(name),ParserPair(outlineParserFactory,codeParserFactory,name));
+ m_parsers.emplace(name.str(),ParserPair(outlineParserFactory,codeParserFactory,name));
}
/** Registers a file \a extension with a parser with name \a parserName.
* Returns TRUE if the extension was successfully registered.
*/
- bool registerExtension(const char *extension, const char *parserName)
+ bool registerExtension(const QCString &extension, const QCString &parserName)
{
- if (parserName==0 || extension==0) return FALSE;
+ if (parserName.isEmpty() || extension.isEmpty()) return FALSE;
- const auto &parserIt = m_parsers.find(parserName);
+ const auto &parserIt = m_parsers.find(parserName.str());
if (parserIt == m_parsers.end()) return FALSE;
- auto extensionIt = m_extensions.find(extension);
+ auto extensionIt = m_extensions.find(extension.str());
if (extensionIt != m_extensions.end()) // extension already exists
{
m_extensions.erase(extensionIt); // remove it (e.g. user specified extension overrules built in one)
}
- m_extensions.emplace(std::string(extension),parserIt->second); // add new mapping
+ m_extensions.emplace(extension.str(),parserIt->second); // add new mapping
return TRUE;
}
@@ -205,7 +205,7 @@ class ParserManager
* If there is no parser explicitly registered for the supplied extension,
* the interface to the default parser will be returned.
*/
- std::unique_ptr<OutlineParserInterface> getOutlineParser(const char *extension)
+ std::unique_ptr<OutlineParserInterface> getOutlineParser(const QCString &extension)
{
return getParsers(extension).outlineParserFactory();
}
@@ -214,14 +214,14 @@ class ParserManager
* If there is no parser explicitly registered for the supplied extension,
* the interface to the default parser will be returned.
*/
- std::unique_ptr<CodeParserInterface> getCodeParser(const char *extension)
+ std::unique_ptr<CodeParserInterface> getCodeParser(const QCString &extension)
{
auto factory = getCodeParserFactory(extension);
return factory();
}
/** Get the factory for create code parser objects with a given \a extension. */
- CodeParserFactory &getCodeParserFactory(const char *extension)
+ CodeParserFactory &getCodeParserFactory(const QCString &extension)
{
return getParsers(extension).codeParserFactory;
}
@@ -230,15 +230,15 @@ class ParserManager
* If there is no parser explicitly registered for the supplied extension,
* te empty string will be reurned.
*/
- QCString getParserName(const char *extension)
+ QCString getParserName(const QCString &extension)
{
return getParsers(extension).parserName;
}
private:
- ParserPair &getParsers(const char *extension)
+ ParserPair &getParsers(const QCString &extension)
{
- QCString ext = QCString(extension).lower().data();
+ QCString ext = extension.lower();
if (ext.isEmpty()) ext=".no_extension";
auto it = m_extensions.find(ext.data());
if (it==m_extensions.end() && ext.length()>4)
diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp
index 4cf0d4a..b86f9aa 100644
--- a/src/perlmodgen.cpp
+++ b/src/perlmodgen.cpp
@@ -20,8 +20,8 @@
#include <stdlib.h>
#include <stack>
-#include <qdir.h>
-#include <qfile.h>
+#include <fstream>
+#include <iostream>
#include "perlmodgen.h"
#include "docparser.h"
@@ -29,7 +29,6 @@
#include "doxygen.h"
#include "pagedef.h"
#include "memberlist.h"
-#include "ftextstream.h"
#include "arguments.h"
#include "config.h"
#include "groupdef.h"
@@ -43,63 +42,58 @@
#include "util.h"
#include "htmlentity.h"
#include "emoji.h"
+#include "dir.h"
#define PERLOUTPUT_MAX_INDENTATION 40
class PerlModOutputStream
{
-public:
-
- QCString m_s;
- FTextStream *m_t;
+ public:
+ //QCString m_s;
+ std::ostream &m_t;
- PerlModOutputStream(FTextStream *t = 0) : m_t(t) { }
+ PerlModOutputStream(std::ostream &t) : m_t(t) { }
- void add(char c);
- void add(const char *s);
- void add(QCString &s);
- void add(int n);
- void add(unsigned int n);
+ void add(char c);
+ void add(const QCString &s);
+ void add(int n);
+ void add(unsigned int n);
};
void PerlModOutputStream::add(char c)
{
- if (m_t != 0)
- (*m_t) << c;
- else
- m_s += c;
+ m_t << c;
+ //if (m_t != 0)
+ // (*m_t) << c;
+ //else
+ // m_s += c;
}
-void PerlModOutputStream::add(const char *s)
+void PerlModOutputStream::add(const QCString &s)
{
- if (m_t != 0)
- (*m_t) << s;
- else
- m_s += s;
-}
-
-void PerlModOutputStream::add(QCString &s)
-{
- if (m_t != 0)
- (*m_t) << s;
- else
- m_s += s;
+ m_t << s;
+ //if (m_t != 0)
+ // (*m_t) << s;
+ //else
+ // m_s += s;
}
void PerlModOutputStream::add(int n)
{
- if (m_t != 0)
- (*m_t) << n;
- else
- m_s += QCString().setNum(n);
+ m_t << n;
+ //if (m_t != 0)
+ // (*m_t) << n;
+ //else
+ // m_s += QCString().setNum(n);
}
void PerlModOutputStream::add(unsigned int n)
{
- if (m_t != 0)
- (*m_t) << n;
- else
- m_s += QCString().setNum(n);
+ m_t << n;
+ //if (m_t != 0)
+ // (*m_t) << n;
+ //else
+ // m_s += QCString().setNum(n);
}
class PerlModOutput
@@ -118,8 +112,8 @@ public:
inline void setPerlModOutputStream(PerlModOutputStream *os) { m_stream = os; }
- inline PerlModOutput &openSave() { iopenSave(); return *this; }
- inline PerlModOutput &closeSave(QCString &s) { icloseSave(s); return *this; }
+ //inline PerlModOutput &openSave() { iopenSave(); return *this; }
+ //inline PerlModOutput &closeSave(QCString &s) { icloseSave(s); return *this; }
inline PerlModOutput &continueBlock()
{
@@ -132,12 +126,12 @@ public:
}
inline PerlModOutput &add(char c) { m_stream->add(c); return *this; }
- inline PerlModOutput &add(const char *s) { m_stream->add(s); return *this; }
+ inline PerlModOutput &add(const QCString &s) { m_stream->add(s); return *this; }
inline PerlModOutput &add(QCString &s) { m_stream->add(s); return *this; }
inline PerlModOutput &add(int n) { m_stream->add(n); return *this; }
inline PerlModOutput &add(unsigned int n) { m_stream->add(n); return *this; }
- PerlModOutput &addQuoted(const char *s) { iaddQuoted(s); return *this; }
+ PerlModOutput &addQuoted(const QCString &s) { iaddQuoted(s); return *this; }
inline PerlModOutput &indent()
{
@@ -148,41 +142,41 @@ public:
return *this;
}
- inline PerlModOutput &open(char c, const char *s = 0) { iopen(c, s); return *this; }
+ inline PerlModOutput &open(char c, const QCString &s = QCString()) { iopen(c, s); return *this; }
inline PerlModOutput &close(char c = 0) { iclose(c); return *this; }
- inline PerlModOutput &addField(const char *s) { iaddField(s); return *this; }
- inline PerlModOutput &addFieldQuotedChar(const char *field, char content)
+ inline PerlModOutput &addField(const QCString &s) { iaddField(s); return *this; }
+ inline PerlModOutput &addFieldQuotedChar(const QCString &field, char content)
{
iaddFieldQuotedChar(field, content); return *this;
}
- inline PerlModOutput &addFieldQuotedString(const char *field, const char *content)
+ inline PerlModOutput &addFieldQuotedString(const QCString &field, const QCString &content)
{
iaddFieldQuotedString(field, content); return *this;
}
- inline PerlModOutput &addFieldBoolean(const char *field, bool content)
+ inline PerlModOutput &addFieldBoolean(const QCString &field, bool content)
{
return addFieldQuotedString(field, content ? "yes" : "no");
}
- inline PerlModOutput &openList(const char *s = 0) { open('[', s); return *this; }
+ inline PerlModOutput &openList(const QCString &s = QCString()) { open('[', s); return *this; }
inline PerlModOutput &closeList() { close(']'); return *this; }
- inline PerlModOutput &openHash(const char *s = 0 ) { open('{', s); return *this; }
+ inline PerlModOutput &openHash(const QCString &s = QCString() ) { open('{', s); return *this; }
inline PerlModOutput &closeHash() { close('}'); return *this; }
protected:
- void iopenSave();
- void icloseSave(QCString &);
+ //void iopenSave();
+ //void icloseSave(QCString &);
void incIndent();
void decIndent();
- void iaddQuoted(const char *);
- void iaddFieldQuotedChar(const char *, char);
- void iaddFieldQuotedString(const char *, const char *);
- void iaddField(const char *);
+ void iaddQuoted(const QCString &);
+ void iaddFieldQuotedChar(const QCString &, char);
+ void iaddFieldQuotedString(const QCString &, const QCString &);
+ void iaddField(const QCString &);
- void iopen(char, const char *);
+ void iopen(char, const QCString &);
void iclose(char);
private:
@@ -191,23 +185,23 @@ private:
int m_indentation;
bool m_blockstart;
- std::stack<PerlModOutputStream*> m_saved;
+ //std::stack<PerlModOutputStream*> m_saved;
char m_spaces[PERLOUTPUT_MAX_INDENTATION * 2 + 2];
};
-void PerlModOutput::iopenSave()
-{
- m_saved.push(m_stream);
- m_stream = new PerlModOutputStream();
-}
+//void PerlModOutput::iopenSave()
+//{
+// m_saved.push(m_stream);
+// m_stream = new PerlModOutputStream();
+//}
-void PerlModOutput::icloseSave(QCString &s)
-{
- s = m_stream->m_s;
- delete m_stream;
- m_stream = m_saved.top();
- m_saved.pop();
-}
+//void PerlModOutput::icloseSave(QCString &s)
+//{
+// s = m_stream->m_s;
+// delete m_stream;
+// m_stream = m_saved.top();
+// m_saved.pop();
+//}
void PerlModOutput::incIndent()
{
@@ -226,24 +220,29 @@ void PerlModOutput::decIndent()
m_spaces[m_indentation * 2] = 0;
}
-void PerlModOutput::iaddQuoted(const char *s)
+void PerlModOutput::iaddQuoted(const QCString &str)
{
+ if (str.isEmpty()) return;
+ const char *s = str.data();
char c;
- while ((c = *s++) != 0) {
+ while ((c = *s++) != 0)
+ {
if ((c == '\'') || (c == '\\'))
+ {
m_stream->add('\\');
+ }
m_stream->add(c);
}
}
-void PerlModOutput::iaddField(const char *s)
+void PerlModOutput::iaddField(const QCString &s)
{
continueBlock();
m_stream->add(s);
m_stream->add(m_pretty ? " => " : "=>");
}
-void PerlModOutput::iaddFieldQuotedChar(const char *field, char content)
+void PerlModOutput::iaddFieldQuotedChar(const QCString &field, char content)
{
iaddField(field);
m_stream->add('\'');
@@ -253,7 +252,7 @@ void PerlModOutput::iaddFieldQuotedChar(const char *field, char content)
m_stream->add('\'');
}
-void PerlModOutput::iaddFieldQuotedString(const char *field, const char *content)
+void PerlModOutput::iaddFieldQuotedString(const QCString &field, const QCString &content)
{
if (content == 0)
return;
@@ -263,7 +262,7 @@ void PerlModOutput::iaddFieldQuotedString(const char *field, const char *content
m_stream->add('\'');
}
-void PerlModOutput::iopen(char c, const char *s)
+void PerlModOutput::iopen(char c, const QCString &s)
{
if (s != 0)
iaddField(s);
@@ -409,13 +408,13 @@ private:
void enterText();
void leaveText();
- void openItem(const char *);
+ void openItem(const QCString &);
void closeItem();
- void singleItem(const char *);
- void openSubBlock(const char * = 0);
+ void singleItem(const QCString &);
+ void openSubBlock(const QCString & = QCString());
void closeSubBlock();
- void openOther();
- void closeOther();
+ //void openOther();
+ //void closeOther();
//--------------------------------------
// state variables
@@ -448,7 +447,7 @@ void PerlModDocVisitor::addLink(const QCString &,const QCString &file,const QCSt
m_output.addFieldQuotedString("link", link);
}
-void PerlModDocVisitor::openItem(const char *name)
+void PerlModDocVisitor::openItem(const QCString &name)
{
leaveText();
m_output.openHash().addFieldQuotedString("type", name);
@@ -479,13 +478,13 @@ void PerlModDocVisitor::leaveText()
.closeHash();
}
-void PerlModDocVisitor::singleItem(const char *name)
+void PerlModDocVisitor::singleItem(const QCString &name)
{
openItem(name);
closeItem();
}
-void PerlModDocVisitor::openSubBlock(const char *s)
+void PerlModDocVisitor::openSubBlock(const QCString &s)
{
leaveText();
m_output.openList(s);
@@ -498,18 +497,18 @@ void PerlModDocVisitor::closeSubBlock()
m_output.closeList();
}
-void PerlModDocVisitor::openOther()
-{
+//void PerlModDocVisitor::openOther()
+//{
// Using a secondary text stream will corrupt the perl file. Instead of
// printing doc => [ data => [] ], it will print doc => [] data => [].
/*
leaveText();
m_output.openSave();
*/
-}
+//}
-void PerlModDocVisitor::closeOther()
-{
+//void PerlModDocVisitor::closeOther()
+//{
// Using a secondary text stream will corrupt the perl file. Instead of
// printing doc => [ data => [] ], it will print doc => [] data => [].
/*
@@ -518,7 +517,7 @@ void PerlModDocVisitor::closeOther()
m_output.closeSave(other);
m_other += other;
*/
-}
+//}
void PerlModDocVisitor::visit(DocWord *w)
{
@@ -709,23 +708,8 @@ void PerlModDocVisitor::visit(DocInclude *inc)
switch(inc->type())
{
case DocInclude::IncWithLines:
- #if 0
- {
- m_t << "<div class=\"fragment\"><pre>";
- QFileInfo cfi( inc->file() );
- FileDef fd( cfi.dirPath(), cfi.fileName() );
- parseCode(m_ci,inc->context(),inc->text().latin1(),inc->isExample(),inc->exampleFile(), &fd);
- m_t << "</pre></div>";
- }
- break;
- #endif
return;
case DocInclude::Include:
-#if 0
- m_output.add("<programlisting>");
- parseCode(m_ci,inc->context(),inc->text(),FALSE,0);
- m_output.add("</programlisting>");
-#endif
return;
case DocInclude::DontInclude: return;
case DocInclude::DontIncWithLines: return;
@@ -889,14 +873,14 @@ void PerlModDocVisitor::visitPre(DocSimpleSect *s)
}
leaveText();
m_output.openHash();
- openOther();
+ //openOther();
openSubBlock(type);
}
void PerlModDocVisitor::visitPost(DocSimpleSect *)
{
closeSubBlock();
- closeOther();
+ //closeOther();
m_output.closeHash();
}
@@ -1276,14 +1260,14 @@ void PerlModDocVisitor::visitPre(DocParamSect *s)
break;
}
m_output.openHash();
- openOther();
+ //openOther();
openSubBlock(type);
}
void PerlModDocVisitor::visitPost(DocParamSect *)
{
closeSubBlock();
- closeOther();
+ //closeOther();
m_output.closeHash();
}
@@ -1374,7 +1358,7 @@ void PerlModDocVisitor::visitPost(DocXRefItem *x)
void PerlModDocVisitor::visitPre(DocInternalRef *ref)
{
openItem("ref");
- addLink(0,ref->file(),ref->anchor());
+ addLink(QCString(),ref->file(),ref->anchor());
openSubBlock("content");
}
@@ -1421,7 +1405,7 @@ void PerlModDocVisitor::visitPost(DocParBlock *)
}
-static void addTemplateArgumentList(const ArgumentList &al,PerlModOutput &output,const char *)
+static void addTemplateArgumentList(const ArgumentList &al,PerlModOutput &output,const QCString &)
{
if (!al.hasParameters()) return;
output.openList("template_parameters");
@@ -1445,8 +1429,13 @@ static void addTemplateList(const ClassDef *cd,PerlModOutput &output)
addTemplateArgumentList(cd->templateArguments(),output,cd->name());
}
+static void addTemplateList(const ConceptDef *cd,PerlModOutput &output)
+{
+ addTemplateArgumentList(cd->getTemplateParameterList(),output,cd->name());
+}
+
static void addPerlModDocBlock(PerlModOutput &output,
- const char *name,
+ const QCString &name,
const QCString &fileName,
int lineNr,
const Definition *scope,
@@ -1458,7 +1447,7 @@ static void addPerlModDocBlock(PerlModOutput &output,
output.addField(name).add("{}");
else {
DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,stext,FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
output.openHash(name);
PerlModDocVisitor *visitor = new PerlModDocVisitor(output);
root->accept(visitor);
@@ -1498,7 +1487,7 @@ static QCString pathDoxyExec;
void setPerlModDoxyfile(const QCString &qs)
{
pathDoxyfile = qs;
- pathDoxyExec = QDir::currentDirPath().utf8();
+ pathDoxyExec = Dir::currentDirPath();
}
class PerlModGenerator
@@ -1525,16 +1514,18 @@ public:
void generatePerlModForMember(const MemberDef *md, const Definition *);
void generatePerlUserDefinedSection(const Definition *d, const MemberGroupList &mgl);
void generatePerlModSection(const Definition *d, MemberList *ml,
- const char *name, const char *header=0);
+ const QCString &name, const QCString &header=QCString());
void addListOfAllMembers(const ClassDef *cd);
+ void addIncludeInfo(const IncludeInfo *ii);
void generatePerlModForClass(const ClassDef *cd);
+ void generatePerlModForConcept(const ConceptDef *cd);
void generatePerlModForNamespace(const NamespaceDef *nd);
void generatePerlModForFile(const FileDef *fd);
void generatePerlModForGroup(const GroupDef *gd);
void generatePerlModForPage(PageDef *pi);
- bool createOutputFile(QFile &f, const char *s);
- bool createOutputDir(QDir &perlModDir);
+ bool createOutputFile(std::ofstream &f, const QCString &s);
+ bool createOutputDir(Dir &perlModDir);
bool generateDoxyLatexTex();
bool generateDoxyFormatTex();
bool generateDoxyStructurePM();
@@ -1665,7 +1656,7 @@ void PerlModGenerator::generatePerlModForMember(const MemberDef *md,const Defini
if (!md->initializer().isEmpty())
m_output.addFieldQuotedString("initializer", md->initializer());
- if (md->excpString())
+ if (!md->excpString().isEmpty())
m_output.addFieldQuotedString("exceptions", md->excpString());
if (md->memberType()==MemberType_Enumeration) // enum
@@ -1692,7 +1683,7 @@ void PerlModGenerator::generatePerlModForMember(const MemberDef *md,const Defini
}
}
- if (md->memberType() == MemberType_Variable && md->bitfieldString())
+ if (md->memberType() == MemberType_Variable && !md->bitfieldString().isEmpty())
{
QCString bitfield = md->bitfieldString();
if (bitfield.at(0) == ':') bitfield = bitfield.mid(1);
@@ -1720,13 +1711,13 @@ void PerlModGenerator::generatePerlModForMember(const MemberDef *md,const Defini
}
void PerlModGenerator::generatePerlModSection(const Definition *d,
- MemberList *ml,const char *name,const char *header)
+ MemberList *ml,const QCString &name,const QCString &header)
{
if (ml==0) return; // empty list
m_output.openHash(name);
- if (header)
+ if (!header.isEmpty())
m_output.addFieldQuotedString("header", header);
m_output.openList("members");
@@ -1773,8 +1764,10 @@ void PerlModGenerator::generatePerlUserDefinedSection(const Definition *d, const
for (const auto &mg : mgl)
{
m_output.openHash();
- if (mg->header())
+ if (!mg->header().isEmpty())
+ {
m_output.addFieldQuotedString("header", mg->header());
+ }
if (!mg->members().empty())
{
@@ -1791,6 +1784,22 @@ void PerlModGenerator::generatePerlUserDefinedSection(const Definition *d, const
}
}
+void PerlModGenerator::addIncludeInfo(const IncludeInfo *ii)
+{
+ if (ii)
+ {
+ QCString nm = ii->includeName;
+ if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
+ if (!nm.isEmpty())
+ {
+ m_output.openHash("includes");
+ m_output.addFieldBoolean("local", ii->local)
+ .addFieldQuotedString("name", nm)
+ .closeHash();
+ }
+ }
+}
+
void PerlModGenerator::generatePerlModForClass(const ClassDef *cd)
{
// + brief description
@@ -1855,23 +1864,7 @@ void PerlModGenerator::generatePerlModForClass(const ClassDef *cd)
m_output.closeList();
}
- const IncludeInfo *ii=cd->includeInfo();
- if (ii)
- {
- QCString nm = ii->includeName;
- if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
- if (!nm.isEmpty())
- {
- m_output.openHash("includes");
-#if 0
- if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
- t << " id=\"" << ii->fileDef->getOutputFileBase() << "\"";
-#endif
- m_output.addFieldBoolean("local", ii->local)
- .addFieldQuotedString("name", nm)
- .closeHash();
- }
- }
+ addIncludeInfo(cd->includeInfo());
addTemplateList(cd,m_output);
addListOfAllMembers(cd);
@@ -1933,6 +1926,22 @@ void PerlModGenerator::generatePerlModForClass(const ClassDef *cd)
m_output.closeHash();
}
+void PerlModGenerator::generatePerlModForConcept(const ConceptDef *cd)
+{
+ if (cd->isReference()) return; // skip external references
+
+ m_output.openHash()
+ .addFieldQuotedString("name", cd->name());
+
+ addIncludeInfo(cd->includeInfo());
+ addTemplateList(cd,m_output);
+ m_output.addFieldQuotedString("initializer", cd->initializer());
+ addPerlModDocBlock(m_output,"brief",cd->getDefFileName(),cd->getDefLine(),0,0,cd->briefDescription());
+ addPerlModDocBlock(m_output,"detailed",cd->getDefFileName(),cd->getDefLine(),0,0,cd->documentation());
+
+ m_output.closeHash();
+}
+
void PerlModGenerator::generatePerlModForNamespace(const NamespaceDef *nd)
{
// + contained class definitions
@@ -2152,12 +2161,11 @@ void PerlModGenerator::generatePerlModForPage(PageDef *pd)
bool PerlModGenerator::generatePerlModOutput()
{
- QFile outputFile;
- if (!createOutputFile(outputFile, pathDoxyDocsPM))
+ std::ofstream outputFileStream;
+ if (!createOutputFile(outputFileStream, pathDoxyDocsPM))
return false;
- FTextStream outputTextStream(&outputFile);
- PerlModOutputStream outputStream(&outputTextStream);
+ PerlModOutputStream outputStream(outputFileStream);
m_output.setPerlModOutputStream(&outputStream);
m_output.add("$doxydocs=").openHash();
@@ -2166,6 +2174,11 @@ bool PerlModGenerator::generatePerlModOutput()
generatePerlModForClass(cd.get());
m_output.closeList();
+ m_output.openList("concepts");
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ generatePerlModForConcept(cd.get());
+ m_output.closeList();
+
m_output.openList("namespaces");
for (const auto &nd : *Doxygen::namespaceLinkedMap)
generatePerlModForNamespace(nd.get());
@@ -2203,56 +2216,20 @@ bool PerlModGenerator::generatePerlModOutput()
return true;
}
-bool PerlModGenerator::createOutputFile(QFile &f, const char *s)
+bool PerlModGenerator::createOutputFile(std::ofstream &f, const QCString &s)
{
- f.setName(s);
- if (!f.open(IO_WriteOnly))
+ f.open(s.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- err("Cannot open file %s for writing!\n", s);
+ err("Cannot open file %s for writing!\n", qPrint(s));
return false;
}
return true;
}
-bool PerlModGenerator::createOutputDir(QDir &perlModDir)
+bool PerlModGenerator::createOutputDir(Dir &perlModDir)
{
- QCString outputDirectory = Config_getString(OUTPUT_DIRECTORY);
- if (outputDirectory.isEmpty())
- {
- outputDirectory=QDir::currentDirPath().utf8();
- }
- else
- {
- QDir dir(outputDirectory);
- if (!dir.exists())
- {
- dir.setPath(QDir::currentDirPath());
- if (!dir.mkdir(outputDirectory))
- {
- term("tag OUTPUT_DIRECTORY: Output directory '%s' does not "
- "exist and cannot be created\n",outputDirectory.data());
- }
- else
- {
- msg("Notice: Output directory '%s' does not exist. "
- "I have created it for you.\n", outputDirectory.data());
- }
- dir.cd(outputDirectory);
- }
- outputDirectory=dir.absPath().utf8();
- }
-
- QDir dir(outputDirectory);
- if (!dir.exists())
- {
- dir.setPath(QDir::currentDirPath());
- if (!dir.mkdir(outputDirectory))
- {
- err("Cannot create directory %s\n",outputDirectory.data());
- return false;
- }
- }
-
+ std::string outputDirectory = Config_getString(OUTPUT_DIRECTORY).str();
perlModDir.setPath(outputDirectory+"/perlmod");
if (!perlModDir.exists() && !perlModDir.mkdir(outputDirectory+"/perlmod"))
{
@@ -2264,11 +2241,10 @@ bool PerlModGenerator::createOutputDir(QDir &perlModDir)
bool PerlModGenerator::generateDoxyStructurePM()
{
- QFile doxyModelPM;
- if (!createOutputFile(doxyModelPM, pathDoxyStructurePM))
+ std::ofstream doxyModelPMStream;
+ if (!createOutputFile(doxyModelPMStream, pathDoxyStructurePM))
return false;
- FTextStream doxyModelPMStream(&doxyModelPM);
doxyModelPMStream <<
"sub memberlist($) {\n"
" my $prefix = $_[0];\n"
@@ -2448,14 +2424,13 @@ bool PerlModGenerator::generateDoxyStructurePM()
bool PerlModGenerator::generateDoxyRules()
{
- QFile doxyRules;
- if (!createOutputFile(doxyRules, pathDoxyRules))
+ std::ofstream doxyRulesStream;
+ if (!createOutputFile(doxyRulesStream, pathDoxyRules))
return false;
bool perlmodLatex = Config_getBool(PERLMOD_LATEX);
QCString prefix = Config_getString(PERLMOD_MAKEVAR_PREFIX);
- FTextStream doxyRulesStream(&doxyRules);
doxyRulesStream <<
prefix << "DOXY_EXEC_PATH = " << pathDoxyExec << "\n" <<
prefix << "DOXYFILE = " << pathDoxyfile << "\n" <<
@@ -2545,14 +2520,13 @@ bool PerlModGenerator::generateDoxyRules()
bool PerlModGenerator::generateMakefile()
{
- QFile makefile;
- if (!createOutputFile(makefile, pathMakefile))
+ std::ofstream makefileStream;
+ if (!createOutputFile(makefileStream, pathMakefile))
return false;
bool perlmodLatex = Config_getBool(PERLMOD_LATEX);
QCString prefix = Config_getString(PERLMOD_MAKEVAR_PREFIX);
- FTextStream makefileStream(&makefile);
makefileStream <<
".PHONY: default clean" << (perlmodLatex ? " pdf" : "") << "\n"
"default: " << (perlmodLatex ? "pdf" : "clean") << "\n"
@@ -2572,11 +2546,10 @@ bool PerlModGenerator::generateMakefile()
bool PerlModGenerator::generateDoxyLatexStructurePL()
{
- QFile doxyLatexStructurePL;
- if (!createOutputFile(doxyLatexStructurePL, pathDoxyLatexStructurePL))
+ std::ofstream doxyLatexStructurePLStream;
+ if (!createOutputFile(doxyLatexStructurePLStream, pathDoxyLatexStructurePL))
return false;
- FTextStream doxyLatexStructurePLStream(&doxyLatexStructurePL);
doxyLatexStructurePLStream <<
"use DoxyStructure;\n"
"\n"
@@ -2606,11 +2579,10 @@ bool PerlModGenerator::generateDoxyLatexStructurePL()
bool PerlModGenerator::generateDoxyLatexPL()
{
- QFile doxyLatexPL;
- if (!createOutputFile(doxyLatexPL, pathDoxyLatexPL))
+ std::ofstream doxyLatexPLStream;
+ if (!createOutputFile(doxyLatexPLStream, pathDoxyLatexPL))
return false;
- FTextStream doxyLatexPLStream(&doxyLatexPL);
doxyLatexPLStream <<
"use DoxyStructure;\n"
"use DoxyDocs;\n"
@@ -2729,11 +2701,10 @@ bool PerlModGenerator::generateDoxyLatexPL()
bool PerlModGenerator::generateDoxyFormatTex()
{
- QFile doxyFormatTex;
- if (!createOutputFile(doxyFormatTex, pathDoxyFormatTex))
+ std::ofstream doxyFormatTexStream;
+ if (!createOutputFile(doxyFormatTexStream, pathDoxyFormatTex))
return false;
- FTextStream doxyFormatTexStream(&doxyFormatTex);
doxyFormatTexStream <<
"\\def\\Defcs#1{\\long\\expandafter\\def\\csname#1\\endcsname}\n"
"\\Defcs{Empty}{}\n"
@@ -2892,11 +2863,10 @@ bool PerlModGenerator::generateDoxyFormatTex()
bool PerlModGenerator::generateDoxyLatexTex()
{
- QFile doxyLatexTex;
- if (!createOutputFile(doxyLatexTex, pathDoxyLatexTex))
+ std::ofstream doxyLatexTexStream;
+ if (!createOutputFile(doxyLatexTexStream, pathDoxyLatexTex))
return false;
- FTextStream doxyLatexTexStream(&doxyLatexTex);
doxyLatexTexStream <<
"\\documentclass[a4paper,12pt]{article}\n"
"\\usepackage[latin1]{inputenc}\n"
@@ -2926,13 +2896,13 @@ void PerlModGenerator::generate()
// + related pages
// - examples
- QDir perlModDir;
+ Dir perlModDir;
if (!createOutputDir(perlModDir))
return;
bool perlmodLatex = Config_getBool(PERLMOD_LATEX);
- QCString perlModAbsPath = perlModDir.absPath().utf8();
+ QCString perlModAbsPath = perlModDir.absPath();
pathDoxyDocsPM = perlModAbsPath + "/DoxyDocs.pm";
pathDoxyStructurePM = perlModAbsPath + "/DoxyStructure.pm";
pathMakefile = perlModAbsPath + "/Makefile";
diff --git a/src/plantuml.cpp b/src/plantuml.cpp
index 51debca..81f7df8 100644
--- a/src/plantuml.cpp
+++ b/src/plantuml.cpp
@@ -20,8 +20,7 @@
#include "doxygen.h"
#include "message.h"
#include "debug.h"
-
-#include <qfileinfo.h>
+#include "fileinfo.h"
QCString PlantumlManager::writePlantUMLSource(const QCString &outDirArg,const QCString &fileName,const QCString &content,OutputFormat format)
{
@@ -86,7 +85,7 @@ QCString PlantumlManager::writePlantUMLSource(const QCString &outDirArg,const QC
return baseName;
}
-void PlantumlManager::generatePlantUMLOutput(const char *baseName,const char *outDir,OutputFormat format)
+void PlantumlManager::generatePlantUMLOutput(const QCString &baseName,const QCString &outDir,OutputFormat format)
{
QCString plantumlJarPath = Config_getString(PLANTUML_JAR_PATH);
QCString plantumlConfigFile = Config_getString(PLANTUML_CFG_FILE);
@@ -128,7 +127,7 @@ PlantumlManager &PlantumlManager::instance()
PlantumlManager::PlantumlManager()
{
QCString outputFilename = Config_getString(OUTPUT_DIRECTORY) + "/" + CACHE_FILENAME;
- QFileInfo fi(outputFilename);
+ FileInfo fi(outputFilename.str());
if (fi.exists())
{
m_cachedPlantumlAllContent = fileToString(outputFilename);
@@ -230,17 +229,17 @@ static void runPlantumlContent(const PlantumlManager::FilesMap &plantumlFiles,
pumlArguments+=puFileName;
pumlArguments+="\" ";
- QFile file(puFileName);
- if (!file.open(IO_WriteOnly))
+ std::ofstream file(puFileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!file.is_open())
{
err("Could not open file %s for writing\n",puFileName.data());
}
- file.writeBlock( nb.content, nb.content.length() );
+ file.write( nb.content.data(), nb.content.length() );
file.close();
Debug::print(Debug::Plantuml,0,"*** %s Running Plantuml arguments:%s\n","PlantumlManager::runPlantumlContent",qPrint(pumlArguments));
Portable::sysTimerStart();
- if ((exitCode=Portable::system(pumlExe,pumlArguments,TRUE))!=0)
+ if ((exitCode=Portable::system(pumlExe.data(),pumlArguments.data(),TRUE))!=0)
{
err("Problems running PlantUML. Verify that the command 'java -jar \"%splantuml.jar\" -h' works from the command line. Exit code: %d\n",
plantumlJarPath.data(),exitCode);
@@ -248,7 +247,7 @@ static void runPlantumlContent(const PlantumlManager::FilesMap &plantumlFiles,
else if (Config_getBool(DOT_CLEANUP))
{
Debug::print(Debug::Plantuml,0,"*** %s Remove %s file\n","PlantumlManager::runPlantumlContent",qPrint(puFileName));
- file.remove();
+ Dir().remove(puFileName.str());
}
Portable::sysTimerStop();
@@ -265,7 +264,7 @@ static void runPlantumlContent(const PlantumlManager::FilesMap &plantumlFiles,
epstopdfArgs.sprintf("\"%s%s.eps\" --outfile=\"%s%s.pdf\"",
pumlOutDir.data(),str.c_str(), pumlOutDir.data(),str.c_str());
Portable::sysTimerStart();
- if ((exitCode=Portable::system("epstopdf",epstopdfArgs))!=0)
+ if ((exitCode=Portable::system("epstopdf",epstopdfArgs.data()))!=0)
{
err("Problems running epstopdf. Check your TeX installation! Exit code: %d\n",exitCode);
}
@@ -285,12 +284,12 @@ void PlantumlManager::run()
runPlantumlContent(m_svgPlantumlFiles, m_svgPlantumlContent, PUML_SVG);
runPlantumlContent(m_epsPlantumlFiles, m_epsPlantumlContent, PUML_EPS);
QCString outputFilename = Config_getString(OUTPUT_DIRECTORY) + "/" + CACHE_FILENAME;
- QFile file(outputFilename);
- if (!file.open(IO_WriteOnly))
+ std::ofstream file(outputFilename.str(),std::ofstream::out | std::ofstream::binary);
+ if (!file.is_open())
{
err("Could not open file %s for writing\n",CACHE_FILENAME);
}
- file.writeBlock( m_currentPlantumlAllContent, m_currentPlantumlAllContent.length() );
+ file.write( m_currentPlantumlAllContent.data(), m_currentPlantumlAllContent.length() );
file.close();
}
diff --git a/src/plantuml.h b/src/plantuml.h
index b553fa8..6b439f4 100644
--- a/src/plantuml.h
+++ b/src/plantuml.h
@@ -18,8 +18,9 @@
#include <map>
#include <string>
+
#include "containers.h"
-#include <qcstring.h>
+#include "qcstring.h"
#define CACHE_FILENAME "inline_umlgraph_cache_all.pu"
#define DIVIDE_COUNT 4
@@ -28,14 +29,10 @@
class QCString;
struct PlantumlContent
{
- QCString outDir;
+ PlantumlContent(const QCString &content_, const QCString &outDir_)
+ : content(content_), outDir(outDir_) {}
QCString content;
- PlantumlContent(const QCString Content, const QCString OutDir)
- {
- outDir = OutDir;
- content = Content;
- };
- ~PlantumlContent(){};
+ QCString outDir;
};
/** Singleton that manages plantuml relation actions */
@@ -64,7 +61,7 @@ class PlantumlManager
* @param[in] outDir the directory to write the resulting image into.
* @param[in] format the image format to generate.
*/
- void generatePlantUMLOutput(const char *baseName,const char *outDir,OutputFormat format);
+ void generatePlantUMLOutput(const QCString &baseName,const QCString &outDir,OutputFormat format);
using FilesMap = std::map< std::string, StringVector >;
using ContentMap = std::map< std::string, PlantumlContent >;
diff --git a/src/portable.cpp b/src/portable.cpp
index 4cf3244..7448e55 100644
--- a/src/portable.cpp
+++ b/src/portable.cpp
@@ -1,4 +1,5 @@
#include "portable.h"
+#include "qcstring.h"
#include <stdlib.h>
#include <stdio.h>
@@ -16,12 +17,15 @@
extern char **environ;
#endif
+#include <assert.h>
#include <ctype.h>
-#include <qdir.h>
#include <map>
#include <string>
+#include "fileinfo.h"
+
#include "util.h"
+#include "dir.h"
#ifndef NODEBUG
#include "debug.h"
#endif
@@ -35,10 +39,10 @@ static double g_sysElapsedTime;
static std::chrono::steady_clock::time_point g_startTime;
-int Portable::system(const char *command,const char *args,bool commandHasConsole)
+int Portable::system(const QCString &command,const QCString &args,bool commandHasConsole)
{
- if (command==0) return 1;
+ if (command.isEmpty()) return 1;
#if defined(_WIN32) && !defined(__CYGWIN__)
QCString commandCorrectedPath = substitute(command,'/','\\');
@@ -132,7 +136,7 @@ int Portable::system(const char *command,const char *args,bool commandHasConsole
#else // Win32 specific
if (commandHasConsole)
{
- return ::system(fullCmd);
+ return ::system(fullCmd.data());
}
else
{
@@ -144,8 +148,10 @@ 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( commandCorrectedPath );
- QString argsw = QString::fromUtf8( args );
+ uint16_t *commandw = NULL;
+ recodeUtf8StringToW( commandCorrectedPath, &commandw );
+ uint16_t *argsw = NULL;
+ recodeUtf8StringToW( args, &argsw );
// gswin32 is a GUI api which will pop up a window and run
// asynchronously. To prevent both, we use ShellExecuteEx and
@@ -159,8 +165,8 @@ int Portable::system(const char *command,const char *args,bool commandHasConsole
*/
NULL, /* window handle */
NULL, /* action to perform: open */
- (LPCWSTR)commandw.ucs2(), /* file to execute */
- (LPCWSTR)argsw.ucs2(), /* argument list */
+ (LPCWSTR)commandw, /* file to execute */
+ (LPCWSTR)argsw, /* argument list */
NULL, /* use current working dir */
SW_HIDE, /* minimize on start-up */
0, /* application instance handle */
@@ -174,6 +180,8 @@ int Portable::system(const char *command,const char *args,bool commandHasConsole
if (!ShellExecuteExW(&sInfo))
{
+ delete[] commandw;
+ delete[] argsw;
return -1;
}
else if (sInfo.hProcess) /* executable was launched, wait for it to finish */
@@ -186,6 +194,8 @@ int Portable::system(const char *command,const char *args,bool commandHasConsole
exitCode = -1;
}
CloseHandle(sInfo.hProcess);
+ delete[] commandw;
+ delete[] argsw;
return exitCode;
}
}
@@ -233,56 +243,56 @@ void loadEnvironment()
}
#endif
-void Portable::setenv(const char *name,const char *value)
+void Portable::setenv(const QCString &name,const QCString &value)
{
- if (value==0) value="";
#if defined(_WIN32) && !defined(__CYGWIN__)
- SetEnvironmentVariable(name,value);
+ SetEnvironmentVariable(name.data(),!value.isEmpty() ? value.data() : "");
#else
if(!environmentLoaded) // if the environment variables are not loaded already...
{ // ...call loadEnvironment to store them in class
loadEnvironment();
}
- proc_env[name] = std::string(value); // create or replace existing value
+ proc_env[name.str()] = value.str(); // create or replace existing value
#endif
}
-void Portable::unsetenv(const char *variable)
+void Portable::unsetenv(const QCString &variable)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
- SetEnvironmentVariable(variable,0);
+ SetEnvironmentVariable(variable.data(),0);
#else
/* Some systems don't have unsetenv(), so we do it ourselves */
- if (variable == NULL || *variable == '\0' || strchr (variable, '=') != NULL)
+ if (variable.isEmpty() || variable.find('=')!=-1)
{
return; // not properly formatted
}
- if(proc_env.find(variable) != proc_env.end())
+ auto it = proc_env.find(variable.str());
+ if (it != proc_env.end())
{
- proc_env[variable].erase();
+ proc_env.erase(it);
}
#endif
}
-const char *Portable::getenv(const char *variable)
+QCString Portable::getenv(const QCString &variable)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
- return ::getenv(variable);
+ return ::getenv(variable.data());
#else
if(!environmentLoaded) // if the environment variables are not loaded already...
- { // ...call loadEnvironment to store them in class
+ { // ...call loadEnvironment to store them in class
loadEnvironment();
}
- if(proc_env.find(variable) != proc_env.end())
+ if (proc_env.find(variable.str()) != proc_env.end())
{
- return proc_env[variable].c_str();
+ return QCString(proc_env[variable.str()]);
}
else
{
- return NULL;
+ return QCString();
}
#endif
}
@@ -309,44 +319,52 @@ portable_off_t Portable::ftell(FILE *f)
#endif
}
-FILE *Portable::fopen(const char *fileName,const char *mode)
+FILE *Portable::fopen(const QCString &fileName,const QCString &mode)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
- QString fn(fileName);
- QString m(mode);
- return _wfopen((wchar_t*)fn.ucs2(),(wchar_t*)m.ucs2());
+ uint16_t *fn = 0;
+ size_t fn_len = recodeUtf8StringToW(fileName,&fn);
+ uint16_t *m = 0;
+ size_t m_len = recodeUtf8StringToW(mode,&m);
+ FILE *result = 0;
+ if (fn_len!=(size_t)-1 && m_len!=(size_t)-1)
+ {
+ result = _wfopen((wchar_t*)fn,(wchar_t*)m);
+ }
+ delete[] fn;
+ delete[] m;
+ return result;
#else
- return ::fopen(fileName,mode);
+ return ::fopen(fileName.data(),mode.data());
#endif
}
-char Portable::pathSeparator()
+QCString Portable::pathSeparator()
{
#if defined(_WIN32) && !defined(__CYGWIN__)
- return '\\';
+ return "\\";
#else
- return '/';
+ return "/";
#endif
}
-char Portable::pathListSeparator()
+QCString Portable::pathListSeparator()
{
#if defined(_WIN32) && !defined(__CYGWIN__)
- return ';';
+ return ";";
#else
- return ':';
+ return ":";
#endif
}
-static bool ExistsOnPath(const char *fileName)
+static bool ExistsOnPath(const QCString &fileName)
{
- QFileInfo fi1(fileName);
+ FileInfo fi1(fileName.str());
if (fi1.exists()) return true;
- const char *p = Portable::getenv("PATH");
- char listSep = Portable::pathListSeparator();
- char pathSep = Portable::pathSeparator();
- QCString paths(p);
+ QCString paths = Portable::getenv("PATH");
+ char listSep = Portable::pathListSeparator()[0];
+ char pathSep = Portable::pathSeparator()[0];
int strt = 0;
int idx;
while ((idx = paths.find(listSep,strt)) != -1)
@@ -354,7 +372,7 @@ static bool ExistsOnPath(const char *fileName)
QCString locFile(paths.mid(strt,idx-strt));
locFile += pathSep;
locFile += fileName;
- QFileInfo fi(locFile);
+ FileInfo fi(locFile.str());
if (fi.exists()) return true;
strt = idx + 1;
}
@@ -364,19 +382,19 @@ static bool ExistsOnPath(const char *fileName)
{
locFile += pathSep;
locFile += fileName;
- QFileInfo fi(locFile);
+ FileInfo fi(locFile.str());
if (fi.exists()) return true;
}
return false;
}
-bool Portable::checkForExecutable(const char *fileName)
+bool Portable::checkForExecutable(const QCString &fileName)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
char *extensions[] = {".bat",".com",".exe"};
for (int i = 0; i < sizeof(extensions) / sizeof(*extensions); i++)
{
- if (ExistsOnPath(QCString(fileName) + extensions[i])) return true;
+ if (ExistsOnPath(fileName + extensions[i])) return true;
}
return false;
#else
@@ -426,12 +444,12 @@ bool Portable::fileSystemIsCaseSensitive()
#endif
}
-FILE * Portable::popen(const char *name,const char *type)
+FILE * Portable::popen(const QCString &name,const QCString &type)
{
#if defined(_MSC_VER) || defined(__BORLANDC__)
- return ::_popen(name,type);
+ return ::_popen(name.data(),type.data());
#else
- return ::popen(name,type);
+ return ::popen(name.data(),type.data());
#endif
}
@@ -470,19 +488,16 @@ void Portable::sleep(int ms)
#endif
}
-bool Portable::isAbsolutePath(const char *fileName)
+bool Portable::isAbsolutePath(const QCString &fileName)
{
+ const char *fn = fileName.data();
# ifdef _WIN32
- if (isalpha (fileName [0]) && fileName[1] == ':')
- fileName += 2;
+ if (fileName.length()>1 && isalpha(fileName[0]) && fileName[1]==':') fn+=2;
# endif
- char const fst = fileName [0];
- if (fst == '/') {
- return true;
- }
+ char const fst = fn[0];
+ if (fst == '/') return true;
# ifdef _WIN32
- if (fst == '\\')
- return true;
+ if (fst == '\\') return true;
# endif
return false;
}
@@ -495,19 +510,19 @@ bool Portable::isAbsolutePath(const char *fileName)
void Portable::correct_path()
{
#if defined(_WIN32) && !defined(__CYGWIN__)
- const char *p = Portable::getenv("PATH");
- if (!p) return; // no path nothing to correct
- QCString result = substitute(p,'/','\\');
+ QCString p = Portable::getenv("PATH");
+ if (p.isEmpty()) return; // no path nothing to correct
+ QCString result = substitute(p,"/","\\");
if (result!=p) Portable::setenv("PATH",result.data());
#endif
}
-void Portable::unlink(const char *fileName)
+void Portable::unlink(const QCString &fileName)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
- _unlink(fileName);
+ _unlink(fileName.data());
#else
- ::unlink(fileName);
+ ::unlink(fileName.data());
#endif
}
@@ -517,14 +532,14 @@ void Portable::setShortDir()
long length = 0;
TCHAR* buffer = NULL;
// First obtain the size needed by passing NULL and 0.
- length = GetShortPathName(QDir::currentDirPath().data(), NULL, 0);
+ length = GetShortPathName(Dir::currentDirPath().c_str(), NULL, 0);
// Dynamically allocate the correct size
// (terminating null char was included in length)
buffer = new TCHAR[length];
// Now simply call again using same (long) path.
- length = GetShortPathName(QDir::currentDirPath().data(), buffer, length);
+ length = GetShortPathName(Dir::currentDirPath().c_str(), buffer, length);
// Set the correct directory (short name)
- QDir::setCurrent(buffer);
+ Dir::setCurrent(buffer);
delete [] buffer;
#endif
}
@@ -580,3 +595,22 @@ const char *Portable::devNull()
return "/dev/null";
#endif
}
+
+size_t Portable::recodeUtf8StringToW(const QCString &inputStr,uint16_t **outBuf)
+{
+ if (inputStr.isEmpty() || outBuf==0) return 0; // empty input or invalid output
+ void *handle = portable_iconv_open("UTF-16LE","UTF-8");
+ if (handle==(void *)(-1)) return 0; // invalid encoding
+ size_t len = inputStr.length();
+ uint16_t *buf = new uint16_t[len+1];
+ *outBuf = buf;
+ size_t inRemains = len;
+ size_t outRemains = len*sizeof(uint16_t)+2; // chars + \0
+ const char *p = inputStr.data();
+ portable_iconv(handle,(char**)&p,&inRemains,(char**)&buf,&outRemains);
+ *buf=0;
+ portable_iconv_close(handle);
+ return len;
+}
+
+
diff --git a/src/portable.h b/src/portable.h
index d2b3036..bf4cb47 100644
--- a/src/portable.h
+++ b/src/portable.h
@@ -3,9 +3,11 @@
#include <stdio.h>
#include <sys/types.h>
+#include <stdint.h>
+#include "qcstring.h"
-
+class Buf;
#if defined(_WIN32)
typedef __int64 portable_off_t;
@@ -19,38 +21,39 @@ typedef off_t portable_off_t;
namespace Portable
{
- int system(const char *command,const char *args,bool commandHasConsole=true);
+ int system(const QCString &command,const QCString &args,bool commandHasConsole=true);
unsigned int pid();
- const char * getenv(const char *variable);
- void setenv(const char *variable,const char *value);
- void unsetenv(const char *variable);
+ QCString getenv(const QCString &variable);
+ void setenv(const QCString &variable,const QCString &value);
+ void unsetenv(const QCString &variable);
portable_off_t fseek(FILE *f,portable_off_t offset, int whence);
portable_off_t ftell(FILE *f);
- FILE * fopen(const char *fileName,const char *mode);
- void unlink(const char *fileName);
- char pathSeparator();
- char pathListSeparator();
+ FILE * fopen(const QCString &fileName,const QCString &mode);
+ void unlink(const QCString &fileName);
+ QCString pathSeparator();
+ QCString pathListSeparator();
const char * ghostScriptCommand();
const char * commandExtension();
bool fileSystemIsCaseSensitive();
- FILE * popen(const char *name,const char *type);
+ FILE * popen(const QCString &name,const QCString &type);
int pclose(FILE *stream);
void sysTimerStart();
void sysTimerStop();
double getSysElapsedTime();
void sleep(int ms);
- bool isAbsolutePath(const char *fileName);
+ bool isAbsolutePath(const QCString &fileName);
void correct_path();
void setShortDir();
const char * strnstr(const char *haystack, const char *needle, size_t haystack_len);
const char * devNull();
- bool checkForExecutable(const char *fileName);
+ bool checkForExecutable(const QCString &fileName);
+ size_t recodeUtf8StringToW(const QCString &inputStr,uint16_t **buf);
}
extern "C" {
- void * portable_iconv_open(const char* tocode, const char* fromcode);
- size_t portable_iconv (void *cd, char** inbuf, size_t *inbytesleft,
+ void * portable_iconv_open(const QCString &tocode, const QCString &fromcode);
+ size_t portable_iconv (void *cd, char** inbuf, size_t *inbytesleft,
char* * outbuf, size_t *outbytesleft);
int portable_iconv_close (void *cd);
}
diff --git a/src/pre.h b/src/pre.h
index 47f6652..fcf511e 100644
--- a/src/pre.h
+++ b/src/pre.h
@@ -1,12 +1,12 @@
/******************************************************************************
*
- *
+ *
*
* Copyright (C) 1997-2015 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
+ * 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.
*
@@ -21,14 +21,15 @@
#include <memory>
class BufStr;
+class QCString;
class Preprocessor
{
public:
Preprocessor();
~Preprocessor();
- void processFile(const char *fileName,BufStr &input,BufStr &output);
- void addSearchDir(const char *dir);
+ void processFile(const QCString &fileName,BufStr &input,BufStr &output);
+ void addSearchDir(const QCString &dir);
private:
struct Private;
std::unique_ptr<Private> p;
diff --git a/src/pre.l b/src/pre.l
index b153942..580b553 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -34,15 +34,14 @@
#include <utility>
#include <mutex>
#include <thread>
+#include <algorithm>
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
-#include <qcstring.h>
-#include <qfileinfo.h>
-
+#include "qcstring.h"
#include "containers.h"
#include "pre.h"
#include "constexp.h"
@@ -60,6 +59,7 @@
#include "config.h"
#include "filedef.h"
#include "regex.h"
+#include "fileinfo.h"
#define YY_NO_UNISTD_H 1
@@ -96,7 +96,7 @@ struct FileState
struct PreIncludeInfo
{
- PreIncludeInfo(const char *fn,FileDef *srcFd, FileDef *dstFd,const char *iName,bool loc, bool imp)
+ PreIncludeInfo(const QCString &fn,FileDef *srcFd, FileDef *dstFd,const QCString &iName,bool loc, bool imp)
: fileName(fn), fromFileDef(srcFd), toFileDef(dstFd), includeName(iName), local(loc), imported(imp)
{
}
@@ -154,7 +154,7 @@ class DefineManager
{
includeStack.insert(incFile);
dpf->retrieveRec(toMap,includeStack);
- //printf(" retrieveRec: processing include %s: #toMap=%zu\n",incFile.data(),toMap.size());
+ //printf(" retrieveRec: processing include %s: #toMap=%zu\n",qPrint(incFile),toMap.size());
}
}
for (auto &kv : m_defines)
@@ -307,12 +307,13 @@ struct preYY_state
};
// stateless functions
-static QCString escapeAt(const char *text);
-static QCString extractTrailingComment(const char *s);
+static QCString escapeAt(const QCString &text);
+static QCString extractTrailingComment(const QCString &s);
static char resolveTrigraph(char c);
// statefull functions
-static inline void outputArray(yyscan_t yyscanner,const char *a,int len);
+static inline void outputArray(yyscan_t yyscanner,const char *a,yy_size_t len);
+static inline void outputString(yyscan_t yyscanner,const QCString &s);
static inline void outputChar(yyscan_t yyscanner,char c);
static QCString expandMacro(yyscan_t yyscanner,const QCString &name);
static void readIncludeFile(yyscan_t yyscanner,const QCString &inc);
@@ -321,13 +322,13 @@ static void decrLevel(yyscan_t yyscanner);
static void setCaseDone(yyscan_t yyscanner,bool value);
static bool otherCaseDone(yyscan_t yyscanner);
static bool computeExpression(yyscan_t yyscanner,const QCString &expr);
-static void startCondSection(yyscan_t yyscanner,const char *sectId);
+static void startCondSection(yyscan_t yyscanner,const QCString &sectId);
static void endCondSection(yyscan_t yyscanner);
static void addMacroDefinition(yyscan_t yyscanner);
static void addDefine(yyscan_t yyscanner);
-static void setFileName(yyscan_t yyscanner,const char *name);
+static void setFileName(yyscan_t yyscanner,const QCString &name);
static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
-static Define * isDefined(yyscan_t yyscanner,const char *name);
+static Define * isDefined(yyscan_t yyscanner,const QCString &name);
/* ----------------------------------------------------------------- */
@@ -411,11 +412,11 @@ WSopt [ \t\r]*
<Start>^{B}*"#" { BEGIN(Command); yyextra->yyColNr+=(int)yyleng; yyextra->yyMLines=0;}
<Start>^("%top{"|"%{") {
if (getLanguageFromFileName(yyextra->yyFileName)!=SrcLangExt_Lex) REJECT
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
BEGIN(LexCopyLine);
}
<Start>^{Bopt}/[^#] {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
BEGIN(CopyLine);
}
<Start>^{B}*[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]+{B}*"("[^\)\n]*")"/{BN}{1,10}*[:{] { // constructors?
@@ -460,12 +461,12 @@ WSopt [ \t\r]*
<CopyLine,LexCopyLine>"extern"{BN}{0,80}"\"C\""*{BN}{0,80}"{" {
QCString text=yytext;
yyextra->yyLineNr+=text.contains('\n');
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyLine,LexCopyLine>{RAWBEGIN} {
yyextra->delimiter = yytext+2;
yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
BEGIN(CopyRawString);
}
<CopyLine,LexCopyLine>"{" { // count brackets inside the main file
@@ -476,7 +477,7 @@ WSopt [ \t\r]*
outputChar(yyscanner,*yytext);
}
<LexCopyLine>^"%}" {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyLine,LexCopyLine>"}" { // count brackets inside the main file
if (yyextra->includeStack.empty() && yyextra->curlyCount>0)
@@ -486,17 +487,17 @@ WSopt [ \t\r]*
outputChar(yyscanner,*yytext);
}
<CopyLine,LexCopyLine>"'"\\[0-7]{1,3}"'" {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyLine,LexCopyLine>"'"\\."'" {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyLine,LexCopyLine>"'"."'" {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyLine,LexCopyLine>@\" {
if (getLanguageFromFileName(yyextra->yyFileName)!=SrcLangExt_CSharp) REJECT;
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
BEGIN( CopyStringCs );
}
<CopyLine,LexCopyLine>\" {
@@ -516,40 +517,40 @@ WSopt [ \t\r]*
BEGIN( CopyStringFtn );
}
<CopyString>[^\"\\\r\n]+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyStringCs>[^\"\r\n]+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyString>\\. {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyString,CopyStringCs>\" {
outputChar(yyscanner,*yytext);
BEGIN( CopyLine );
}
<CopyStringFtnDouble>[^\"\\\r\n]+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyStringFtnDouble>\\. {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyStringFtnDouble>\" {
outputChar(yyscanner,*yytext);
BEGIN( CopyLine );
}
<CopyStringFtn>[^\'\\\r\n]+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyStringFtn>\\. {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyStringFtn>\' {
outputChar(yyscanner,*yytext);
BEGIN( CopyLine );
}
<CopyRawString>{RAWEND} {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
QCString delimiter = yytext+1;
delimiter=delimiter.left(delimiter.length()-1);
if (delimiter==yyextra->delimiter)
@@ -558,7 +559,7 @@ WSopt [ \t\r]*
}
}
<CopyRawString>[^)]+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyRawString>. {
outputChar(yyscanner,*yytext);
@@ -587,7 +588,7 @@ WSopt [ \t\r]*
if (def->nargs==-1) // no function macro
{
QCString result = def->isPredefined ? def->definition : expandMacro(yyscanner,yyextra->defArgsStr);
- outputArray(yyscanner,result,result.length());
+ outputString(yyscanner,result);
}
else // zero or more arguments
{
@@ -597,7 +598,7 @@ WSopt [ \t\r]*
}
else
{
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
}
<CopyLine,LexCopyLine>{ID} {
@@ -611,11 +612,11 @@ WSopt [ \t\r]*
)
{
QCString result=def->isPredefined ? def->definition : expandMacro(yyscanner,yytext);
- outputArray(yyscanner,result,result.length());
+ outputString(yyscanner,result);
}
else
{
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
}
<CopyLine,LexCopyLine>"\\"\r?/\n { // strip line continuation characters
@@ -640,10 +641,10 @@ WSopt [ \t\r]*
if (yyextra->roundCount==0)
{
QCString result=expandMacro(yyscanner,yyextra->defArgsStr);
- //printf("yyextra->defArgsStr='%s'->'%s'\n",yyextra->defArgsStr.data(),result.data());
+ //printf("yyextra->defArgsStr='%s'->'%s'\n",qPrint(yyextra->defArgsStr),qPrint(result));
if (yyextra->findDefArgContext==CopyLine)
{
- outputArray(yyscanner,result,result.length());
+ outputString(yyscanner,result);
BEGIN(yyextra->findDefArgContext);
}
else // yyextra->findDefArgContext==IncludeID
@@ -848,7 +849,7 @@ WSopt [ \t\r]*
<Guard>\n {
unput(*yytext);
//printf("Guard: '%s'\n",
- // yyextra->guardExpr.data());
+ // qPrint(yyextra->guardExpr));
bool guard=computeExpression(yyscanner,yyextra->guardExpr);
setCaseDone(yyscanner,guard);
if (guard)
@@ -1020,11 +1021,11 @@ WSopt [ \t\r]*
yyextra->defName = yyextra->defName.left(yyextra->defName.length()-1).stripWhiteSpace();
yyextra->defVarArgs = FALSE;
//printf("Guard check: %s!=%s || %d\n",
- // yyextra->defName.data(),yyextra->lastGuardName.data(),yyextra->expectGuard);
+ // qPrint(yyextra->defName),qPrint(yyextra->lastGuardName),yyextra->expectGuard);
if (yyextra->curlyCount>0 || yyextra->defName!=yyextra->lastGuardName || !yyextra->expectGuard)
{ // define may appear in the output
QCString tmp=(QCString)"#define "+yyextra->defName;
- outputArray(yyscanner,tmp.data(),tmp.length());
+ outputString(yyscanner,tmp);
yyextra->quoteArg=FALSE;
yyextra->insideComment=FALSE;
yyextra->lastGuardName.resize(0);
@@ -1050,11 +1051,11 @@ WSopt [ \t\r]*
yyextra->defLitText.resize(0);
yyextra->defVarArgs = FALSE;
//printf("Guard check: %s!=%s || %d\n",
- // yyextra->defName.data(),yyextra->lastGuardName.data(),yyextra->expectGuard);
+ // qPrint(yyextra->defName),qPrint(yyextra->lastGuardName),yyextra->expectGuard);
if (yyextra->curlyCount>0 || yyextra->defName!=yyextra->lastGuardName || !yyextra->expectGuard)
{ // define may appear in the output
QCString tmp=(QCString)"#define "+yyextra->defName;
- outputArray(yyscanner,tmp.data(),tmp.length());
+ outputString(yyscanner,tmp);
yyextra->quoteArg=FALSE;
yyextra->insideComment=FALSE;
if (yyextra->insideCS) yyextra->defText="1"; // for C#, use "1" as define text
@@ -1079,7 +1080,7 @@ WSopt [ \t\r]*
yyextra->defName = yytext;
yyextra->defVarArgs = FALSE;
QCString tmp=(QCString)"#define "+yyextra->defName+yyextra->defArgsStr;
- outputArray(yyscanner,tmp.data(),tmp.length());
+ outputString(yyscanner,tmp);
yyextra->quoteArg=FALSE;
yyextra->insideComment=FALSE;
BEGIN(DefineText);
@@ -1093,7 +1094,7 @@ WSopt [ \t\r]*
<DefineArg>{B}*")"{B}* {
yyextra->defArgsStr+=yytext;
QCString tmp=(QCString)"#define "+yyextra->defName+yyextra->defArgsStr+yyextra->defExtraSpacing;
- outputArray(yyscanner,tmp.data(),tmp.length());
+ outputString(yyscanner,tmp);
yyextra->quoteArg=FALSE;
yyextra->insideComment=FALSE;
BEGIN(DefineText);
@@ -1137,7 +1138,7 @@ WSopt [ \t\r]*
BEGIN(CopyCComment);
}
<DefineText>{CPPC}[!/]? {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
yyextra->lastCPPContext=YY_START;
yyextra->defLitText+=' ';
BEGIN(SkipCPPComment);
@@ -1157,14 +1158,14 @@ WSopt [ \t\r]*
}
}
<SkipCComment>{CPPC}("/")* {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<SkipCComment>{CCS} {
outputChar(yyscanner,'/');outputChar(yyscanner,'*');
//yyextra->commentCount++;
}
<SkipCComment>[\\@][\\@]("f{"|"f$"|"f[") {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<SkipCComment>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
bool markdownSupport = Config_getBool(MARKDOWN_SUPPORT);
@@ -1174,7 +1175,7 @@ WSopt [ \t\r]*
}
else
{
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
yyextra->fenceSize=(int)yyleng;
BEGIN(SkipVerbatim);
}
@@ -1187,17 +1188,17 @@ WSopt [ \t\r]*
}
else
{
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
yyextra->fenceSize=(int)yyleng;
BEGIN(SkipVerbatim);
}
}
<SkipCComment>[\\@][\\@]("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"docbookonly"|"rtfonly"|"manonly"|"dot"|"code"("{"[^}]*"}")?){BN}+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
yyextra->yyLineNr+=QCString(yytext).contains('\n');
}
<SkipCComment>[\\@]("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"docbookonly"|"rtfonly"|"manonly"|"dot"|"code"("{"[^}]*"}")?){BN}+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
yyextra->yyLineNr+=QCString(yytext).contains('\n');
yyextra->fenceSize=0;
if (yytext[1]=='f')
@@ -1214,7 +1215,7 @@ WSopt [ \t\r]*
BEGIN(SkipVerbatim);
}
<SkipCComment,SkipCPPComment>[\\@][\\@]"cond"[ \t]+ { // escaped @cond
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<SkipCPPComment>[\\@]"cond"[ \t]+ { // conditional section
yyextra->ccomment=TRUE;
@@ -1292,7 +1293,7 @@ WSopt [ \t\r]*
<SkipCond,SkipCComment,SkipCPPComment>[\\@][\\@]"endcond"/[^a-z_A-Z0-9\x80-\xFF] {
if (!yyextra->skip)
{
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
}
<SkipCond>[\\@]"endcond"/[^a-z_A-Z0-9\x80-\xFF] {
@@ -1316,7 +1317,7 @@ WSopt [ \t\r]*
}
}
<SkipVerbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"f$"|"f]"|"f}") { /* end of verbatim block */
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
if (yytext[1]=='f' && yyextra->blockName=="f")
{
BEGIN(SkipCComment);
@@ -1327,24 +1328,24 @@ WSopt [ \t\r]*
}
}
<SkipVerbatim>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
if (yyextra->fenceSize==(yy_size_t)yyleng)
{
BEGIN(SkipCComment);
}
}
<SkipVerbatim>^({B}*"*"+)?{B}{0,3}"```"[`]* {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
if (yyextra->fenceSize==(yy_size_t)yyleng)
{
BEGIN(SkipCComment);
}
}
<SkipVerbatim>{CCE}|{CCS} {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<SkipCComment,SkipVerbatim>[^*\\@\x06~`\n\/]+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<SkipCComment,SkipVerbatim>\n {
yyextra->yyLineNr++;
@@ -1390,7 +1391,7 @@ WSopt [ \t\r]*
<RemoveCComment>\n { yyextra->yyLineNr++; outputChar(yyscanner,'\n'); }
<RemoveCComment>.
<SkipCPPComment>[^\n\/\\@]+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<SkipCPPComment,RemoveCPPComment>\n {
unput(*yytext);
@@ -1403,7 +1404,7 @@ WSopt [ \t\r]*
outputChar(yyscanner,'/');outputChar(yyscanner,'/');
}
<SkipCPPComment>[^\x06\@\\\n]+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<SkipCPPComment>. {
outputChar(yyscanner,*yytext);
@@ -1462,12 +1463,12 @@ WSopt [ \t\r]*
yyextra->defLitText+=yytext;
if (!comment.isEmpty())
{
- outputArray(yyscanner,comment,comment.length());
+ outputString(yyscanner,comment);
yyextra->defLitText=yyextra->defLitText.left(yyextra->defLitText.length()-comment.length()-1);
}
outputChar(yyscanner,'\n');
Define *def=0;
- //printf("Define name='%s' text='%s' litTexti='%s'\n",yyextra->defName.data(),yyextra->defText.data(),yyextra->defLitText.data());
+ //printf("Define name='%s' text='%s' litTexti='%s'\n",qPrint(yyextra->defName),qPrint(yyextra->defText),qPrint(yyextra->defLitText));
if (yyextra->includeStack.empty() || yyextra->curlyCount>0)
{
addMacroDefinition(yyscanner);
@@ -1475,7 +1476,7 @@ WSopt [ \t\r]*
def=isDefined(yyscanner,yyextra->defName);
if (def==0) // new define
{
- //printf("new define '%s'!\n",yyextra->defName.data());
+ //printf("new define '%s'!\n",qPrint(yyextra->defName));
addDefine(yyscanner);
}
else if (def /*&& macroIsAccessible(def)*/)
@@ -1489,13 +1490,13 @@ WSopt [ \t\r]*
def->name = yyextra->defName;
def->definition = yyextra->defText.stripWhiteSpace();
def->nargs = yyextra->defArgs;
- def->fileName = yyextra->yyFileName.copy();
+ def->fileName = yyextra->yyFileName;
def->lineNr = yyextra->yyLineNr-yyextra->yyMLines;
def->columnNr = yyextra->yyColNr;
}
else
{
- //printf("error: define %s is defined more than once!\n",yyextra->defName.data());
+ //printf("error: define %s is defined more than once!\n",qPrint(yyextra->defName));
}
}
yyextra->argMap.clear();
@@ -1560,13 +1561,13 @@ WSopt [ \t\r]*
yyextra->inputBufPos = fs->oldFileBufPos;
yyextra->curlyCount = fs->curlyCount;
setFileName(yyscanner,fs->fileName);
- DBG_CTX((stderr,"######## FileName %s\n",yyextra->yyFileName.data()));
+ DBG_CTX((stderr,"######## FileName %s\n",qPrint(yyextra->yyFileName)));
// Deal with file changes due to
// #include's within { .. } blocks
QCString lineStr(15+yyextra->yyFileName.length());
- lineStr.sprintf("# %d \"%s\" 2",yyextra->yyLineNr,yyextra->yyFileName.data());
- outputArray(yyscanner,lineStr.data(),lineStr.length());
+ lineStr.sprintf("# %d \"%s\" 2",yyextra->yyLineNr,qPrint(yyextra->yyFileName));
+ outputString(yyscanner,lineStr);
yyextra->includeStack.pop_back();
@@ -1611,7 +1612,7 @@ WSopt [ \t\r]*
}
else
{
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
yyextra->lastCContext=YY_START;
yyextra->commentCount=1;
if (yyleng==3)
@@ -1633,7 +1634,7 @@ WSopt [ \t\r]*
}
else
{
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
yyextra->lastCPPContext=YY_START;
if (yyleng==3)
{
@@ -1664,18 +1665,18 @@ static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size)
{
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
yy_size_t bytesInBuf = state->inputBuf->curPos()-state->inputBufPos;
- yy_size_t bytesToCopy = QMIN(max_size,bytesInBuf);
+ yy_size_t bytesToCopy = std::min(max_size,bytesInBuf);
memcpy(buf,state->inputBuf->data()+state->inputBufPos,bytesToCopy);
state->inputBufPos+=bytesToCopy;
return bytesToCopy;
}
-static void setFileName(yyscan_t yyscanner,const char *name)
+static void setFileName(yyscan_t yyscanner,const QCString &name)
{
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
bool ambig;
- QFileInfo fi(name);
- state->yyFileName=fi.absFilePath().utf8();
+ FileInfo fi(name.str());
+ state->yyFileName=fi.absFilePath();
state->yyFileDef=findFileDef(Doxygen::inputNameLinkedMap,state->yyFileName,ambig);
if (state->yyFileDef==0) // if this is not an input file check if it is an
// include file
@@ -1683,7 +1684,7 @@ static void setFileName(yyscan_t yyscanner,const char *name)
state->yyFileDef=findFileDef(Doxygen::includeNameLinkedMap,state->yyFileName,ambig);
}
//printf("setFileName(%s) state->yyFileName=%s state->yyFileDef=%p\n",
- // name,state->yyFileName.data(),state->yyFileDef);
+ // name,qPrint(state->yyFileName),state->yyFileDef);
if (state->yyFileDef && state->yyFileDef->isReference()) state->yyFileDef=0;
state->insideCS = getLanguageFromFileName(state->yyFileName)==SrcLangExt_CSharp;
state->insideFtn = getLanguageFromFileName(state->yyFileName)==SrcLangExt_Fortran;
@@ -1694,13 +1695,13 @@ static void incrLevel(yyscan_t yyscanner)
{
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
state->levelGuard.push(false);
- //printf("%s line %d: incrLevel %d\n",yyextra->yyFileName.data(),yyextra->yyLineNr,yyextra->levelGuard.size());
+ //printf("%s line %d: incrLevel %d\n",qPrint(yyextra->yyFileName),yyextra->yyLineNr,yyextra->levelGuard.size());
}
static void decrLevel(yyscan_t yyscanner)
{
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
- //printf("%s line %d: decrLevel %d\n",state->yyFileName.data(),state->yyLineNr,state->levelGuard.size());
+ //printf("%s line %d: decrLevel %d\n",qPrint(state->yyFileName),state->yyLineNr,state->levelGuard.size());
if (!state->levelGuard.empty())
{
state->levelGuard.pop();
@@ -1737,14 +1738,14 @@ static FileState *checkAndOpenFile(yyscan_t yyscanner,const QCString &fileName,b
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
alreadyProcessed = FALSE;
FileState *fs = 0;
- //printf("checkAndOpenFile(%s)\n",fileName.data());
- QFileInfo fi(fileName);
+ //printf("checkAndOpenFile(%s)\n",qPrint(fileName));
+ FileInfo fi(fileName.str());
if (fi.exists() && fi.isFile())
{
const StringVector &exclPatterns = Config_getList(EXCLUDE_PATTERNS);
if (patternMatch(fi,exclPatterns)) return 0;
- QCString absName = fi.absFilePath().utf8();
+ QCString absName = fi.absFilePath();
// global guard
if (state->curlyCount==0) // not #include inside { ... }
@@ -1771,7 +1772,7 @@ static FileState *checkAndOpenFile(yyscan_t yyscanner,const QCString &fileName,b
//printf(" already included 2\n");
return 0;
}
- //printf("#include %s\n",absName.data());
+ //printf("#include %s\n",qPrint(absName));
fs = new FileState(fi.size()+4096);
if (!readInputFile(absName,fs->fileBuf))
@@ -1789,10 +1790,10 @@ static FileState *checkAndOpenFile(yyscan_t yyscanner,const QCString &fileName,b
return fs;
}
-static FileState *findFile(yyscan_t yyscanner, const char *fileName,bool localInclude,bool &alreadyProcessed)
+static FileState *findFile(yyscan_t yyscanner, const QCString &fileName,bool localInclude,bool &alreadyProcessed)
{
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
- //printf("** findFile(%s,%d) state->yyFileName=%s\n",fileName,localInclude,state->yyFileName.data());
+ //printf("** findFile(%s,%d) state->yyFileName=%s\n",qPrint(fileName),localInclude,qPrint(state->yyFileName));
if (Portable::isAbsolutePath(fileName))
{
FileState *fs = checkAndOpenFile(yyscanner,fileName,alreadyProcessed);
@@ -1809,10 +1810,10 @@ static FileState *findFile(yyscan_t yyscanner, const char *fileName,bool localIn
}
if (localInclude && !state->yyFileName.isEmpty())
{
- QFileInfo fi(state->yyFileName);
+ FileInfo fi(state->yyFileName.str());
if (fi.exists())
{
- QCString absName = QCString(fi.dirPath(TRUE).data())+"/"+fileName;
+ QCString absName = QCString(fi.dirPath(TRUE))+"/"+fileName;
FileState *fs = checkAndOpenFile(yyscanner,absName,alreadyProcessed);
if (fs)
{
@@ -1832,7 +1833,7 @@ static FileState *findFile(yyscan_t yyscanner, const char *fileName,bool localIn
}
for (auto path : state->pathList)
{
- std::string absName = path+"/"+fileName;
+ std::string absName = (path+"/"+fileName).str();
//printf(" Looking for %s in %s\n",fileName,path.c_str());
FileState *fs = checkAndOpenFile(yyscanner,absName.c_str(),alreadyProcessed);
if (fs)
@@ -1850,10 +1851,10 @@ static FileState *findFile(yyscan_t yyscanner, const char *fileName,bool localIn
return 0;
}
-static QCString extractTrailingComment(const char *s)
+static QCString extractTrailingComment(const QCString &s)
{
- if (s==0) return "";
- int i=(int)strlen(s)-1;
+ if (s.isEmpty()) return "";
+ int i=(int)s.length()-1;
while (i>=0)
{
char c=s[i];
@@ -1969,7 +1970,7 @@ static QCString stringize(const QCString &s)
}
}
}
- //printf("stringize '%s'->'%s'\n",s.data(),result.data());
+ //printf("stringize '%s'->'%s'\n",qPrint(s),qPrint(result));
return result;
}
@@ -1981,7 +1982,7 @@ static QCString stringize(const QCString &s)
static void processConcatOperators(QCString &expr)
{
if (expr.isEmpty()) return;
- //printf("processConcatOperators: in='%s'\n",expr.data());
+ //printf("processConcatOperators: in='%s'\n",qPrint(expr));
std::string e = expr.str();
static const reg::Ex r(R"(\s*##\s*)");
reg::Iterator end;
@@ -1995,13 +1996,13 @@ static void processConcatOperators(QCString &expr)
const auto &match = *it;
size_t n = match.position();
size_t l = match.length();
- //printf("Match: '%s'\n",expr.data()+i);
+ //printf("Match: '%s'\n",qPrint(expr.mid(i)));
if (n+l+1<e.length() && e[static_cast<int>(n+l)]=='@' && expr[static_cast<int>(n+l+1)]=='-')
{
// remove no-rescan marker after ID
l+=2;
}
- //printf("found '%s'\n",expr.mid(n,l).data());
+ //printf("found '%s'\n",qPrint(expr.mid(n,l)));
// remove the ## operator and the surrounding whitespace
e=e.substr(0,n)+e.substr(n+l);
int k=static_cast<int>(n)-1;
@@ -2022,7 +2023,7 @@ static void processConcatOperators(QCString &expr)
expr = e;
- //printf("processConcatOperators: out='%s'\n",expr.data());
+ //printf("processConcatOperators: out='%s'\n",qPrint(expr));
}
static void returnCharToStream(yyscan_t yyscanner,char c)
@@ -2053,7 +2054,7 @@ static inline void addTillEndOfString(yyscan_t yyscanner,const QCString &expr,QC
static bool replaceFunctionMacro(yyscan_t yyscanner,const QCString &expr,QCString *rest,int pos,int &len,const Define *def,QCString &result,int level)
{
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
- //printf(">replaceFunctionMacro(expr='%s',rest='%s',pos=%d,def='%s') level=%d\n",expr.data(),rest ? rest->data() : 0,pos,def->name.data(),state->levelGuard.size());
+ //printf(">replaceFunctionMacro(expr='%s',rest='%s',pos=%d,def='%s') level=%d\n",qPrint(expr),rest ? qPrint(*rest) : 0,pos,qPrint(def->name),state->levelGuard.size());
uint j=pos;
len=0;
result.resize(0);
@@ -2065,7 +2066,7 @@ static bool replaceFunctionMacro(yyscan_t yyscanner,const QCString &expr,QCStrin
}
if (cc!='(')
{
- unputChar(yyscanner,expr,rest,j,(char)cc);
+ unputChar(yyscanner,expr,rest,j,' ');
return FALSE;
}
getNextChar(yyscanner,expr,rest,j); // eat the '(' character
@@ -2206,7 +2207,7 @@ static bool replaceFunctionMacro(yyscan_t yyscanner,const QCString &expr,QCStrin
// substitution of all formal arguments
QCString resExpr;
const QCString d=def->definition.stripWhiteSpace();
- //printf("Macro definition: '%s'\n",d.data());
+ //printf("Macro definition: '%s'\n",qPrint(d));
bool inString=FALSE;
while (k<d.length())
{
@@ -2242,12 +2243,12 @@ static bool replaceFunctionMacro(yyscan_t yyscanner,const QCString &expr,QCStrin
while (l<(int)d.length() && d.at(l)==' ') l++;
if (l<(int)d.length()-1 && d.at(l)=='#' && d.at(l+1)=='#') hash=TRUE;
}
- //printf("request key %s result %s\n",key.data(),argTable[key]->data());
- auto it = argTable.find(key.data());
+ //printf("request key %s result %s\n",qPrint(key),argTable[key]->data());
+ auto it = argTable.find(key.str());
if (it!=argTable.end())
{
QCString substArg = it->second.c_str();
- //printf("substArg='%s'\n",substArg.data());
+ //printf("substArg='%s'\n",qPrint(substArg));
// only if no ## operator is before or after the argument
// marker we do macro expansion.
if (!hash)
@@ -2256,7 +2257,7 @@ static bool replaceFunctionMacro(yyscan_t yyscanner,const QCString &expr,QCStrin
}
if (inString)
{
- //printf("'%s'=stringize('%s')\n",stringize(*subst).data(),subst->data());
+ //printf("'%s'=stringize('%s')\n",qPrint(stringize(*subst)),subst->data());
// if the marker is inside a string (because a # was put
// before the macro name) we must escape " and \ characters
@@ -2295,10 +2296,10 @@ static bool replaceFunctionMacro(yyscan_t yyscanner,const QCString &expr,QCStrin
}
len=j-pos;
result=resExpr;
- //printf("<replaceFunctionMacro(expr='%s',rest='%s',pos=%d,def='%s',result='%s') level=%d return=TRUE\n",expr.data(),rest ? rest->data() : 0,pos,def->name.data(),result.data(),state->levelGuard.size());
+ //printf("<replaceFunctionMacro(expr='%s',rest='%s',pos=%d,def='%s',result='%s') level=%d return=TRUE\n",qPrint(expr),rest ? qPrint(*rest) : 0,pos,qPrint(def->name),qPrint(result),state->levelGuard.size());
return TRUE;
}
- //printf("<replaceFunctionMacro(expr='%s',rest='%s',pos=%d,def='%s',result='%s') level=%d return=FALSE\n",expr.data(),rest ? rest->data() : 0,pos,def->name.data(),result.data(),state->levelGuard.size());
+ //printf("<replaceFunctionMacro(expr='%s',rest='%s',pos=%d,def='%s',result='%s') level=%d return=FALSE\n",qPrint(expr),rest ? qPrint(*rest) : 0,pos,qPrint(def->name),qPrint(result),state->levelGuard.size());
return FALSE;
}
@@ -2370,21 +2371,21 @@ static int getNextId(const QCString &expr,int p,int *l)
static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,int pos,int level)
{
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
- //printf(">expandExpression(expr='%s',rest='%s',pos=%d,level=%d)\n",expr.data(),rest ? rest->data() : "", pos, level);
+ //printf(">expandExpression(expr='%s',rest='%s',pos=%d,level=%d)\n",qPrint(expr),rest ? qPrint(*rest) : "", pos, level);
if (expr.isEmpty())
{
//printf("<expandExpression: empty\n");
return TRUE;
}
- if (state->expanded.find(expr.data())!=state->expanded.end() &&
+ if (state->expanded.find(expr.str())!=state->expanded.end() &&
level>MAX_EXPANSION_DEPTH) // check for too deep recursive expansions
{
- //printf("<expandExpression: already expanded expr='%s'\n",expr.data());
+ //printf("<expandExpression: already expanded expr='%s'\n",qPrint(expr));
return FALSE;
}
else
{
- state->expanded.insert(expr.data());
+ state->expanded.insert(expr.str());
}
QCString macroName;
QCString expMacro;
@@ -2396,15 +2397,15 @@ static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,in
{
bool replaced=FALSE;
macroName=expr.mid(p,l);
- //printf(" p=%d macroName=%s\n",p,macroName.data());
+ //printf(" p=%d macroName=%s\n",p,qPrint(macroName));
if (p<2 || !(expr.at(p-2)=='@' && expr.at(p-1)=='-')) // no-rescan marker?
{
- if (state->expandedDict.find(macroName.data())==state->expandedDict.end()) // expand macro
+ if (state->expandedDict.find(macroName.str())==state->expandedDict.end()) // expand macro
{
Define *def=isDefined(yyscanner,macroName);
if (macroName=="defined")
{
- //printf("found defined inside macro definition '%s'\n",expr.right(expr.length()-p).data());
+ //printf("found defined inside macro definition '%s'\n",qPrint(expr.right(expr.length()-p)));
definedTest=TRUE;
}
else if (definedTest) // macro name was found after defined
@@ -2417,7 +2418,7 @@ static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,in
else if (def && def->nargs==-1) // simple macro
{
// substitute the definition of the macro
- //printf("macro '%s'->'%s'\n",macroName.data(),def->definition.data());
+ //printf("macro '%s'->'%s'\n",qPrint(macroName),qPrint(def->definition));
if (state->nospaces)
{
expMacro=def->definition.stripWhiteSpace();
@@ -2429,7 +2430,7 @@ static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,in
//expMacro=def->definition.stripWhiteSpace();
replaced=TRUE;
len=l;
- //printf("simple macro expansion='%s'->'%s'\n",macroName.data(),expMacro.data());
+ //printf("simple macro expansion='%s'->'%s'\n",qPrint(macroName),qPrint(expMacro));
}
else if (def && def->nargs>=0) // function macro
{
@@ -2438,15 +2439,15 @@ static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,in
//printf(" <<<< call replaceFunctionMacro: replaced=%d\n",replaced);
len+=l;
}
- //printf(" macroName='%s' expMacro='%s' replaced=%d\n",macroName.data(),expMacro.data(),replaced);
+ //printf(" macroName='%s' expMacro='%s' replaced=%d\n",qPrint(macroName),qPrint(expMacro),replaced);
if (replaced) // expand the macro and rescan the expression
{
- //printf(" replacing '%s'->'%s'\n",expr.mid(p,len).data(),expMacro.data());
+ //printf(" replacing '%s'->'%s'\n",expr.mid(p,qPrint(len)),qPrint(expMacro));
QCString resultExpr=expMacro;
QCString restExpr=expr.right(expr.length()-len-p);
processConcatOperators(resultExpr);
- //printf(" macroName=%s restExpr='%s' def->nonRecursive=%d\n",macroName.data(),restExpr.data(),def->nonRecursive);
+ //printf(" macroName=%s restExpr='%s' def->nonRecursive=%d\n",qPrint(macroName),qPrint(restExpr),def->nonRecursive);
bool expanded=false;
if (def && !def->nonRecursive)
{
@@ -2461,7 +2462,7 @@ static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,in
if (expanded)
{
expr=expr.left(p)+resultExpr+restExpr;
- //printf(" new expression: '%s' old i=%d new i=%d\n",expr.data(),i,p);
+ //printf(" new expression: '%s' old i=%d new i=%d\n",qPrint(expr),i,p);
i=p;
}
else
@@ -2479,7 +2480,7 @@ static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,in
else // move to the next macro name
{
expr=expr.left(p)+"@-"+expr.right(expr.length()-p);
- //printf("macro already expanded, moving to the next macro expr=%s\n",expr.data());
+ //printf("macro already expanded, moving to the next macro expr=%s\n",qPrint(expr));
i=p+l+2;
//i=p+l;
}
@@ -2504,7 +2505,7 @@ static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,in
i=p+l;
}
}
- //printf("<expandExpression(expr='%s',rest='%s',pos=%d,level=%d)\n",expr.data(),rest ? rest->data() : 0, pos,level);
+ //printf("<expandExpression(expr='%s',rest='%s',pos=%d,level=%d)\n",qPrint(expr),rest ? qPrint(*rest) : "", pos,level);
return TRUE;
}
@@ -2550,10 +2551,11 @@ static const char *processUntilMatchingTerminator(const char *inputStr,QCString
* and removes all occurrences of @@E.
* All identifiers found are replaced by 0L
*/
-static QCString removeIdsAndMarkers(const char *s)
+static QCString removeIdsAndMarkers(const QCString &s)
{
//printf("removeIdsAndMarkers(%s)\n",s);
- const char *p=s;
+ if (s.isEmpty()) return s;
+ const char *p=s.data();
char c;
bool inNum=FALSE;
QCString result;
@@ -2661,7 +2663,7 @@ nextChar:
}
}
}
- //printf("removeIdsAndMarkers(%s)=%s\n",s,result.data());
+ //printf("removeIdsAndMarkers(%s)=%s\n",s,qPrint(result));
return result;
}
@@ -2669,9 +2671,10 @@ nextChar:
* \par assumption:
* \a s only contains pairs of @@'s
*/
-static QCString removeMarkers(const char *s)
+static QCString removeMarkers(const QCString &s)
{
- const char *p=s;
+ if (s.isEmpty()) return s;
+ const char *p=s.data();
char c;
QCString result;
if (p)
@@ -2722,7 +2725,7 @@ static QCString removeMarkers(const char *s)
}
}
}
- //printf("RemoveMarkers(%s)=%s\n",s,result.data());
+ //printf("RemoveMarkers(%s)=%s\n",s,qPrint(result));
return result;
}
@@ -2736,11 +2739,11 @@ static bool computeExpression(yyscan_t yyscanner,const QCString &expr)
QCString e=expr;
state->expanded.clear();
expandExpression(yyscanner,e,0,0,0);
- //printf("after expansion '%s'\n",e.data());
+ //printf("after expansion '%s'\n",qPrint(e));
e = removeIdsAndMarkers(e);
if (e.isEmpty()) return FALSE;
- //printf("parsing '%s'\n",e.data());
- return state->constExpParser.parse(state->yyFileName,state->yyLineNr,e.str());
+ //printf("parsing '%s'\n",qPrint(e));
+ return state->constExpParser.parse(state->yyFileName.data(),state->yyLineNr,e.str());
}
/*! expands the macro definition in \a name
@@ -2754,7 +2757,7 @@ static QCString expandMacro(yyscan_t yyscanner,const QCString &name)
state->expanded.clear();
expandExpression(yyscanner,n,0,0,0);
n=removeMarkers(n);
- //printf("expandMacro '%s'->'%s'\n",name.data(),n.data());
+ //printf("expandMacro '%s'->'%s'\n",qPrint(name),qPrint(n));
return n;
}
@@ -2770,9 +2773,9 @@ static void addDefine(yyscan_t yyscanner)
def.lineNr = state->yyLineNr-state->yyMLines;
def.columnNr = state->yyColNr;
def.varArgs = state->defVarArgs;
- //printf("newDefine: %s %s file: %s\n",def.name.data(),def.definition.data(),
- // def.fileDef ? def.fileDef->name().data() : def.fileName.data());
- //printf("newDefine: '%s'->'%s'\n",def.name.data(),def.definition.data());
+ //printf("newDefine: %s %s file: %s\n",qPrint(def.name),qPrint(def.definition),
+ // def.fileDef ? qPrint(def.fileDef->name()) : qPrint(def.fileName));
+ //printf("newDefine: '%s'->'%s'\n",qPrint(def.name),qPrint(def.definition));
if (!def.name.isEmpty() &&
Doxygen::expandAsDefinedSet.find(def.name.str())!=Doxygen::expandAsDefinedSet.end())
{
@@ -2836,46 +2839,52 @@ static inline void outputChar(yyscan_t yyscanner,char c)
if (state->includeStack.empty() || state->curlyCount>0) state->outputBuf->addChar(c);
}
-static inline void outputArray(yyscan_t yyscanner,const char *a,int len)
+static inline void outputArray(yyscan_t yyscanner,const char *a,yy_size_t len)
{
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
if (state->includeStack.empty() || state->curlyCount>0) state->outputBuf->addArray(a,len);
}
+static inline void outputString(yyscan_t yyscanner,const QCString &a)
+{
+ YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+ if (state->includeStack.empty() || state->curlyCount>0) state->outputBuf->addArray(a.data(),a.length());
+}
+
static QCString determineAbsoluteIncludeName(const QCString &curFile,const QCString &incFileName)
{
bool searchIncludes = Config_getBool(SEARCH_INCLUDES);
QCString absIncFileName = incFileName;
- QFileInfo fi(curFile);
+ FileInfo fi(curFile.str());
if (fi.exists())
{
- QCString absName = QCString(fi.dirPath(TRUE).data())+"/"+incFileName;
- QFileInfo fi2(absName);
+ QCString absName = QCString(fi.dirPath(TRUE))+"/"+incFileName;
+ FileInfo fi2(absName.str());
if (fi2.exists())
{
- absIncFileName=fi2.absFilePath().utf8();
+ absIncFileName=fi2.absFilePath();
}
else if (searchIncludes) // search in INCLUDE_PATH as well
{
const StringVector &includePath = Config_getList(INCLUDE_PATH);
for (const auto &incPath : includePath)
{
- QFileInfo fi3(incPath.c_str());
+ FileInfo fi3(incPath);
if (fi3.exists() && fi3.isDir())
{
- absName = QCString(fi3.absFilePath().utf8())+"/"+incFileName;
- //printf("trying absName=%s\n",absName.data());
- QFileInfo fi4(absName);
+ absName = QCString(fi3.absFilePath())+"/"+incFileName;
+ //printf("trying absName=%s\n",qPrint(absName));
+ FileInfo fi4(absName.str());
if (fi4.exists())
{
- absIncFileName=fi4.absFilePath().utf8();
+ absIncFileName=fi4.absFilePath();
break;
}
- //printf( "absIncFileName = %s\n", absIncFileName.data() );
+ //printf( "absIncFileName = %s\n", qPrint(absIncFileName) );
}
}
}
- //printf( "absIncFileName = %s\n", absIncFileName.data() );
+ //printf( "absIncFileName = %s\n", qPrint(absIncFileName) );
}
return absIncFileName;
}
@@ -2912,14 +2921,14 @@ static void readIncludeFile(yyscan_t yyscanner,const QCString &inc)
QCString oldFileName = state->yyFileName;
FileDef *oldFileDef = state->yyFileDef;
int oldLineNr = state->yyLineNr;
- //printf("Searching for '%s'\n",incFileName.data());
+ //printf("Searching for '%s'\n",qPrint(incFileName));
QCString absIncFileName = determineAbsoluteIncludeName(state->yyFileName,incFileName);
// findFile will overwrite state->yyFileDef if found
FileState *fs;
bool alreadyProcessed = FALSE;
- //printf("calling findFile(%s)\n",incFileName.data());
+ //printf("calling findFile(%s)\n",qPrint(incFileName));
if ((fs=findFile(yyscanner,incFileName,localInclude,alreadyProcessed))) // see if the include file can be found
{
{
@@ -2934,7 +2943,7 @@ static void readIncludeFile(yyscan_t yyscanner,const QCString &inc)
{
Debug::print(Debug::Preprocessor,0," ");
}
- Debug::print(Debug::Preprocessor,0,"#include %s: parsing...\n",incFileName.data());
+ Debug::print(Debug::Preprocessor,0,"#include %s: parsing...\n",qPrint(incFileName));
}
if (state->includeStack.empty() && oldFileDef)
@@ -2968,10 +2977,10 @@ static void readIncludeFile(yyscan_t yyscanner,const QCString &inc)
// Deal with file changes due to
// #include's within { .. } blocks
QCString lineStr(state->yyFileName.length()+20);
- lineStr.sprintf("# 1 \"%s\" 1\n",state->yyFileName.data());
- outputArray(yyscanner,lineStr.data(),lineStr.length());
+ lineStr.sprintf("# 1 \"%s\" 1\n",qPrint(state->yyFileName));
+ outputString(yyscanner,lineStr);
- DBG_CTX((stderr,"Switching to include file %s\n",incFileName.data()));
+ DBG_CTX((stderr,"Switching to include file %s\n",qPrint(incFileName)));
state->expectGuard=TRUE;
state->inputBuf = &fs->fileBuf;
state->inputBufPos=0;
@@ -3022,7 +3031,7 @@ static void readIncludeFile(yyscan_t yyscanner,const QCString &inc)
}
if (state->curlyCount>0 && !alreadyProcessed) // failed to find #include inside { ... }
{
- warn(state->yyFileName,state->yyLineNr,"include file %s not found, perhaps you forgot to add its directory to INCLUDE_PATH?",incFileName.data());
+ warn(state->yyFileName,state->yyLineNr,"include file %s not found, perhaps you forgot to add its directory to INCLUDE_PATH?",qPrint(incFileName));
}
}
}
@@ -3030,12 +3039,12 @@ static void readIncludeFile(yyscan_t yyscanner,const QCString &inc)
/* ----------------------------------------------------------------- */
-static void startCondSection(yyscan_t yyscanner,const char *sectId)
+static void startCondSection(yyscan_t yyscanner,const QCString &sectId)
{
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
//printf("startCondSection: skip=%d stack=%d\n",state->skip,state->condStack.size());
CondParser prs;
- bool expResult = prs.parse(state->yyFileName,state->yyLineNr,sectId);
+ bool expResult = prs.parse(state->yyFileName.data(),state->yyLineNr,sectId.data());
state->condStack.emplace(std::make_unique<CondCtx>(state->yyLineNr,sectId,state->skip));
if (!expResult)
{
@@ -3070,13 +3079,13 @@ static void forceEndCondSection(yyscan_t yyscanner)
state->skip=FALSE;
}
-static QCString escapeAt(const char *text)
+static QCString escapeAt(const QCString &text)
{
QCString result;
- if (text)
+ if (!text.isEmpty())
{
char c;
- const char *p=text;
+ const char *p=text.data();
while ((c=*p++))
{
if (c=='@') result+="@@"; else result+=c;
@@ -3107,7 +3116,7 @@ static char resolveTrigraph(char c)
static int getNextChar(yyscan_t yyscanner,const QCString &expr,QCString *rest,uint &pos)
{
- //printf("getNextChar(%s,%s,%d)\n",expr.data(),rest ? rest->data() : 0,pos);
+ //printf("getNextChar(%s,%s,%d)\n",qPrint(expr),rest ? rest->data() : 0,pos);
if (pos<expr.length())
{
//printf("%c=expr()\n",expr.at(pos));
@@ -3130,7 +3139,7 @@ static int getNextChar(yyscan_t yyscanner,const QCString &expr,QCString *rest,ui
static int getCurrentChar(yyscan_t yyscanner,const QCString &expr,QCString *rest,uint pos)
{
- //printf("getCurrentChar(%s,%s,%d)\n",expr.data(),rest ? rest->data() : 0,pos);
+ //printf("getCurrentChar(%s,%s,%d)\n",qPrint(expr),rest ? rest->data() : 0,pos);
if (pos<expr.length())
{
//printf("%c=expr()\n",expr.at(pos));
@@ -3153,7 +3162,7 @@ static int getCurrentChar(yyscan_t yyscanner,const QCString &expr,QCString *rest
static void unputChar(yyscan_t yyscanner,const QCString &expr,QCString *rest,uint &pos,char c)
{
- //printf("unputChar(%s,%s,%d,%c)\n",expr.data(),rest ? rest->data() : 0,pos,c);
+ //printf("unputChar(%s,%s,%d,%c)\n",qPrint(expr),rest ? rest->data() : 0,pos,c);
if (pos<expr.length())
{
pos++;
@@ -3169,13 +3178,13 @@ static void unputChar(yyscan_t yyscanner,const QCString &expr,QCString *rest,uin
//unput(c);
returnCharToStream(yyscanner,c);
}
- //printf("result: unputChar(%s,%s,%d,%c)\n",expr.data(),rest ? rest->data() : 0,pos,c);
+ //printf("result: unputChar(%s,%s,%d,%c)\n",qPrint(expr),rest ? rest->data() : 0,pos,c);
}
/** Returns a reference to a Define object given its name or 0 if the Define does
* not exist.
*/
-static Define *isDefined(yyscan_t yyscanner,const char *name)
+static Define *isDefined(yyscan_t yyscanner,const QCString &name)
{
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
@@ -3183,7 +3192,7 @@ static Define *isDefined(yyscan_t yyscanner,const char *name)
auto findDefine = [&undef,&name](DefineMap &map)
{
Define *d=0;
- auto it = map.find(name);
+ auto it = map.find(name.str());
if (it!=map.end())
{
d = &it->second;
@@ -3204,7 +3213,7 @@ static Define *isDefined(yyscan_t yyscanner,const char *name)
return def;
}
-static void initPredefined(yyscan_t yyscanner,const char *fileName)
+static void initPredefined(yyscan_t yyscanner,const QCString &fileName)
{
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
@@ -3282,7 +3291,7 @@ static void initPredefined(yyscan_t yyscanner,const char *fileName)
int argIndex = it->second;
QCString marker;
marker.sprintf(" @%d ",argIndex);
- definition+=marker;
+ definition+=marker.str();
}
else
{
@@ -3308,7 +3317,7 @@ static void initPredefined(yyscan_t yyscanner,const char *fileName)
state->contextDefines.insert(std::make_pair(def.name.str(),def));
//printf("#define '%s' '%s' #nargs=%d\n",
- // def->name.data(),def->definition.data(),def->nargs);
+ // qPrint(def->name),qPrint(def->definition),def->nargs);
}
}
else if (!ds.empty()) // predefined non-function macro definition
@@ -3347,11 +3356,11 @@ struct Preprocessor::Private
preYY_state state;
};
-void Preprocessor::addSearchDir(const char *dir)
+void Preprocessor::addSearchDir(const QCString &dir)
{
YY_EXTRA_TYPE state = preYYget_extra(p->yyscanner);
- QFileInfo fi(dir);
- if (fi.isDir()) state->pathList.push_back(fi.absFilePath().utf8().data());
+ FileInfo fi(dir.str());
+ if (fi.isDir()) state->pathList.push_back(fi.absFilePath());
}
Preprocessor::Preprocessor() : p(std::make_unique<Private>())
@@ -3365,7 +3374,7 @@ Preprocessor::~Preprocessor()
preYYlex_destroy(p->yyscanner);
}
-void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output)
+void Preprocessor::processFile(const QCString &fileName,BufStr &input,BufStr &output)
{
// printf("Preprocessor::processFile(%s)\n",fileName);
yyscan_t yyscanner = p->yyscanner;
@@ -3376,10 +3385,10 @@ void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output
preYYset_debug(1,yyscanner);
#endif
- printlex(yy_flex_debug, TRUE, __FILE__, fileName);
+ printlex(yy_flex_debug, TRUE, __FILE__, qPrint(fileName));
uint orgOffset=output.curPos();
//printf("##########################\n%s\n####################\n",
- // input.data());
+ // qPrint(input));
state->macroExpansion = Config_getBool(MACRO_EXPANSION);
state->expandOnlyPredef = Config_getBool(EXPAND_ONLY_PREDEF);
@@ -3418,9 +3427,9 @@ void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output
{
const std::unique_ptr<CondCtx> &ctx = state->condStack.top();
QCString sectionInfo = " ";
- if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label '%s' ",ctx->sectionId.stripWhiteSpace().data());
+ if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label '%s' ",qPrint(ctx->sectionId.stripWhiteSpace()));
warn(fileName,ctx->lineNr,"Conditional section%sdoes not have "
- "a corresponding \\endcond command within this file.",sectionInfo.data());
+ "a corresponding \\endcond command within this file.",qPrint(sectionInfo));
state->condStack.pop();
}
// make sure we don't extend a \cond with missing \endcond over multiple files (see bug 624829)
@@ -3431,7 +3440,7 @@ void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output
std::lock_guard<std::mutex> lock(g_debugMutex);
char *orgPos=output.data()+orgOffset;
char *newPos=output.data()+output.curPos();
- Debug::print(Debug::Preprocessor,0,"Preprocessor output of %s (size: %d bytes):\n",fileName,newPos-orgPos);
+ Debug::print(Debug::Preprocessor,0,"Preprocessor output of %s (size: %d bytes):\n",qPrint(fileName),newPos-orgPos);
int line=1;
Debug::print(Debug::Preprocessor,0,"---------\n");
if (!Debug::isFlagSet(Debug::NoLineNo)) Debug::print(Debug::Preprocessor,0,"00001 ");
@@ -3444,7 +3453,7 @@ void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output
Debug::print(Debug::Preprocessor,0,"\n---------\n");
if (yyextra->contextDefines.size()>0)
{
- Debug::print(Debug::Preprocessor,0,"Macros accessible in this file (%s):\n", fileName);
+ Debug::print(Debug::Preprocessor,0,"Macros accessible in this file (%s):\n", qPrint(fileName));
Debug::print(Debug::Preprocessor,0,"---------\n");
for (auto &kv : yyextra->contextDefines)
{
@@ -3458,7 +3467,7 @@ void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output
}
else
{
- Debug::print(Debug::Preprocessor,0,"No macros accessible in this file (%s).\n", fileName);
+ Debug::print(Debug::Preprocessor,0,"No macros accessible in this file (%s).\n", qPrint(fileName));
}
}
@@ -3480,7 +3489,7 @@ void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output
}
//yyextra->defineManager.endContext();
- printlex(yy_flex_debug, FALSE, __FILE__, fileName);
+ printlex(yy_flex_debug, FALSE, __FILE__, qPrint(fileName));
// printf("Preprocessor::processFile(%s) finished\n",fileName);
}
diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h
index 2992717..5ad0205 100644
--- a/src/printdocvisitor.h
+++ b/src/printdocvisitor.h
@@ -36,19 +36,19 @@ class PrintDocVisitor : public DocVisitor
void visit(DocWord *w)
{
indent_leaf();
- printf("%s",w->word().data());
+ printf("%s",qPrint(w->word()));
}
void visit(DocLinkedWord *w)
{
indent_leaf();
- printf("%s",w->word().data());
+ printf("%s",qPrint(w->word()));
}
void visit(DocWhiteSpace *w)
{
indent_leaf();
if (m_insidePre)
{
- printf("%s",w->chars().data());
+ printf("%s",qPrint(w->chars()));
}
else
{
@@ -84,7 +84,7 @@ class PrintDocVisitor : public DocVisitor
void visit(DocURL *u)
{
indent_leaf();
- printf("%s",u->url().data());
+ printf("%s",qPrint(u->url()));
}
void visit(DocLineBreak *)
{
@@ -165,7 +165,7 @@ class PrintDocVisitor : public DocVisitor
case DocVerbatim::Msc: printf("<msc>"); break;
case DocVerbatim::PlantUML: printf("<plantuml>"); break;
}
- printf("%s",s->text().data());
+ printf("%s",qPrint(s->text()));
switch(s->type())
{
case DocVerbatim::Code: printf("</code>"); break;
@@ -184,12 +184,12 @@ class PrintDocVisitor : public DocVisitor
void visit(DocAnchor *a)
{
indent_leaf();
- printf("<anchor name=\"%s\"/>",a->anchor().data());
+ printf("<anchor name=\"%s\"/>",qPrint(a->anchor()));
}
void visit(DocInclude *inc)
{
indent_leaf();
- printf("<include file=\"%s\" type=\"",inc->file().data());
+ printf("<include file=\"%s\" type=\"",qPrint(inc->file()));
switch(inc->type())
{
case DocInclude::Include: printf("include"); break;
@@ -219,7 +219,7 @@ class PrintDocVisitor : public DocVisitor
void visit(DocIncOperator *op)
{
indent_leaf();
- printf("<incoperator pattern=\"%s\" type=\"",op->pattern().data());
+ printf("<incoperator pattern=\"%s\" type=\"",qPrint(op->pattern()));
switch(op->type())
{
case DocIncOperator::Line: printf("line"); break;
@@ -232,12 +232,12 @@ class PrintDocVisitor : public DocVisitor
void visit(DocFormula *f)
{
indent_leaf();
- printf("<formula name=%s text=%s/>",f->name().data(),f->text().data());
+ printf("<formula name=%s text=%s/>",qPrint(f->name()),qPrint(f->text()));
}
void visit(DocIndexEntry *i)
{
indent_leaf();
- printf("<indexentry>%s</indexentry\n",i->entry().data());
+ printf("<indexentry>%s</indexentry\n",qPrint(i->entry()));
}
void visit(DocSimpleSectSep *)
{
@@ -250,8 +250,8 @@ class PrintDocVisitor : public DocVisitor
printf("<cite ref=\"%s\" file=\"%s\" "
"anchor=\"%s\" text=\"%s\""
"/>\n",
- cite->ref().data(),cite->file().data(),cite->anchor().data(),
- cite->text().data());
+ qPrint(cite->ref()),qPrint(cite->file()),qPrint(cite->anchor()),
+ qPrint(cite->text()));
}
//--------------------------------------
@@ -498,7 +498,7 @@ class PrintDocVisitor : public DocVisitor
void visitPre(DocHRef *href)
{
indent_pre();
- printf("<a url=\"%s\">\n",href->url().data());
+ printf("<a url=\"%s\">\n",qPrint(href->url()));
}
void visitPost(DocHRef *)
{
@@ -518,7 +518,7 @@ class PrintDocVisitor : public DocVisitor
void visitPre(DocImage *img)
{
indent_pre();
- printf("<image src=\"%s\" type=\"",img->name().data());
+ printf("<image src=\"%s\" type=\"",qPrint(img->name()));
switch(img->type())
{
case DocImage::Html: printf("html"); break;
@@ -526,7 +526,7 @@ class PrintDocVisitor : public DocVisitor
case DocImage::Rtf: printf("rtf"); break;
case DocImage::DocBook: printf("docbook"); break;
}
- printf("\" %s %s inline=\"%s\">\n",img->width().data(),img->height().data(),img->isInlineImage() ? "yes" : "no");
+ printf("\" %s %s inline=\"%s\">\n",qPrint(img->width()),qPrint(img->height()),img->isInlineImage() ? "yes" : "no");
}
void visitPost(DocImage *)
{
@@ -536,7 +536,7 @@ class PrintDocVisitor : public DocVisitor
void visitPre(DocDotFile *df)
{
indent_pre();
- printf("<dotfile src=\"%s\">\n",df->name().data());
+ printf("<dotfile src=\"%s\">\n",qPrint(df->name()));
}
void visitPost(DocDotFile *)
{
@@ -546,7 +546,7 @@ class PrintDocVisitor : public DocVisitor
void visitPre(DocMscFile *df)
{
indent_pre();
- printf("<mscfile src=\"%s\">\n",df->name().data());
+ printf("<mscfile src=\"%s\">\n",qPrint(df->name()));
}
void visitPost(DocMscFile *)
{
@@ -556,7 +556,7 @@ class PrintDocVisitor : public DocVisitor
void visitPre(DocDiaFile *df)
{
indent_pre();
- printf("<diafile src=\"%s\">\n",df->name().data());
+ printf("<diafile src=\"%s\">\n",qPrint(df->name()));
}
void visitPost(DocDiaFile *)
{
@@ -567,7 +567,7 @@ class PrintDocVisitor : public DocVisitor
{
indent_pre();
printf("<link ref=\"%s\" file=\"%s\" anchor=\"%s\">\n",
- lnk->ref().data(),lnk->file().data(),lnk->anchor().data());
+ qPrint(lnk->ref()),qPrint(lnk->file()),qPrint(lnk->anchor()));
}
void visitPost(DocLink *)
{
@@ -580,8 +580,8 @@ class PrintDocVisitor : public DocVisitor
printf("<ref ref=\"%s\" file=\"%s\" "
"anchor=\"%s\" targetTitle=\"%s\""
" hasLinkText=\"%s\" refToAnchor=\"%s\" refToSection=\"%s\" refToTable=\"%s\">\n",
- ref->ref().data(),ref->file().data(),ref->anchor().data(),
- ref->targetTitle().data(),ref->hasLinkText()?"yes":"no",
+ qPrint(ref->ref()),qPrint(ref->file()),qPrint(ref->anchor()),
+ qPrint(ref->targetTitle()),ref->hasLinkText()?"yes":"no",
ref->refToAnchor()?"yes":"no", ref->refToSection()?"yes":"no",
ref->refToTable()?"yes":"no");
}
@@ -593,7 +593,7 @@ class PrintDocVisitor : public DocVisitor
void visitPre(DocSecRefItem *ref)
{
indent_pre();
- printf("<secrefitem target=\"%s\">\n",ref->target().data());
+ printf("<secrefitem target=\"%s\">\n",qPrint(ref->target()));
}
void visitPost(DocSecRefItem *)
{
@@ -613,7 +613,7 @@ class PrintDocVisitor : public DocVisitor
//void visitPre(DocLanguage *l)
//{
// indent_pre();
- // printf("<language id=%s>\n",l->id().data());
+ // printf("<language id=%s>\n",qPrint(l->id()));
//}
//void visitPost(DocLanguage *)
//{
@@ -675,7 +675,7 @@ class PrintDocVisitor : public DocVisitor
{
indent_pre();
printf("<xrefitem file=\"%s\" anchor=\"%s\" title=\"%s\">\n",
- x->file().data(),x->anchor().data(),x->title().data());
+ qPrint(x->file()),qPrint(x->anchor()),qPrint(x->title()));
}
void visitPost(DocXRefItem *)
{
@@ -685,7 +685,7 @@ class PrintDocVisitor : public DocVisitor
void visitPre(DocInternalRef *r)
{
indent_pre();
- printf("<internalref file=%s anchor=%s>\n",r->file().data(),r->anchor().data());
+ printf("<internalref file=%s anchor=%s>\n",qPrint(r->file()),qPrint(r->anchor()));
}
void visitPost(DocInternalRef *)
{
diff --git a/src/pycode.h b/src/pycode.h
index 8bce2a9..43179da 100644
--- a/src/pycode.h
+++ b/src/pycode.h
@@ -37,11 +37,11 @@ class PythonCodeParser : public CodeParserInterface
PythonCodeParser();
virtual ~PythonCodeParser();
void parseCode(CodeOutputInterface &codeOutIntf,
- const char *scopeName,
+ const QCString &scopeName,
const QCString &input,
SrcLangExt lang,
bool isExampleBlock,
- const char *exampleName=0,
+ const QCString &exampleName=QCString(),
FileDef *fileDef=0,
int startLine=-1,
int endLine=-1,
diff --git a/src/pycode.l b/src/pycode.l
index 107d855..fa65e22 100644
--- a/src/pycode.l
+++ b/src/pycode.l
@@ -118,27 +118,27 @@ static const char *stateToString(int state);
static void startCodeLine(yyscan_t yyscanner);
static int countLines(yyscan_t yyscanner);
static void setCurrentDoc(yyscan_t yyscanner, const QCString &anchor);
-static void addToSearchIndex(yyscan_t yyscanner, const char *text);
-static const ClassDef *stripClassName(yyscan_t yyscanner,const char *s,Definition *d);
-static void codify(yyscan_t yyscanner,const char* text);
+static void addToSearchIndex(yyscan_t yyscanner, const QCString &text);
+static const ClassDef *stripClassName(yyscan_t yyscanner,const QCString &s,Definition *d);
+static void codify(yyscan_t yyscanner,const QCString &text);
static void endCodeLine(yyscan_t yyscanner);
static void nextCodeLine(yyscan_t yyscanner);
-static void writeMultiLineCodeLink(yyscan_t yyscanner, CodeOutputInterface &ol, const Definition *d, const char *text);
+static void writeMultiLineCodeLink(yyscan_t yyscanner, CodeOutputInterface &ol, const Definition *d, const QCString &text);
static void startFontClass(yyscan_t yyscanner,const char *s);
static void endFontClass(yyscan_t yyscanner);
-static void codifyLines(yyscan_t yyscanner,const char *text);
+static void codifyLines(yyscan_t yyscanner,const QCString &text);
static bool getLinkInScope(yyscan_t yyscanner, const QCString &c, const QCString &m,
- const char *memberText, CodeOutputInterface &ol, const char *text);
-static bool getLink(yyscan_t yyscanner, const char *className, const char *memberName,
- CodeOutputInterface &ol, const char *text=0);
+ const QCString &memberText, CodeOutputInterface &ol, const QCString &text);
+static bool getLink(yyscan_t yyscanner, const QCString &className, const QCString &memberName,
+ CodeOutputInterface &ol, const QCString &text=QCString());
static void generateClassOrGlobalLink(yyscan_t yyscanner, CodeOutputInterface &ol,
- const char *clName, bool typeOnly=FALSE);
+ const QCString &clName, bool typeOnly=FALSE);
static void generateFunctionLink(yyscan_t yyscanner, CodeOutputInterface &ol,
- const char *funcName);
+ const QCString &funcName);
static bool findMemberLink(yyscan_t yyscanner, CodeOutputInterface &ol,
- Definition *sym, const char *symName);
+ Definition *sym, const QCString &symName);
static void findMemberLink(yyscan_t yyscanner, CodeOutputInterface &ol,
- const char *symName);
+ const QCString &symName);
static void adjustScopesAndSuites(yyscan_t yyscanner,unsigned indentLength);
static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
@@ -395,7 +395,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBU
// Push a class scope
- std::unique_ptr<ClassDef> classDefToAdd { createClassDef("<code>",1,1,yyextra->curClassName,ClassDef::Class,0,0,FALSE) };
+ std::unique_ptr<ClassDef> classDefToAdd { createClassDef("<code>",1,1,yyextra->curClassName,ClassDef::Class,QCString(),QCString(),FALSE) };
ScopedTypeVariant var(yyextra->curClassName);
for (const auto &s : yyextra->curClassBases)
{
@@ -829,7 +829,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBU
static void addVariable(yyscan_t yyscanner, QCString type, QCString name)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- //printf("PyVariableContext::addVariable(%s,%s)\n",type.data(),name.data());
+ //printf("PyVariableContext::addVariable(%s,%s)\n",qPrint(type),qPrint(name));
QCString ltype = type.simplifyWhiteSpace();
QCString lname = name.simplifyWhiteSpace();
@@ -951,7 +951,7 @@ static void setCurrentDoc(yyscan_t yyscanner, const QCString &anchor)
//-------------------------------------------------------------------------------
-static void addToSearchIndex(yyscan_t yyscanner, const char *text)
+static void addToSearchIndex(yyscan_t yyscanner, const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (Doxygen::searchIndex)
@@ -963,7 +963,7 @@ static void addToSearchIndex(yyscan_t yyscanner, const char *text)
//-------------------------------------------------------------------------------
-static const ClassDef *stripClassName(yyscan_t yyscanner,const char *s,Definition *d)
+static const ClassDef *stripClassName(yyscan_t yyscanner,const QCString &s,Definition *d)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
int pos=0;
@@ -1018,9 +1018,9 @@ static void startCodeLine(yyscan_t yyscanner)
//yyextra->insideBody = FALSE;
yyextra->endComment = FALSE;
yyextra->searchingForBody = TRUE;
- yyextra->realScope = d->name().copy();
- yyextra->classScope = d->name().copy();
- //printf("Real scope: '%s'\n",yyextra->realScope.data());
+ yyextra->realScope = d->name();
+ yyextra->classScope = d->name();
+ //printf("Real scope: '%s'\n",qPrint(yyextra->realScope));
yyextra->bodyCurlyCount = 0;
QCString lineAnchor;
lineAnchor.sprintf("l%05d",yyextra->yyLineNr);
@@ -1035,14 +1035,14 @@ static void startCodeLine(yyscan_t yyscanner)
{
yyextra->code->writeLineNumber(d->getReference(),
d->getOutputFileBase(),
- 0,yyextra->yyLineNr);
+ QCString(),yyextra->yyLineNr);
setCurrentDoc(yyscanner,lineAnchor);
}
}
else
{
//yyextra->code->codify(lineNumber);
- yyextra->code->writeLineNumber(0,0,0,yyextra->yyLineNr);
+ yyextra->code->writeLineNumber(QCString(),QCString(),QCString(),yyextra->yyLineNr);
}
//yyextra->code->endLineNumber();
}
@@ -1055,7 +1055,7 @@ static void startCodeLine(yyscan_t yyscanner)
//-------------------------------------------------------------------------------
-static void codify(yyscan_t yyscanner,const char* text)
+static void codify(yyscan_t yyscanner,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->code->codify(text);
@@ -1093,9 +1093,10 @@ static void nextCodeLine(yyscan_t yyscanner)
static void writeMultiLineCodeLink(yyscan_t yyscanner,
CodeOutputInterface &ol,
const Definition *d,
- const char *text)
+ const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ if (text.isEmpty()) return;
bool sourceTooltips = Config_getBool(SOURCE_TOOLTIPS);
TooltipManager::instance().addTooltip(ol,d);
QCString ref = d->getReference();
@@ -1107,7 +1108,7 @@ static void writeMultiLineCodeLink(yyscan_t yyscanner,
tooltip = d->briefDescriptionAsTooltip();
}
bool done=FALSE;
- char *p=(char *)text;
+ char *p=text.rawData();
while (!done)
{
char *sp=p;
@@ -1159,11 +1160,12 @@ static void endFontClass(yyscan_t yyscanner)
//-------------------------------------------------------------------------------
-static void codifyLines(yyscan_t yyscanner,const char *text)
+static void codifyLines(yyscan_t yyscanner,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ if (text.isEmpty()) return;
//printf("codifyLines(%d,\"%s\")\n",yyextra->yyLineNr,text);
- const char *p=text,*sp=p;
+ const char *p=text.data(),*sp=p;
char c;
bool done=FALSE;
while (!done)
@@ -1194,9 +1196,9 @@ static void codifyLines(yyscan_t yyscanner,const char *text)
static bool getLinkInScope(yyscan_t yyscanner,
const QCString &c, // scope
const QCString &m, // member
- const char *memberText, // exact text
+ const QCString &memberText, // exact text
CodeOutputInterface &ol,
- const char *text
+ const QCString &text
)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
@@ -1205,7 +1207,7 @@ static bool getLinkInScope(yyscan_t yyscanner,
const FileDef *fd = 0;
const NamespaceDef *nd = 0;
const GroupDef *gd = 0;
- //printf("Trying '%s'::'%s'\n",c.data(),m.data());
+ //printf("Trying '%s'::'%s'\n",qPrint(c),qPrint(m));
if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,yyextra->sourceFileDef) &&
md->isLinkable())
{
@@ -1214,7 +1216,7 @@ static bool getLinkInScope(yyscan_t yyscanner,
const Definition *d = md->getOuterScope()==Doxygen::globalScope ?
md->getBodyDef() : md->getOuterScope();
- //printf("Found! d=%s\n",d?d->name().data():"<none>");
+ //printf("Found! d=%s\n",d?qPrint(d->name()):"<none>");
if (md->getGroupDef()) d = md->getGroupDef();
if (d && d->isLinkable())
{
@@ -1228,10 +1230,10 @@ static bool getLinkInScope(yyscan_t yyscanner,
std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(md));
}
- //printf("d->getReference()='%s' d->getOutputBase()='%s' name='%s' member name='%s'\n",d->getReference().data(),d->getOutputFileBase().data(),d->name().data(),md->name().data());
+ //printf("d->getReference()='%s' d->getOutputBase()='%s' name='%s' member name='%s'\n",qPrint(d->getReference()),qPrint(d->getOutputFileBase()),qPrint(d->name()),qPrint(md->name()));
- writeMultiLineCodeLink(yyscanner,ol,md, text ? text : memberText);
- addToSearchIndex(yyscanner,text ? text : memberText);
+ writeMultiLineCodeLink(yyscanner,ol,md, !text.isEmpty() ? text : memberText);
+ addToSearchIndex(yyscanner,!text.isEmpty() ? text : memberText);
return TRUE;
}
}
@@ -1241,10 +1243,10 @@ static bool getLinkInScope(yyscan_t yyscanner,
//-------------------------------------------------------------------------------
static bool getLink(yyscan_t yyscanner,
- const char *className,
- const char *memberName,
+ const QCString &className,
+ const QCString &memberName,
CodeOutputInterface &ol,
- const char *text)
+ const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
QCString m=removeRedundantWhiteSpace(memberName);
@@ -1270,7 +1272,7 @@ static bool getLink(yyscan_t yyscanner,
*/
static void generateClassOrGlobalLink(yyscan_t yyscanner,
CodeOutputInterface &ol,
- const char *clName,
+ const QCString &clName,
bool typeOnly)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
@@ -1279,7 +1281,7 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
// Don't do anything for empty text
if (className.isEmpty()) return;
- DBG_CTX((stderr,"generateClassOrGlobalLink(className=%s)\n",className.data()));
+ DBG_CTX((stderr,"generateClassOrGlobalLink(className=%s)\n",qPrint(className)));
const ScopedTypeVariant *lcd = 0;
const ClassDef *cd=0; // Class def that we may find
@@ -1295,9 +1297,9 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
md = yyextra->symbolResolver.getTypedef();
DBG_CTX((stderr,"d=%s yyextra->sourceFileDef=%s\n",
- d?d->displayName().data():"<null>",
- yyextra->currentDefinition?yyextra->currentDefinition->displayName().data():"<null>"));
- DBG_CTX((stderr,"is found as a type %s\n",cd?cd->name().data():"<null>"));
+ d?qPrint(d->displayName()):"<null>",
+ yyextra->currentDefinition?qPrint(yyextra->currentDefinition->displayName()):"<null>"));
+ DBG_CTX((stderr,"is found as a type %s\n",cd?qPrint(cd->name()):"<null>"));
if (cd==0 && md==0) // also see if it is variable or enum or enum value
{
@@ -1349,7 +1351,7 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
QCString scope = substitute(className.left(scopeEnd),".","::");
QCString locName = className.right(className.length()-scopeEnd-1);
ClassDef *mcd = getClass(scope);
- DBG_CTX((stderr,"scope=%s locName=%s mcd=%p\n",scope.data(),locName.data(),mcd));
+ DBG_CTX((stderr,"scope=%s locName=%s mcd=%p\n",qPrint(scope),qPrint(locName),mcd));
if (mcd)
{
const MemberDef *mmd = mcd->getMemberByName(locName);
@@ -1378,7 +1380,7 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
const MemberDef *mmd=mnd->getMemberByName(locName);
if (mmd)
{
- //printf("name=%s scope=%s\n",locName.data(),scope.data());
+ //printf("name=%s scope=%s\n",qPrint(locName),qPrint(scope));
yyextra->theCallContext.setScope(ScopedTypeVariant(stripClassName(yyscanner,mmd->typeString(),mmd->getOuterScope())));
writeMultiLineCodeLink(yyscanner,ol,mmd,clName);
addToSearchIndex(yyscanner,className);
@@ -1414,26 +1416,26 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
*/
static void generateFunctionLink(yyscan_t yyscanner,
CodeOutputInterface &ol,
- const char *funcName)
+ const QCString &funcName)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
QCString locScope=yyextra->classScope;
QCString locFunc=removeRedundantWhiteSpace(funcName);
- DBG_CTX((stdout,"*** locScope=%s locFunc=%s\n",locScope.data(),locFunc.data()));
+ DBG_CTX((stdout,"*** locScope=%s locFunc=%s\n",qPrint(locScope),qPrint(locFunc)));
int i=locFunc.findRev("::");
if (i>0)
{
locScope=locFunc.left(i);
locFunc=locFunc.right(locFunc.length()-i-2).stripWhiteSpace();
}
- //printf("generateFunctionLink(%s) classScope='%s'\n",locFunc.data(),locScope.data());
+ //printf("generateFunctionLink(%s) classScope='%s'\n",qPrint(locFunc),qPrint(locScope));
if (!locScope.isEmpty())
{
auto it = yyextra->codeClassMap.find(locScope.str());
if (it!=yyextra->codeClassMap.end())
{
ScopedTypeVariant ccd = it->second;
- //printf("using classScope %s\n",yyextra->classScope.data());
+ //printf("using classScope %s\n",qPrint(yyextra->classScope));
if (ccd.localDef() && !ccd.localDef()->baseClasses().empty())
{
for (const auto &bcName : ccd.localDef()->baseClasses())
@@ -1458,11 +1460,11 @@ static void generateFunctionLink(yyscan_t yyscanner,
static bool findMemberLink(yyscan_t yyscanner,
CodeOutputInterface &ol,
Definition *sym,
- const char *symName)
+ const QCString &symName)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
//printf("sym %s outerScope=%s equal=%d\n",
- // sym->name().data(),sym->getOuterScope()->name().data(),
+ // qPrint(sym->name()),qPrint(sym->getOuterScope()->name()),
// sym->getOuterScope()==yyextra->currentDefinition);
if (sym->getOuterScope() &&
@@ -1479,7 +1481,7 @@ static bool findMemberLink(yyscan_t yyscanner,
addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(toMemberDef(sym)));
}
}
- DBG_CTX((stderr,"cd=%s thisCd=%s\n",cd?cd->name().data():"<none>",thisCd?thisCd->name().data():"<none>"));
+ DBG_CTX((stderr,"cd=%s thisCd=%s\n",cd?qPrint(cd->name()):"<none>",thisCd?qPrint(thisCd->name()):"<none>"));
// TODO: find the nearest base class in case cd is a base class of
// thisCd
@@ -1496,13 +1498,13 @@ static bool findMemberLink(yyscan_t yyscanner,
static void findMemberLink(yyscan_t yyscanner,
CodeOutputInterface &ol,
- const char *symName)
+ const QCString &symName)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
//printf("Member reference: %s scope=%s member=%s\n",
// yytext,
- // yyextra->currentDefinition?yyextra->currentDefinition->name().data():"<none>",
- // yyextra->currentMemberDef?yyextra->currentMemberDef->name().data():"<none>"
+ // yyextra->currentDefinition?qPrint(yyextra->currentDefinition->name()):"<none>",
+ // yyextra->currentMemberDef?qPrint(yyextra->currentMemberDef->name()):"<none>"
// );
if (yyextra->currentDefinition)
{
@@ -1552,11 +1554,11 @@ void PythonCodeParser::resetCodeParserState()
}
void PythonCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
- const char *scopeName,
+ const QCString &scopeName,
const QCString &input,
SrcLangExt /*lang*/,
bool isExampleBlock,
- const char *exampleName,
+ const QCString &exampleName,
FileDef *fileDef,
int startLine,
int endLine,
@@ -1573,9 +1575,9 @@ void PythonCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
//printf("***parseCode()\n");
if (input.isEmpty()) return;
- printlex(yy_flex_debug, TRUE, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
+ printlex(yy_flex_debug, TRUE, __FILE__, fileDef ? qPrint(fileDef->fileName()): NULL);
yyextra->code = &codeOutIntf;
- yyextra->inputString = input;
+ yyextra->inputString = input.data();
yyextra->inputPosition = 0;
yyextra->currentFontClass = 0;
yyextra->needsTermination = FALSE;
@@ -1600,7 +1602,7 @@ void PythonCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
if (yyextra->exampleBlock && fileDef==0)
{
// create a dummy filedef for the example
- yyextra->sourceFileDef = createFileDef("",(exampleName?exampleName:"generated"));
+ yyextra->sourceFileDef = createFileDef("",(!exampleName.isEmpty()?qPrint(exampleName):"generated"));
cleanupSourceDef = TRUE;
}
if (yyextra->sourceFileDef)
@@ -1633,7 +1635,7 @@ void PythonCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
}
// write the tooltips
TooltipManager::instance().writeTooltips(codeOutIntf);
- printlex(yy_flex_debug, FALSE, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
+ printlex(yy_flex_debug, FALSE, __FILE__, fileDef ? qPrint(fileDef->fileName()): NULL);
}
#if USE_STATE2STRING
diff --git a/src/pyscanner.h b/src/pyscanner.h
index 4f0ae38..dc7ea1c 100644
--- a/src/pyscanner.h
+++ b/src/pyscanner.h
@@ -36,12 +36,12 @@ class PythonOutlineParser : public OutlineParserInterface
public:
PythonOutlineParser();
virtual ~PythonOutlineParser();
- void parseInput(const char * fileName,
+ void parseInput(const QCString &fileName,
const char *fileBuf,
const std::shared_ptr<Entry> &root,
ClangTUParser *clangParser);
bool needsPreprocessing(const QCString &extension) const;
- void parsePrototype(const char *text);
+ void parsePrototype(const QCString &text);
private:
struct Private;
std::unique_ptr<Private> p;
diff --git a/src/pyscanner.l b/src/pyscanner.l
index 403b400..b0ebd41 100644
--- a/src/pyscanner.l
+++ b/src/pyscanner.l
@@ -37,8 +37,6 @@
#include <assert.h>
#include <ctype.h>
-#include <qfileinfo.h>
-
#include "pyscanner.h"
#include "entry.h"
#include "message.h"
@@ -50,6 +48,7 @@
#include "commentscan.h"
#include "arguments.h"
#include "markdown.h"
+#include "fileinfo.h"
// Toggle for some debugging info
//#define DBG_CTX(x) fprintf x
@@ -87,7 +86,7 @@ struct pyscannerYY_state
bool doubleQuote = FALSE;
bool specialBlock = FALSE;
int stringContext = 0;
- QGString * copyString = 0;
+ TextStream * copyString = 0;
int indent = 0;
int curIndent = 0;
int commentIndent = 0;
@@ -98,7 +97,7 @@ struct pyscannerYY_state
int atomCount = 0;
QCString moduleScope;
QCString packageName;
- QGString defVal;
+ TextStream defVal;
int braceCount = 0;
bool lexInit = FALSE;
bool packageCommentAllowed = FALSE;
@@ -107,6 +106,7 @@ struct pyscannerYY_state
QCString argType;
bool funcParamsEnd = FALSE;
std::vector<QCString> decorators;
+ QCString programStr;
};
//-----------------------------------------------------------------------------
@@ -134,7 +134,7 @@ static void initTriSingleQuoteBlock(yyscan_t yyscanner);
static void initSpecialBlock(yyscan_t yyscanner);
static void searchFoundDef(yyscan_t yyscanner);
static void searchFoundClass(yyscan_t yyscanner);
-static QCString findPackageScope(yyscan_t yyscanner,const char *fileName);
+static QCString findPackageScope(yyscan_t yyscanner,const QCString &fileName);
static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
@@ -448,7 +448,7 @@ STARTDOCSYMS "##"
{IDENTIFIER}({B}"."{B}{IDENTIFIER})* {
yyextra->current->name=removeRedundantWhiteSpace(substitute(yytext,".","::"));
yyextra->current->fileName = yyextra->yyFileName;
- //printf("Adding using declaration: found:%s:%d name=%s\n",yyextra->yyFileName.data(),yyextra->yyLineNr,yyextra->current->name.data());
+ //printf("Adding using declaration: found:%s:%d name=%s\n",qPrint(yyextra->yyFileName),yyextra->yyLineNr,qPrint(yyextra->current->name));
yyextra->current->section=Entry::USINGDECL_SEC;
yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
initEntry(yyscanner);
@@ -468,7 +468,7 @@ STARTDOCSYMS "##"
<SearchMemVars>{
"self."{IDENTIFIER}/{B}"=" {
- DBG_CTX((stderr,"Found instance method variable %s in %s at %d\n",&yytext[5],yyextra->current_root->name.data(),yyextra->yyLineNr));
+ DBG_CTX((stderr,"Found instance method variable %s in %s at %d\n",&yytext[5],qPrint(yyextra->current_root->name.data(),yyextra->yyLineNr)));
yyextra->current->name=&yytext[5];
yyextra->current->section=Entry::VARIABLE_SEC;
yyextra->current->fileName = yyextra->yyFileName;
@@ -482,7 +482,7 @@ STARTDOCSYMS "##"
newEntry(yyscanner);
}
"cls."{IDENTIFIER}/{B}"=" {
- DBG_CTX((stderr,"Found class method variable %s in %s at %d\n",&yytext[4],yyextra->current_root->name.data(),yyextra->yyLineNr));
+ DBG_CTX((stderr,"Found class method variable %s in %s at %d\n",&yytext[4],qPrint(yyextra->current_root->name),yyextra->yyLineNr));
yyextra->current->name=&yytext[4];
yyextra->current->section=Entry::VARIABLE_SEC;
yyextra->current->fileName = yyextra->yyFileName;
@@ -544,7 +544,7 @@ STARTDOCSYMS "##"
else
{
incLineNr(yyscanner);
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
}
\n{B}/"##" {
@@ -562,7 +562,7 @@ STARTDOCSYMS "##"
else
{
incLineNr(yyscanner);
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
}
<<EOF>> {
@@ -570,10 +570,10 @@ STARTDOCSYMS "##"
yyterminate();
}
^{BB}/\n { // skip empty line
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
^{BB} { // something at indent >0
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
yyextra->curIndent = computeIndent(yytext);
if (yyextra->curIndent<=yyextra->indent)
// jumped out of the function
@@ -583,46 +583,46 @@ STARTDOCSYMS "##"
}
}
"'" { // start of a single quoted string
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
yyextra->stringContext=YY_START;
yyextra->specialBlock = FALSE;
yyextra->copyString=&yyextra->current->program;
BEGIN( SingleQuoteString );
}
"\"" { // start of a double quoted string
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
yyextra->stringContext=YY_START;
yyextra->specialBlock = FALSE;
yyextra->copyString=&yyextra->current->program;
BEGIN( DoubleQuoteString );
}
[^ \t\n#'".]+ { // non-special stuff
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
yyextra->specialBlock = FALSE;
}
^{POUNDCOMMENT} { // normal comment
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
"#".* { // comment half way
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
{NEWLINE} {
incLineNr(yyscanner);
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
. { // any character
- yyextra->current->program+=*yytext;
+ yyextra->current->program << *yytext;
yyextra->specialBlock = FALSE;
}
{TRIDOUBLEQUOTE} { // start of a comment block
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
initTriDoubleQuoteBlock(yyscanner);
BEGIN(TripleComment);
}
{TRISINGLEQUOTE} { // start of a comment block
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
initTriSingleQuoteBlock(yyscanner);
BEGIN(TripleComment);
}
@@ -653,7 +653,7 @@ STARTDOCSYMS "##"
}
"->" {
- yyextra->defVal.resize(0);
+ yyextra->defVal.str(std::string());
yyextra->braceCount = 0;
BEGIN(FunctionTypeAnnotation);
}
@@ -690,7 +690,7 @@ STARTDOCSYMS "##"
"=" { // default value
// TODO: this rule is too simple, need to be able to
// match things like =")" as well!
- yyextra->defVal.resize(0);
+ yyextra->defVal.str(std::string());
yyextra->braceCount = 0;
BEGIN(FunctionParamDefVal);
}
@@ -699,7 +699,7 @@ STARTDOCSYMS "##"
BEGIN(FunctionDec);
}
":"{B} {
- yyextra->defVal.resize(0);
+ yyextra->defVal.str(std::string());
yyextra->braceCount = 0;
BEGIN(FunctionAnnotation);
}
@@ -715,42 +715,42 @@ STARTDOCSYMS "##"
"[" |
"(" {
++yyextra->braceCount;
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
}
"}" |
"]" |
")" {
--yyextra->braceCount;
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
}
":" {
if (yyextra->braceCount == 0)
{
- yyextra->current->type = yyextra->defVal.data();
+ yyextra->current->type = yyextra->defVal.str();
unput(*yytext);
BEGIN(FunctionDec);
}
else
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
}
"'" {
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
yyextra->copyString=&yyextra->defVal;
yyextra->stringContext=FunctionTypeAnnotation;
BEGIN(SingleQuoteString);
}
"\"" {
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
yyextra->copyString=&yyextra->defVal;
yyextra->stringContext=FunctionTypeAnnotation;
BEGIN(DoubleQuoteString);
}
\n {
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
incLineNr(yyscanner);
}
. {
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
}
}
@@ -759,12 +759,12 @@ STARTDOCSYMS "##"
"[" |
"(" {
++yyextra->braceCount;
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
}
"}" |
"]" {
--yyextra->braceCount;
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
}
")" |
"=" |
@@ -772,7 +772,7 @@ STARTDOCSYMS "##"
if (yyextra->braceCount == 0)
{
if (!yyextra->current->argList.empty())
- yyextra->current->argList.back().type += yyextra->defVal;
+ yyextra->current->argList.back().type += yyextra->defVal.str();
if (*yytext != ',')
unput(*yytext);
BEGIN(FunctionParams);
@@ -781,27 +781,27 @@ STARTDOCSYMS "##"
{
if (*yytext == ')')
--yyextra->braceCount;
- yyextra->defVal += *yytext;
+ yyextra->defVal << *yytext;
}
}
"'" {
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
yyextra->copyString=&yyextra->defVal;
yyextra->stringContext=FunctionAnnotation;
BEGIN(SingleQuoteString);
}
"\"" {
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
yyextra->copyString=&yyextra->defVal;
yyextra->stringContext=FunctionAnnotation;
BEGIN(DoubleQuoteString);
}
\n {
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
incLineNr(yyscanner);
}
. {
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
}
}
@@ -810,19 +810,19 @@ STARTDOCSYMS "##"
"[" |
"(" { // internal opening brace, assumption is that we have correct code so braces do match
++yyextra->braceCount;
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
}
"}" |
"]" {
--yyextra->braceCount;
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
}
")" |
"," {
if (yyextra->braceCount == 0)
{
if (!yyextra->current->argList.empty())
- yyextra->current->argList.back().defval=QCString(yyextra->defVal).stripWhiteSpace();
+ yyextra->current->argList.back().defval=QCString(yyextra->defVal.str()).stripWhiteSpace();
if (*yytext == ')')
unput(*yytext);
BEGIN(FunctionParams);
@@ -831,28 +831,28 @@ STARTDOCSYMS "##"
{
if (*yytext == ')')
--yyextra->braceCount;
- yyextra->defVal += *yytext;
+ yyextra->defVal << *yytext;
}
}
"'" {
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
yyextra->copyString=&yyextra->defVal;
yyextra->stringContext=FunctionParamDefVal;
BEGIN( SingleQuoteString );
}
"\"" {
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
yyextra->copyString=&yyextra->defVal;
yyextra->stringContext=FunctionParamDefVal;
BEGIN( DoubleQuoteString );
}
\n {
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
incLineNr(yyscanner);
}
. {
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
}
}
@@ -873,7 +873,7 @@ STARTDOCSYMS "##"
BEGIN(Search);
}
^{BB}/\n { // skip empty line
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
<<EOF>> {
endOfDef(yyscanner);
@@ -894,49 +894,49 @@ STARTDOCSYMS "##"
}
else
{
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
}
"'" { // start of a single quoted string
- yyextra->current->program+=*yytext;
+ yyextra->current->program << *yytext;
yyextra->stringContext=YY_START;
yyextra->specialBlock = FALSE;
yyextra->copyString=&yyextra->current->program;
BEGIN( SingleQuoteString );
}
"\"" { // start of a double quoted string
- yyextra->current->program+=*yytext;
+ yyextra->current->program << *yytext;
yyextra->stringContext=YY_START;
yyextra->specialBlock = FALSE;
yyextra->copyString=&yyextra->current->program;
BEGIN( DoubleQuoteString );
}
[^ \t\n#'"]+ { // non-special stuff
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
yyextra->specialBlock = FALSE;
//yyextra->hideClassDocs = FALSE;
}
{NEWLINE} {
- yyextra->current->program+=*yytext;
+ yyextra->current->program << *yytext;
incLineNr(yyscanner);
}
{POUNDCOMMENT} { // normal comment
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
. { // any character
yyextra->specialBlock = FALSE;
- yyextra->current->program+=*yytext;
+ yyextra->current->program << *yytext;
}
{TRIDOUBLEQUOTE} { // start of a comment block
//if (!yyextra->hideClassDocs)
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
initTriDoubleQuoteBlock(yyscanner);
BEGIN(TripleComment);
}
{TRISINGLEQUOTE} { // start of a comment block
//if (!yyextra->hideClassDocs)
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
initTriSingleQuoteBlock(yyscanner);
BEGIN(TripleComment);
}
@@ -954,7 +954,7 @@ STARTDOCSYMS "##"
// prepend scope in case of nested classes
if (yyextra->current_root->section&Entry::SCOPE_MASK)
{
- //printf("*** Prepending scope %s to class %s\n",yyextra->current_root->name.data(),yyextra->current->name.data());
+ //printf("*** Prepending scope %s to class %s\n",qPrint(yyextra->current_root->name),qPrint(yyextra->current->name));
yyextra->current->name.prepend(yyextra->current_root->name+"::");
}
@@ -975,7 +975,7 @@ STARTDOCSYMS "##"
":" { // begin of the class definition
yyextra->specialBlock = TRUE; // expecting a docstring
yyextra->current->bodyLine = yyextra->yyLineNr;
- yyextra->current->program.resize(0);
+ yyextra->current->program.str(std::string());
BEGIN(ClassCaptureIndent);
}
@@ -1012,17 +1012,17 @@ STARTDOCSYMS "##"
"\n"|({BB}"\n") {
// Blankline - ignore, keep looking for indentation.
lineCount(yyscanner);
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
{TRIDOUBLEQUOTE} { // start of a comment block
initTriDoubleQuoteBlock(yyscanner);
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
BEGIN(TripleComment);
}
{TRISINGLEQUOTE} { // start of a comment block
initTriSingleQuoteBlock(yyscanner);
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
BEGIN(TripleComment);
}
{STARTDOCSYMS}[#]* { // start of a special comment
@@ -1032,12 +1032,12 @@ STARTDOCSYMS "##"
{POUNDCOMMENT} { // ignore comment with just one #
}
^{BB} {
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
//yyextra->current->startLine = yyextra->yyLineNr;
yyextra->curIndent=computeIndent(yytext);
yyextra->bodyEntry = yyextra->current;
DBG_CTX((stderr,"setting indent %d\n",yyextra->curIndent));
- //printf("yyextra->current->program=[%s]\n",yyextra->current->program.data());
+ //printf("yyextra->current->program=[%s]\n",qPrint(yyextra->current->program));
//yyextra->hideClassDocs = TRUE;
BEGIN(ClassBody);
}
@@ -1046,7 +1046,7 @@ STARTDOCSYMS "##"
// Just pushback an empty class, and
// resume parsing the body.
newEntry(yyscanner);
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
// printf("Failed to find indent - skipping!");
BEGIN( Search );
@@ -1058,41 +1058,41 @@ STARTDOCSYMS "##"
"=" { // the assignment operator
//printf("====== VariableDec at line %d\n",yyextra->yyLineNr);
yyextra->start_init = TRUE;
- yyextra->current->initializer = yytext;
- yyextra->current->initializer += " ";
+ yyextra->current->initializer.str(yytext);
+ yyextra->current->initializer << " ";
}
{B} { // spaces
- yyextra->current->initializer += yytext;
+ yyextra->current->initializer << yytext;
}
{INTNUMBER} { // integer value
if (yyextra->current-> type.isEmpty()) yyextra->current->type = "int";
- yyextra->current->initializer += yytext;
+ yyextra->current->initializer << yytext;
}
{FLOATNUMBER} { // floating point value
if (yyextra->current->type.isEmpty()) yyextra->current->type = "float";
- yyextra->current->initializer += yytext;
+ yyextra->current->initializer << yytext;
}
{BOOL} { // boolean value
if (yyextra->current->type.isEmpty()) yyextra->current->type = "bool";
- yyextra->current->initializer += yytext;
+ yyextra->current->initializer << yytext;
}
{STRINGPREFIX}?"'" { // string
if (yyextra->current->type.isEmpty()) yyextra->current->type = "string";
- yyextra->current->initializer += yytext;
+ yyextra->current->initializer << yytext;
yyextra->copyString=&yyextra->current->initializer;
yyextra->stringContext=VariableDec;
BEGIN( SingleQuoteString );
}
{STRINGPREFIX}?"\"" { // string
if (yyextra->current->type.isEmpty()) yyextra->current->type = "string";
- yyextra->current->initializer += yytext;
+ yyextra->current->initializer << yytext;
yyextra->copyString=&yyextra->current->initializer;
yyextra->stringContext=VariableDec;
BEGIN( DoubleQuoteString );
}
{TRIDOUBLEQUOTE} { // start of a comment block
if (yyextra->current->type.isEmpty()) yyextra->current->type = "string";
- yyextra->current->initializer += yytext;
+ yyextra->current->initializer << yytext;
yyextra->doubleQuote=TRUE;
yyextra->copyString=&yyextra->current->initializer;
yyextra->stringContext=VariableDec;
@@ -1101,7 +1101,7 @@ STARTDOCSYMS "##"
{TRISINGLEQUOTE} { // start of a comment block
if (yyextra->current->type.isEmpty()) yyextra->current->type = "string";
- yyextra->current->initializer += yytext;
+ yyextra->current->initializer << yytext;
yyextra->doubleQuote=FALSE;
yyextra->copyString=&yyextra->current->initializer;
yyextra->stringContext=VariableDec;
@@ -1112,7 +1112,7 @@ STARTDOCSYMS "##"
{
yyextra->current->type = "tuple";
}
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
yyextra->atomStart='(';
yyextra->atomEnd=')';
yyextra->atomCount=1;
@@ -1120,7 +1120,7 @@ STARTDOCSYMS "##"
}
"[" { // list
if (yyextra->start_init) yyextra->current->type = "list";
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
yyextra->atomStart='[';
yyextra->atomEnd=']';
yyextra->atomCount=1;
@@ -1128,7 +1128,7 @@ STARTDOCSYMS "##"
}
"{" { // dictionary
if (yyextra->start_init) yyextra->current->type = "dictionary";
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
yyextra->atomStart='{';
yyextra->atomEnd='}';
yyextra->atomCount=1;
@@ -1151,11 +1151,11 @@ STARTDOCSYMS "##"
}
}
yyextra->start_init = FALSE;
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
}
. {
yyextra->start_init = FALSE;
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
}
\n {
unput('\n');
@@ -1165,14 +1165,14 @@ STARTDOCSYMS "##"
<VariableAtom>{
[\(\[\{] {
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
if (yyextra->atomStart==*yytext)
{
yyextra->atomCount++;
}
}
[\)\]\}] {
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
if (yyextra->atomEnd==*yytext)
{
yyextra->atomCount--;
@@ -1185,37 +1185,37 @@ STARTDOCSYMS "##"
}
{TRIDOUBLEQUOTE} { // start of a comment block
yyextra->specialBlock = FALSE;
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
initTriDoubleQuoteBlock(yyscanner);
BEGIN(TripleComment);
}
{TRISINGLEQUOTE} { // start of a comment block
yyextra->specialBlock = FALSE;
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
initTriSingleQuoteBlock(yyscanner);
BEGIN(TripleComment);
}
"'" {
yyextra->stringContext=YY_START;
- yyextra->current->initializer+="'";
+ yyextra->current->initializer << "'";
yyextra->copyString=&yyextra->current->initializer;
BEGIN( SingleQuoteString );
}
"\"" {
yyextra->stringContext=YY_START;
- yyextra->current->initializer+="\"";
+ yyextra->current->initializer << "\"";
yyextra->copyString=&yyextra->current->initializer;
BEGIN( DoubleQuoteString );
}
{IDENTIFIER} {
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
}
. {
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
}
\n {
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
incLineNr(yyscanner);
}
@@ -1275,8 +1275,8 @@ STARTDOCSYMS "##"
if ((yyextra->docBlockContext==ClassBody /*&& !yyextra->hideClassDocs*/) ||
yyextra->docBlockContext==FunctionBody)
{
- yyextra->current->program+=yyextra->docBlock;
- yyextra->current->program+=yytext;
+ yyextra->current->program << yyextra->docBlock;
+ yyextra->current->program << yytext;
}
//if (yyextra->hideClassDocs)
//{
@@ -1381,7 +1381,7 @@ STARTDOCSYMS "##"
<TripleString>{
{ENDTRIDOUBLEQUOTE} |
{ENDTRISINGLEQUOTE} {
- *yyextra->copyString += yytext;
+ *yyextra->copyString << yytext;
if (yyextra->doubleQuote==(yytext[0]=='"'))
{
BEGIN(yyextra->stringContext);
@@ -1391,14 +1391,14 @@ STARTDOCSYMS "##"
({LONGSTRINGBLOCK}) {
lineCount(yyscanner);
- *yyextra->copyString += yytext;
+ *yyextra->copyString << yytext;
}
\n {
incLineNr(yyscanner);
- *yyextra->copyString += yytext;
+ *yyextra->copyString << yytext;
}
. {
- *yyextra->copyString += *yytext;
+ *yyextra->copyString << *yytext;
}
}
@@ -1526,9 +1526,9 @@ static QCString findPackageScopeFromPath(yyscan_t yyscanner,const QCString &path
auto it = yyextra->packageNameCache.find(path.str());
if (it!=yyextra->packageNameCache.end())
{
- return it->second;
+ return QCString(it->second);
}
- QFileInfo pf(path+"/__init__.py"); // found package initialization file
+ FileInfo pf(path.str()+"/__init__.py"); // found package initialization file
if (pf.exists())
{
int i=path.findRev('/');
@@ -1546,12 +1546,12 @@ static QCString findPackageScopeFromPath(yyscan_t yyscanner,const QCString &path
}
return "";
}
-
-static QCString findPackageScope(yyscan_t yyscanner,const char *fileName)
+
+static QCString findPackageScope(yyscan_t yyscanner,const QCString &fileName)
{
- if (fileName==0) return "";
- QFileInfo fi(fileName);
- return findPackageScopeFromPath(yyscanner,fi.dirPath(TRUE).data());
+ if (fileName.isEmpty()) return fileName;
+ FileInfo fi(fileName.str());
+ return findPackageScopeFromPath(yyscanner,fi.dirPath(true).c_str());
}
static void addFrom(yyscan_t yyscanner,bool all)
@@ -1560,7 +1560,7 @@ static void addFrom(yyscan_t yyscanner,bool all)
QCString item=all ? yyextra->packageName : yyextra->packageName+"."+yytext;
yyextra->current->name=removeRedundantWhiteSpace(substitute(item,".","::"));
yyextra->current->fileName = yyextra->yyFileName;
- //printf("Adding using declaration: found:%s:%d name=%s\n",yyextra->yyFileName.data(),yyextra->yyLineNr,yyextra->current->name.data());
+ //printf("Adding using declaration: found:%s:%d name=%s\n",qPrint(yyextra->yyFileName),yyextra->yyLineNr,qPrint(yyextra->current->name));
yyextra->current->section=all ? Entry::USINGDIR_SEC : Entry::USINGDECL_SEC;
yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
initEntry(yyscanner);
@@ -1604,7 +1604,7 @@ static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
//printf("handleCommentBlock(doc=[%s] brief=%d yyextra->docBlockInBody=%d yyextra->docBlockJavaStyle=%d\n",
- // doc.data(),brief,yyextra->docBlockInBody,yyextra->docBlockJavaStyle);
+ // qPrint(doc),brief,yyextra->docBlockInBody,yyextra->docBlockJavaStyle);
// TODO: Fix me
yyextra->docBlockInBody=FALSE;
@@ -1666,7 +1666,7 @@ static void endOfDef(yyscan_t yyscanner,int correction)
static inline void addToString(yyscan_t yyscanner,const char *s)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- if (yyextra->copyString) (*yyextra->copyString)+=s;
+ if (yyextra->copyString) (*yyextra->copyString) << s;
}
static void initTriDoubleQuoteBlock(yyscan_t yyscanner)
@@ -1744,16 +1744,17 @@ static void searchFoundClass(yyscan_t yyscanner)
static void parseCompounds(yyscan_t yyscanner,std::shared_ptr<Entry> rt)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- //printf("parseCompounds(%s)\n",rt->name.data());
+ //printf("parseCompounds(%s)\n",qPrint(rt->name));
for (size_t i=0; i<rt->children().size(); ++i)
{
std::shared_ptr<Entry> ce = rt->children()[i];
- if (!ce->program.isEmpty())
+ if (!ce->program.empty())
{
//fprintf(stderr,"parseCompounds: -- %s (line %d) ---------\n%s\n---------------\n",
- // ce->name.data(), ce->bodyLine, ce->program.data());
+ // qPrint(ce->name), ce->bodyLine, qPrint(ce->program));
// init scanner state
- yyextra->inputString = ce->program;
+ yyextra->programStr = ce->program.str();
+ yyextra->inputString = yyextra->programStr.data();
yyextra->inputPosition = 0;
pyscannerYYrestart( 0, yyscanner );
if (ce->section&Entry::COMPOUND_MASK)
@@ -1765,7 +1766,7 @@ static void parseCompounds(yyscan_t yyscanner,std::shared_ptr<Entry> rt)
{
yyextra->current_root = rt;
//printf("Searching for member variables in %s parent=%s\n",
- // ce->name.data(),ce->parent->name.data());
+ // qPrint(ce->name),qPrint(ce->parent->name));
BEGIN( SearchMemVars );
}
yyextra->yyFileName = ce->fileName;
@@ -1778,7 +1779,9 @@ static void parseCompounds(yyscan_t yyscanner,std::shared_ptr<Entry> rt)
pyscannerYYlex(yyscanner) ;
yyextra->lexInit=TRUE;
- ce->program.resize(0);
+
+ yyextra->programStr.resize(0);
+ ce->program.str(std::string());
yyextra->commentScanner.leaveCompound(yyextra->yyFileName,yyextra->yyLineNr,name);
@@ -1790,11 +1793,13 @@ static void parseCompounds(yyscan_t yyscanner,std::shared_ptr<Entry> rt)
//----------------------------------------------------------------------------
-static void parseMain(yyscan_t yyscanner, const char *fileName,const char *fileBuf,const std::shared_ptr<Entry> &rt)
+static void parseMain(yyscan_t yyscanner, const QCString &fileName,const char *fileBuf,const std::shared_ptr<Entry> &rt)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
initParser(yyscanner);
+ if (fileBuf==0 || fileBuf[0]=='\0') return;
+
yyextra->inputString = fileBuf;
yyextra->inputPosition = 0;
@@ -1805,15 +1810,14 @@ static void parseMain(yyscan_t yyscanner, const char *fileName,const char *fileB
yyextra->current_root = rt;
yyextra->specialBlock = FALSE;
-
yyextra->yyLineNr= 1 ;
yyextra->yyFileName = fileName;
//setContext();
- msg("Parsing file %s...\n",yyextra->yyFileName.data());
+ msg("Parsing file %s...\n",qPrint(yyextra->yyFileName));
- QFileInfo fi(fileName);
+ FileInfo fi(fileName.str());
yyextra->moduleScope = findPackageScope(yyscanner,fileName);
- QCString baseName=fi.baseName().utf8();
+ QCString baseName=fi.baseName();
if (baseName!="__init__") // package initializer file is not a package itself
{
if (!yyextra->moduleScope.isEmpty())
@@ -1849,7 +1853,8 @@ static void parseMain(yyscan_t yyscanner, const char *fileName,const char *fileB
yyextra->commentScanner.leaveFile(yyextra->yyFileName,yyextra->yyLineNr);
- yyextra->current_root->program.resize(0);
+ yyextra->programStr.resize(0);
+ yyextra->current_root->program.str(std::string());
parseCompounds(yyscanner, yyextra->current_root);
}
@@ -1859,7 +1864,7 @@ static void parseMain(yyscan_t yyscanner, const char *fileName,const char *fileB
static void parsePrototype(yyscan_t yyscanner,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- //printf("**** parsePrototype(%s) begin\n",text.data());
+ //printf("**** parsePrototype(%s) begin\n",qPrint(text));
if (text.isEmpty())
{
warn(yyextra->yyFileName,yyextra->yyLineNr,"Empty prototype found!");
@@ -1880,7 +1885,7 @@ static void parsePrototype(yyscan_t yyscanner,const QCString &text)
orgInputPosition = yyextra->inputPosition;
// set new string
- yyextra->inputString = text;
+ yyextra->inputString = text.data();
yyextra->inputPosition = 0;
pyscannerYYrestart( 0, yyscanner );
@@ -1927,16 +1932,16 @@ PythonOutlineParser::~PythonOutlineParser()
}
-void PythonOutlineParser::parseInput(const char *fileName,
- const char *fileBuf,
- const std::shared_ptr<Entry> &root,
- ClangTUParser * /*clangParser*/)
+void PythonOutlineParser::parseInput(const QCString &fileName,
+ const char *fileBuf,
+ const std::shared_ptr<Entry> &root,
+ ClangTUParser * /*clangParser*/)
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
yyextra->thisParser = this;
- printlex(yy_flex_debug, TRUE, __FILE__, fileName);
+ printlex(yy_flex_debug, TRUE, __FILE__, qPrint(fileName));
::parseMain(p->yyscanner, fileName,fileBuf,root);
- printlex(yy_flex_debug, FALSE, __FILE__, fileName);
+ printlex(yy_flex_debug, FALSE, __FILE__, qPrint(fileName));
// May print the AST for debugging purposes
// printAST(global_root);
@@ -1947,10 +1952,9 @@ bool PythonOutlineParser::needsPreprocessing(const QCString &) const
return FALSE;
}
-void PythonOutlineParser::parsePrototype(const char *text)
+void PythonOutlineParser::parsePrototype(const QCString &text)
{
::parsePrototype(p->yyscanner,text);
-
}
//----------------------------------------------------------------------------
diff --git a/src/qcstring.cpp b/src/qcstring.cpp
new file mode 100644
index 0000000..d95687d
--- /dev/null
+++ b/src/qcstring.cpp
@@ -0,0 +1,560 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2015 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.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#include "qcstring.h"
+
+#include <limits.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <ctype.h>
+
+QCString &QCString::sprintf( const char *format, ... )
+{
+ va_list ap;
+ va_start( ap, format );
+ const int minlen=256;
+ int l = length();
+ if (l<minlen) { resize(minlen); l=minlen; }
+ int n=vsnprintf( rawData(), l, format, ap);
+ if (n<0) n=l;
+ resize(n+1);
+ va_end( ap );
+ return *this;
+}
+
+int QCString::find( char c, int index, bool cs ) const
+{
+ if (index<0 || index>=(int)length()) return -1; // index outside string
+ const char *pos;
+ if (cs)
+ {
+ pos = strchr(data()+index,c);
+ }
+ else
+ {
+ pos = data()+index;
+ c = (char)tolower((unsigned char)c);
+ while (*pos && tolower((unsigned char)*pos)!=c) pos++;
+ if (!*pos && c) pos=0; // not found
+ }
+ return pos ? (int)(pos - data()) : -1;
+}
+
+int QCString::find( const char *str, int index, bool cs ) const
+{
+ int l = length();
+ if (index<0 || index>=l) return -1; // index outside string
+ if (!str) return -1; // no string to search for
+ if (!*str) return index; // empty string matching at index
+ const char *pos;
+ if (cs) // case sensitive
+ {
+ pos = strstr(data()+index,str);
+ }
+ else // case insensitive
+ {
+ pos = data();
+ int len = qstrlen(str);
+ while (*pos)
+ {
+ if (qstrnicmp(pos,str,len)==0) break;
+ pos++;
+ }
+ if (!*pos) pos = 0; // not found
+ }
+ return pos ? (int)(pos - data()) : -1;
+}
+
+int QCString::find( const QCString &str, int index, bool cs ) const
+{
+ return find(str.data(),index,cs);
+}
+
+int QCString::findRev( char c, int index, bool cs) const
+{
+ const char *b = data();
+ const char *pos;
+ int len = length();
+ if (len==0) return -1; // empty string
+ if (index<0) // start from end
+ {
+ if (cs)
+ {
+ pos = strrchr(b,c);
+ return pos ? (int)(pos - b) : -1;
+ }
+ index=len;
+ }
+ else if (index>len) // bad index
+ {
+ return -1;
+ }
+ pos = b+index;
+ if (cs)
+ {
+ while ( pos>=b && *pos!=c) pos--;
+ }
+ else
+ {
+ c = (char)tolower((unsigned char)c);
+ while ( pos>=b && tolower((unsigned char)*pos)!=c) pos--;
+ }
+ return pos>=b ? (int)(pos - b) : -1;
+}
+
+int QCString::findRev( const char *str, int index, bool cs) const
+{
+ int slen = qstrlen(str);
+ int len = length();
+ if (index<0) index = len-slen; // start from end
+ else if (index>len) return -1; // bad index
+ else if (index+slen>len) index=len-slen; // str would be too long
+ if (index<0) return -1; // no match possible
+ const char *pos = data()+index;
+ if (cs) // case sensitive
+ {
+ for (int i=index; i>=0; i--) if (qstrncmp(pos--,str,slen)==0) return i;
+ }
+ else // case insensitive
+ {
+ for (int i=index; i>=0; i--) if (qstrnicmp(pos,str,slen)==0) return i;
+ }
+ return -1;
+}
+
+int QCString::contains( char c, bool cs ) const
+{
+ if (length()==0) return 0;
+ int count=0;
+ const char *pos = data();
+ if (cs)
+ {
+ while (*pos) if (*pos++ == c) count++;
+ }
+ else
+ {
+ c = (char)tolower((unsigned char)c);
+ while (*pos)
+ {
+ if (tolower((unsigned char)*pos)==c) count++;
+ pos++;
+ }
+ }
+ return count;
+}
+
+int QCString::contains( const char *str, bool cs ) const
+{
+ if (str==0 || length()==0) return 0;
+ int count=0;
+ const char *pos = data();
+ int len = qstrlen(str);
+ while (*pos)
+ {
+ if (cs)
+ {
+ if (qstrncmp(pos,str,len)==0) count++;
+ }
+ else
+ {
+ if (qstrnicmp(pos,str,len)==0) count++;
+ }
+ pos++;
+ }
+ return count;
+}
+
+QCString QCString::simplifyWhiteSpace() const
+{
+ if ( isEmpty() ) // nothing to do
+ return *this;
+
+ QCString result( length()+1 );
+ const char *from = data();
+ char *to = result.rawData();
+ char *first = to;
+ while ( TRUE )
+ {
+ while ( *from && qisspace(*from) )
+ from++;
+ while ( *from && !qisspace(*from) )
+ *to++ = *from++;
+ if ( *from )
+ *to++ = 0x20; // ' '
+ else
+ break;
+ }
+ if ( to > first && *(to-1) == 0x20 )
+ to--;
+ *to = '\0';
+ result.resize( (int)(to - result.data()) + 1 );
+ return result;
+}
+
+QCString &QCString::replace( uint index, uint len, const char *s)
+{
+ remove( index, len );
+ insert( index, s );
+ return *this;
+}
+
+static bool ok_in_base( char c, int base )
+{
+ if ( base <= 10 )
+ return c>='0' && c<='9' && (c-'0') < base;
+ else
+ return (c>='0' && c<='9') ||
+ (c >= 'a' && c < char('a'+base-10)) ||
+ (c >= 'A' && c < char('A'+base-10));
+}
+
+short QCString::toShort(bool *ok, int base) const
+{
+ long v = toLong( ok, base );
+ if ( ok && *ok && (v < -32768 || v > 32767) ) {
+ *ok = FALSE;
+ v = 0;
+ }
+ return (short)v;
+}
+
+ushort QCString::toUShort(bool *ok,int base) const
+{
+ ulong v = toULong( ok, base );
+ if ( ok && *ok && (v > 65535) ) {
+ *ok = FALSE;
+ v = 0;
+ }
+ return (ushort)v;
+}
+
+int QCString::toInt(bool *ok, int base) const
+{
+ return (int)toLong( ok, base );
+}
+
+uint QCString::toUInt(bool *ok,int base) const
+{
+ return (uint)toULong( ok, base );
+}
+
+
+long QCString::toLong(bool *ok,int base) const
+{
+ const char *p = data();
+ long val=0;
+ int l = length();
+ const long max_mult = INT_MAX / base;
+ bool is_ok = FALSE;
+ int neg = 0;
+ if ( !p )
+ goto bye;
+ while ( l && qisspace(*p) ) // skip leading space
+ l--,p++;
+ if ( l && *p == '-' ) {
+ l--;
+ p++;
+ neg = 1;
+ } else if ( *p == '+' ) {
+ l--;
+ p++;
+ }
+
+ // NOTE: toULong() code is similar
+ if ( !l || !ok_in_base(*p,base) )
+ goto bye;
+ while ( l && ok_in_base(*p,base) ) {
+ l--;
+ int dv;
+ if ( *p>='0' && *p<='9' ) {
+ dv = *p-'0';
+ } else {
+ if ( *p >= 'a' && *p <= 'z' )
+ dv = *p - 'a' + 10;
+ else
+ dv = *p - 'A' + 10;
+ }
+ if ( val > max_mult || (val == max_mult && dv > (INT_MAX%base)+neg) )
+ goto bye;
+ val = base*val + dv;
+ p++;
+ }
+ if ( neg )
+ val = -val;
+ while ( l && qisspace(*p) ) // skip trailing space
+ l--,p++;
+ if ( !l )
+ is_ok = TRUE;
+bye:
+ if ( ok )
+ *ok = is_ok;
+ return is_ok ? val : 0;
+}
+
+ulong QCString::toULong(bool *ok,int base) const
+{
+ const char *p = data();
+ ulong val=0;
+ int l = length();
+ const ulong max_mult = 429496729; // UINT_MAX/10, rounded down
+ bool is_ok = FALSE;
+ if ( !p )
+ goto bye;
+ while ( l && qisspace(*p) ) // skip leading space
+ l--,p++;
+ if ( *p == '+' )
+ l--,p++;
+
+ // NOTE: toLong() code is similar
+ if ( !l || !ok_in_base(*p,base) )
+ goto bye;
+ while ( l && ok_in_base(*p,base) ) {
+ l--;
+ uint dv;
+ if ( *p>='0' && *p<='9' ) {
+ dv = *p-'0';
+ } else {
+ if ( *p >= 'a' && *p <= 'z' )
+ dv = *p - 'a' + 10;
+ else
+ dv = *p - 'A' + 10;
+ }
+ if ( val > max_mult || (val == max_mult && dv > (UINT_MAX%base)) )
+ goto bye;
+ val = base*val + dv;
+ p++;
+ }
+
+ while ( l && qisspace(*p) ) // skip trailing space
+ l--,p++;
+ if ( !l )
+ is_ok = TRUE;
+bye:
+ if ( ok )
+ *ok = is_ok;
+ return is_ok ? val : 0;
+}
+
+uint64 QCString::toUInt64(bool *ok,int base) const
+{
+ const char *p = data();
+ uint64 val=0;
+ int l = length();
+ const uint64 max_mult = 1844674407370955161ULL; // ULLONG_MAX/10, rounded down
+ bool is_ok = FALSE;
+ if ( !p )
+ goto bye;
+ while ( l && qisspace(*p) ) // skip leading space
+ l--,p++;
+ if ( *p == '+' )
+ l--,p++;
+
+ // NOTE: toULong() code is similar
+ if ( !l || !ok_in_base(*p,base) )
+ goto bye;
+ while ( l && ok_in_base(*p,base) ) {
+ l--;
+ uint dv;
+ if ( *p>='0' && *p<='9' ) {
+ dv = *p-'0';
+ } else {
+ if ( *p >= 'a' && *p <= 'z' )
+ dv = *p - 'a' + 10;
+ else
+ dv = *p - 'A' + 10;
+ }
+ if ( val > max_mult || (val == max_mult && dv > (ULLONG_MAX%base)) )
+ goto bye;
+ val = base*val + dv;
+ p++;
+ }
+
+ while ( l && qisspace(*p) ) // skip trailing space
+ l--,p++;
+ if ( !l )
+ is_ok = TRUE;
+bye:
+ if ( ok )
+ *ok = is_ok;
+ return is_ok ? val : 0;
+}
+
+//-------------------------------------------------
+
+void *qmemmove( void *dst, const void *src, uint len )
+{
+ char *d;
+ char *s;
+ if ( dst > src ) {
+ d = (char *)dst + len - 1;
+ s = (char *)src + len - 1;
+ while ( len-- )
+ *d-- = *s--;
+ } else if ( dst < src ) {
+ d = (char *)dst;
+ s = (char *)src;
+ while ( len-- )
+ *d++ = *s++;
+ }
+ return dst;
+}
+
+char *qstrdup( const char *str )
+{
+ if ( !str )
+ return 0;
+ char *dst = new char[qstrlen(str)+1];
+ return strcpy( dst, str );
+}
+
+char *qstrncpy( char *dst, const char *src, uint len )
+{
+ if ( !src )
+ return 0;
+ strncpy( dst, src, len );
+ if ( len > 0 )
+ dst[len-1] = '\0';
+ return dst;
+}
+
+int qstricmp( const char *str1, const char *str2 )
+{
+ const uchar *s1 = (const uchar *)str1;
+ const uchar *s2 = (const uchar *)str2;
+ int res;
+ uchar c;
+ if ( !s1 || !s2 )
+ return s1 == s2 ? 0 : (int)(s2 - s1);
+ for ( ; !(res = (c=(char)tolower(*s1)) - tolower(*s2)); s1++, s2++ )
+ if ( !c ) // strings are equal
+ break;
+ return res;
+}
+
+int qstrnicmp( const char *str1, const char *str2, uint len )
+{
+ const uchar *s1 = (const uchar *)str1;
+ const uchar *s2 = (const uchar *)str2;
+ int res;
+ uchar c;
+ if ( !s1 || !s2 )
+ return (int)(s2 - s1);
+ for ( ; len--; s1++, s2++ ) {
+ if ( (res = (c=(char)tolower(*s1)) - tolower(*s2)) )
+ return res;
+ if ( !c ) // strings are equal
+ break;
+ }
+ return 0;
+}
+
+/// substitute all occurrences of \a src in \a s by \a dst
+QCString substitute(const QCString &s,const QCString &src,const QCString &dst)
+{
+ if (s.isEmpty() || src.isEmpty()) return s;
+ const char *p, *q;
+ int srcLen = src.length();
+ int dstLen = dst.length();
+ int resLen;
+ if (srcLen!=dstLen)
+ {
+ int count;
+ for (count=0, p=s.data(); (q=strstr(p,src.data()))!=0; p=q+srcLen) count++;
+ resLen = s.length()+count*(dstLen-srcLen);
+ }
+ else // result has same size as s
+ {
+ resLen = s.length();
+ }
+ QCString result(resLen+1);
+ char *r;
+ for (r=result.rawData(), p=s.data(); (q=strstr(p,src.data()))!=0; p=q+srcLen)
+ {
+ int l = (int)(q-p);
+ memcpy(r,p,l);
+ r+=l;
+
+ if (dstLen>0) memcpy(r,dst.data(),dstLen);
+ r+=dstLen;
+ }
+ if (r)
+ {
+ qstrcpy(r,p);
+ }
+ //printf("substitute(%s,%s,%s)->%s\n",s,src,dst,result.data());
+ return result;
+}
+
+
+/// substitute all occurrences of \a src in \a s by \a dst, but skip
+/// each consecutive sequence of \a src where the number consecutive
+/// \a src matches \a skip_seq; if \a skip_seq is negative, skip any
+/// number of consecutive \a src
+QCString substitute(const QCString &s,const QCString &src,const QCString &dst,int skip_seq)
+{
+ if (s.isEmpty() || src.isEmpty()) return s;
+ const char *p, *q;
+ int srcLen = src.length();
+ int dstLen = dst.length();
+ int resLen;
+ if (srcLen!=dstLen)
+ {
+ int count;
+ for (count=0, p=s.data(); (q=strstr(p,src.data()))!=0; p=q+srcLen) count++;
+ resLen = s.length()+count*(dstLen-srcLen);
+ }
+ else // result has same size as s
+ {
+ resLen = s.length();
+ }
+ QCString result(resLen+1);
+ char *r;
+ for (r=result.rawData(), p=s.data(); (q=strstr(p,src.data()))!=0; p=q+srcLen)
+ {
+ // search a consecutive sequence of src
+ int seq = 0, skip = 0;
+ if (skip_seq)
+ {
+ for (const char *n=q+srcLen; qstrncmp(n,src.data(),srcLen)==0; seq=1+skip, n+=srcLen)
+ ++skip; // number of consecutive src after the current one
+
+ // verify the allowed number of consecutive src to skip
+ if (skip_seq > 0 && skip_seq != seq)
+ seq = skip = 0;
+ }
+
+ // skip a consecutive sequence of src when necessary
+ int l = (int)((q + seq * srcLen)-p);
+ memcpy(r,p,l);
+ r+=l;
+
+ if (skip)
+ {
+ // skip only the consecutive src found after the current one
+ q += skip * srcLen;
+ // the next loop will skip the current src, aka (p=q+srcLen)
+ continue;
+ }
+
+ if (dstLen>0) memcpy(r,dst.data(),dstLen);
+ r+=dstLen;
+ }
+ qstrcpy(r,p);
+ result.resize((int)strlen(result.data())+1);
+ //printf("substitute(%s,%s,%s)->%s\n",s,src,dst,result.data());
+ return result;
+}
+
diff --git a/src/qcstring.h b/src/qcstring.h
new file mode 100644
index 0000000..1588d5c
--- /dev/null
+++ b/src/qcstring.h
@@ -0,0 +1,613 @@
+/****************************************************************************
+**
+** Copyright (C) 1997-2015 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 reimplementation of the qcstring.h that came with
+** an Qt version 2.2.3. For short strings it stores the string data inside
+** the object. For long strings it uses a separate array with reference counting.
+**
+**********************************************************************/
+
+#ifndef QCSTRING_H
+#define QCSTRING_H
+
+#include <string>
+#include <algorithm>
+
+#include <cctype>
+#include <cstring>
+#include <cstdio>
+#include <cstdlib>
+#include <cstdint>
+#include <ostream>
+
+#include "utf8.h"
+
+#ifndef FALSE
+#define FALSE false
+#endif
+#ifndef TRUE
+#define TRUE true
+#endif
+typedef unsigned char uchar;
+typedef unsigned short ushort;
+typedef unsigned uint;
+typedef unsigned long ulong;
+typedef int64_t int64;
+typedef uint64_t uint64;
+#define ASSERT(x) if ( !(x) )\
+ fprintf(stderr,"ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__)
+
+
+/*****************************************************************************
+ Safe and portable C string functions; extensions to standard string.h
+ *****************************************************************************/
+
+void *qmemmove( void *dst, const void *src, uint len );
+
+#if defined(_OS_WIN32_)
+#define qsnprintf _snprintf
+#else
+#define qsnprintf snprintf
+#endif
+
+char *qstrdup( const char * );
+
+inline uint cstrlen( const char *str )
+{ return (uint)strlen(str); }
+
+inline uint qstrlen( const char *str )
+{ return str ? (uint)strlen(str) : 0; }
+
+inline char *cstrcpy( char *dst, const char *src )
+{ return strcpy(dst,src); }
+
+inline char *qstrcpy( char *dst, const char *src )
+{ return src ? strcpy(dst, src) : 0; }
+
+char * qstrncpy(char *dst,const char *src, uint len);
+
+inline int cstrcmp( const char *str1, const char *str2 )
+{ return strcmp(str1,str2); }
+
+inline int qstrcmp( const char *str1, const char *str2 )
+{ return (str1 && str2) ? strcmp(str1,str2) :
+ (!str1 && !str2) ? 0 : // both empty
+ str1 ? -1 : 1;
+}
+
+inline int cstrncmp( const char *str1, const char *str2, uint len )
+{ return strncmp(str1,str2,len); }
+
+inline int qstrncmp( const char *str1, const char *str2, uint len )
+{ return (str1 && str2) ? strncmp(str1,str2,len) :
+ (!str1 && !str2) ? 0 : // both empty
+ str1 ? -1 : 1;
+}
+
+inline bool qisspace(char c)
+{ return c==' ' || c=='\t' || c=='\n' || c=='\r'; }
+
+int qstricmp( const char *str1, const char *str2 );
+
+int qstrnicmp( const char *str1, const char *str2, uint len );
+
+
+/** This is an alternative implementation of QCString. It provides basically
+ * the same functions but uses std::string as the underlying string type
+ */
+class QCString
+{
+ public:
+ QCString() = default;
+ ~QCString() = default;
+ QCString( const QCString &s ) = default;
+ QCString &operator=( const QCString &s ) = default;
+ QCString( QCString &&s ) = default;
+ QCString &operator=( QCString &&s ) = default;
+
+ explicit QCString( const std::string &s ) : m_rep(s) {}
+
+ QCString( std::string &&s) { m_rep = std::move(s); }
+
+ /** creates a string with room for size characters
+ * @param[in] size the number of character to allocate (also counting the 0-terminator!)
+ */
+ explicit QCString( uint size ) { m_rep.resize(size>0 ? size-1 : 0); }
+
+ /** creates a string from a plain C string.
+ * @param[in] str A zero terminated C string. When 0 an empty string is created.
+ */
+ QCString( const char *str ) : m_rep(str?str:"") {}
+
+ /** creates a string from \a str and copies over the first \a maxlen characters. */
+ QCString( const char *str, uint maxlen ) : m_rep(str?str:"") { m_rep.resize(maxlen); }
+
+ /** replaces the contents by that of string \a s. */
+
+ /** replaces the contents by that of C string \a str. */
+ QCString &operator=( const char *str) { m_rep = str?str:""; return *this; }
+
+ QCString &operator=( const std::string &s) { m_rep = s; return *this; }
+
+ /** Returns TRUE iff the string is empty. Equivalent to isEmpty(). */
+ bool isNull() const { return m_rep.empty(); }
+
+ /** Returns TRUE iff the string is empty */
+ bool isEmpty() const { return m_rep.empty(); }
+
+ /** Returns the length of the string, not counting the 0-terminator. Equivalent to size(). */
+ uint length() const { return (uint)m_rep.size(); }
+
+ /** Returns the length of the string, not counting the 0-terminator. */
+ uint size() const { return (uint)m_rep.size(); }
+
+ /** Returns a pointer to the contents of the string in the form of a 0-terminated C string */
+ const char *data() const { return m_rep.c_str(); }
+
+ /** Returns a writable pointer to the data.
+ */
+ char *rawData() const { return m_rep.empty() ? 0 : const_cast<char*>(&m_rep[0]); }
+
+ /** Resizes the string to hold \a newlen characters
+ * (this value should also count the 0-terminator).
+ * If the string is enlarged the contents will
+ * be left unmodified.
+ */
+ bool resize( uint newlen ) { m_rep.resize( newlen>0 ? newlen-1 : 0 ); return TRUE; }
+
+ /** Truncates the string at position \a pos. */
+ bool truncate( uint pos ) { return resize( pos + 1 ); }
+
+ /** Fills a string with a predefined character
+ * @param[in] c the character used to fill the string with.
+ * @param[in] len the number of character to fill. Use -1 to fill the whole string.
+ * @note the string will be resized to contain \a len characters. The contents of the
+ * string will be lost.
+ */
+ bool fill( char c, int len = -1 )
+ {
+ int l = len==-1 ? (int)m_rep.size() : len;
+ m_rep = std::string(l,c);
+ return TRUE;
+ }
+
+ QCString &sprintf( const char *format, ... );
+
+ int find( char c, int index=0, bool cs=TRUE ) const;
+ int find( const char *str, int index=0, bool cs=TRUE ) const;
+ int find( const QCString &str, int index=0, bool cs=TRUE ) const;
+ //int find( const QRegExp &rx, int index=0 ) const;
+
+ int findRev( char c, int index=-1, bool cs=TRUE) const;
+ int findRev( const char *str, int index=-1, bool cs=TRUE) const;
+ //int findRev( const QRegExp &rx, int index=-1 ) const;
+
+ int contains( char c, bool cs=TRUE ) const;
+ int contains( const char *str, bool cs=TRUE ) const;
+ //int contains( const QRegExp &rx ) const;
+
+ bool stripPrefix(const QCString &prefix)
+ {
+ if (prefix.isEmpty() || m_rep.empty()) return FALSE;
+ if (m_rep.rfind(prefix.data(),0)==0) // string starts with prefix
+ {
+ m_rep.erase(0,prefix.length());
+ return TRUE;
+ }
+ return FALSE;
+ }
+ bool stripPrefix(const char *prefix)
+ {
+ return stripPrefix(QCString(prefix));
+ }
+
+ QCString left( uint len ) const
+ {
+ return m_rep.empty() ? QCString() : QCString(m_rep.substr(0,len));
+ }
+
+ QCString right( uint len ) const
+ {
+ return m_rep.empty() ? QCString() :
+ len<m_rep.size() ? QCString(m_rep.substr(m_rep.size()-len,len)) :
+ *this;
+ }
+
+ QCString mid( uint index, uint len=(uint)-1) const
+ {
+ uint slen = (uint)m_rep.size();
+ if (len==(uint)-1) len = slen-index;
+ return m_rep.empty() || index>slen || len==0 ? QCString() :
+ QCString(m_rep.substr(index,len));
+ }
+
+ QCString lower() const
+ {
+ return QCString(convertUTF8ToLower(m_rep));
+ }
+
+ QCString upper() const
+ {
+ return QCString(convertUTF8ToUpper(m_rep));
+ }
+
+ QCString stripWhiteSpace() const
+ {
+ int sl = (uint)m_rep.size();
+ if (sl==0 || (!qisspace(m_rep[0]) && !qisspace(m_rep[sl-1]))) return *this;
+ int start=0,end=sl-1;
+ while (start<sl && qisspace(m_rep[start])) start++;
+ if (start==sl) return QCString(); // only whitespace
+ while (end>start && qisspace(m_rep[end])) end--;
+ return QCString(m_rep.substr(start,1+end-start));
+ }
+
+ QCString simplifyWhiteSpace() const;
+
+ QCString &insert( uint index, const QCString &s )
+ {
+ if (s.length()>0)
+ {
+ uint ol = (uint)m_rep.size();
+ if (index>ol) // insert beyond end of string and fill gap with spaces
+ {
+ m_rep.resize(index+s.length());
+ std::memset(&m_rep[ol],' ',index-ol);
+ std::memcpy(&m_rep[index],s.data(),s.length()+1);
+ }
+ else // insert inside the string
+ {
+ m_rep.insert(index,s.str());
+ }
+ }
+ return *this;
+ }
+ QCString &insert( uint index, const char *s )
+ {
+ uint len = s ? qstrlen(s) : 0;
+ if (len>0)
+ {
+ uint ol = (uint)m_rep.size();
+ if (index>ol) // insert beyond end of string and fill gap with spaces
+ {
+ m_rep.resize(index+len);
+ std::memset(&m_rep[ol],' ',index-ol);
+ std::memcpy(&m_rep[index],s,len+1);
+ }
+ else // insert inside the string
+ {
+ m_rep.insert(index,s);
+ }
+ }
+ return *this;
+ }
+
+ QCString &insert( uint index, char c)
+ {
+ char s[2] = { c, '\0' };
+ return insert(index,s);
+ }
+
+ QCString &append( char c)
+ {
+ m_rep+=c;
+ return *this;
+ }
+
+ QCString &append( const char *s )
+ {
+ return operator+=(s);
+ }
+
+ QCString &append( const QCString &s )
+ {
+ return operator+=(s);
+ }
+
+ QCString &append( const std::string &s )
+ {
+ return operator+=(s);
+ }
+
+ QCString &prepend( const char *s )
+ {
+ return insert(0,s);
+ }
+
+ QCString &prepend( const QCString &s )
+ {
+ return insert(0,s.data());
+ }
+
+ QCString &prepend( const std::string &s )
+ {
+ return insert(0,s.c_str());
+ }
+
+ QCString &remove( uint index, uint len )
+ {
+ uint ol = (uint)m_rep.size();
+ if (index<ol && len>0) m_rep.erase(index,index+len>=ol ? std::string::npos : len);
+ return *this;
+ }
+
+ QCString &replace( uint index, uint len, const char *s);
+ //QCString &replace( const QRegExp &rx, const char *str );
+
+ short toShort( bool *ok=0, int base=10 ) const;
+ ushort toUShort( bool *ok=0, int base=10 ) const;
+ int toInt( bool *ok=0, int base=10 ) const;
+ uint toUInt( bool *ok=0, int base=10 ) const;
+ long toLong( bool *ok=0, int base=10 ) const;
+ ulong toULong( bool *ok=0, int base=10 ) const;
+ uint64 toUInt64( bool *ok=0, int base=10 ) const;
+
+ QCString &setNum(short n)
+ {
+ m_rep = std::to_string(n);
+ return *this;
+ }
+
+ QCString &setNum(ushort n)
+ {
+ m_rep = std::to_string(n);
+ return *this;
+ }
+
+ QCString &setNum(int n)
+ {
+ m_rep = std::to_string(n);
+ return *this;
+ }
+
+ QCString &setNum(uint n)
+ {
+ m_rep = std::to_string(n);
+ return *this;
+ }
+
+ QCString &setNum(long n)
+ {
+ m_rep = std::to_string(n);
+ return *this;
+ }
+
+ QCString &setNum(ulong n)
+ {
+ m_rep = std::to_string(n);
+ return *this;
+ }
+
+ bool startsWith( const char *s ) const
+ {
+ if (m_rep.empty() || s==0) return s==0;
+ return m_rep.rfind(s,0)==0; // looking "backward" starting and ending at index 0
+ }
+
+#define HAS_IMPLICIT_CAST_TO_PLAIN_C_STRING 0
+#if HAS_IMPLICIT_CAST_TO_PLAIN_C_STRING
+ /** Converts the string to a plain C string */
+ operator const char *() const
+ {
+ return data();
+ }
+#endif
+
+ std::string str() const
+ {
+ return m_rep;
+ }
+
+ QCString &operator+=( const QCString &s)
+ {
+ m_rep+=s.str();
+ return *this;
+ }
+
+ QCString &operator+=( const std::string &s)
+ {
+ m_rep+=s;
+ return *this;
+ }
+
+ /** Appends string \a str to this string and returns a reference to the result. */
+ QCString &operator+=( const char *s )
+ {
+ if (s) m_rep+=s;
+ return *this;
+ }
+
+#define HAS_CHARACTER_APPEND_OPERATOR 1
+#if HAS_CHARACTER_APPEND_OPERATOR
+ /** Appends character \a c to this string and returns a reference to the result. */
+ QCString &operator+=( char c )
+ {
+ m_rep+=c;
+ return *this;
+ }
+#endif
+
+ /** Returns a reference to the character at index \a i. */
+ char &at( uint i) const
+ {
+ return const_cast<char&>(m_rep[i]);
+ }
+
+ /** Indexing operator. Equivalent to at(). */
+ char &operator[]( int i ) const
+ {
+ return const_cast<char&>(m_rep[i]);
+ }
+
+ private:
+ std::string m_rep;
+};
+
+/*****************************************************************************
+ QCString non-member operators
+ *****************************************************************************/
+
+inline bool operator==( const QCString &s1, const QCString &s2 )
+{ return qstrcmp(s1.data(),s2.data()) == 0; }
+
+inline bool operator==( const QCString &s1, const char *s2 )
+{ return qstrcmp(s1.data(),s2) == 0; }
+
+inline bool operator==( const char *s1, const QCString &s2 )
+{ return qstrcmp(s1,s2.data()) == 0; }
+
+inline bool operator!=( const QCString &s1, const QCString &s2 )
+{ return qstrcmp(s1.data(),s2.data()) != 0; }
+
+inline bool operator!=( const QCString &s1, const char *s2 )
+{ return qstrcmp(s1.data(),s2) != 0; }
+
+inline bool operator!=( const char *s1, const QCString &s2 )
+{ return qstrcmp(s1,s2.data()) != 0; }
+
+inline bool operator<( const QCString &s1, const QCString& s2 )
+{ return qstrcmp(s1.data(),s2.data()) < 0; }
+
+inline bool operator<( const QCString &s1, const char *s2 )
+{ return qstrcmp(s1.data(),s2) < 0; }
+
+inline bool operator<( const char *s1, const QCString &s2 )
+{ return qstrcmp(s1,s2.data()) < 0; }
+
+inline bool operator<=( const QCString &s1, const char *s2 )
+{ return qstrcmp(s1.data(),s2) <= 0; }
+
+inline bool operator<=( const char *s1, const QCString &s2 )
+{ return qstrcmp(s1,s2.data()) <= 0; }
+
+inline bool operator>( const QCString &s1, const char *s2 )
+{ return qstrcmp(s1.data(),s2) > 0; }
+
+inline bool operator>( const char *s1, const QCString &s2 )
+{ return qstrcmp(s1,s2.data()) > 0; }
+
+inline bool operator>=( const QCString &s1, const char *s2 )
+{ return qstrcmp(s1.data(),s2) >= 0; }
+
+inline bool operator>=( const char *s1, const QCString &s2 )
+{ return qstrcmp(s1,s2.data()) >= 0; }
+
+inline QCString operator+( const QCString &s1, const QCString &s2 )
+{
+ return QCString(s1.str()+s2.str());
+}
+
+
+inline QCString operator+( const QCString &s1, const char *s2 )
+{
+ QCString tmp(s1);
+ tmp.append(s2);
+ return tmp;
+}
+
+inline QCString operator+( const char *s1, const QCString &s2 )
+{
+ QCString tmp(s1);
+ tmp.append(s2);
+ return tmp;
+}
+
+#define HAD_PLUS_OPERATOR_FOR_CHAR 0
+#if HAS_PLUS_OPERATOR_FOR_CHAR
+inline QCString operator+( const QCString &s1, char c2 )
+{
+ QCString tmp( s1.data() );
+ tmp.append(c2);
+ return tmp;
+}
+
+inline QCString operator+( char c1, const QCString &s2 )
+{
+ QCString tmp;
+ tmp.append(c1);
+ tmp.append(s2);
+ return tmp;
+}
+#endif
+
+inline const char *qPrint(const char *s)
+{
+ if (s) return s; else return "";
+}
+
+inline const char *qPrint(const QCString &s)
+{
+ if (!s.isEmpty()) return s.data(); else return "";
+}
+
+inline const char *qPrint(const std::string &s)
+{
+ return s.c_str();
+}
+
+inline std::string toStdString(const QCString &s)
+{
+ return s.str();
+}
+
+//---- overloads
+
+inline int qstricmp( const QCString &str1, const char *str2 )
+{
+ return qstricmp(str1.data(),str2);
+}
+
+inline int qstricmp( const char *str1, const QCString &str2 )
+{
+ return qstricmp(str1,str2.data());
+}
+
+inline int qstricmp( const QCString &str1, const QCString &str2 )
+{
+ return qstricmp(str1.data(),str2.data());
+}
+
+inline int qstrnicmp( const QCString &str1, const char *str2, uint len )
+{
+ return qstrnicmp(str1.data(),str2,len);
+}
+
+inline int qstrnicmp( const char *str1, const QCString &str2, uint len )
+{
+ return qstrnicmp(str1,str2.data(),len);
+}
+
+inline int qstrnicmp( const QCString &str1, const QCString &str2, uint len )
+{
+ return qstrnicmp(str1.data(),str2.data(),len);
+}
+
+// helper functions
+QCString substitute(const QCString &str,const QCString &find,const QCString &replace);
+inline QCString substitute(const QCString &str,const char *find,const char *replace)
+{
+ return substitute(str,QCString(find),QCString(replace));
+}
+QCString substitute(const QCString &s,const QCString &src,const QCString &dst,int skip_seq);
+
+inline QCString substitute(const QCString &s,char srcChar,char dstChar)
+{
+ std::string ss = s.str();
+ std::replace(ss.begin(),ss.end(),srcChar,dstChar);
+ return QCString(ss);
+}
+
+inline std::ostream& operator<<(std::ostream& os, const QCString& s)
+{
+ os << s.str();
+ return os;
+}
+
+#endif // QCSTRING_H
diff --git a/src/qhp.cpp b/src/qhp.cpp
index 50f43ff..fc2f215 100644
--- a/src/qhp.cpp
+++ b/src/qhp.cpp
@@ -3,8 +3,8 @@
* Copyright (C) 2008 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
+ * 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.
*
@@ -22,12 +22,12 @@
#include "groupdef.h"
#include "doxygen.h"
#include "filedef.h"
+#include "util.h"
-#include <qcstringlist.h>
+#include <fstream>
#include <string.h>
-#include <qfile.h>
-static QCString makeFileName(const char * withoutExtension)
+static QCString makeFileName(const QCString & withoutExtension)
{
QCString result=withoutExtension;
if (!result.isEmpty())
@@ -44,12 +44,12 @@ static QCString makeFileName(const char * withoutExtension)
return result;
}
-static QCString makeRef(const char * withoutExtension, const char * anchor)
+static QCString makeRef(const QCString & withoutExtension, const QCString & anchor)
{
//printf("QHP::makeRef(%s,%s)\n",withoutExtension,anchor);
- if (!withoutExtension) return QCString();
+ if (withoutExtension.isEmpty()) return QCString();
QCString result = makeFileName(withoutExtension);
- if (!anchor) return result;
+ if (anchor.isEmpty()) return result;
return result+"#"+anchor;
}
@@ -97,14 +97,15 @@ void Qhp::initialize()
QCString filterName = Config_getString(QHP_CUST_FILTER_NAME);
if (!filterName.isEmpty())
{
- const char * tagAttributes[] =
- { "name", filterName, 0 };
+ const char * tagAttributes[] =
+ { "name", filterName.data(), 0 };
m_doc.open("customFilter", tagAttributes);
- QCStringList customFilterAttributes = QCStringList::split(' ', Config_getString(QHP_CUST_FILTER_ATTRS));
- for (int i = 0; i < (int)customFilterAttributes.count(); i++)
+ StringVector customFilterAttributes =
+ split(Config_getString(QHP_CUST_FILTER_ATTRS).str(), " ");
+ for (const auto &attr : customFilterAttributes)
{
- m_doc.openCloseContent("filterAttribute", customFilterAttributes[i]);
+ m_doc.openCloseContent("filterAttribute", attr.c_str());
}
m_doc.close("customFilter");
}
@@ -112,15 +113,16 @@ void Qhp::initialize()
m_doc.open("filterSection");
// Add section attributes
- QCStringList sectionFilterAttributes = QCStringList::split(' ',
- Config_getString(QHP_SECT_FILTER_ATTRS));
- if (!sectionFilterAttributes.contains("doxygen"))
+ StringVector sectionFilterAttributes =
+ split(Config_getString(QHP_SECT_FILTER_ATTRS).str(), " ");
+ if (std::find(sectionFilterAttributes.begin(), sectionFilterAttributes.end(), "doxygen") ==
+ sectionFilterAttributes.end())
{
- sectionFilterAttributes << "doxygen";
+ sectionFilterAttributes.push_back("doxygen");
}
- for (int i = 0; i < (int)sectionFilterAttributes.count(); i++)
+ for (const auto &attr : sectionFilterAttributes)
{
- m_doc.openCloseContent("filterAttribute", sectionFilterAttributes[i]);
+ m_doc.openCloseContent("filterAttribute", attr.c_str());
}
m_toc.open("toc");
@@ -129,8 +131,8 @@ void Qhp::initialize()
QCString fullProjectname = getFullProjectName();
QCString indexFile = "index"+Doxygen::htmlFileExtension;
const char * const attributes[] =
- { "title", fullProjectname,
- "ref", indexFile,
+ { "title", fullProjectname.data(),
+ "ref", indexFile.data(),
NULL
};
m_toc.open("section", attributes);
@@ -165,12 +167,13 @@ void Qhp::finalize()
m_doc.close("QtHelpProject");
QCString fileName = Config_getString(HTML_OUTPUT) + "/" + getQhpFileName();
- QFile file(fileName);
- if (!file.open(IO_WriteOnly))
+ std::ofstream file(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!file.is_open())
{
term("Could not open file %s for writing\n", fileName.data());
}
- m_doc.dumpTo(file);
+ TextStream t(&file);
+ m_doc.dumpTo(t);
}
void Qhp::incContentsDepth()
@@ -188,9 +191,9 @@ void Qhp::decContentsDepth()
m_sectionLevel--;
}
-void Qhp::addContentsItem(bool /*isDir*/, const char * name,
- const char * /*ref*/, const char * file,
- const char *anchor, bool /* separateIndex */,
+void Qhp::addContentsItem(bool /*isDir*/, const QCString & name,
+ const QCString & /*ref*/, const QCString & file,
+ const QCString &anchor, bool /* separateIndex */,
bool /* addToNavIndex */,
const Definition * /*def*/)
{
@@ -214,7 +217,7 @@ void Qhp::addContentsItem(bool /*isDir*/, const char * name,
}
void Qhp::addIndexItem(const Definition *context,const MemberDef *md,
- const char *sectionAnchor,const char *word)
+ const QCString &sectionAnchor,const QCString &word)
{
(void)word;
//printf("addIndexItem(%s %s %s\n",
@@ -236,9 +239,9 @@ void Qhp::addIndexItem(const Definition *context,const MemberDef *md,
QCString cfname = md->getOutputFileBase();
QCString cfiname = context->getOutputFileBase();
QCString level1 = context->name();
- QCString level2 = word ? QCString(word) : md->name();
+ QCString level2 = !word.isEmpty() ? word : md->name();
QCString contRef = separateMemberPages ? cfname : cfiname;
- QCString anchor = sectionAnchor ? QCString(sectionAnchor) : md->anchor();
+ QCString anchor = !sectionAnchor.isEmpty() ? sectionAnchor : md->anchor();
QCString ref;
@@ -247,9 +250,9 @@ void Qhp::addIndexItem(const Definition *context,const MemberDef *md,
QCString id = level1+"::"+level2;
const char * attributes[] =
{
- "name", level2,
- "id", id,
- "ref", ref,
+ "name", level2.data(),
+ "id", id.data(),
+ "ref", ref.data(),
0
};
m_index.openClose("keyword", attributes);
@@ -258,20 +261,20 @@ void Qhp::addIndexItem(const Definition *context,const MemberDef *md,
{
// <keyword name="Foo" id="Foo" ref="doc.html#Foo"/>
QCString contRef = context->getOutputFileBase();
- QCString level1 = word ? QCString(word) : context->name();
+ QCString level1 = !word.isEmpty() ? word : context->name();
QCString ref = makeRef(contRef,sectionAnchor);
const char * attributes[] =
{
- "name", level1,
- "id", level1,
- "ref", ref,
+ "name", level1.data(),
+ "id", level1.data(),
+ "ref", ref.data(),
0
};
m_index.openClose("keyword", attributes);
}
}
-void Qhp::addIndexFile(const char * name)
+void Qhp::addIndexFile(const QCString & name)
{
addFile(name);
}
@@ -314,8 +317,8 @@ void Qhp::handlePrevSection()
QCString finalRef = makeRef(m_prevSectionBaseName, m_prevSectionAnchor);
const char * const attributes[] =
- { "title", m_prevSectionTitle,
- "ref", finalRef,
+ { "title", m_prevSectionTitle.data(),
+ "ref", finalRef.data(),
NULL
};
@@ -338,7 +341,7 @@ void Qhp::handlePrevSection()
clearPrevSection();
}
-void Qhp::setPrevSection(const char * title, const char * basename, const char * anchor, int level)
+void Qhp::setPrevSection(const QCString & title, const QCString & basename, const QCString & anchor, int level)
{
m_prevSectionTitle = title;
m_prevSectionBaseName = basename;
@@ -353,17 +356,17 @@ void Qhp::clearPrevSection()
m_prevSectionAnchor.resize(0);
}
-void Qhp::addFile(const char * fileName)
+void Qhp::addFile(const QCString & fileName)
{
m_files.openCloseContent("file", fileName);
}
-void Qhp::addImageFile(const char *fileName)
+void Qhp::addImageFile(const QCString &fileName)
{
addFile(fileName);
}
-void Qhp::addStyleSheetFile(const char *fileName)
+void Qhp::addStyleSheetFile(const QCString &fileName)
{
addFile(fileName);
}
diff --git a/src/qhp.h b/src/qhp.h
index eba7db5..d1fc335 100644
--- a/src/qhp.h
+++ b/src/qhp.h
@@ -3,8 +3,8 @@
* Copyright (C) 2008 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
+ * 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.
*
@@ -31,15 +31,15 @@ class Qhp : public IndexIntf
void finalize();
void incContentsDepth();
void decContentsDepth();
- void addContentsItem(bool isDir, const char * name, const char * ref,
- const char * file, const char * anchor,
+ void addContentsItem(bool isDir, const QCString & name, const QCString & ref,
+ const QCString & file, const QCString & anchor,
bool separateIndex,bool addToNavIndex,
const Definition *def);
void addIndexItem(const Definition *context, const MemberDef *md,
- const char *sectionAnchor, const char *title);
- void addIndexFile(const char * name);
- void addImageFile(const char * name);
- void addStyleSheetFile(const char * name);
+ const QCString &sectionAnchor, const QCString &title);
+ void addIndexFile(const QCString & name);
+ void addImageFile(const QCString & name);
+ void addStyleSheetFile(const QCString & name);
// END IndexIntf
static QCString getQhpFileName();
@@ -47,8 +47,8 @@ class Qhp : public IndexIntf
private:
void handlePrevSection();
void clearPrevSection();
- void setPrevSection(const char * title, const char * basename, const char * anchor, int level);
- void addFile(const char * fileName);
+ void setPrevSection(const QCString & title, const QCString & basename, const QCString & anchor, int level);
+ void addFile(const QCString & fileName);
static QCString getFullProjectName();
diff --git a/src/qhpxmlwriter.cpp b/src/qhpxmlwriter.cpp
index edf9ae0..b3ab95a 100644
--- a/src/qhpxmlwriter.cpp
+++ b/src/qhpxmlwriter.cpp
@@ -3,8 +3,8 @@
* Copyright (C) 2008 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
+ * 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.
*
@@ -16,12 +16,10 @@
#include "qhpxmlwriter.h"
#include "util.h"
+#include "qcstring.h"
-#include <qfile.h>
-
-QhpXmlWriter::QhpXmlWriter()
- : m_out(&m_backend), m_indentLevel(0),
- m_curLineIndented(false), m_compress(false)
+QhpXmlWriter::QhpXmlWriter()
+ : m_indentLevel(0), m_curLineIndented(false), m_compress(false)
{
}
@@ -41,16 +39,16 @@ void QhpXmlWriter::setCompressionEnabled(bool enabled)
void QhpXmlWriter::insert(QhpXmlWriter const & source)
{
- m_out << source.m_backend.data();
+ m_backend << source.m_backend.str();
}
-void QhpXmlWriter::dumpTo(QFile & file)
+void QhpXmlWriter::dumpTo(TextStream & file)
{
- file.writeBlock(m_backend.data(), m_backend.length());
+ file << m_backend.str();
}
-void QhpXmlWriter::open(char const * elementName,
- char const * const * attributes)
+void QhpXmlWriter::open(const QCString &elementName,
+ const char * const attributes[])
{
indent();
openPure(elementName, attributes);
@@ -58,25 +56,25 @@ void QhpXmlWriter::open(char const * elementName,
m_indentLevel++;
}
-void QhpXmlWriter::openClose(char const * elementName,
- char const * const * attributes)
+void QhpXmlWriter::openClose(const QCString &elementName,
+ const char * const attributes[])
{
indent();
openClosePure(elementName, attributes);
newLine();
}
-void QhpXmlWriter::openCloseContent(char const * elementName,
- char const * content)
+void QhpXmlWriter::openCloseContent(const QCString &elementName,
+ const QCString &content)
{
indent();
openPure(elementName);
- m_out << convertToXML(content);
+ m_backend << convertToXML(content);
closePure(elementName);
newLine();
}
-void QhpXmlWriter::close(char const * elementName)
+void QhpXmlWriter::close(const QCString &elementName)
{
m_indentLevel--;
indent();
@@ -84,9 +82,9 @@ void QhpXmlWriter::close(char const * elementName)
newLine();
}
-void QhpXmlWriter::declaration(char const * version, char const * encoding)
+void QhpXmlWriter::declaration(const QCString &version, const QCString &encoding)
{
- m_out << "<?xml version=\"" << version << "\" encoding=\"" << encoding << "\"?>";
+ m_backend << "<?xml version=\"" << version << "\" encoding=\"" << encoding << "\"?>";
newLine();
}
@@ -96,9 +94,9 @@ void QhpXmlWriter::indent()
{
return;
}
- for (int i = 0; i < m_indentLevel; i++)
+ for (int i = 0; i < m_indentLevel; i++)
{
- m_out << " ";
+ m_backend << " ";
}
m_curLineIndented = true;
}
@@ -107,51 +105,51 @@ void QhpXmlWriter::newLine()
{
if (!m_compress)
{
- m_out << "\n";
+ m_backend << "\n";
m_curLineIndented = false;
}
}
-void QhpXmlWriter::openPureHelper(char const * elementName,
- char const * const * attributes, bool close)
+void QhpXmlWriter::openPureHelper(const QCString &elementName,
+ const char * const attributes[], bool close)
{
- m_out << "<" << elementName;
+ m_backend << "<" << elementName;
if (attributes)
{
- for (char const * const * walker = attributes;
+ for (const char * const * walker = attributes;
walker[0]; walker += 2)
{
- char const * const key = walker[0];
- char const * const value = walker[1];
+ const char *const key = walker[0];
+ const char *const value = walker[1];
if (!value)
{
- continue;
+ continue;
}
- m_out << " " << key << "=\"" << convertToXML(value) << "\"";
+ m_backend << " " << key << "=\"" << convertToXML(value) << "\"";
}
}
if (close)
{
- m_out << " /";
+ m_backend << " /";
}
- m_out << ">";
+ m_backend << ">";
}
-void QhpXmlWriter::openPure(char const * elementName,
- char const * const * attributes)
+void QhpXmlWriter::openPure(const QCString &elementName,
+ const char * const attributes[])
{
openPureHelper(elementName, attributes, false);
}
-void QhpXmlWriter::openClosePure(char const * elementName,
- char const * const * attributes)
+void QhpXmlWriter::openClosePure(const QCString &elementName,
+ const char * const attributes[])
{
openPureHelper(elementName, attributes, true);
}
-void QhpXmlWriter::closePure(char const * elementName)
+void QhpXmlWriter::closePure(const QCString &elementName)
{
- m_out << "</" << elementName << ">";
+ m_backend << "</" << elementName << ">";
}
diff --git a/src/qhpxmlwriter.h b/src/qhpxmlwriter.h
index 5541edd..7b591eb 100644
--- a/src/qhpxmlwriter.h
+++ b/src/qhpxmlwriter.h
@@ -17,9 +17,8 @@
#ifndef QHPXMLWRITER_H
#define QHPXMLWRITER_H
-#include "ftextstream.h"
-
-class QFile;
+#include <sstream>
+#include "textstream.h"
class QhpXmlWriter
{
@@ -30,30 +29,27 @@ class QhpXmlWriter
void setIndentLevel(int level);
void setCompressionEnabled(bool enabled);
void insert(QhpXmlWriter const & source);
- void dumpTo(QFile & file);
- void open(char const * elementName,
- char const * const * attributes = 0);
- void openClose(char const * elementName,
- char const * const * attributes = 0);
- void openCloseContent(char const * elementName, char const * content);
- void close(char const * elementName);
- void declaration(char const * version, char const * encoding);
-
- static char * dupEscaped(const char * source);
+ void dumpTo(TextStream & file);
+ void open(const QCString &elementName,
+ const char * const attributes[] = 0);
+ void openClose(const QCString &elementName,
+ const char * const attributes[] = 0);
+ void openCloseContent(const QCString &elementName, const QCString &content);
+ void close(const QCString &elementName);
+ void declaration(const QCString &version, const QCString &encoding);
private:
void indent();
void newLine();
- void openPureHelper(char const * elementName,
- char const * const * attributes, bool close);
- void openPure(char const * elementName,
- char const * const * attributes = 0);
- void openClosePure(char const * elementName,
- char const * const * attributes = 0);
- void closePure(char const * elementName);
-
- QGString m_backend;
- FTextStream m_out;
+ void openPureHelper(const QCString &elementName,
+ const char * const attributes[], bool close);
+ void openPure(const QCString &elementName,
+ const char * const attributes[] = 0);
+ void openClosePure(const QCString &elementName,
+ const char * const attributes[] = 0);
+ void closePure(const QCString &elementName);
+
+ TextStream m_backend;
int m_indentLevel;
bool m_curLineIndented;
bool m_compress;
diff --git a/src/reflist.cpp b/src/reflist.cpp
index 39987f9..9a32449 100644
--- a/src/reflist.cpp
+++ b/src/reflist.cpp
@@ -14,15 +14,14 @@
*/
#include <algorithm>
-
#include <stdio.h>
+
#include "reflist.h"
#include "util.h"
-#include "ftextstream.h"
#include "definition.h"
#include "config.h"
-RefList::RefList(const char *listName, const char *pageTitle, const char *secTitle) :
+RefList::RefList(const QCString &listName, const QCString &pageTitle, const QCString &secTitle) :
m_listName(listName), m_fileName(convertNameToFile(listName,FALSE,TRUE)),
m_pageTitle(pageTitle), m_secTitle(secTitle)
{
@@ -68,7 +67,7 @@ void RefList::generatePage()
bool first=true;
for (const std::unique_ptr<RefItem> &item : m_entries)
{
- if (!item->name()) continue;
+ if (item->name().isEmpty()) continue;
cnt++;
bool startNewGroup = item->group()!=lastGroup;
if (startNewGroup)
diff --git a/src/reflist.h b/src/reflist.h
index 7f4473c..6ab360b 100644
--- a/src/reflist.h
+++ b/src/reflist.h
@@ -20,7 +20,7 @@
#include <unordered_map>
#include <memory>
-#include <qcstring.h>
+#include "qcstring.h"
#include "linkedmap.h"
class Definition;
@@ -32,13 +32,13 @@ class RefItem
public:
RefItem(int id,RefList *list) : m_id(id), m_list(list) {}
- void setText (const char *text) { m_text = text; }
- void setAnchor(const char *anchor) { m_anchor = anchor; }
- void setPrefix(const char *prefix) { m_prefix = prefix; }
- void setName (const char *name) { m_name = name; }
- void setTitle (const char *title) { m_title = title; }
- void setArgs (const char *args) { m_args = args; }
- void setGroup (const char *group) { m_group = group; }
+ void setText (const QCString &text) { m_text = text; }
+ void setAnchor(const QCString &anchor) { m_anchor = anchor; }
+ void setPrefix(const QCString &prefix) { m_prefix = prefix; }
+ void setName (const QCString &name) { m_name = name; }
+ void setTitle (const QCString &title) { m_title = title; }
+ void setArgs (const QCString &args) { m_args = args; }
+ void setGroup (const QCString &group) { m_group = group; }
void setScope (const Definition *scope) { m_scope = scope; }
QCString text() const { return m_text; }
@@ -83,7 +83,7 @@ class RefList
* @param pageTitle String representing the title of the list page.
* @param secTitle String representing the title of the section.
*/
- RefList(const char *listName, const char *pageTitle, const char *secTitle);
+ RefList(const QCString &listName, const QCString &pageTitle, const QCString &secTitle);
bool isEnabled() const;
/*! Adds a new item to the list.
diff --git a/src/regex.cpp b/src/regex.cpp
index 62678b7..2a39f63 100644
--- a/src/regex.cpp
+++ b/src/regex.cpp
@@ -30,6 +30,27 @@
namespace reg
{
+static inline bool isspace(char c)
+{
+ return c==' ' || c=='\t' || c=='\n' || c=='\r';
+}
+
+static inline bool isalpha(char c)
+{
+ return static_cast<unsigned char>(c)>=128 || (c>='a' && c<='z') || (c>='A' && c<='Z');
+}
+
+static inline bool isdigit(char c)
+{
+ return c>='0' && c<='9';
+}
+
+static inline bool isalnum(char c)
+{
+ return isalpha(c) || isdigit(c);
+}
+
+
/** Class representing a token in the compiled regular expression token stream.
* A token has a kind and an optional value whose meaning depends on the kind.
* It is also possible to store a (from,to) character range in a token.
@@ -417,8 +438,8 @@ void Ex::Private::dump()
bool Ex::Private::matchAt(size_t tokenPos,const std::string &str,Match &match,const size_t pos,int level) const
{
DBG("%d:matchAt(tokenPos=%zu, str='%s', pos=%zu)\n",level,tokenPos,str.c_str(),pos);
- auto isStartIdChar = [](char c) { return std::isalpha(c) || c=='_' || c<0; };
- auto isIdChar = [](char c) { return std::isalnum(c) || c=='_' || c<0; };
+ auto isStartIdChar = [](char c) { return isalpha(c) || c=='_'; };
+ auto isIdChar = [](char c) { return isalnum(c) || c=='_'; };
auto matchCharClass = [this,isStartIdChar,isIdChar](size_t tp,char c) -> bool
{
PToken tok = data[tp];
@@ -431,8 +452,8 @@ bool Ex::Private::matchAt(size_t tokenPos,const std::string &str,Match &match,co
// first check for built-in ranges
if ((tok.kind()==PToken::Kind::Alpha && isStartIdChar(c)) ||
(tok.kind()==PToken::Kind::AlphaNum && isIdChar(c)) ||
- (tok.kind()==PToken::Kind::WhiteSpace && std::isspace(c)) ||
- (tok.kind()==PToken::Kind::Digit && std::isdigit(c))
+ (tok.kind()==PToken::Kind::WhiteSpace && isspace(c)) ||
+ (tok.kind()==PToken::Kind::Digit && isdigit(c))
)
{
found=true;
@@ -481,12 +502,12 @@ bool Ex::Private::matchAt(size_t tokenPos,const std::string &str,Match &match,co
}
else if (tok.kind()==PToken::Kind::WhiteSpace) // '\s*' -> eat spaces
{
- while (index<=str.length() && std::isspace(str[index])) { index++; if (type==Optional) break; }
+ while (index<=str.length() && isspace(str[index])) { index++; if (type==Optional) break; }
tokenPos++;
}
else if (tok.kind()==PToken::Kind::Digit) // '\d*' -> eat digits
{
- while (index<=str.length() && std::isdigit(str[index])) { index++; if (type==Optional) break; }
+ while (index<=str.length() && isdigit(str[index])) { index++; if (type==Optional) break; }
tokenPos++;
}
else if (tok.kind()==PToken::Kind::Any) // '.*' -> eat all
@@ -537,11 +558,11 @@ bool Ex::Private::matchAt(size_t tokenPos,const std::string &str,Match &match,co
index++;
break;
case PToken::Kind::WhiteSpace:
- if (index>=str.length() || !std::isspace(str[index])) return false;
+ if (index>=str.length() || !isspace(str[index])) return false;
index++;
break;
case PToken::Kind::Digit:
- if (index>=str.length() || !std::isdigit(str[index])) return false;
+ if (index>=str.length() || !isdigit(str[index])) return false;
index++;
break;
case PToken::Kind::BeginOfLine:
diff --git a/src/resourcemgr.cpp b/src/resourcemgr.cpp
index b0361f0..161e480 100644
--- a/src/resourcemgr.cpp
+++ b/src/resourcemgr.cpp
@@ -14,14 +14,12 @@
*/
#include <map>
-#include <qfile.h>
-#include <qcstring.h>
#include <string.h>
+#include <fstream>
#include "resourcemgr.h"
#include "util.h"
#include "version.h"
-#include "ftextstream.h"
#include "message.h"
#include "config.h"
@@ -53,18 +51,24 @@ void ResourceMgr::registerResources(std::initializer_list<Resource> resources)
}
}
-bool ResourceMgr::writeCategory(const char *categoryName,const char *targetDir) const
+bool ResourceMgr::writeCategory(const QCString &categoryName,const QCString &targetDir) const
{
for (auto &kv : p->resources)
{
Resource &res = kv.second;
- if (qstrcmp(res.category,categoryName)==0)
+ if (res.category==categoryName)
{
- QCString pathName = QCString(targetDir)+"/"+res.name;
- QFile f(pathName);
- if (!f.open(IO_WriteOnly) || f.writeBlock((const char *)res.data,res.size)!=res.size)
+ std::string pathName = targetDir.str()+"/"+res.name;
+ std::ofstream f(pathName,std::ofstream::out | std::ofstream::binary);
+ bool ok=false;
+ if (f.is_open())
{
- err("Failed to write resource '%s' to directory '%s'\n",res.name,targetDir);
+ f.write(reinterpret_cast<const char *>(res.data),res.size);
+ ok = !f.fail();
+ }
+ if (!ok)
+ {
+ err("Failed to write resource '%s' to directory '%s'\n",res.name,qPrint(targetDir));
return FALSE;
}
}
@@ -72,9 +76,9 @@ bool ResourceMgr::writeCategory(const char *categoryName,const char *targetDir)
return TRUE;
}
-bool ResourceMgr::copyResourceAs(const char *name,const char *targetDir,const char *targetName) const
+bool ResourceMgr::copyResourceAs(const QCString &name,const QCString &targetDir,const QCString &targetName) const
{
- QCString pathName = QCString(targetDir)+"/"+targetName;
+ std::string pathName = targetDir.str()+"/"+targetName.str();
const Resource *res = get(name);
if (res)
{
@@ -82,8 +86,14 @@ bool ResourceMgr::copyResourceAs(const char *name,const char *targetDir,const ch
{
case Resource::Verbatim:
{
- QFile f(pathName);
- if (f.open(IO_WriteOnly) && f.writeBlock((const char *)res->data,res->size)==res->size)
+ std::ofstream f(pathName,std::ofstream::out | std::ofstream::binary);
+ bool ok=false;
+ if (f.is_open())
+ {
+ f.write(reinterpret_cast<const char *>(res->data),res->size);
+ ok = !f.fail();
+ }
+ if (ok)
{
return TRUE;
}
@@ -97,7 +107,7 @@ bool ResourceMgr::copyResourceAs(const char *name,const char *targetDir,const ch
ushort width = (data[0]<<8)+data[1];
ushort height = (data[2]<<8)+data[3];
ColoredImgDataItem images[2];
- images[0].name = n;
+ images[0].name = n.data();
images[0].width = width;
images[0].height = height;
images[0].content = &data[4];
@@ -115,7 +125,7 @@ bool ResourceMgr::copyResourceAs(const char *name,const char *targetDir,const ch
ushort width = (data[0]<<8)+data[1];
ushort height = (data[2]<<8)+data[3];
ColoredImgDataItem images[2];
- images[0].name = n;
+ images[0].name = n.data();
images[0].width = width;
images[0].height = height;
images[0].content = &data[4];
@@ -127,14 +137,13 @@ bool ResourceMgr::copyResourceAs(const char *name,const char *targetDir,const ch
break;
case Resource::CSS:
{
- QFile f(pathName);
- if (f.open(IO_WriteOnly))
+ std::ofstream t(pathName,std::ofstream::out | std::ofstream::binary);
+ if (t.is_open())
{
QCString buf(res->size+1);
memcpy(buf.rawData(),res->data,res->size);
- FTextStream t(&f);
buf = replaceColorMarkers(buf);
- if (qstrcmp(name,"navtree.css")==0)
+ if (name=="navtree.css")
{
t << substitute(buf,"$width",QCString().setNum(Config_getInt(TREEVIEW_WIDTH))+"px");
}
@@ -148,12 +157,11 @@ bool ResourceMgr::copyResourceAs(const char *name,const char *targetDir,const ch
break;
case Resource::SVG:
{
- QFile f(pathName);
- if (f.open(IO_WriteOnly))
+ std::ofstream t(pathName,std::ostream::out | std::ofstream::binary);
+ if (t.is_open())
{
QCString buf(res->size+1);
memcpy(buf.rawData(),res->data,res->size);
- FTextStream t(&f);
t << replaceColorMarkers(buf);
return TRUE;
}
@@ -162,24 +170,24 @@ bool ResourceMgr::copyResourceAs(const char *name,const char *targetDir,const ch
}
else
{
- err("requested resource '%s' not compiled in!\n",name);
+ err("requested resource '%s' not compiled in!\n",qPrint(name));
}
return FALSE;
}
-bool ResourceMgr::copyResource(const char *name,const char *targetDir) const
+bool ResourceMgr::copyResource(const QCString &name,const QCString &targetDir) const
{
return copyResourceAs(name,targetDir,name);
}
-const Resource *ResourceMgr::get(const char *name) const
+const Resource *ResourceMgr::get(const QCString &name) const
{
- auto it = p->resources.find(name);
+ auto it = p->resources.find(name.str());
if (it!=p->resources.end()) return &it->second;
return 0;
}
-QCString ResourceMgr::getAsString(const char *name) const
+QCString ResourceMgr::getAsString(const QCString &name) const
{
const Resource *res = get(name);
if (res)
diff --git a/src/resourcemgr.h b/src/resourcemgr.h
index 2d7ad9b..7978e09 100644
--- a/src/resourcemgr.h
+++ b/src/resourcemgr.h
@@ -18,7 +18,7 @@
#include <memory>
#include <initializer_list>
-#include <qcstring.h>
+#include "qcstring.h"
/** @brief Compiled resource */
struct Resource
@@ -42,20 +42,20 @@ class ResourceMgr
void registerResources(std::initializer_list<Resource> resources);
/** Writes all resource belonging to a given category to a given target directory */
- bool writeCategory(const char *categoryName,const char *targetDir) const;
+ bool writeCategory(const QCString &categoryName,const QCString &targetDir) const;
/** Copies a registered resource to a given target directory */
- bool copyResource(const char *name,const char *targetDir) const;
+ bool copyResource(const QCString &name,const QCString &targetDir) const;
/** Copies a registered resource to a given target directory under a given target name */
- bool copyResourceAs(const char *name,const char *targetDir,const char *targetName) const;
+ bool copyResourceAs(const QCString &name,const QCString &targetDir,const QCString &targetName) const;
/** Gets the resource data as a C string */
- QCString getAsString(const char *name) const;
+ QCString getAsString(const QCString &name) const;
private:
/** Returns a pointer to the resource object with the given name. */
- const Resource *get(const char *name) const;
+ const Resource *get(const QCString &name) const;
ResourceMgr();
~ResourceMgr();
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index 797e3a2..0d571dc 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -16,7 +16,7 @@
*
*/
-#include <qfileinfo.h>
+#include <algorithm>
#include "rtfdocvisitor.h"
#include "docparser.h"
@@ -36,6 +36,7 @@
#include "htmlentity.h"
#include "emoji.h"
#include "plantuml.h"
+#include "fileinfo.h"
//#define DBG_RTF(x) m_t << x
#define DBG_RTF(x) do {} while(0)
@@ -54,17 +55,16 @@ static QCString align(DocHtmlCell *cell)
return "";
}
-RTFDocVisitor::RTFDocVisitor(FTextStream &t,CodeOutputInterface &ci,
- const char *langExt)
+RTFDocVisitor::RTFDocVisitor(TextStream &t,CodeOutputInterface &ci,
+ const QCString &langExt)
: DocVisitor(DocVisitor_RTF), m_t(t), m_ci(ci), m_insidePre(FALSE),
m_hide(FALSE), m_indentLevel(0), m_lastIsPara(FALSE), m_langExt(langExt)
{
}
-QCString RTFDocVisitor::getStyle(const char *name)
+QCString RTFDocVisitor::getStyle(const QCString &name)
{
- QCString n;
- n.sprintf("%s%d",name,m_indentLevel);
+ QCString n = name + QCString().setNum(m_indentLevel);
StyleData &sd = rtf_Style[n.str()];
return sd.reference();
}
@@ -193,7 +193,7 @@ void RTFDocVisitor::visit(DocURL *u)
filter(u->url());
m_t << "}"
"}"
- "}" << endl;
+ "}\n";
}
else
{
@@ -208,7 +208,7 @@ void RTFDocVisitor::visit(DocLineBreak *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visit(DocLineBreak)}\n");
- m_t << "\\par" << endl;
+ m_t << "\\par\n";
m_lastIsPara=TRUE;
}
@@ -216,7 +216,7 @@ void RTFDocVisitor::visit(DocHorRuler *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visit(DocHorRuler)}\n");
- m_t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}" << endl;
+ m_t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}\n";
m_lastIsPara=TRUE;
}
@@ -260,8 +260,8 @@ void RTFDocVisitor::visit(DocStyleChange *s)
case DocStyleChange::Preformatted:
if (s->enable())
{
- m_t << "{" << endl;
- m_t << "\\par" << endl;
+ m_t << "{\n";
+ m_t << "\\par\n";
m_t << rtf_Style_Reset << getStyle("CodeExample");
m_insidePre=TRUE;
}
@@ -269,7 +269,7 @@ void RTFDocVisitor::visit(DocStyleChange *s)
{
m_insidePre=FALSE;
m_t << "\\par";
- m_t << "}" << endl;
+ m_t << "}\n";
}
m_lastIsPara=TRUE;
break;
@@ -296,21 +296,21 @@ void RTFDocVisitor::visit(DocVerbatim *s)
switch(s->type())
{
case DocVerbatim::Code: // fall though
- m_t << "{" << endl;
- m_t << "\\par" << endl;
+ m_t << "{\n";
+ m_t << "\\par\n";
m_t << rtf_Style_Reset << getStyle("CodeExample");
getCodeParser(lang).parseCode(m_ci,s->context(),s->text(),langExt,
s->isExample(),s->exampleFile());
- //m_t << "\\par" << endl;
- m_t << "}" << endl;
+ //m_t << "\\par\n";
+ m_t << "}\n";
break;
case DocVerbatim::Verbatim:
- m_t << "{" << endl;
- m_t << "\\par" << endl;
+ m_t << "{\n";
+ m_t << "\\par\n";
m_t << rtf_Style_Reset << getStyle("CodeExample");
filter(s->text(),TRUE);
- //m_t << "\\par" << endl;
- m_t << "}" << endl;
+ //m_t << "\\par\n";
+ m_t << "}\n";
break;
case DocVerbatim::RtfOnly:
m_t << s->text();
@@ -328,23 +328,27 @@ void RTFDocVisitor::visit(DocVerbatim *s)
QCString fileName(4096);
fileName.sprintf("%s%d%s",
- (Config_getString(RTF_OUTPUT)+"/inline_dotgraph_").data(),
+ qPrint(Config_getString(RTF_OUTPUT)+"/inline_dotgraph_"),
dotindex++,
".dot"
);
- QFile file(fileName);
- if (!file.open(IO_WriteOnly))
+ std::ofstream file(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!file.is_open())
{
- err("Could not open file %s for writing\n",fileName.data());
+ err("Could not open file %s for writing\n",qPrint(fileName));
+ }
+ else
+ {
+ QCString stext = s->text();
+ file.write( stext.data(), stext.length() );
+ file.close();
}
- file.writeBlock( s->text(), s->text().length() );
- file.close();
writeDotFile(fileName, s->hasCaption());
visitCaption(this, s->children());
includePicturePostRTF(true, s->hasCaption());
- if (Config_getBool(DOT_CLEANUP)) file.remove();
+ if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
}
break;
case DocVerbatim::Msc:
@@ -353,26 +357,26 @@ void RTFDocVisitor::visit(DocVerbatim *s)
QCString baseName(4096);
baseName.sprintf("%s%d%s",
- (Config_getString(RTF_OUTPUT)+"/inline_mscgraph_").data(),
+ qPrint(Config_getString(RTF_OUTPUT)+"/inline_mscgraph_"),
mscindex++,
".msc"
);
- QFile file(baseName);
- if (!file.open(IO_WriteOnly))
+ std::ofstream file(baseName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!file.is_open())
{
- err("Could not open file %s for writing\n",baseName.data());
+ err("Could not open file %s for writing\n",qPrint(baseName));
}
QCString text = "msc {";
text+=s->text();
text+="}";
- file.writeBlock( text, text.length() );
+ file.write( text.data(), text.length() );
file.close();
writeMscFile(baseName, s->hasCaption());
visitCaption(this, s->children());
includePicturePostRTF(true, s->hasCaption());
- if (Config_getBool(DOT_CLEANUP)) file.remove();
+ if (Config_getBool(DOT_CLEANUP)) Dir().remove(baseName.str());
}
break;
case DocVerbatim::PlantUML:
@@ -406,8 +410,8 @@ void RTFDocVisitor::visit(DocAnchor *anc)
{
anchor+=anc->anchor();
}
- m_t << "{\\bkmkstart " << rtfFormatBmkStr(anchor) << "}" << endl;
- m_t << "{\\bkmkend " << rtfFormatBmkStr(anchor) << "}" << endl;
+ m_t << "{\\bkmkstart " << rtfFormatBmkStr(anchor) << "}\n";
+ m_t << "{\\bkmkend " << rtfFormatBmkStr(anchor) << "}\n";
m_lastIsPara=FALSE;
}
@@ -420,11 +424,11 @@ void RTFDocVisitor::visit(DocInclude *inc)
{
case DocInclude::IncWithLines:
{
- m_t << "{" << endl;
- m_t << "\\par" << endl;
+ m_t << "{\n";
+ m_t << "\\par\n";
m_t << rtf_Style_Reset << getStyle("CodeExample");
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
getCodeParser(inc->extension()).parseCode(m_ci,inc->context(),
inc->text(),
langExt,
@@ -439,12 +443,12 @@ void RTFDocVisitor::visit(DocInclude *inc)
);
delete fd;
m_t << "\\par";
- m_t << "}" << endl;
+ m_t << "}\n";
}
break;
case DocInclude::Include:
- m_t << "{" << endl;
- m_t << "\\par" << endl;
+ m_t << "{\n";
+ m_t << "\\par\n";
m_t << rtf_Style_Reset << getStyle("CodeExample");
getCodeParser(inc->extension()).parseCode(m_ci,inc->context(),
inc->text(),langExt,inc->isExample(),
@@ -457,7 +461,7 @@ void RTFDocVisitor::visit(DocInclude *inc)
FALSE // show line numbers
);
m_t << "\\par";
- m_t << "}" << endl;
+ m_t << "}\n";
break;
case DocInclude::DontInclude:
case DocInclude::DontIncWithLines:
@@ -471,16 +475,16 @@ void RTFDocVisitor::visit(DocInclude *inc)
m_t << inc->text();
break;
case DocInclude::VerbInclude:
- m_t << "{" << endl;
- m_t << "\\par" << endl;
+ m_t << "{\n";
+ m_t << "\\par\n";
m_t << rtf_Style_Reset << getStyle("CodeExample");
filter(inc->text());
m_t << "\\par";
- m_t << "}" << endl;
+ m_t << "}\n";
break;
case DocInclude::Snippet:
- m_t << "{" << endl;
- if (!m_lastIsPara) m_t << "\\par" << endl;
+ m_t << "{\n";
+ if (!m_lastIsPara) m_t << "\\par\n";
m_t << rtf_Style_Reset << getStyle("CodeExample");
getCodeParser(inc->extension()).parseCode(m_ci,
inc->context(),
@@ -493,10 +497,10 @@ void RTFDocVisitor::visit(DocInclude *inc)
break;
case DocInclude::SnipWithLines:
{
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
- m_t << "{" << endl;
- if (!m_lastIsPara) m_t << "\\par" << endl;
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
+ m_t << "{\n";
+ if (!m_lastIsPara) m_t << "\\par\n";
m_t << rtf_Style_Reset << getStyle("CodeExample");
getCodeParser(inc->extension()).parseCode(m_ci,
inc->context(),
@@ -527,7 +531,7 @@ void RTFDocVisitor::visit(DocInclude *inc)
void RTFDocVisitor::visit(DocIncOperator *op)
{
//printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
- // op->type(),op->isFirst(),op->isLast(),op->text().data());
+ // op->type(),op->isFirst(),op->isLast(),qPrint(op->text()));
DBG_RTF("{\\comment RTFDocVisitor::visit(DocIncOperator)}\n");
QCString locLangExt = getFileNameExtension(op->includeFileName());
if (locLangExt.isEmpty()) locLangExt = m_langExt;
@@ -536,8 +540,8 @@ void RTFDocVisitor::visit(DocIncOperator *op)
{
if (!m_hide)
{
- m_t << "{" << endl;
- m_t << "\\par" << endl;
+ m_t << "{\n";
+ m_t << "\\par\n";
m_t << rtf_Style_Reset << getStyle("CodeExample");
}
pushHidden(m_hide);
@@ -551,8 +555,8 @@ void RTFDocVisitor::visit(DocIncOperator *op)
FileDef *fd = 0;
if (!op->includeFileName().isEmpty())
{
- QFileInfo cfi( op->includeFileName() );
- fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( op->includeFileName().str() );
+ fd = createFileDef( cfi.dirPath(), cfi.fileName() );
}
getCodeParser(locLangExt).parseCode(m_ci,op->context(),op->text(),langExt,
@@ -575,13 +579,13 @@ void RTFDocVisitor::visit(DocIncOperator *op)
if (!m_hide)
{
m_t << "\\par";
- m_t << "}" << endl;
+ m_t << "}\n";
}
m_lastIsPara=TRUE;
}
else
{
- if (!m_hide) m_t << endl;
+ if (!m_hide) m_t << "\n";
m_lastIsPara=FALSE;
}
}
@@ -611,7 +615,7 @@ void RTFDocVisitor::visit(DocIndexEntry *i)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visit(DocIndexEntry)}\n");
- m_t << "{\\xe \\v " << i->entry() << "}" << endl;
+ m_t << "{\\xe \\v " << i->entry() << "}\n";
m_lastIsPara=FALSE;
}
@@ -651,7 +655,7 @@ void RTFDocVisitor::visitPre(DocAutoList *l)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocAutoList)}\n");
- m_t << "{" << endl;
+ m_t << "{\n";
rtf_listItemInfo[m_indentLevel].isEnum = l->isEnumList();
rtf_listItemInfo[m_indentLevel].number = 1;
m_lastIsPara=FALSE;
@@ -662,26 +666,26 @@ void RTFDocVisitor::visitPost(DocAutoList *)
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocAutoList)}\n");
if (!m_lastIsPara) m_t << "\\par";
- m_t << "}" << endl;
+ m_t << "}\n";
m_lastIsPara=TRUE;
- if (!m_indentLevel) m_t << "\\par" << endl;
+ if (!m_indentLevel) m_t << "\\par\n";
}
void RTFDocVisitor::visitPre(DocAutoListItem *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocAutoListItem)}\n");
- if (!m_lastIsPara) m_t << "\\par" << endl;
+ if (!m_lastIsPara) m_t << "\\par\n";
m_t << rtf_Style_Reset;
if (rtf_listItemInfo[m_indentLevel].isEnum)
{
- m_t << getStyle("ListEnum") << endl;
+ m_t << getStyle("ListEnum") << "\n";
m_t << rtf_listItemInfo[m_indentLevel].number << ".\\tab ";
rtf_listItemInfo[m_indentLevel].number++;
}
else
{
- m_t << getStyle("ListBullet") << endl;
+ m_t << getStyle("ListBullet") << "\n";
}
incIndentLevel();
m_lastIsPara=FALSE;
@@ -709,7 +713,7 @@ void RTFDocVisitor::visitPost(DocPara *p)
)
)
{
- m_t << "\\par" << endl;
+ m_t << "\\par\n";
m_lastIsPara=TRUE;
}
}
@@ -719,14 +723,14 @@ void RTFDocVisitor::visitPre(DocRoot *r)
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocRoot)}\n");
if (r->indent()) incIndentLevel();
- m_t << "{" << rtf_Style["BodyText"].reference() << endl;
+ m_t << "{" << rtf_Style["BodyText"].reference() << "\n";
}
void RTFDocVisitor::visitPost(DocRoot *r)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocRoot)}\n");
- if (!m_lastIsPara && !r->singleLine()) m_t << "\\par" << endl;
+ if (!m_lastIsPara && !r->singleLine()) m_t << "\\par\n";
m_t << "}";
m_lastIsPara=TRUE;
if (r->indent()) decIndentLevel();
@@ -736,10 +740,10 @@ void RTFDocVisitor::visitPre(DocSimpleSect *s)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSimpleSect)}\n");
- if (!m_lastIsPara) m_t << "\\par" << endl;
+ if (!m_lastIsPara) m_t << "\\par\n";
m_t << "{"; // start desc
//m_t << "{\\b "; // start bold
- m_t << "{" << rtf_Style["Heading5"].reference() << endl;
+ m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
switch(s->type())
{
case DocSimpleSect::See:
@@ -793,7 +797,7 @@ void RTFDocVisitor::visitPost(DocSimpleSect *s)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleSect)}\n");
- if (!m_lastIsPara) m_t << "\\par" << endl;
+ if (!m_lastIsPara) m_t << "\\par\n";
decIndentLevel();
if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs) m_t << "}";
m_t << "}"; // end desc
@@ -809,7 +813,7 @@ void RTFDocVisitor::visitPost(DocTitle *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocTitle)}\n");
- m_t << "\\par" << endl;
+ m_t << "\\par\n";
m_t << "}"; // end bold
incIndentLevel();
m_t << rtf_Style_Reset << getStyle("DescContinue");
@@ -820,7 +824,7 @@ void RTFDocVisitor::visitPre(DocSimpleList *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSimpleSect)}\n");
- m_t << "{" << endl;
+ m_t << "{\n";
rtf_listItemInfo[m_indentLevel].isEnum = FALSE;
m_lastIsPara=FALSE;
}
@@ -829,8 +833,8 @@ void RTFDocVisitor::visitPost(DocSimpleList *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleSect)}\n");
- if (!m_lastIsPara) m_t << "\\par" << endl;
- m_t << "}" << endl;
+ if (!m_lastIsPara) m_t << "\\par\n";
+ m_t << "}\n";
m_lastIsPara=TRUE;
}
@@ -838,7 +842,7 @@ void RTFDocVisitor::visitPre(DocSimpleListItem *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSimpleListItem)}\n");
- m_t << "\\par" << rtf_Style_Reset << getStyle("ListBullet") << endl;
+ m_t << "\\par" << rtf_Style_Reset << getStyle("ListBullet") << "\n";
m_lastIsPara=FALSE;
incIndentLevel();
}
@@ -853,22 +857,22 @@ void RTFDocVisitor::visitPre(DocSection *s)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSection)}\n");
- if (!m_lastIsPara) m_t << "\\par" << endl;
- m_t << "{\\bkmkstart " << rtfFormatBmkStr(s->file()+"_"+s->anchor()) << "}" << endl;
- m_t << "{\\bkmkend " << rtfFormatBmkStr(s->file()+"_"+s->anchor()) << "}" << endl;
+ if (!m_lastIsPara) m_t << "\\par\n";
+ m_t << "{\\bkmkstart " << rtfFormatBmkStr(s->file()+"_"+s->anchor()) << "}\n";
+ m_t << "{\\bkmkend " << rtfFormatBmkStr(s->file()+"_"+s->anchor()) << "}\n";
m_t << "{{" // start section
<< rtf_Style_Reset;
QCString heading;
- int level = QMIN(s->level()+1,4);
+ int level = std::min(s->level()+1,4);
heading.sprintf("Heading%d",level);
// set style
- m_t << rtf_Style[heading.str()].reference() << endl;
+ m_t << rtf_Style[heading.str()].reference() << "\n";
// make table of contents entry
filter(s->title());
- m_t << endl << "\\par" << "}" << endl;
+ m_t << "\n\\par" << "}\n";
m_t << "{\\tc\\tcl" << level << " \\v ";
filter(s->title());
- m_t << "}" << endl;
+ m_t << "}\n";
m_lastIsPara=TRUE;
}
@@ -876,7 +880,7 @@ void RTFDocVisitor::visitPost(DocSection *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSection)}\n");
- m_t << "\\par}" << endl; // end section
+ m_t << "\\par}\n"; // end section
m_lastIsPara=TRUE;
}
@@ -884,7 +888,7 @@ void RTFDocVisitor::visitPre(DocHtmlList *l)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlList)}\n");
- m_t << "{" << endl;
+ m_t << "{\n";
rtf_listItemInfo[m_indentLevel].isEnum = l->type()==DocHtmlList::Ordered;
rtf_listItemInfo[m_indentLevel].number = 1;
m_lastIsPara=FALSE;
@@ -894,7 +898,7 @@ void RTFDocVisitor::visitPost(DocHtmlList *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlList)}\n");
- m_t << "\\par" << "}" << endl;
+ m_t << "\\par" << "}\n";
m_lastIsPara=TRUE;
}
@@ -902,17 +906,17 @@ void RTFDocVisitor::visitPre(DocHtmlListItem *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlListItem)}\n");
- m_t << "\\par" << endl;
+ m_t << "\\par\n";
m_t << rtf_Style_Reset;
if (rtf_listItemInfo[m_indentLevel].isEnum)
{
- m_t << getStyle("ListEnum") << endl;
+ m_t << getStyle("ListEnum") << "\n";
m_t << rtf_listItemInfo[m_indentLevel].number << ".\\tab ";
rtf_listItemInfo[m_indentLevel].number++;
}
else
{
- m_t << getStyle("ListBullet") << endl;
+ m_t << getStyle("ListBullet") << "\n";
}
incIndentLevel();
m_lastIsPara=FALSE;
@@ -928,7 +932,7 @@ void RTFDocVisitor::visitPre(DocHtmlDescList *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlDescList)}\n");
- //m_t << "{" << endl;
+ //m_t << "{\n";
//m_t << rtf_Style_Reset << getStyle("ListContinue");
//m_lastIsPara=FALSE;
}
@@ -937,8 +941,8 @@ void RTFDocVisitor::visitPost(DocHtmlDescList *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlDescList)}\n");
- //m_t << "}" << endl;
- //m_t << "\\par" << endl;
+ //m_t << "}\n";
+ //m_t << "\\par\n";
//m_lastIsPara=TRUE;
}
@@ -946,9 +950,9 @@ void RTFDocVisitor::visitPre(DocHtmlDescTitle *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlDescTitle)}\n");
- //m_t << "\\par" << endl;
+ //m_t << "\\par\n";
//m_t << "{\\b ";
- m_t << "{" << rtf_Style["Heading5"].reference() << endl;
+ m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
m_lastIsPara=FALSE;
}
@@ -956,8 +960,8 @@ void RTFDocVisitor::visitPost(DocHtmlDescTitle *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlDescTitle)}\n");
- m_t << "\\par" << endl;
- m_t << "}" << endl;
+ m_t << "\\par\n";
+ m_t << "}\n";
m_lastIsPara=TRUE;
}
@@ -974,7 +978,7 @@ void RTFDocVisitor::visitPost(DocHtmlDescData *)
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlDescData)}\n");
m_t << "\\par";
- m_t << "}" << endl;
+ m_t << "}\n";
decIndentLevel();
m_lastIsPara=TRUE;
}
@@ -983,7 +987,7 @@ void RTFDocVisitor::visitPre(DocHtmlTable *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlTable)}\n");
- if (!m_lastIsPara) m_t << "\\par" << endl;
+ if (!m_lastIsPara) m_t << "\\par\n";
m_lastIsPara=TRUE;
}
@@ -991,8 +995,8 @@ void RTFDocVisitor::visitPost(DocHtmlTable *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlTable)}\n");
- m_t << "\\pard\\plain" << endl;
- m_t << "\\par" << endl;
+ m_t << "\\pard\\plain\n";
+ m_t << "\\par\n";
m_lastIsPara=TRUE;
}
@@ -1006,7 +1010,7 @@ void RTFDocVisitor::visitPre(DocHtmlCaption *)
void RTFDocVisitor::visitPost(DocHtmlCaption *)
{
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlCaption)}\n");
- m_t << "}\n\\par" << endl;
+ m_t << "}\n\\par\n";
}
void RTFDocVisitor::visitPre(DocHtmlRow *r)
@@ -1020,7 +1024,7 @@ void RTFDocVisitor::visitPre(DocHtmlRow *r)
"\\trbrdrb\\brdrs\\brdrw10 "
"\\trbrdrr\\brdrs\\brdrw10 "
"\\trbrdrh\\brdrs\\brdrw10 "
- "\\trbrdrv\\brdrs\\brdrw10 "<< endl;
+ "\\trbrdrv\\brdrs\\brdrw10 \n";
for (i=0;i<r->numCells();i++)
{
if (r->isHeading())
@@ -1032,9 +1036,9 @@ void RTFDocVisitor::visitPre(DocHtmlRow *r)
"\\clbrdrb\\brdrs\\brdrw10 "
"\\clbrdrr \\brdrs\\brdrw10 "
"\\cltxlrtb "
- "\\cellx" << ((i+1)*columnWidth) << endl;
+ "\\cellx" << ((i+1)*columnWidth) << "\n";
}
- m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
+ m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
m_lastIsPara=FALSE;
}
@@ -1042,9 +1046,9 @@ void RTFDocVisitor::visitPost(DocHtmlRow *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlRow)}\n");
- m_t << endl;
- m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
- m_t << "{\\row }" << endl;
+ m_t << "\n";
+ m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
+ m_t << "{\\row }\n";
m_lastIsPara=FALSE;
}
@@ -1072,7 +1076,7 @@ void RTFDocVisitor::visitPre(DocInternal *)
//m_t << "{\\b "; // start bold
//m_t << theTranslator->trForInternalUseOnly();
//m_t << "}"; // end bold
- //m_t << "\\par" << endl;
+ //m_t << "\\par\n";
//incIndentLevel();
//m_t << rtf_Style_Reset << getStyle("DescContinue");
//m_lastIsPara=FALSE;
@@ -1150,7 +1154,7 @@ void RTFDocVisitor::visitPre(DocHtmlHeader *header)
m_t << "{" // start section
<< rtf_Style_Reset;
QCString heading;
- int level = QMIN(header->level(),5);
+ int level = std::min(header->level(),5);
heading.sprintf("Heading%d",level);
// set style
m_t << rtf_Style[heading.str()].reference();
@@ -1165,7 +1169,7 @@ void RTFDocVisitor::visitPost(DocHtmlHeader *)
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlHeader)}\n");
// close open table of contents entry
m_t << "} \\par";
- m_t << "}" << endl; // end section
+ m_t << "}\n"; // end section
m_lastIsPara=TRUE;
}
@@ -1174,24 +1178,24 @@ void RTFDocVisitor::visitPre(DocImage *img)
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocImage)}\n");
includePicturePreRTF(img->name(), img->type()==DocImage::Rtf, img->hasCaption(), img->isInlineImage());
}
-void RTFDocVisitor::includePicturePreRTF(const QCString name, bool isTypeRTF, bool hasCaption, bool inlineImage)
+void RTFDocVisitor::includePicturePreRTF(const QCString &name, bool isTypeRTF, bool hasCaption, bool inlineImage)
{
if (isTypeRTF)
{
if (!inlineImage)
{
- m_t << "\\par" << endl;
- m_t << "{" << endl;
- m_t << rtf_Style_Reset << endl;
- if (hasCaption || m_lastIsPara) m_t << "\\par" << endl;
+ m_t << "\\par\n";
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << "\n";
+ if (hasCaption || m_lastIsPara) m_t << "\\par\n";
m_t << "\\pard \\qc ";
}
m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
m_t << name;
- m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}" << endl;
+ m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}\n";
if (!inlineImage)
{
- m_t << "\\par" << endl;
+ m_t << "\\par\n";
if (hasCaption)
{
m_t << "\\pard \\qc \\b";
@@ -1230,12 +1234,12 @@ void RTFDocVisitor::includePicturePostRTF(bool isTypeRTF, bool hasCaption, bool
{
if (hasCaption)
{
- m_t << "}" <<endl;
- m_t << "\\par}" <<endl;
+ m_t << "}\n";
+ m_t << "\\par}\n";
}
else
{
- m_t << "}" <<endl;
+ m_t << "}\n";
}
}
}
@@ -1302,7 +1306,7 @@ void RTFDocVisitor::visitPre(DocRef *ref)
// ref->anchor() for LaTeX/RTF
if (ref->isSubPage())
{
- startLink(ref->ref(),0,ref->anchor());
+ startLink(ref->ref(),QCString(),ref->anchor());
}
else
{
@@ -1334,10 +1338,10 @@ void RTFDocVisitor::visitPre(DocSecRefList *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSecRefList)}\n");
- m_t << "{" << endl;
+ m_t << "{\n";
incIndentLevel();
- m_t << rtf_Style_Reset << getStyle("LatexTOC") << endl;
- m_t << "\\par" << endl;
+ m_t << rtf_Style_Reset << getStyle("LatexTOC") << "\n";
+ m_t << "\\par\n";
m_lastIsPara=TRUE;
}
@@ -1347,7 +1351,7 @@ void RTFDocVisitor::visitPost(DocSecRefList *)
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSecRefList)}\n");
decIndentLevel();
m_t << "\\par";
- m_t << "}" << endl;
+ m_t << "}\n";
m_lastIsPara=TRUE;
}
@@ -1356,9 +1360,9 @@ void RTFDocVisitor::visitPre(DocParamSect *s)
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocParamSect)}\n");
m_t << "{"; // start param list
- if (!m_lastIsPara) m_t << "\\par" << endl;
+ if (!m_lastIsPara) m_t << "\\par\n";
//m_t << "{\\b "; // start bold
- m_t << "{" << rtf_Style["Heading5"].reference() << endl;
+ m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
switch(s->type())
{
case DocParamSect::Param:
@@ -1373,7 +1377,7 @@ void RTFDocVisitor::visitPre(DocParamSect *s)
ASSERT(0);
}
m_t << "\\par";
- m_t << "}" << endl;
+ m_t << "}\n";
bool useTable = s->type()==DocParamSect::Param ||
s->type()==DocParamSect::RetVal ||
s->type()==DocParamSect::Exception ||
@@ -1390,7 +1394,7 @@ void RTFDocVisitor::visitPost(DocParamSect *s)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocParamSect)}\n");
- //m_t << "\\par" << endl;
+ //m_t << "\\par\n";
bool useTable = s->type()==DocParamSect::Param ||
s->type()==DocParamSect::RetVal ||
s->type()==DocParamSect::Exception ||
@@ -1399,7 +1403,7 @@ void RTFDocVisitor::visitPost(DocParamSect *s)
{
decIndentLevel();
}
- m_t << "}" << endl;
+ m_t << "}\n";
}
void RTFDocVisitor::visitPre(DocParamList *pl)
@@ -1436,7 +1440,7 @@ void RTFDocVisitor::visitPre(DocParamList *pl)
"\\trbrdrb\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 "
- "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< endl;
+ "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< "\n";
for (i=0;i<columnPos[config][0];i++)
{
m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
@@ -1444,9 +1448,9 @@ void RTFDocVisitor::visitPre(DocParamList *pl)
"\\clbrdrb\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrr \\brdrs\\brdrw10\\brdrcf15 "
"\\cltxlrtb "
- "\\cellx" << (rtf_pageWidth*columnPos[config][i+1]/100) << endl;
+ "\\cellx" << (rtf_pageWidth*columnPos[config][i+1]/100) << "\n";
}
- m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
+ m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
}
if (sect && sect->hasInOutSpecifier())
@@ -1553,13 +1557,13 @@ void RTFDocVisitor::visitPost(DocParamList *pl)
parentType==DocParamSect::TemplateParam;
if (useTable)
{
- m_t << "\\cell }" << endl;
- //m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
- m_t << "{\\row }" << endl;
+ m_t << "\\cell }\n";
+ //m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
+ m_t << "{\\row }\n";
}
else
{
- m_t << "\\par" << endl;
+ m_t << "\\par\n";
}
m_lastIsPara=TRUE;
@@ -1573,12 +1577,12 @@ void RTFDocVisitor::visitPre(DocXRefItem *x)
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocXRefItem)}\n");
if (!m_lastIsPara)
{
- m_t << "\\par" << endl;
+ m_t << "\\par\n";
m_lastIsPara=TRUE;
}
m_t << "{"; // start param list
//m_t << "{\\b "; // start bold
- m_t << "{" << rtf_Style["Heading5"].reference() << endl;
+ m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
if (Config_getBool(RTF_HYPERLINKS) && !anonymousEnum)
{
QCString refName;
@@ -1624,9 +1628,9 @@ void RTFDocVisitor::visitPost(DocXRefItem *x)
if (m_hide) return;
if (x->title().isEmpty()) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocXRefItem)}\n");
- m_t << "\\par" << endl;
+ m_t << "\\par\n";
decIndentLevel();
- m_t << "}" << endl; // end xref item
+ m_t << "}\n"; // end xref item
m_lastIsPara=TRUE;
}
@@ -1661,7 +1665,7 @@ void RTFDocVisitor::visitPre(DocHtmlBlockQuote *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlBlockQuote)}\n");
- if (!m_lastIsPara) m_t << "\\par" << endl;
+ if (!m_lastIsPara) m_t << "\\par\n";
m_t << "{"; // start desc
incIndentLevel();
m_t << rtf_Style_Reset << getStyle("DescContinue");
@@ -1671,7 +1675,7 @@ void RTFDocVisitor::visitPost(DocHtmlBlockQuote *)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlBlockQuote)}\n");
- if (!m_lastIsPara) m_t << "\\par" << endl;
+ if (!m_lastIsPara) m_t << "\\par\n";
decIndentLevel();
m_t << "}"; // end desc
m_lastIsPara=TRUE;
@@ -1705,11 +1709,11 @@ void RTFDocVisitor::visitPost(DocParBlock *)
// return s;
//}
-void RTFDocVisitor::filter(const char *str,bool verbatim)
+void RTFDocVisitor::filter(const QCString &str,bool verbatim)
{
- if (str)
+ if (!str.isEmpty())
{
- const unsigned char *p=(const unsigned char *)str;
+ const unsigned char *p=(const unsigned char *)str.data();
unsigned char c;
//unsigned char pc='\0';
while (*p)
@@ -1737,7 +1741,7 @@ void RTFDocVisitor::filter(const char *str,bool verbatim)
case '\\': m_t << "\\\\"; break;
case '\n': if (verbatim)
{
- m_t << "\\par" << endl;
+ m_t << "\\par\n";
}
else
{
@@ -1760,11 +1764,11 @@ void RTFDocVisitor::startLink(const QCString &ref,const QCString &file,const QCS
{
refName+=file;
}
- if (!file.isEmpty() && anchor)
+ if (!file.isEmpty() && !anchor.isEmpty())
{
refName+='_';
}
- if (anchor)
+ if (!anchor.isEmpty())
{
refName+=anchor;
}
diff --git a/src/rtfdocvisitor.h b/src/rtfdocvisitor.h
index 5cb5de3..01be1aa 100644
--- a/src/rtfdocvisitor.h
+++ b/src/rtfdocvisitor.h
@@ -19,17 +19,19 @@
#ifndef _RTFDOCVISITOR_H
#define _RTFDOCVISITOR_H
+#include <iostream>
+
#include "docvisitor.h"
-#include <qcstring.h>
+#include "qcstring.h"
-class FTextStream;
class CodeOutputInterface;
+class TextStream;
/*! @brief Concrete visitor implementation for RTF output. */
class RTFDocVisitor : public DocVisitor
{
public:
- RTFDocVisitor(FTextStream &t,CodeOutputInterface &ci,const char *langExt);
+ RTFDocVisitor(TextStream &t,CodeOutputInterface &ci,const QCString &langExt);
//--------------------------------------
// visitor functions for leaf nodes
@@ -140,15 +142,15 @@ class RTFDocVisitor : public DocVisitor
// helper functions
//--------------------------------------
- void filter(const char *str,bool verbatim=FALSE);
+ void filter(const QCString &str,bool verbatim=FALSE);
void startLink(const QCString &ref,const QCString &file,
const QCString &anchor);
void endLink(const QCString &ref);
- QCString getStyle(const char *name);
+ QCString getStyle(const QCString &name);
void incIndentLevel();
void decIndentLevel();
- void includePicturePreRTF(const QCString name, bool isTypeRTF, bool hasCaption, bool inlineImage = FALSE);
+ void includePicturePreRTF(const QCString &name, bool isTypeRTF, bool hasCaption, bool inlineImage = FALSE);
void includePicturePostRTF(bool isTypeRTF, bool hasCaption, bool inlineImage = FALSE);
void writeDotFile(const QCString &fileName, bool hasCaption);
void writeDotFile(DocDotFile *);
@@ -161,7 +163,7 @@ class RTFDocVisitor : public DocVisitor
// state variables
//--------------------------------------
- FTextStream &m_t;
+ TextStream &m_t;
CodeOutputInterface &m_ci;
bool m_insidePre;
bool m_hide;
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp
index debda5c..8e01a38 100644
--- a/src/rtfgen.cpp
+++ b/src/rtfgen.cpp
@@ -21,8 +21,6 @@
#include <ctime>
#include <stdlib.h>
-#include <qdir.h>
-
#include "rtfgen.h"
#include "config.h"
#include "message.h"
@@ -47,6 +45,8 @@
#include "classlist.h"
#include "filename.h"
#include "namespacedef.h"
+#include "dir.h"
+#include "utf8.h"
//#define DBG_RTF(x) x;
@@ -98,9 +98,8 @@ void RTFGenerator::setSourceFileName(const QCString &name)
m_sourceFileName = name;
}
-void RTFGenerator::writeStyleSheetFile(QFile &file)
+void RTFGenerator::writeStyleSheetFile(TextStream &t)
{
- FTextStream t(&file);
t << "# Generated by doxygen " << getDoxygenVersion() << "\n\n";
t << "# This file describes styles used for generating RTF output.\n";
t << "# All text after a hash (#) is considered a comment and will be ignored.\n";
@@ -111,13 +110,12 @@ void RTFGenerator::writeStyleSheetFile(QFile &file)
{
t << "# " << rtf_Style_Default[i].name << " = "
<< rtf_Style_Default[i].reference
- << rtf_Style_Default[i].definition << endl;
+ << rtf_Style_Default[i].definition << "\n";
}
}
-void RTFGenerator::writeExtensionsFile(QFile &file)
+void RTFGenerator::writeExtensionsFile(TextStream &t)
{
- FTextStream t(&file);
t << "# Generated by doxygen " << getDoxygenVersion() << "\n\n";
t << "# This file describes extensions used for generating RTF output.\n";
t << "# All text after a hash (#) is considered a comment and will be ignored.\n";
@@ -171,10 +169,10 @@ void RTFGenerator::writeExtensionsFile(QFile &file)
void RTFGenerator::init()
{
QCString dir=Config_getString(RTF_OUTPUT);
- QDir d(dir);
- if (!d.exists() && !d.mkdir(dir))
+ Dir d(dir.str());
+ if (!d.exists() && !d.mkdir(dir.str()))
{
- term("Could not create output directory %s\n",dir.data());
+ term("Could not create output directory %s\n",qPrint(dir));
}
// first duplicate strings of rtf_Style_Default
@@ -209,7 +207,7 @@ void RTFGenerator::init()
createSubDirs(d);
}
-static QCString makeIndexName(const char *s,int i)
+static QCString makeIndexName(const QCString &s,int i)
{
QCString result=s;
result+=(char)(i+'0');
@@ -221,77 +219,77 @@ void RTFGenerator::beginRTFDocument()
/* all the included RTF files should begin with the
* same header
*/
- t <<"{\\rtf1\\ansi\\ansicpg" << theTranslator->trRTFansicp();
- t <<"\\uc1 \\deff0\\deflang1033\\deflangfe1033\n";
-
- DBG_RTF(t <<"{\\comment Beginning font list}\n")
- t <<"{\\fonttbl ";
- t <<"{\\f0\\froman\\fcharset" << theTranslator->trRTFCharSet();
- t <<"\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\n";
- t <<"{\\f1\\fswiss\\fcharset" << theTranslator->trRTFCharSet();
- t <<"\\fprq2{\\*\\panose 020b0604020202020204}Arial;}\n";
- t <<"{\\f2\\fmodern\\fcharset" << theTranslator->trRTFCharSet();
- t <<"\\fprq1{\\*\\panose 02070309020205020404}Courier New;}\n";
- t <<"{\\f3\\froman\\fcharset2\\fprq2{\\*\\panose 05050102010706020507}Symbol;}\n";
- t <<"}\n";
- DBG_RTF(t <<"{\\comment begin colors}\n")
- t <<"{\\colortbl;";
- t <<"\\red0\\green0\\blue0;";
- t <<"\\red0\\green0\\blue255;";
- t <<"\\red0\\green255\\blue255;";
- t <<"\\red0\\green255\\blue0;";
- t <<"\\red255\\green0\\blue255;";
- t <<"\\red255\\green0\\blue0;";
- t <<"\\red255\\green255\\blue0;";
- t <<"\\red255\\green255\\blue255;";
- t <<"\\red0\\green0\\blue128;";
- t <<"\\red0\\green128\\blue128;";
- t <<"\\red0\\green128\\blue0;";
- t <<"\\red128\\green0\\blue128;";
- t <<"\\red128\\green0\\blue0;";
- t <<"\\red128\\green128\\blue0;";
- t <<"\\red128\\green128\\blue128;";
- t <<"\\red192\\green192\\blue192;";
+ m_t << "{\\rtf1\\ansi\\ansicpg" << theTranslator->trRTFansicp();
+ m_t << "\\uc1 \\deff0\\deflang1033\\deflangfe1033\n";
+
+ DBG_RTF(m_t << "{\\comment Beginning font list}\n")
+ m_t << "{\\fonttbl ";
+ m_t << "{\\f0\\froman\\fcharset" << theTranslator->trRTFCharSet();
+ m_t << "\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\n";
+ m_t << "{\\f1\\fswiss\\fcharset" << theTranslator->trRTFCharSet();
+ m_t << "\\fprq2{\\*\\panose 020b0604020202020204}Arial;}\n";
+ m_t << "{\\f2\\fmodern\\fcharset" << theTranslator->trRTFCharSet();
+ m_t << "\\fprq1{\\*\\panose 02070309020205020404}Courier New;}\n";
+ m_t << "{\\f3\\froman\\fcharset2\\fprq2{\\*\\panose 05050102010706020507}Symbol;}\n";
+ m_t << "}\n";
+ DBG_RTF(m_t << "{\\comment begin colors}\n")
+ m_t << "{\\colortbl;";
+ m_t << "\\red0\\green0\\blue0;";
+ m_t << "\\red0\\green0\\blue255;";
+ m_t << "\\red0\\green255\\blue255;";
+ m_t << "\\red0\\green255\\blue0;";
+ m_t << "\\red255\\green0\\blue255;";
+ m_t << "\\red255\\green0\\blue0;";
+ m_t << "\\red255\\green255\\blue0;";
+ m_t << "\\red255\\green255\\blue255;";
+ m_t << "\\red0\\green0\\blue128;";
+ m_t << "\\red0\\green128\\blue128;";
+ m_t << "\\red0\\green128\\blue0;";
+ m_t << "\\red128\\green0\\blue128;";
+ m_t << "\\red128\\green0\\blue0;";
+ m_t << "\\red128\\green128\\blue0;";
+ m_t << "\\red128\\green128\\blue128;";
+ m_t << "\\red192\\green192\\blue192;";
// code highlighting colors. Note order is important see also RTFGenerator::startFontClass
- t <<"\\red0\\green128\\blue0;"; // keyword = index 17
- t <<"\\red96\\green64\\blue32;"; // keywordtype
- t <<"\\rede0\\green128\\blue0;"; // keywordflow
- t <<"\\red128\\green0\\blue0;"; // comment
- t <<"\\red128\\green96\\blue32;"; // preprocessor
- t <<"\\red0\\green32\\blue128;"; // stringliteral
- t <<"\\red0\\green128\\blue128;"; // charliteral
- t <<"\\red255\\green0\\blue255;"; // vhdldigit
- t <<"\\red0\\green0\\blue0;"; // vhdlchar
- t <<"\\red112\\green0\\blue112;"; // vhdlkeyword
- t <<"\\red255\\green0\\blue0;"; // vhdllogic
-
- t <<"}\n";
-
- DBG_RTF(t <<"{\\comment Beginning style list}\n")
- t <<"{\\stylesheet\n";
- t <<"{\\widctlpar\\adjustright \\fs20\\cgrid \\snext0 Normal;}\n";
+ m_t << "\\red0\\green128\\blue0;"; // keyword = index 17
+ m_t << "\\red96\\green64\\blue32;"; // keywordtype
+ m_t << "\\rede0\\green128\\blue0;"; // keywordflow
+ m_t << "\\red128\\green0\\blue0;"; // comment
+ m_t << "\\red128\\green96\\blue32;"; // preprocessor
+ m_t << "\\red0\\green32\\blue128;"; // stringliteral
+ m_t << "\\red0\\green128\\blue128;"; // charliteral
+ m_t << "\\red255\\green0\\blue255;"; // vhdldigit
+ m_t << "\\red0\\green0\\blue0;"; // vhdlchar
+ m_t << "\\red112\\green0\\blue112;"; // vhdlkeyword
+ m_t << "\\red255\\green0\\blue0;"; // vhdllogic
+
+ m_t << "}\n";
+
+ DBG_RTF(m_t << "{\\comment Beginning style list}\n")
+ m_t << "{\\stylesheet\n";
+ m_t << "{\\widctlpar\\adjustright \\fs20\\cgrid \\snext0 Normal;}\n";
// set the paper dimensions according to PAPER_TYPE
QCString paperName = Config_getEnum(PAPER_TYPE);
- t << "{";
+ m_t << "{";
if (paperName=="a4")
{
- t << "\\paperw11900\\paperh16840"; // width & height values are inches * 1440
+ m_t << "\\paperw11900\\paperh16840"; // width & height values are inches * 1440
}
else if (paperName=="letter")
{
- t << "\\paperw12240\\paperh15840";
+ m_t << "\\paperw12240\\paperh15840";
}
else if (paperName=="legal")
{
- t << "\\paperw12240\\paperh20160";
+ m_t << "\\paperw12240\\paperh20160";
}
else if (paperName=="executive")
{
- t << "\\paperw10440\\paperh15120";
+ m_t << "\\paperw10440\\paperh15120";
}
- t << "\\margl1800\\margr1800\\margt1440\\margb1440\\gutter0\\ltrsect}\n";
+ m_t << "\\margl1800\\margr1800\\margt1440\\margb1440\\gutter0\\ltrsect}\n";
// sort styles ascending by \s-number via an intermediate QArray
unsigned maxIndex = 0;
@@ -320,57 +318,57 @@ void RTFGenerator::beginRTFDocument()
const StyleData *pStyle = array[i];
if (pStyle)
{
- t <<"{" << pStyle->reference() << pStyle->definition() << ";}\n";
+ m_t << "{" << pStyle->reference() << pStyle->definition() << ";}\n";
}
}
- t <<"}" << endl;
+ m_t << "}\n";
// this comment is needed for postprocessing!
- t <<"{\\comment begin body}" << endl;
+ m_t << "{\\comment begin body}\n";
}
void RTFGenerator::beginRTFChapter()
{
- t <<"\n";
- DBG_RTF(t << "{\\comment BeginRTFChapter}\n")
- t << rtf_Style_Reset;
+ m_t << "\n";
+ DBG_RTF(m_t << "{\\comment BeginRTFChapter}\n")
+ m_t << rtf_Style_Reset;
// if we are compact, no extra page breaks...
if (Config_getBool(COMPACT_RTF))
{
- // t <<"\\sect\\sectd\\sbknone\n";
- t <<"\\sect\\sbknone\n";
+ // m_t << "\\sect\\sectd\\sbknone\n";
+ m_t << "\\sect\\sbknone\n";
rtfwriteRuler_thick();
}
else
- t <<"\\sect\\sbkpage\n";
- //t <<"\\sect\\sectd\\sbkpage\n";
+ m_t << "\\sect\\sbkpage\n";
+ //m_t << "\\sect\\sectd\\sbkpage\n";
- t << rtf_Style["Heading1"].reference() << "\n";
+ m_t << rtf_Style["Heading1"].reference() << "\n";
}
void RTFGenerator::beginRTFSection()
{
- t <<"\n";
- DBG_RTF(t << "{\\comment BeginRTFSection}\n")
- t << rtf_Style_Reset;
+ m_t << "\n";
+ DBG_RTF(m_t << "{\\comment BeginRTFSection}\n")
+ m_t << rtf_Style_Reset;
// if we are compact, no extra page breaks...
if (Config_getBool(COMPACT_RTF))
{
- t <<"\\sect\\sbknone\n";
+ m_t << "\\sect\\sbknone\n";
rtfwriteRuler_emboss();
}
else
{
- t <<"\\sect\\sbkpage\n";
+ m_t << "\\sect\\sbkpage\n";
}
- t << rtf_Style["Heading2"].reference() << "\n";
+ m_t << rtf_Style["Heading2"].reference() << "\n";
}
-void RTFGenerator::startFile(const char *name,const char *,const char *,int)
+void RTFGenerator::startFile(const QCString &name,const QCString &,const QCString &,int)
{
//setEncoding(QCString().sprintf("CP%s",theTranslator->trRTFansicp()));
QCString fileName=name;
@@ -385,8 +383,8 @@ void RTFGenerator::startFile(const char *name,const char *,const char *,int)
void RTFGenerator::endFile()
{
- DBG_RTF(t << "{\\comment endFile}\n")
- t << "}";
+ DBG_RTF(m_t << "{\\comment endFile}\n")
+ m_t << "}";
endPlainFile();
setSourceFileName("");
@@ -394,13 +392,13 @@ void RTFGenerator::endFile()
void RTFGenerator::startProjectNumber()
{
- DBG_RTF(t <<"{\\comment startProjectNumber }" << endl)
- t << " ";
+ DBG_RTF(m_t << "{\\comment startProjectNumber }\n")
+ m_t << " ";
}
void RTFGenerator::endProjectNumber()
{
- DBG_RTF(t <<"{\\comment endProjectNumber }" << endl)
+ DBG_RTF(m_t << "{\\comment endProjectNumber }\n")
}
void RTFGenerator::startIndexSection(IndexSections is)
@@ -415,19 +413,19 @@ void RTFGenerator::startIndexSection(IndexSections is)
// basic RTFstart
// get readyfor author etc
- t << "{\\info \n";
- t << "{\\title {\\comment ";
+ m_t << "{\\info \n";
+ m_t << "{\\title {\\comment ";
break;
case isTitlePageAuthor:
- t << "}\n";
- if (rtf_subject) t << "{\\subject " << rtf_subject << "}\n";
- if (rtf_comments) t << "{\\comment " << rtf_comments << "}\n";
- if (rtf_company) t << "{\\company " << rtf_company << "}\n";
- if (rtf_author) t << "{\\author " << rtf_author << "}\n";
- if (rtf_manager) t << "{\\manager " << rtf_manager << "}\n";
- if (rtf_documentType) t << "{\\category " << rtf_documentType << "}\n";
- if (rtf_keywords) t << "{\\keywords " << rtf_keywords << "}\n";
- t << "{\\comment ";
+ m_t << "}\n";
+ if (!rtf_subject.isEmpty()) m_t << "{\\subject " << rtf_subject << "}\n";
+ if (!rtf_comments.isEmpty()) m_t << "{\\comment " << rtf_comments << "}\n";
+ if (!rtf_company.isEmpty()) m_t << "{\\company " << rtf_company << "}\n";
+ if (!rtf_author.isEmpty()) m_t << "{\\author " << rtf_author << "}\n";
+ if (!rtf_manager.isEmpty()) m_t << "{\\manager " << rtf_manager << "}\n";
+ if (!rtf_documentType.isEmpty()) m_t << "{\\category " << rtf_documentType << "}\n";
+ if (!rtf_keywords.isEmpty()) m_t << "{\\keywords " << rtf_keywords << "}\n";
+ m_t << "{\\comment ";
break;
case isMainPage:
//Introduction
@@ -449,9 +447,13 @@ void RTFGenerator::startIndexSection(IndexSections is)
//Namespace Index
beginRTFChapter();
break;
+ case isConceptIndex:
+ //Concept Index
+ beginRTFChapter();
+ break;
case isClassHierarchyIndex:
//Hierarchical Index
- DBG_RTF(t << "{\\comment start classhierarchy}\n")
+ DBG_RTF(m_t << "{\\comment start classhierarchy}\n")
beginRTFChapter();
break;
case isCompoundIndex:
@@ -505,6 +507,19 @@ void RTFGenerator::startIndexSection(IndexSections is)
}
}
break;
+ case isConceptDocumentation:
+ {
+ // Concept Documentation
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ if (cd->isLinkableInProject())
+ {
+ beginRTFChapter();
+ break;
+ }
+ }
+ }
+ break;
case isClassDocumentation:
{
//Compound Documentation
@@ -561,7 +576,7 @@ void RTFGenerator::startIndexSection(IndexSections is)
break;
case isPageDocumentation2:
{
- t << "{\\tc \\v ";
+ m_t << "{\\tc \\v ";
}
break;
case isEndIndex:
@@ -579,177 +594,187 @@ void RTFGenerator::endIndexSection(IndexSections is)
switch (is)
{
case isTitlePageStart:
- if (rtf_title)
+ if (!rtf_title.isEmpty())
// User has overridden document title in extensions file
- t << "}" << rtf_title;
+ m_t << "}" << rtf_title;
else
- t << "}" << projectName;
+ m_t << "}" << projectName;
break;
case isTitlePageAuthor:
{
- t << " doxygen" << getDoxygenVersion() << ".}\n";
- t << "{\\creatim " << dateToRTFDateString() << "}\n}";
- DBG_RTF(t << "{\\comment end of infoblock}\n");
+ m_t << " doxygen" << getDoxygenVersion() << ".}\n";
+ m_t << "{\\creatim " << dateToRTFDateString() << "}\n}";
+ DBG_RTF(m_t << "{\\comment end of infoblock}\n");
// setup for this section
- t << rtf_Style_Reset <<"\n";
- t <<"\\sectd\\pgnlcrm\n";
- t <<"{\\footer "<<rtf_Style["Footer"].reference() << "{\\chpgn}}\n";
+ m_t << rtf_Style_Reset <<"\n";
+ m_t << "\\sectd\\pgnlcrm\n";
+ m_t << "{\\footer "<<rtf_Style["Footer"].reference() << "{\\chpgn}}\n";
// the title entry
- DBG_RTF(t << "{\\comment begin title page}\n")
+ DBG_RTF(m_t << "{\\comment begin title page}\n")
- t << rtf_Style_Reset << rtf_Style["SubTitle"].reference() << endl; // set to title style
+ m_t << rtf_Style_Reset << rtf_Style["SubTitle"].reference() << "\n"; // set to title style
- t << "\\vertalc\\qc\\par\\par\\par\\par\\par\\par\\par\n";
- if (rtf_logoFilename)
+ m_t << "\\vertalc\\qc\\par\\par\\par\\par\\par\\par\\par\n";
+ if (!rtf_logoFilename.isEmpty())
{
- t << "{\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << rtf_logoFilename;
- t << "\" \\\\d \\\\*MERGEFORMAT} {\\fldrslt IMAGE }}\\par\\par\n";
+ m_t << "{\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << rtf_logoFilename;
+ m_t << "\" \\\\d \\\\*MERGEFORMAT} {\\fldrslt IMAGE }}\\par\\par\n";
}
- if (rtf_company)
+ if (!rtf_company.isEmpty())
{
- t << rtf_company << "\\par\\par\n";
+ m_t << rtf_company << "\\par\\par\n";
}
- t << rtf_Style_Reset << rtf_Style["Title"].reference() << endl; // set to title style
- if (rtf_title)
+ m_t << rtf_Style_Reset << rtf_Style["Title"].reference() << "\n"; // set to title style
+ if (!rtf_title.isEmpty())
+ {
// User has overridden document title in extensions file
- t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt " << rtf_title << "}}\\par" << endl;
+ m_t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt " << rtf_title << "}}\\par\n";
+ }
else
{
DocText *root = validatingParseText(projectName);
- t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt ";
+ m_t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt ";
writeDoc(root,0,0,0);
- t << "}}\\par" << endl;
-
+ m_t << "}}\\par\n";
}
- t << rtf_Style_Reset << rtf_Style["SubTitle"].reference() << endl; // set to title style
- t << "\\par\n";
- if (rtf_documentType)
+ m_t << rtf_Style_Reset << rtf_Style["SubTitle"].reference() << "\n"; // set to title style
+ m_t << "\\par\n";
+ if (!rtf_documentType.isEmpty())
{
- t << rtf_documentType << "\\par\n";
+ m_t << rtf_documentType << "\\par\n";
}
- if (rtf_documentId)
+ if (!rtf_documentId.isEmpty())
{
- t << rtf_documentId << "\\par\n";
+ m_t << rtf_documentId << "\\par\n";
}
- t << "\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\n";
+ m_t << "\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\n";
- t << rtf_Style_Reset << rtf_Style["SubTitle"].reference() << endl; // set to subtitle style
- if (rtf_author)
- t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt "<< rtf_author << " }}\\par" << endl;
+ m_t << rtf_Style_Reset << rtf_Style["SubTitle"].reference() << "\n"; // set to subtitle style
+ if (!rtf_author.isEmpty())
+ {
+ m_t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt "<< rtf_author << " }}\\par\n";
+ }
else
- t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt AUTHOR}}\\par" << endl;
+ {
+ m_t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt AUTHOR}}\\par\n";
+ }
- t << theTranslator->trVersion() << " " << Config_getString(PROJECT_NUMBER) << "\\par";
- t << "{\\field\\fldedit {\\*\\fldinst CREATEDATE \\\\*MERGEFORMAT}"
- "{\\fldrslt "<< dateToString(FALSE) << " }}\\par"<<endl;
- t << "\\page\\page";
- DBG_RTF(t << "{\\comment End title page}" << endl)
+ m_t << theTranslator->trVersion() << " " << Config_getString(PROJECT_NUMBER) << "\\par";
+ m_t << "{\\field\\fldedit {\\*\\fldinst CREATEDATE \\\\*MERGEFORMAT}"
+ "{\\fldrslt "<< dateToString(FALSE) << " }}\\par\n";
+ m_t << "\\page\\page";
+ DBG_RTF(m_t << "{\\comment End title page}\n")
// table of contents section
- DBG_RTF(t << "{\\comment Table of contents}\n")
- t << "\\vertalt\n";
- t << rtf_Style_Reset << endl;
- t << rtf_Style["Heading1"].reference();
- t << theTranslator->trRTFTableOfContents() << "\\par"<< endl;
- t << rtf_Style_Reset << "\\par" << endl;
- t << "{\\field\\fldedit {\\*\\fldinst TOC \\\\f \\\\*MERGEFORMAT}{\\fldrslt Table of contents}}\\par\n";
- t << rtf_Style_Reset << endl;
+ DBG_RTF(m_t << "{\\comment Table of contents}\n")
+ m_t << "\\vertalt\n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << rtf_Style["Heading1"].reference();
+ m_t << theTranslator->trRTFTableOfContents() << "\\par\n";
+ m_t << rtf_Style_Reset << "\\par\n";
+ m_t << "{\\field\\fldedit {\\*\\fldinst TOC \\\\f \\\\*MERGEFORMAT}{\\fldrslt Table of contents}}\\par\n";
+ m_t << rtf_Style_Reset << "\n";
}
break;
case isMainPage:
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!mainPageHasTitle())
{
- t << "{\\tc \\v " << theTranslator->trMainPage() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trMainPage() << "}\n";
}
else
{
- t << "{\\tc \\v " << substitute(Doxygen::mainPage->title(),"%","") << "}"<< endl;
+ m_t << "{\\tc \\v " << substitute(Doxygen::mainPage->title(),"%","") << "}\n";
}
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- //if (Config_getBool(GENERATE_TREEVIEW)) t << "main"; else t << "index";
- t << "index";
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ //if (Config_getBool(GENERATE_TREEVIEW)) m_t << "main"; else m_t << "index";
+ m_t << "index";
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
//case isPackageIndex:
- // t << "\\par " << rtf_Style_Reset << endl;
- // t << "{\\tc \\v " << theTranslator->trPackageList() << "}"<< endl;
- // t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"packages.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ // m_t << "\\par " << rtf_Style_Reset << "\n";
+ // m_t << "{\\tc \\v " << theTranslator->trPackageList() << "}\n";
+ // m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"packages.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
// break;
case isModuleIndex:
- t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\tc \\v " << theTranslator->trModuleIndex() << "}"<< endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"modules.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trModuleIndex() << "}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"modules.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isDirIndex:
- t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\tc \\v " << theTranslator->trDirIndex() << "}"<< endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"dirs.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trDirIndex() << "}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"dirs.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isNamespaceIndex:
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (fortranOpt)
{
- t << "{\\tc \\v " << theTranslator->trModulesIndex() << "}" << endl;
+ m_t << "{\\tc \\v " << theTranslator->trModulesIndex() << "}\n";
}
else
{
- t << "{\\tc \\v " << theTranslator->trNamespaceIndex() << "}" << endl;
+ m_t << "{\\tc \\v " << theTranslator->trNamespaceIndex() << "}\n";
}
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"namespaces.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"namespaces.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ break;
+ case isConceptIndex:
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trConceptIndex() << "}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"concepts.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isClassHierarchyIndex:
- t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\tc \\v " << theTranslator->trHierarchicalIndex() << "}"<< endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"hierarchy.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trHierarchicalIndex() << "}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"hierarchy.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isCompoundIndex:
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (fortranOpt)
{
- t << "{\\tc \\v " << theTranslator->trCompoundIndexFortran() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trCompoundIndexFortran() << "}\n";
}
else if (vhdlOpt)
{
- t << "{\\tc \\v " << theTranslator->trDesignUnitIndex() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trDesignUnitIndex() << "}\n";
}
else
{
- t << "{\\tc \\v " << theTranslator->trCompoundIndex() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trCompoundIndex() << "}\n";
}
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"annotated.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"annotated.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isFileIndex:
- t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\tc \\v " << theTranslator->trFileIndex() << "}"<< endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"files.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trFileIndex() << "}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"files.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isPageIndex:
- t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\tc \\v " << theTranslator->trPageIndex() << "}"<< endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"pages.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trPageIndex() << "}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"pages.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
break;
case isModuleDocumentation:
{
bool first=true;
- t << "{\\tc \\v " << theTranslator->trModuleDocumentation() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trModuleDocumentation() << "}\n";
for (const auto &gd : *Doxygen::groupLinkedMap)
{
if (!gd->isReference())
{
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!first)
{
beginRTFSection();
}
first=false;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << gd->getOutputFileBase();
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << gd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
}
}
@@ -757,20 +782,20 @@ void RTFGenerator::endIndexSection(IndexSections is)
case isDirDocumentation:
{
bool first=true;
- t << "{\\tc \\v " << theTranslator->trDirDocumentation() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trDirDocumentation() << "}\n";
for (const auto &dd : *Doxygen::dirLinkedMap)
{
if (dd->isLinkableInProject())
{
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!first)
{
beginRTFSection();
}
first=false;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << dd->getOutputFileBase();
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << dd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
}
}
@@ -782,15 +807,35 @@ void RTFGenerator::endIndexSection(IndexSections is)
{
if (nd->isLinkableInProject() && !nd->isAlias())
{
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!first)
{
beginRTFSection();
}
first=false;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << nd->getOutputFileBase();
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << nd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ }
+ }
+ }
+ break;
+ case isConceptDocumentation:
+ {
+ bool first=true;
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ if (cd->isLinkableInProject() && !cd->isAlias())
+ {
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ if (!first)
+ {
+ beginRTFSection();
+ }
+ first=false;
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << cd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
}
}
@@ -800,11 +845,11 @@ void RTFGenerator::endIndexSection(IndexSections is)
bool first=true;
if (fortranOpt)
{
- t << "{\\tc \\v " << theTranslator->trTypeDocumentation() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trTypeDocumentation() << "}\n";
}
else
{
- t << "{\\tc \\v " << theTranslator->trClassDocumentation() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trClassDocumentation() << "}\n";
}
for (const auto &cd : *Doxygen::classLinkedMap)
{
@@ -814,15 +859,15 @@ void RTFGenerator::endIndexSection(IndexSections is)
!cd->isAlias()
)
{
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!first)
{
beginRTFSection();
}
first=false;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << cd->getOutputFileBase();
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << cd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
}
}
@@ -831,26 +876,26 @@ void RTFGenerator::endIndexSection(IndexSections is)
{
bool isFirst=TRUE;
- t << "{\\tc \\v " << theTranslator->trFileDocumentation() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trFileDocumentation() << "}\n";
for (const auto &fn : *Doxygen::inputNameLinkedMap)
{
for (const auto &fd : *fn)
{
if (fd->isLinkableInProject())
{
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!isFirst)
{
beginRTFSection();
}
isFirst=FALSE;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << fd->getOutputFileBase();
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << fd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
{
- t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"" << fd->getSourceFileBase() << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"" << fd->getSourceFileBase() << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
}
}
@@ -859,37 +904,37 @@ void RTFGenerator::endIndexSection(IndexSections is)
break;
case isExampleDocumentation:
{
- //t << "}\n";
+ //m_t << "}\n";
bool isFirst=true;
- t << "{\\tc \\v " << theTranslator->trExampleDocumentation() << "}"<< endl;
+ m_t << "{\\tc \\v " << theTranslator->trExampleDocumentation() << "}\n";
for (const auto &pd : *Doxygen::exampleLinkedMap)
{
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "\\par " << rtf_Style_Reset << "\n";
if (!isFirst)
{
beginRTFSection();
}
isFirst=false;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << pd->getOutputFileBase();
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << pd->getOutputFileBase();
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
}
break;
case isPageDocumentation:
{
//#error "fix me in the same way as the latex index..."
- //t << "{\\tc \\v " << theTranslator->trPageDocumentation() << "}"<< endl;
- //t << "}"<< endl;
+ //m_t << "{\\tc \\v " << theTranslator->trPageDocumentation() << "}\n";
+ //m_t << "}\n";
//bool first=TRUE;
//for (const auto *pd : Doxygen::pageLinkedMap)
//{
// if (!pd->getGroupDef() && !pd->isReference())
// {
- // if (first) t << "\\par " << rtf_Style_Reset << endl;
- // t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- // t << pd->getOutputFileBase();
- // t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ // if (first) m_t << "\\par " << rtf_Style_Reset << "\n";
+ // m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ // m_t << pd->getOutputFileBase();
+ // m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
// first=FALSE;
// }
//}
@@ -897,39 +942,39 @@ void RTFGenerator::endIndexSection(IndexSections is)
break;
case isPageDocumentation2:
{
- t << "}";
- t << "\\par " << rtf_Style_Reset << endl;
+ m_t << "}";
+ m_t << "\\par " << rtf_Style_Reset << "\n";
}
break;
case isEndIndex:
beginRTFChapter();
- t << rtf_Style["Heading1"].reference();
- t << theTranslator->trRTFGeneralIndex() << "\\par "<< endl;
- t << rtf_Style_Reset << endl;
- t << "{\\tc \\v " << theTranslator->trRTFGeneralIndex() << "}" << endl;
- t << "{\\field\\fldedit {\\*\\fldinst INDEX \\\\c2 \\\\*MERGEFORMAT}{\\fldrslt INDEX}}\n";
+ m_t << rtf_Style["Heading1"].reference();
+ m_t << theTranslator->trRTFGeneralIndex() << "\\par \n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << "{\\tc \\v " << theTranslator->trRTFGeneralIndex() << "}\n";
+ m_t << "{\\field\\fldedit {\\*\\fldinst INDEX \\\\c2 \\\\*MERGEFORMAT}{\\fldrslt INDEX}}\n";
break;
}
}
-void RTFGenerator::writePageLink(const char *name,bool first)
+void RTFGenerator::writePageLink(const QCString &name,bool first)
{
- if (first) t << "\\par " << rtf_Style_Reset << endl;
- t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
- t << name;
- t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ if (first) m_t << "\\par " << rtf_Style_Reset << "\n";
+ m_t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
+ m_t << name;
+ m_t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
void RTFGenerator::lastIndexPage()
{
- DBG_RTF(t <<"{\\comment Beginning Body of RTF Document}\n")
+ DBG_RTF(m_t << "{\\comment Beginning Body of RTF Document}\n")
// end page and setup for rest of document
- t <<"\\sect \\sbkpage \\pgndec \\pgnrestart\n";
- t <<"\\sect \\sectd \\sbknone\n";
+ m_t << "\\sect \\sbkpage \\pgndec \\pgnrestart\n";
+ m_t << "\\sect \\sectd \\sbknone\n";
// set new footer with arabic numbers
- t <<"{\\footer "<< rtf_Style["Footer"].reference() << "{\\chpgn}}\n";
+ m_t << "{\\footer "<< rtf_Style["Footer"].reference() << "{\\chpgn}}\n";
}
@@ -937,37 +982,37 @@ void RTFGenerator::writeStyleInfo(int)
{
}
-void RTFGenerator::lineBreak(const char *)
+void RTFGenerator::lineBreak(const QCString &)
{
- DBG_RTF(t << "{\\comment (lineBreak)}" << endl)
- t << "\\par" << endl;
+ DBG_RTF(m_t << "{\\comment (lineBreak)}" << "\n")
+ m_t << "\\par\n";
m_omitParagraph = TRUE;
}
-void RTFGenerator::writeString(const char *text)
+void RTFGenerator::writeString(const QCString &text)
{
- t << text;
+ m_t << text;
}
void RTFGenerator::startIndexList()
{
- DBG_RTF(t << "{\\comment (startIndexList)}" << endl)
- t << "{" << endl;
- t << "\\par" << endl;
+ DBG_RTF(m_t << "{\\comment (startIndexList)}\n")
+ m_t << "{\n";
+ m_t << "\\par\n";
incrementIndentLevel();
- t << rtf_Style_Reset << rtf_LCList_DepthStyle() << endl;
+ m_t << rtf_Style_Reset << rtf_LCList_DepthStyle() << "\n";
m_omitParagraph = TRUE;
}
void RTFGenerator::endIndexList()
{
- DBG_RTF(t << "{\\comment (endIndexList)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endIndexList)}\n")
if (!m_omitParagraph)
{
- t << "\\par";
+ m_t << "\\par";
m_omitParagraph = TRUE;
}
- t << "}";
+ m_t << "}";
decrementIndentLevel();
}
@@ -975,8 +1020,8 @@ void RTFGenerator::endIndexList()
void RTFGenerator::startItemList()
{
newParagraph();
- DBG_RTF(t << "{\\comment (startItemList level=" << m_listLevel << ") }" << endl)
- t << "{";
+ DBG_RTF(m_t << "{\\comment (startItemList level=" << m_listLevel << ") }\n")
+ m_t << "{";
incrementIndentLevel();
rtf_listItemInfo[m_listLevel].isEnum = FALSE;
}
@@ -985,8 +1030,8 @@ void RTFGenerator::startItemList()
void RTFGenerator::endItemList()
{
newParagraph();
- DBG_RTF(t << "{\\comment (endItemList level=" << m_listLevel << ")}" << endl)
- t << "}";
+ DBG_RTF(m_t << "{\\comment (endItemList level=" << m_listLevel << ")}\n")
+ m_t << "}";
decrementIndentLevel();
m_omitParagraph = TRUE;
}
@@ -994,8 +1039,8 @@ void RTFGenerator::endItemList()
///*! start enumeration list */
//void RTFGenerator::startEnumList() // starts an enumeration list
//{
-// DBG_RTF(t << "{\\comment (startEnumList)}" << endl)
-// t << "{" << endl;
+// DBG_RTF(m_t << "{\\comment (startEnumList)}\n")
+// m_t << "{\n";
// incrementIndentLevel();
// rtf_listItemInfo[m_listLevel].isEnum = TRUE;
// rtf_listItemInfo[m_listLevel].number = 1;
@@ -1005,8 +1050,8 @@ void RTFGenerator::endItemList()
//void RTFGenerator::endEnumList()
//{
// newParagraph();
-// DBG_RTF(t << "{\\comment (endEnumList)}" << endl)
-// t << "}";
+// DBG_RTF(m_t << "{\\comment (endEnumList)}\n")
+// m_t << "}";
// decrementIndentLevel();
// m_omitParagraph = TRUE;
//}
@@ -1014,70 +1059,70 @@ void RTFGenerator::endItemList()
/*! write bullet or enum item */
void RTFGenerator::startItemListItem()
{
- DBG_RTF(t << "{\\comment (startItemListItem)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startItemListItem)}\n")
newParagraph();
- t << rtf_Style_Reset;
+ m_t << rtf_Style_Reset;
if (rtf_listItemInfo[m_listLevel].isEnum)
{
- t << rtf_EList_DepthStyle() << endl;
- t << rtf_listItemInfo[m_listLevel].number << ".\\tab ";
+ m_t << rtf_EList_DepthStyle() << "\n";
+ m_t << rtf_listItemInfo[m_listLevel].number << ".\\tab ";
rtf_listItemInfo[m_listLevel].number++;
}
else
{
- t << rtf_BList_DepthStyle() << endl;
+ m_t << rtf_BList_DepthStyle() << "\n";
}
m_omitParagraph = TRUE;
}
void RTFGenerator::endItemListItem()
{
- DBG_RTF(t << "{\\comment (endItemListItem)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endItemListItem)}\n")
}
-void RTFGenerator::startIndexItem(const char *,const char *)
+void RTFGenerator::startIndexItem(const QCString &,const QCString &)
{
- DBG_RTF(t << "{\\comment (startIndexItem)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startIndexItem)}\n")
if (!m_omitParagraph)
{
- t << "\\par" << endl;
+ m_t << "\\par\n";
m_omitParagraph = TRUE;
}
}
-void RTFGenerator::endIndexItem(const char *ref,const char *fn)
+void RTFGenerator::endIndexItem(const QCString &ref,const QCString &fn)
{
- DBG_RTF(t << "{\\comment (endIndexItem)}" << endl)
- if (!ref && fn)
+ DBG_RTF(m_t << "{\\comment (endIndexItem)}\n")
+ if (ref.isEmpty() && !fn.isEmpty())
{
- t << "\\tab ";
+ m_t << "\\tab ";
writeRTFReference(fn);
- t << endl;
+ m_t << "\n";
}
else
{
- t << endl;
+ m_t << "\n";
}
m_omitParagraph = TRUE;
}
-//void RTFGenerator::writeIndexFileItem(const char *,const char *text)
+//void RTFGenerator::writeIndexFileItem(const QCString &,const QCString &text)
//{
-// t << "\\item\\contentsline{section}{";
+// m_t << "\\item\\contentsline{section}{";
// docify(text);
-// t << "}{\\pageref{" << text << "}}" << endl;
+// m_t << "}{\\pageref{" << texm_t << "}}\n";
//}
-void RTFGenerator::startHtmlLink(const char *url)
+void RTFGenerator::startHtmlLink(const QCString &url)
{
if (Config_getBool(RTF_HYPERLINKS))
{
- t << "{\\field {\\*\\fldinst { HYPERLINK \"";
- t << url;
- t << "\" }{}";
- t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
+ m_t << "{\\field {\\*\\fldinst { HYPERLINK \"";
+ m_t << url;
+ m_t << "\" }{}";
+ m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
}
else
{
@@ -1089,7 +1134,7 @@ void RTFGenerator::endHtmlLink()
{
if (Config_getBool(RTF_HYPERLINKS))
{
- t << "}}}" << endl;
+ m_t << "}}}\n";
}
else
{
@@ -1097,85 +1142,85 @@ void RTFGenerator::endHtmlLink()
}
}
-//void RTFGenerator::writeMailLink(const char *url)
+//void RTFGenerator::writeMailLink(const QCString &url)
//{
// startTypewriter();
// docify(url);
// endTypewriter();
//}
-void RTFGenerator::writeStartAnnoItem(const char *,const char *f,
- const char *path,const char *name)
+void RTFGenerator::writeStartAnnoItem(const QCString &,const QCString &f,
+ const QCString &path,const QCString &name)
{
- DBG_RTF(t << "{\\comment (writeStartAnnoItem)}" << endl)
- t << "{\\b ";
- if (path) docify(path);
- if (f && Config_getBool(RTF_HYPERLINKS))
+ DBG_RTF(m_t << "{\\comment (writeStartAnnoItem)}\n")
+ m_t << "{\\b ";
+ if (!path.isEmpty()) docify(path);
+ if (!f.isEmpty() && Config_getBool(RTF_HYPERLINKS))
{
- t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
- t << rtfFormatBmkStr(f);
- t << "\" }{}";
- t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
+ m_t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
+ m_t << rtfFormatBmkStr(f);
+ m_t << "\" }{}";
+ m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
docify(name);
- t << "}}}" << endl;
+ m_t << "}}}\n";
}
else
{
docify(name);
}
- t << "} ";
+ m_t << "} ";
}
-void RTFGenerator::writeEndAnnoItem(const char *name)
+void RTFGenerator::writeEndAnnoItem(const QCString &name)
{
- DBG_RTF(t << "{\\comment (writeEndAnnoItem)}" << endl)
- if (name)
+ DBG_RTF(m_t << "{\\comment (writeEndAnnoItem)}\n")
+ if (!name.isEmpty())
{
- t << "\\tab ";
+ m_t << "\\tab ";
writeRTFReference(name);
- t << endl;
+ m_t << "\n";
}
else
{
- t << endl;
+ m_t << "\n";
}
newParagraph();
}
void RTFGenerator::startIndexKey()
{
- DBG_RTF(t << "{\\comment (startIndexKey)}" << endl)
- t << "{\\b ";
+ DBG_RTF(m_t << "{\\comment (startIndexKey)}\n")
+ m_t << "{\\b ";
}
void RTFGenerator::endIndexKey()
{
- DBG_RTF(t << "{\\comment (endIndexKey)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endIndexKey)}\n")
}
void RTFGenerator::startIndexValue(bool hasBrief)
{
- DBG_RTF(t << "{\\comment (startIndexValue)}" << endl)
- t << " ";
- if (hasBrief) t << "(";
+ DBG_RTF(m_t << "{\\comment (startIndexValue)}\n")
+ m_t << " ";
+ if (hasBrief) m_t << "(";
}
-void RTFGenerator::endIndexValue(const char *name,bool hasBrief)
+void RTFGenerator::endIndexValue(const QCString &name,bool hasBrief)
{
- DBG_RTF(t << "{\\comment (endIndexValue)}" << endl)
- if (hasBrief) t << ")";
- t << "} ";
- if (name)
+ DBG_RTF(m_t << "{\\comment (endIndexValue)}\n")
+ if (hasBrief) m_t << ")";
+ m_t << "} ";
+ if (!name.isEmpty())
{
- t << "\\tab ";
+ m_t << "\\tab ";
writeRTFReference(name);
- t << endl;
+ m_t << "\n";
}
else
{
- t << endl;
+ m_t << "\n";
}
m_omitParagraph=FALSE;
newParagraph();
@@ -1184,128 +1229,128 @@ void RTFGenerator::endIndexValue(const char *name,bool hasBrief)
void RTFGenerator::startSubsection()
{
//beginRTFSubSection();
- t <<"\n";
- DBG_RTF(t << "{\\comment Begin SubSection}\n")
- t << rtf_Style_Reset;
- t << rtf_Style["Heading3"].reference() << "\n";
+ m_t << "\n";
+ DBG_RTF(m_t << "{\\comment Begin SubSection}\n")
+ m_t << rtf_Style_Reset;
+ m_t << rtf_Style["Heading3"].reference() << "\n";
}
void RTFGenerator::endSubsection()
{
newParagraph();
- t << rtf_Style_Reset << endl;
+ m_t << rtf_Style_Reset << "\n";
}
void RTFGenerator::startSubsubsection()
{
//beginRTFSubSubSection();
- t << "\n";
- DBG_RTF(t << "{\\comment Begin SubSubSection}\n")
- t << "{" << endl;
- t << rtf_Style_Reset << rtf_Style["Heading4"].reference() << "\n";
+ m_t << "\n";
+ DBG_RTF(m_t << "{\\comment Begin SubSubSection}\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << rtf_Style["Heading4"].reference() << "\n";
}
void RTFGenerator::endSubsubsection()
{
newParagraph();
- t << "}" << endl;
+ m_t << "}\n";
}
-//void RTFGenerator::writeClassLink(const char *,const char *,
-// const char *,const char *name)
+//void RTFGenerator::writeClassLink(const QCString &,const QCString &,
+// const QCString &,const QCString &name)
//{
-// t << "{\\bf ";
+// m_t << "{\\bf ";
// docify(name);
-// t << "}";
+// m_t << "}";
//}
//void RTFGenerator::startTable(bool,int colNumbers)
//{
-// DBG_RTF(t << "{\\comment startTable}\n";)
+// DBG_RTF(m_t << "{\\comment startTable}\n";)
// m_numCols=colNumbers;
-// t << "\\par\n";
+// m_t << "\\par\n";
//}
//
//void RTFGenerator::endTable(bool hasCaption)
//{
-// DBG_RTF(t << "{\\comment endTable}\n";)
+// DBG_RTF(m_t << "{\\comment endTable}\n";)
// if (!hasCaption)
-// t << "\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n";
-// t << "\\pard\n" << endl;
+// m_t << "\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n";
+// m_t << "\\pard\n\n";
//}
//
//void RTFGenerator::startCaption()
//{
-// DBG_RTF(t << "{\\comment startCaption}\n";)
+// DBG_RTF(m_t << "{\\comment startCaption}\n";)
// endTableRow();
-// t << "\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 \\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 \\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 \\trbrdrv\\brdrs\\brdrw10" << endl;
-// t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 \\clbrdrb\\brdrs\\brdrw10 \\clbrdrr \\brdrs\\brdrw10 \\cltxlrtb \\cellx"<<rtf_pageWidth<<"\\pard \\qc\\nowidctlpar\\widctlpar\\intbl\\adjustright " << endl;
+// m_t << "\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 \\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 \\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 \\trbrdrv\\brdrs\\brdrw10\n";
+// m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 \\clbrdrb\\brdrs\\brdrw10 \\clbrdrr \\brdrs\\brdrw10 \\cltxlrtb \\cellx"<<rtf_pageWidth<<"\\pard \\qc\\nowidctlpar\\widctlpar\\intbl\\adjustright \n";
// nextTableColumn();
//}
//
//void RTFGenerator::endCaption()
//{
-// DBG_RTF(t << "{\\comment endCaption}\n";)
+// DBG_RTF(m_t << "{\\comment endCaption}\n";)
// endTableColumn();
// endTableRow();
//}
//
//void RTFGenerator::nextTableRow()
//{
-// DBG_RTF(t << "{\\comment nextTableRow}\n";)
+// DBG_RTF(m_t << "{\\comment nextTableRow}\n";)
// ASSERT(m_numCols>0 && m_numCols<25);
// uint columnWidth=rtf_pageWidth/m_numCols;
-// t << "\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 "
+// m_t << "\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 "
// "\\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 "
// "\\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 "
-// "\\trbrdrv\\brdrs\\brdrw10 "<<endl;
+// "\\trbrdrv\\brdrs\\brdrw10 \n";
// for (int i=0;i<m_numCols;i++)
// {
-// t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 "
+// m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 "
// "\\clbrdrb\\brdrs\\brdrw10 \\clbrdrr \\brdrs\\brdrw10 \\cltxlrtb "
-// "\\cellx" << (i*columnWidth) << endl;
+// "\\cellx" << (i*columnWidth) << "\n";
// }
-// t << "\\pard \\widctlpar\\intbl\\adjustright\n{";
+// m_t << "\\pard \\widctlpar\\intbl\\adjustright\n{";
//}
//
//void RTFGenerator::endTableRow()
//{
-// DBG_RTF(t << "{\\comment endTableRow}\n";)
-// t << "\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n";
+// DBG_RTF(m_t << "{\\comment endTableRow}\n";)
+// m_t << "\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n";
//}
//
//void RTFGenerator::nextTableColumn()
//{
-// DBG_RTF(t << "{\\comment nextTableColumn}\n";)
-// t << "{ ";
+// DBG_RTF(m_t << "{\\comment nextTableColumn}\n";)
+// m_t << "{ ";
//}
//
//void RTFGenerator::endTableColumn()
//{
-// DBG_RTF(t << "{\\comment endTableColumn}\n";)
-// t << " \\cell }";
+// DBG_RTF(m_t << "{\\comment endTableColumn}\n";)
+// m_t << " \\cell }";
//}
//
-void RTFGenerator::startTextLink(const char *f,const char *anchor)
+void RTFGenerator::startTextLink(const QCString &f,const QCString &anchor)
{
if (Config_getBool(RTF_HYPERLINKS))
{
QCString ref;
- if (f)
+ if (!f.isEmpty())
{
ref+=f;
}
- if (anchor)
+ if (!anchor.isEmpty())
{
ref+='_';
ref+=anchor;
}
- t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
- t << rtfFormatBmkStr(ref);
- t << "\" }{}";
- t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
+ m_t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
+ m_t << rtfFormatBmkStr(ref);
+ m_t << "\" }{}";
+ m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
}
}
@@ -1313,34 +1358,34 @@ void RTFGenerator::endTextLink()
{
if (Config_getBool(RTF_HYPERLINKS))
{
- t << "}}}" << endl;
+ m_t << "}}}\n";
}
}
-void RTFGenerator::writeObjectLink(const char *ref, const char *f,
- const char *anchor, const char *text)
+void RTFGenerator::writeObjectLink(const QCString &ref, const QCString &f,
+ const QCString &anchor, const QCString &text)
{
- if (!ref && Config_getBool(RTF_HYPERLINKS))
+ if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
{
QCString refName;
- if (f)
+ if (!f.isEmpty())
{
refName+=f;
}
- if (anchor)
+ if (!anchor.isEmpty())
{
refName+='_';
refName+=anchor;
}
- t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
- t << rtfFormatBmkStr(refName);
- t << "\" }{}";
- t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
+ m_t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
+ m_t << rtfFormatBmkStr(refName);
+ m_t << "\" }{}";
+ m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
docify(text);
- t << "}}}" << endl;
+ m_t << "}}}\n";
}
else
{
@@ -1352,52 +1397,52 @@ void RTFGenerator::writeObjectLink(const char *ref, const char *f,
void RTFGenerator::startPageRef()
{
- t << " (";
+ m_t << " (";
startEmphasis();
}
-void RTFGenerator::endPageRef(const char *clname, const char *anchor)
+void RTFGenerator::endPageRef(const QCString &clname, const QCString &anchor)
{
QCString ref;
- if (clname)
+ if (!clname.isEmpty())
{
ref+=clname;
}
- if (anchor)
+ if (!anchor.isEmpty())
{
ref+='_';
ref+=anchor;
}
writeRTFReference(ref);
endEmphasis();
- t << ")";
+ m_t << ")";
}
-void RTFGenerator::writeCodeLink(const char *ref,const char *f,
- const char *anchor,const char *name,
- const char *)
+void RTFGenerator::writeCodeLink(const QCString &ref,const QCString &f,
+ const QCString &anchor,const QCString &name,
+ const QCString &)
{
- if (!ref && Config_getBool(RTF_HYPERLINKS))
+ if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
{
QCString refName;
- if (f)
+ if (!f.isEmpty())
{
refName+=f;
}
- if (anchor)
+ if (!anchor.isEmpty())
{
refName+='_';
refName+=anchor;
}
- t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
- t << rtfFormatBmkStr(refName);
- t << "\" }{}";
- t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
+ m_t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
+ m_t << rtfFormatBmkStr(refName);
+ m_t << "\" }{}";
+ m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
codify(name);
- t << "}}}" << endl;
+ m_t << "}}}\n";
}
else
{
@@ -1405,27 +1450,27 @@ void RTFGenerator::writeCodeLink(const char *ref,const char *f,
}
}
-void RTFGenerator::startTitleHead(const char *)
+void RTFGenerator::startTitleHead(const QCString &)
{
- DBG_RTF(t <<"{\\comment startTitleHead}" << endl)
+ DBG_RTF(m_t << "{\\comment startTitleHead}\n")
// beginRTFSection();
- t << rtf_Style_Reset << rtf_Style["Heading2"].reference() << endl;
+ m_t << rtf_Style_Reset << rtf_Style["Heading2"].reference() << "\n";
}
-void RTFGenerator::endTitleHead(const char *fileName,const char *name)
+void RTFGenerator::endTitleHead(const QCString &fileName,const QCString &name)
{
- DBG_RTF(t <<"{\\comment endTitleHead}" << endl)
- t << "\\par " << rtf_Style_Reset << endl;
- if (name)
+ DBG_RTF(m_t << "{\\comment endTitleHead}\n")
+ m_t << "\\par " << rtf_Style_Reset << "\n";
+ if (!name.isEmpty())
{
// make table of contents entry
- t << "{\\tc\\tcl2 \\v ";
+ m_t << "{\\tc\\tcl2 \\v ";
docify(name);
- t << "}" << endl;
+ m_t << "}\n";
// make an index entry
- addIndexItem(name,0);
+ addIndexItem(name,QCString());
//if (name)
//{
@@ -1434,14 +1479,14 @@ void RTFGenerator::endTitleHead(const char *fileName,const char *name)
//
//if (Config_getBool(RTF_HYPERLINKS) && fileName)
//{
- writeAnchor(fileName,0);
+ writeAnchor(fileName,QCString());
//}
}
}
void RTFGenerator::startTitle()
{
- DBG_RTF(t <<"{\\comment startTitle}" << endl)
+ DBG_RTF(m_t << "{\\comment startTitle}\n")
if (Config_getBool(COMPACT_RTF))
beginRTFSection();
else
@@ -1450,222 +1495,222 @@ void RTFGenerator::startTitle()
void RTFGenerator::startGroupHeader(int extraIndent)
{
- DBG_RTF(t <<"{\\comment startGroupHeader}" << endl)
+ DBG_RTF(m_t << "{\\comment startGroupHeader}\n")
//newParagraph();
- t << rtf_Style_Reset;
+ m_t << rtf_Style_Reset;
if (extraIndent==2)
{
- t << rtf_Style["Heading5"].reference();
+ m_t << rtf_Style["Heading5"].reference();
}
else if (extraIndent==1)
{
- t << rtf_Style["Heading4"].reference();
+ m_t << rtf_Style["Heading4"].reference();
}
else // extraIndent==0
{
- t << rtf_Style["Heading3"].reference();
+ m_t << rtf_Style["Heading3"].reference();
}
- t << endl;
+ m_t << "\n";
}
void RTFGenerator::endGroupHeader(int)
{
- DBG_RTF(t <<"{\\comment endGroupHeader}" << endl)
- t << "\\par" << endl;
- t << rtf_Style_Reset << endl;
+ DBG_RTF(m_t << "{\\comment endGroupHeader}\n")
+ m_t << "\\par\n";
+ m_t << rtf_Style_Reset << "\n";
}
-void RTFGenerator::startMemberDoc(const char *clname,
- const char *memname,
- const char *,
- const char *,
+void RTFGenerator::startMemberDoc(const QCString &clname,
+ const QCString &memname,
+ const QCString &,
+ const QCString &,
int,
int,
bool showInline)
{
- DBG_RTF(t << "{\\comment startMemberDoc}" << endl)
- if (memname && memname[0]!='@')
+ DBG_RTF(m_t << "{\\comment startMemberDoc}\n")
+ if (!memname.isEmpty() && memname[0]!='@')
{
addIndexItem(memname,clname);
addIndexItem(clname,memname);
}
- t << rtf_Style_Reset << rtf_Style[showInline ? "Heading5" : "Heading4"].reference();
+ m_t << rtf_Style_Reset << rtf_Style[showInline ? "Heading5" : "Heading4"].reference();
//styleStack.push(rtf_Style_Heading4);
- t << "{" << endl;
+ m_t << "{\n";
//printf("RTFGenerator::startMemberDoc() '%s'\n",rtf_Style["Heading4"].reference());
startBold();
- t << endl;
+ m_t << "\n";
}
void RTFGenerator::endMemberDoc(bool)
{
- DBG_RTF(t << "{\\comment endMemberDoc}" << endl)
- //const char *style = styleStack.pop();
+ DBG_RTF(m_t << "{\\comment endMemberDoc}\n")
+ //const QCString &style = styleStack.pop();
//printf("RTFGenerator::endMemberDoc() '%s'\n",style);
//ASSERT(style==rtf_Style["Heading4"].reference());
endBold();
- t << "}" << endl;
+ m_t << "}\n";
newParagraph();
}
-void RTFGenerator::startDoxyAnchor(const char *,const char *,
- const char *,const char *,
- const char *
+void RTFGenerator::startDoxyAnchor(const QCString &,const QCString &,
+ const QCString &,const QCString &,
+ const QCString &
)
{
- DBG_RTF(t << "{\\comment startDoxyAnchor}" << endl)
+ DBG_RTF(m_t << "{\\comment startDoxyAnchor}\n")
}
-void RTFGenerator::endDoxyAnchor(const char *fName,const char *anchor)
+void RTFGenerator::endDoxyAnchor(const QCString &fName,const QCString &anchor)
{
QCString ref;
- if (fName)
+ if (!fName.isEmpty())
{
ref+=fName;
}
- if (anchor)
+ if (!anchor.isEmpty())
{
ref+='_';
ref+=anchor;
}
- DBG_RTF(t << "{\\comment endDoxyAnchor}" << endl)
- t << "{\\bkmkstart ";
- t << rtfFormatBmkStr(ref);
- t << "}" << endl;
- t << "{\\bkmkend ";
- t << rtfFormatBmkStr(ref);
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment endDoxyAnchor}\n")
+ m_t << "{\\bkmkstart ";
+ m_t << rtfFormatBmkStr(ref);
+ m_t << "}\n";
+ m_t << "{\\bkmkend ";
+ m_t << rtfFormatBmkStr(ref);
+ m_t << "}\n";
}
-//void RTFGenerator::writeLatexLabel(const char *clName,const char *anchor)
+//void RTFGenerator::writeLatexLabel(const QCString &clName,const QCString &anchor)
//{
// writeDoxyAnchor(0,clName,anchor,0);
//}
-void RTFGenerator::addIndexItem(const char *s1,const char *s2)
+void RTFGenerator::addIndexItem(const QCString &s1,const QCString &s2)
{
- if (s1)
+ if (!s1.isEmpty())
{
- t << "{\\xe \\v ";
+ m_t << "{\\xe \\v ";
docify(s1);
- if (s2)
+ if (!s2.isEmpty())
{
- t << "\\:";
+ m_t << "\\:";
docify(s2);
}
- t << "}" << endl;
+ m_t << "}\n";
}
}
void RTFGenerator::startIndent()
{
incrementIndentLevel();
- DBG_RTF(t << "{\\comment (startIndent) }" << endl)
- t << "{" << endl;
- t << rtf_Style_Reset << rtf_CList_DepthStyle() << endl;
+ DBG_RTF(m_t << "{\\comment (startIndent) }\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << rtf_CList_DepthStyle() << "\n";
}
void RTFGenerator::endIndent()
{
- t << "}" << endl;
+ m_t << "}\n";
decrementIndentLevel();
}
void RTFGenerator::startDescription()
{
- DBG_RTF(t << "{\\comment (startDescription)}" << endl)
- t << "{" << endl;
- t << rtf_Style_Reset << rtf_DList_DepthStyle();
+ DBG_RTF(m_t << "{\\comment (startDescription)}" << "\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
}
void RTFGenerator::endDescription()
{
- DBG_RTF(t << "{\\comment (endDescription)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endDescription)}" << "\n")
newParagraph();
- t << "}";
+ m_t << "}";
}
void RTFGenerator::startDescItem()
{
newParagraph();
- DBG_RTF(t << "{\\comment (startDescItem)}" << endl)
- t << "{\\b ";
+ DBG_RTF(m_t << "{\\comment (startDescItem)}\n")
+ m_t << "{\\b ";
}
void RTFGenerator::endDescItem()
{
- DBG_RTF(t << "{\\comment (endDescItem)}" << endl)
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment (endDescItem)}\n")
+ m_t << "}\n";
newParagraph();
}
-void RTFGenerator::startMemberDescription(const char *,const char *,bool)
+void RTFGenerator::startMemberDescription(const QCString &,const QCString &,bool)
{
- DBG_RTF(t << "{\\comment (startMemberDescription)}" << endl)
- t << "{" << endl;
+ DBG_RTF(m_t << "{\\comment (startMemberDescription)}\n")
+ m_t << "{\n";
incrementIndentLevel();
- t << rtf_Style_Reset << rtf_CList_DepthStyle();
+ m_t << rtf_Style_Reset << rtf_CList_DepthStyle();
startEmphasis();
}
void RTFGenerator::endMemberDescription()
{
- DBG_RTF(t << "{\\comment (endMemberDescription)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endMemberDescription)}\n")
endEmphasis();
//newParagraph();
decrementIndentLevel();
- t << "\\par";
- t << "}" << endl;
+ m_t << "\\par";
+ m_t << "}\n";
m_omitParagraph = TRUE;
}
void RTFGenerator::startDescList(SectionTypes)
{
- DBG_RTF(t << "{\\comment (startDescList)}" << endl)
- t << "{"; // ends at endDescList
- t << "{"; // ends at endDescTitle
+ DBG_RTF(m_t << "{\\comment (startDescList)}\n")
+ m_t << "{"; // ends at endDescList
+ m_t << "{"; // ends at endDescTitle
startBold();
newParagraph();
}
//void RTFGenerator::endDescTitle()
//{
-// DBG_RTF(t << "{\\comment (endDescTitle) }" << endl)
+// DBG_RTF(m_t << "{\\comment (endDescTitle) }\n")
// endBold();
-// t << "}";
+// m_t << "}";
// newParagraph();
// incrementIndentLevel();
-// t << rtf_Style_Reset << rtf_DList_DepthStyle();
+// m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
//}
void RTFGenerator::startDescForItem()
{
- DBG_RTF(t << "{\\comment (startDescForItem) }" << endl)
+ DBG_RTF(m_t << "{\\comment (startDescForItem) }\n")
}
void RTFGenerator::endDescForItem()
{
- DBG_RTF(t << "{\\comment (endDescForItem) }" << endl)
+ DBG_RTF(m_t << "{\\comment (endDescForItem) }\n")
}
//void RTFGenerator::endDescList()
//{
-// DBG_RTF(t << "{\\comment (endDescList)}" << endl)
+// DBG_RTF(m_t << "{\\comment (endDescList)}\n")
// newParagraph();
// decrementIndentLevel();
// m_omitParagraph = TRUE;
-// t << "}";
+// m_t << "}";
//}
-void RTFGenerator::startSection(const char *,const char *title,SectionType type)
+void RTFGenerator::startSection(const QCString &,const QCString &title,SectionType type)
{
- DBG_RTF(t << "{\\comment (startSection)}" << endl)
- t << "{";
- t<< rtf_Style_Reset;
+ DBG_RTF(m_t << "{\\comment (startSection)}\n")
+ m_t << "{";
+ m_t << rtf_Style_Reset;
int num=4;
switch(type)
{
@@ -1679,25 +1724,25 @@ void RTFGenerator::startSection(const char *,const char *title,SectionType type)
QCString heading;
heading.sprintf("Heading%d",num);
// set style
- t << rtf_Style[heading.str()].reference();
+ m_t << rtf_Style[heading.str()].reference();
// make table of contents entry
- t << "{\\tc\\tcl" << num << " \\v ";
+ m_t << "{\\tc\\tcl" << num << " \\v ";
docify(title);
- t << "}" << endl;
+ m_t << "}\n";
}
-void RTFGenerator::endSection(const char *lab,SectionType)
+void RTFGenerator::endSection(const QCString &lab,SectionType)
{
- DBG_RTF(t << "{\\comment (endSection)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endSection)}\n")
// make bookmark
m_omitParagraph=FALSE;
newParagraph();
- writeAnchor(0,lab);
- t << "}";
+ writeAnchor(QCString(),lab);
+ m_t << "}";
}
-//void RTFGenerator::writeSectionRef(const char *ref,const char *,
-// const char *lab,const char *title)
+//void RTFGenerator::writeSectionRef(const QCString &ref,const QCString &,
+// const QCString &lab,const QCString &title)
//{
// if (ref)
// {
@@ -1708,24 +1753,24 @@ void RTFGenerator::endSection(const char *lab,SectionType)
// startBold();
// docify(title);
// endBold();
-// t << " (";
+// m_t << " (";
// docify(theTranslator->trPageAbbreviation());
// writeRTFReference(lab);
-// t << ")" << endl;
+// m_t << ")\n";
// }
//}
//
-//void RTFGenerator::writeSectionRefItem(const char *,const char *lab,
-// const char *title)
+//void RTFGenerator::writeSectionRefItem(const QCString &,const QCString &lab,
+// const QCString &title)
//{
// docify(title);
-// t << "\\tab";
+// m_t << "\\tab";
// writeRTFReference(lab);
-// t << endl;
+// m_t << "\n";
//}
//
-//void RTFGenerator::writeSectionRefAnchor(const char *name,const char *lab,
-// const char *title)
+//void RTFGenerator::writeSectionRefAnchor(const QCString &name,const QCString &lab,
+// const QCString &title)
//{
// writeSectionRef(name,lab,title);
//}
@@ -1738,11 +1783,11 @@ void RTFGenerator::endSection(const char *lab,SectionType)
// return s;
//}
-void RTFGenerator::docify(const char *str)
+void RTFGenerator::docify(const QCString &str)
{
- if (str)
+ if (!str.isEmpty())
{
- const unsigned char *p=(const unsigned char *)str;
+ const unsigned char *p=(const unsigned char *)str.data();
unsigned char c;
//unsigned char pc='\0';
while (*p)
@@ -1753,28 +1798,28 @@ void RTFGenerator::docify(const char *str)
#if 0
if ( MultiByte )
{
- t << getMultiByte( c );
+ m_t << getMultiByte( c );
MultiByte = FALSE;
continue;
}
if ( c >= 0x80 )
{
MultiByte = TRUE;
- t << getMultiByte( c );
+ m_t << getMultiByte( c );
continue;
}
#endif
switch (c)
{
- case '{': t << "\\{"; break;
- case '}': t << "\\}"; break;
- case '\\': t << "\\\\"; break;
+ case '{': m_t << "\\{"; break;
+ case '}': m_t << "\\}"; break;
+ case '\\': m_t << "\\\\"; break;
default:
{
// see if we can insert an hyphenation hint
- //if (isupper(c) && islower(pc) && !insideTabbing) t << "\\-";
- t << (char)c;
+ //if (isupper(c) && islower(pc) && !insideTabbing) m_t << "\\-";
+ m_t << (char)c;
}
}
//pc = c;
@@ -1783,14 +1828,14 @@ void RTFGenerator::docify(const char *str)
}
}
-void RTFGenerator::codify(const char *str)
+void RTFGenerator::codify(const QCString &str)
{
// note that RTF does not have a "verbatim", so "\n" means
// nothing... add a "newParagraph()";
//static char spaces[]=" ";
- if (str)
+ if (!str.isEmpty())
{
- const unsigned char *p=(const unsigned char *)str;
+ const unsigned char *p=(const unsigned char *)str.data();
unsigned char c;
int spacesToNextTabStop;
@@ -1803,16 +1848,16 @@ void RTFGenerator::codify(const char *str)
switch(c)
{
case '\t': spacesToNextTabStop = Config_getInt(TAB_SIZE) - (m_col%Config_getInt(TAB_SIZE));
- t << Doxygen::spaces.left(spacesToNextTabStop);
+ m_t << Doxygen::spaces.left(spacesToNextTabStop);
m_col+=spacesToNextTabStop;
break;
case '\n': newParagraph();
- t << '\n'; m_col=0;
+ m_t << '\n'; m_col=0;
break;
- case '{': t << "\\{"; m_col++; break;
- case '}': t << "\\}"; m_col++; break;
- case '\\': t << "\\\\"; m_col++; break;
- default: p=(const unsigned char *)writeUtf8Char(t,(const char *)p-1); m_col++; break;
+ case '{': m_t << "\\{"; m_col++; break;
+ case '}': m_t << "\\}"; m_col++; break;
+ case '\\': m_t << "\\\\"; m_col++; break;
+ default: p=(const unsigned char *)writeUTF8Char(m_t,(const char *)p-1); m_col++; break;
}
}
}
@@ -1828,123 +1873,123 @@ void RTFGenerator::writeChar(char c)
void RTFGenerator::startClassDiagram()
{
- DBG_RTF(t <<"{\\comment startClassDiagram }" << endl)
+ DBG_RTF(m_t << "{\\comment startClassDiagram }\n")
}
void RTFGenerator::endClassDiagram(const ClassDiagram &d,
- const char *fileName,const char *)
+ const QCString &fileName,const QCString &)
{
newParagraph();
// create a png file
- d.writeImage(t,dir(),m_relPath,fileName,FALSE);
+ d.writeImage(m_t,dir(),m_relPath,fileName,FALSE);
// display the file
- t << "{" << endl;
- t << rtf_Style_Reset << endl;
- t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
- t << fileName << ".png\"";
- t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
- t << "}" << endl;
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
+ m_t << fileName << ".png\"";
+ m_t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+ m_t << "}\n";
}
-//void RTFGenerator::writeFormula(const char *,const char *text)
+//void RTFGenerator::writeFormula(const QCString &,const QCString &text)
//{
-// t << text;
+// m_t << text;
//}
-void RTFGenerator::startMemberItem(const char *,int,const char *)
+void RTFGenerator::startMemberItem(const QCString &,int,const QCString &)
{
- DBG_RTF(t <<"{\\comment startMemberItem }" << endl)
- t << rtf_Style_Reset << rtf_BList_DepthStyle() << endl; // set style to appropriate depth
+ DBG_RTF(m_t << "{\\comment startMemberItem }\n")
+ m_t << rtf_Style_Reset << rtf_BList_DepthStyle() << "\n"; // set style to appropriate depth
}
void RTFGenerator::endMemberItem()
{
- DBG_RTF(t <<"{\\comment endMemberItem }" << endl)
+ DBG_RTF(m_t << "{\\comment endMemberItem }\n")
newParagraph();
}
-void RTFGenerator::writeAnchor(const char *fileName,const char *name)
+void RTFGenerator::writeAnchor(const QCString &fileName,const QCString &name)
{
QCString anchor;
- if (fileName)
+ if (!fileName.isEmpty())
{
anchor+=fileName;
}
- if (fileName && name)
+ if (!fileName.isEmpty() && !name.isEmpty())
{
anchor+='_';
}
- if (name)
+ if (!name.isEmpty())
{
anchor+=name;
}
- DBG_RTF(t <<"{\\comment writeAnchor (" << anchor << ")}" << endl)
- t << "{\\bkmkstart " << rtfFormatBmkStr(anchor) << "}" << endl;
- t << "{\\bkmkend " << rtfFormatBmkStr(anchor) << "}" << endl;
+ DBG_RTF(m_t << "{\\comment writeAnchor (" << anchor << ")}\n")
+ m_t << "{\\bkmkstart " << rtfFormatBmkStr(anchor) << "}\n";
+ m_t << "{\\bkmkend " << rtfFormatBmkStr(anchor) << "}\n";
}
-void RTFGenerator::writeRTFReference(const char *label)
+void RTFGenerator::writeRTFReference(const QCString &label)
{
- t << "{\\field\\fldedit {\\*\\fldinst PAGEREF ";
- t << rtfFormatBmkStr(label);
- t << " \\\\*MERGEFORMAT}{\\fldrslt pagenum}}";
+ m_t << "{\\field\\fldedit {\\*\\fldinst PAGEREF ";
+ m_t << rtfFormatBmkStr(label);
+ m_t << " \\\\*MERGEFORMAT}{\\fldrslt pagenum}}";
}
-void RTFGenerator::startCodeFragment(const char *)
+void RTFGenerator::startCodeFragment(const QCString &)
{
- DBG_RTF(t << "{\\comment (startCodeFragment) }" << endl)
- t << "{" << endl;
- t << rtf_Style_Reset << rtf_Code_DepthStyle();
+ DBG_RTF(m_t << "{\\comment (startCodeFragment) }\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << rtf_Code_DepthStyle();
}
-void RTFGenerator::endCodeFragment(const char *)
+void RTFGenerator::endCodeFragment(const QCString &)
{
endCodeLine();
- DBG_RTF(t << "{\\comment (endCodeFragment) }" << endl)
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment (endCodeFragment) }\n")
+ m_t << "}\n";
m_omitParagraph = TRUE;
}
void RTFGenerator::writeNonBreakableSpace(int)
{
- t << "\\~ ";
+ m_t << "\\~ ";
}
void RTFGenerator::startMemberList()
{
- t << endl;
- DBG_RTF(t << "{\\comment (startMemberList) }" << endl)
- t << "{" << endl;
+ m_t << "\n";
+ DBG_RTF(m_t << "{\\comment (startMemberList) }\n")
+ m_t << "{\n";
#ifdef DELETEDCODE
if (!insideTabbing)
- t << "\\begin{CompactItemize}" << endl;
+ m_t << "\\begin{CompactItemize}\n";
#endif
}
void RTFGenerator::endMemberList()
{
- DBG_RTF(t << "{\\comment (endMemberList) }" << endl)
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment (endMemberList) }\n")
+ m_t << "}\n";
#ifdef DELETEDCODE
if (!insideTabbing)
- t << "\\end{CompactItemize}" << endl;
+ m_t << "\\end{CompactItemize}\n";
#endif
}
-//void RTFGenerator::startImage(const char *name,const char *,bool)
+//void RTFGenerator::startImage(const QCString &name,const QCString &,bool)
//{
// newParagraph();
-// t << "{" << endl;
-// t << rtf_Style_Reset << endl;
-// t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";
-// t << name;
-// t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
-// t << "}" << endl;
+// m_t << "{\n";
+// m_t << rtf_Style_Reset << "\n";
+// m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";
+// m_t << name;
+// m_t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+// m_t << "}\n";
//}
//
//void RTFGenerator::endImage(bool)
@@ -1952,7 +1997,7 @@ void RTFGenerator::endMemberList()
// // not yet implemented
//}
//
-//void RTFGenerator::startDotFile(const char *name,bool)
+//void RTFGenerator::startDotFile(const QCString &name,bool)
//{
// QCString baseName=name;
// int i;
@@ -1963,12 +2008,12 @@ void RTFGenerator::endMemberList()
// QCString outDir = Config_getString(RTF_OUTPUT);
// writeDotGraphFromFile(name,outDir,baseName,BITMAP);
// newParagraph();
-// t << "{" << endl;
-// t << rtf_Style_Reset << endl;
-// t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";
-// t << outDir << "\\" << baseName;
-// t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
-// t << "}" << endl;
+// m_t << "{\n";
+// m_t << rtf_Style_Reset << "\n";
+// m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";
+// m_t << outDir << "\\" << baseName;
+// m_t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+// m_t << "}\n";
//}
//
//void RTFGenerator::endDotFile(bool)
@@ -1976,38 +2021,38 @@ void RTFGenerator::endMemberList()
// // not yet implemented
//}
//
-void RTFGenerator::startDescTable(const char *title)
+void RTFGenerator::startDescTable(const QCString &title)
{
- DBG_RTF(t << "{\\comment (startDescTable) }" << endl)
- t << "{\\par" << endl;
- t << "{" << rtf_Style["Heading5"].reference() << endl;
+ DBG_RTF(m_t << "{\\comment (startDescTable) }\n")
+ m_t << "{\\par\n";
+ m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
docify(title);
- t << ":\\par}" << endl;
- t << rtf_Style_Reset << rtf_DList_DepthStyle();
- t << "\\trowd \\trgaph108\\trleft426\\tblind426"
+ m_t << ":\\par}\n";
+ m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
+ m_t << "\\trowd \\trgaph108\\trleft426\\tblind426"
"\\trbrdrt\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrl\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrb\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 "
- "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< endl;
+ "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 \n";
int i,columnPos[2] = { 25, 100 };
for (i=0;i<2;i++)
{
- t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
+ m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrb\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrr \\brdrs\\brdrw10\\brdrcf15 "
"\\cltxlrtb "
- "\\cellx" << (rtf_pageWidth*columnPos[i]/100) << endl;
+ "\\cellx" << (rtf_pageWidth*columnPos[i]/100) << "\n";
}
- t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
+ m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
}
void RTFGenerator::endDescTable()
{
- DBG_RTF(t << "{\\comment (endDescTable)}" << endl)
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment (endDescTable)}\n")
+ m_t << "}\n";
}
void RTFGenerator::startDescTableRow()
@@ -2020,26 +2065,26 @@ void RTFGenerator::endDescTableRow()
void RTFGenerator::startDescTableTitle()
{
- DBG_RTF(t << "{\\comment (startDescTableTitle) }" << endl)
- t << "{\\qr ";
+ DBG_RTF(m_t << "{\\comment (startDescTableTitle) }\n")
+ m_t << "{\\qr ";
}
void RTFGenerator::endDescTableTitle()
{
- DBG_RTF(t << "{\\comment (endDescTableTitle) }" << endl)
- t << "\\cell }";
+ DBG_RTF(m_t << "{\\comment (endDescTableTitle) }\n")
+ m_t << "\\cell }";
}
void RTFGenerator::startDescTableData()
{
- DBG_RTF(t << "{\\comment (startDescTableData) }" << endl)
- t << "{";
+ DBG_RTF(m_t << "{\\comment (startDescTableData) }\n")
+ m_t << "{";
}
void RTFGenerator::endDescTableData()
{
- DBG_RTF(t << "{\\comment (endDescTableData) }" << endl)
- t << "\\cell }{\\row }" << endl;
+ DBG_RTF(m_t << "{\\comment (endDescTableData) }\n")
+ m_t << "\\cell }{\\row }\n";
}
// a style for list formatted as a "bulleted list"
@@ -2065,40 +2110,40 @@ void RTFGenerator::decrementIndentLevel()
}
// a style for list formatted with "list continue" style
-const char * RTFGenerator::rtf_CList_DepthStyle()
+QCString RTFGenerator::rtf_CList_DepthStyle()
{
QCString n=makeIndexName("ListContinue",m_listLevel);
return rtf_Style[n.str()].reference();
}
// a style for list formatted as a "latext style" table of contents
-const char * RTFGenerator::rtf_LCList_DepthStyle()
+QCString RTFGenerator::rtf_LCList_DepthStyle()
{
QCString n=makeIndexName("LatexTOC",m_listLevel);
return rtf_Style[n.str()].reference();
}
// a style for list formatted as a "bullet" style
-const char * RTFGenerator::rtf_BList_DepthStyle()
+QCString RTFGenerator::rtf_BList_DepthStyle()
{
QCString n=makeIndexName("ListBullet",m_listLevel);
return rtf_Style[n.str()].reference();
}
// a style for list formatted as a "enumeration" style
-const char * RTFGenerator::rtf_EList_DepthStyle()
+QCString RTFGenerator::rtf_EList_DepthStyle()
{
QCString n=makeIndexName("ListEnum",m_listLevel);
return rtf_Style[n.str()].reference();
}
-const char * RTFGenerator::rtf_DList_DepthStyle()
+QCString RTFGenerator::rtf_DList_DepthStyle()
{
QCString n=makeIndexName("DescContinue",m_listLevel);
return rtf_Style[n.str()].reference();
}
-const char * RTFGenerator::rtf_Code_DepthStyle()
+QCString RTFGenerator::rtf_Code_DepthStyle()
{
QCString n=makeIndexName("CodeExample",m_listLevel);
return rtf_Style[n.str()].reference();
@@ -2106,24 +2151,24 @@ const char * RTFGenerator::rtf_Code_DepthStyle()
void RTFGenerator::startTextBlock(bool dense)
{
- DBG_RTF(t << "{\\comment startTextBlock}" << endl)
- t << "{" << endl;
- t << rtf_Style_Reset;
+ DBG_RTF(m_t << "{\\comment startTextBlock}\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset;
if (dense) // no spacing between "paragraphs"
{
- t << rtf_Style["DenseText"].reference();
+ m_t << rtf_Style["DenseText"].reference();
}
else // some spacing
{
- t << rtf_Style["BodyText"].reference();
+ m_t << rtf_Style["BodyText"].reference();
}
}
void RTFGenerator::endTextBlock(bool /*paraBreak*/)
{
newParagraph();
- DBG_RTF(t << "{\\comment endTextBlock}" << endl)
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment endTextBlock}\n")
+ m_t << "}\n";
//m_omitParagraph = TRUE;
}
@@ -2131,58 +2176,58 @@ void RTFGenerator::newParagraph()
{
if (!m_omitParagraph)
{
- DBG_RTF(t << "{\\comment (newParagraph)}" << endl)
- t << "\\par" << endl;
+ DBG_RTF(m_t << "{\\comment (newParagraph)}\n")
+ m_t << "\\par\n";
}
m_omitParagraph = FALSE;
}
-void RTFGenerator::startParagraph(const char *txt)
+void RTFGenerator::startParagraph(const QCString &txt)
{
- DBG_RTF(t << "{\\comment startParagraph}" << endl)
+ DBG_RTF(m_t << "{\\comment startParagraph}\n")
newParagraph();
- t << "{" << endl;
- if (QCString(txt) == "reference") t << "\\ql" << endl;
+ m_t << "{\n";
+ if (QCString(txt) == "reference") m_t << "\\ql\n";
}
void RTFGenerator::endParagraph()
{
- DBG_RTF(t << "{\\comment endParagraph}" << endl)
- t << "}\\par" << endl;
+ DBG_RTF(m_t << "{\\comment endParagraph}\n")
+ m_t << "}\\par\n";
m_omitParagraph = TRUE;
}
void RTFGenerator::startMemberSubtitle()
{
- DBG_RTF(t << "{\\comment startMemberSubtitle}" << endl)
- t << "{" << endl;
- t << rtf_Style_Reset << rtf_CList_DepthStyle() << endl;
+ DBG_RTF(m_t << "{\\comment startMemberSubtitle}\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << rtf_CList_DepthStyle() << "\n";
}
void RTFGenerator::endMemberSubtitle()
{
- DBG_RTF(t << "{\\comment endMemberSubtitle}" << endl)
+ DBG_RTF(m_t << "{\\comment endMemberSubtitle}\n")
newParagraph();
- t << "}" << endl;
+ m_t << "}\n";
}
//void RTFGenerator::writeUmlaut(char c)
//{
// switch(c)
// {
-// case 'A' : t << '\304'; break;
-// case 'E' : t << '\313'; break;
-// case 'I' : t << '\317'; break;
-// case 'O' : t << '\326'; break;
-// case 'U' : t << '\334'; break;
-// case 'Y' : t << 'Y'; break;
-// case 'a' : t << '\344'; break;
-// case 'e' : t << '\353'; break;
-// case 'i' : t << '\357'; break;
-// case 'o' : t << '\366'; break;
-// case 'u' : t << '\374'; break;
-// case 'y' : t << '\377'; break;
-// default: t << '?'; break;
+// case 'A' : m_t << '\304'; break;
+// case 'E' : m_t << '\313'; break;
+// case 'I' : m_t << '\317'; break;
+// case 'O' : m_t << '\326'; break;
+// case 'U' : m_t << '\334'; break;
+// case 'Y' : m_t << 'Y'; break;
+// case 'a' : m_t << '\344'; break;
+// case 'e' : m_t << '\353'; break;
+// case 'i' : m_t << '\357'; break;
+// case 'o' : m_t << '\366'; break;
+// case 'u' : m_t << '\374'; break;
+// case 'y' : m_t << '\377'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2190,19 +2235,19 @@ void RTFGenerator::endMemberSubtitle()
//{
// switch(c)
// {
-// case 'A' : t << '\301'; break;
-// case 'E' : t << '\311'; break;
-// case 'I' : t << '\315'; break;
-// case 'O' : t << '\323'; break;
-// case 'U' : t << '\332'; break;
-// case 'Y' : t << '\335'; break;
-// case 'a' : t << '\341'; break;
-// case 'e' : t << '\351'; break;
-// case 'i' : t << '\355'; break;
-// case 'o' : t << '\363'; break;
-// case 'u' : t << '\372'; break;
-// case 'y' : t << '\375'; break;
-// default: t << '?'; break;
+// case 'A' : m_t << '\301'; break;
+// case 'E' : m_t << '\311'; break;
+// case 'I' : m_t << '\315'; break;
+// case 'O' : m_t << '\323'; break;
+// case 'U' : m_t << '\332'; break;
+// case 'Y' : m_t << '\335'; break;
+// case 'a' : m_t << '\341'; break;
+// case 'e' : m_t << '\351'; break;
+// case 'i' : m_t << '\355'; break;
+// case 'o' : m_t << '\363'; break;
+// case 'u' : m_t << '\372'; break;
+// case 'y' : m_t << '\375'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2210,17 +2255,17 @@ void RTFGenerator::endMemberSubtitle()
//{
// switch(c)
// {
-// case 'A' : t << '\300'; break;
-// case 'E' : t << '\310'; break;
-// case 'I' : t << '\314'; break;
-// case 'O' : t << '\322'; break;
-// case 'U' : t << '\331'; break;
-// case 'a' : t << '\340'; break;
-// case 'e' : t << '\350'; break;
-// case 'i' : t << '\354'; break;
-// case 'o' : t << '\362'; break;
-// case 'u' : t << '\371'; break;
-// default: t << '?'; break;
+// case 'A' : m_t << '\300'; break;
+// case 'E' : m_t << '\310'; break;
+// case 'I' : m_t << '\314'; break;
+// case 'O' : m_t << '\322'; break;
+// case 'U' : m_t << '\331'; break;
+// case 'a' : m_t << '\340'; break;
+// case 'e' : m_t << '\350'; break;
+// case 'i' : m_t << '\354'; break;
+// case 'o' : m_t << '\362'; break;
+// case 'u' : m_t << '\371'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2228,17 +2273,17 @@ void RTFGenerator::endMemberSubtitle()
//{
// switch(c)
// {
-// case 'A' : t << '\302'; break;
-// case 'E' : t << '\312'; break;
-// case 'I' : t << '\316'; break;
-// case 'O' : t << '\324'; break;
-// case 'U' : t << '\333'; break;
-// case 'a' : t << '\342'; break;
-// case 'e' : t << '\352'; break;
-// case 'i' : t << '\356'; break;
-// case 'o' : t << '\364'; break;
-// case 'u' : t << '\373'; break;
-// default: t << '?'; break;
+// case 'A' : m_t << '\302'; break;
+// case 'E' : m_t << '\312'; break;
+// case 'I' : m_t << '\316'; break;
+// case 'O' : m_t << '\324'; break;
+// case 'U' : m_t << '\333'; break;
+// case 'a' : m_t << '\342'; break;
+// case 'e' : m_t << '\352'; break;
+// case 'i' : m_t << '\356'; break;
+// case 'o' : m_t << '\364'; break;
+// case 'u' : m_t << '\373'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2246,13 +2291,13 @@ void RTFGenerator::endMemberSubtitle()
//{
// switch(c)
// {
-// case 'A' : t << '\303'; break;
-// case 'N' : t << '\321'; break;
-// case 'O' : t << '\325'; break;
-// case 'a' : t << '\343'; break;
-// case 'n' : t << '\361'; break;
-// case 'o' : t << '\365'; break;
-// default: t << '?'; break;
+// case 'A' : m_t << '\303'; break;
+// case 'N' : m_t << '\321'; break;
+// case 'O' : m_t << '\325'; break;
+// case 'a' : m_t << '\343'; break;
+// case 'n' : m_t << '\361'; break;
+// case 'o' : m_t << '\365'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2260,9 +2305,9 @@ void RTFGenerator::endMemberSubtitle()
//{
// switch(c)
// {
-// case 'A' : t << '\305'; break;
-// case 'a' : t << '\345'; break;
-// default: t << '?'; break;
+// case 'A' : m_t << '\305'; break;
+// case 'a' : m_t << '\345'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2270,9 +2315,9 @@ void RTFGenerator::endMemberSubtitle()
//{
// switch(c)
// {
-// case 'C' : t << '\307'; break;
-// case 'c' : t << '\347'; break;
-// default: t << '?'; break;
+// case 'C' : m_t << '\307'; break;
+// case 'c' : m_t << '\347'; break;
+// default: m_t << '?'; break;
// }
//}
//
@@ -2309,25 +2354,25 @@ bool isLeadBytes(int c)
// note: function is not reentrant!
-static void encodeForOutput(FTextStream &t,const char *s)
+static void encodeForOutput(TextStream &t,const QCString &s)
{
if (s==0) return;
QCString encoding;
bool converted=FALSE;
- int l = qstrlen(s);
- static QByteArray enc;
+ int l = (int)s.length();
+ static std::vector<char> enc;
if (l*4>(int)enc.size()) enc.resize(l*4); // worst case
- encoding.sprintf("CP%s",theTranslator->trRTFansicp().data());
+ encoding.sprintf("CP%s",qPrint(theTranslator->trRTFansicp()));
if (!encoding.isEmpty())
{
// convert from UTF-8 back to the output encoding
- void *cd = portable_iconv_open(encoding,"UTF-8");
+ void *cd = portable_iconv_open(encoding.data(),"UTF-8");
if (cd!=(void *)(-1))
{
size_t iLeft=l;
size_t oLeft=enc.size();
- char *inputPtr = (char*)s;
- char *outputPtr = enc.data();
+ char *inputPtr = (char*)s.data();
+ char *outputPtr = &enc[0];
if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft))
{
enc.resize(enc.size()-(unsigned int)oLeft);
@@ -2338,7 +2383,7 @@ static void encodeForOutput(FTextStream &t,const char *s)
}
if (!converted) // if we did not convert anything, copy as is.
{
- memcpy(enc.data(),s,l);
+ memcpy(enc.data(),s.data(),l);
enc.resize(l);
}
uint i;
@@ -2374,13 +2419,13 @@ static void encodeForOutput(FTextStream &t,const char *s)
* VERY brittle routine inline RTF's included by other RTF's.
* it is recursive and ugly.
*/
-static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncludeHeader=TRUE)
+static bool preProcessFile(Dir &d,const QCString &infName, TextStream &t, bool bIncludeHeader=TRUE)
{
- QFile f(infName);
- if (!f.open(IO_ReadOnly))
+ std::ifstream f(infName.str(),std::ifstream::in);
+ if (!f.is_open())
{
err("problems opening rtf file %s for reading\n",infName.data());
- return FALSE;
+ return false;
}
const int maxLineLength = 10240;
@@ -2390,67 +2435,59 @@ static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncl
// this is EXTREEEEEEEMLY brittle. It works on OUR rtf
// files because the first line before the body
// ALWAYS contains "{\comment begin body}"
- int len;
- for(;;)
+ std::string line;
+ while (getline(f,line))
{
- lineBuf.resize(maxLineLength);
- if ((len=f.readLine(lineBuf.rawData(),maxLineLength))==-1)
- {
- err("read error in %s before end of RTF header!\n",infName.data());
- return FALSE;
- }
- lineBuf.resize(len+1);
- if (lineBuf.find("\\comment begin body")!=-1) break;
- if (bIncludeHeader) encodeForOutput(t,lineBuf.data());
+ line+='\n';
+ if (line.find("\\comment begin body")!=std::string::npos) break;
+ if (bIncludeHeader) encodeForOutput(t,line.c_str());
}
-
- lineBuf.resize(maxLineLength);
- while ((len=f.readLine(lineBuf.rawData(),maxLineLength))!=-1)
+ std::string prevLine;
+ bool first=true;
+ while (getline(f,line))
{
- lineBuf.resize(len+1);
- int pos;
- if ((pos=lineBuf.find("INCLUDETEXT"))!=-1)
+ line+='\n';
+ size_t pos;
+ if ((pos=prevLine.find("INCLUDETEXT"))!=std::string::npos)
{
- int startNamePos = lineBuf.find('"',pos)+1;
- int endNamePos = lineBuf.find('"',startNamePos);
- QCString fileName = lineBuf.mid(startNamePos,endNamePos-startNamePos);
- DBG_RTF(t << "{\\comment begin include " << fileName << "}" << endl)
- if (!preProcessFile(d,fileName,t,FALSE)) return FALSE;
- DBG_RTF(t << "{\\comment end include " << fileName << "}" << endl)
+ size_t startNamePos = prevLine.find('"',pos)+1;
+ size_t endNamePos = prevLine.find('"',startNamePos);
+ std::string fileName = prevLine.substr(startNamePos,endNamePos-startNamePos);
+ DBG_RTF(m_t << "{\\comment begin include " << fileName << "}\n")
+ if (!preProcessFile(d,fileName.c_str(),t,FALSE)) return FALSE;
+ DBG_RTF(m_t << "{\\comment end include " << fileName << "}\n")
}
- else // no INCLUDETEXT on this line
+ else if (!first) // no INCLUDETEXT on this line
{
- // elaborate hoopla to skip the final "}" if we didn't include the
- // headers
- if (!f.atEnd() || bIncludeHeader)
- {
- encodeForOutput(t,lineBuf);
- }
- else // last line of included file
- {
- // null terminate at the last '}'
- //char *str = strrchr(buffer,'}');
- pos = lineBuf.findRev('}');
-
- if (pos != -1)
- lineBuf.at(pos) = '\0';
- else
- err("Strange, the last char was not a '}'\n");
- encodeForOutput(t,lineBuf);
- }
+ encodeForOutput(t,prevLine.c_str());
}
- lineBuf.resize(maxLineLength);
+ prevLine = line;
+ first=false;
+ }
+ if (!bIncludeHeader) // skip final '}' in case we don't include headers
+ {
+ size_t pos = line.rfind('}');
+ if (pos==std::string::npos)
+ {
+ err("Strange, the last char was not a '}'\n");
+ pos = line.length();
+ }
+ encodeForOutput(t,line.substr(0,pos).c_str());
+ }
+ else
+ {
+ encodeForOutput(t,line.c_str());
}
f.close();
// remove temporary file
- d.remove(infName);
+ d.remove(infName.str());
return TRUE;
}
void RTFGenerator::startDotGraph()
{
- DBG_RTF(t << "{\\comment (startDotGraph)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startDotGraph)}\n")
}
void RTFGenerator::endDotGraph(DotClassGraph &g)
@@ -2458,40 +2495,40 @@ void RTFGenerator::endDotGraph(DotClassGraph &g)
newParagraph();
QCString fn =
- g.writeGraph(t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,TRUE,FALSE);
+ g.writeGraph(m_t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,TRUE,FALSE);
// display the file
- t << "{" << endl;
- t << rtf_Style_Reset << endl;
- t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
QCString imgExt = getDotImageExtension();
- t << fn << "." << imgExt;
- t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
- t << "}" << endl;
+ m_t << fn << "." << imgExt;
+ m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+ m_t << "}\n";
newParagraph();
- DBG_RTF(t << "{\\comment (endDotGraph)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endDotGraph)}\n")
}
void RTFGenerator::startInclDepGraph()
{
- DBG_RTF(t << "{\\comment (startInclDepGraph)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startInclDepGraph)}\n")
}
void RTFGenerator::endInclDepGraph(DotInclDepGraph &g)
{
newParagraph();
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
+ QCString fn = g.writeGraph(m_t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
// display the file
- t << "{" << endl;
- t << rtf_Style_Reset << endl;
- t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
QCString imgExt = getDotImageExtension();
- t << fn << "." << imgExt;
- t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
- t << "}" << endl;
- DBG_RTF(t << "{\\comment (endInclDepGraph)}" << endl)
+ m_t << fn << "." << imgExt;
+ m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+ m_t << "}\n";
+ DBG_RTF(m_t << "{\\comment (endInclDepGraph)}\n")
}
void RTFGenerator::startGroupCollaboration()
@@ -2504,64 +2541,64 @@ void RTFGenerator::endGroupCollaboration(DotGroupCollaboration &)
void RTFGenerator::startCallGraph()
{
- DBG_RTF(t << "{\\comment (startCallGraph)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startCallGraph)}\n")
}
void RTFGenerator::endCallGraph(DotCallGraph &g)
{
newParagraph();
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
+ QCString fn = g.writeGraph(m_t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
// display the file
- t << "{" << endl;
- t << rtf_Style_Reset << endl;
- t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
QCString imgExt = getDotImageExtension();
- t << fn << "." << imgExt;
- t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
- t << "}" << endl;
- DBG_RTF(t << "{\\comment (endCallGraph)}" << endl)
+ m_t << fn << "." << imgExt;
+ m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+ m_t << "}\n";
+ DBG_RTF(m_t << "{\\comment (endCallGraph)}\n")
}
void RTFGenerator::startDirDepGraph()
{
- DBG_RTF(t << "{\\comment (startDirDepGraph)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startDirDepGraph)}\n")
}
void RTFGenerator::endDirDepGraph(DotDirDeps &g)
{
newParagraph();
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
+ QCString fn = g.writeGraph(m_t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
// display the file
- t << "{" << endl;
- t << rtf_Style_Reset << endl;
- t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << "\n";
+ m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
QCString imgExt = getDotImageExtension();
- t << fn << "." << imgExt;
- t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
- t << "}" << endl;
- DBG_RTF(t << "{\\comment (endDirDepGraph)}" << endl)
+ m_t << fn << "." << imgExt;
+ m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par\n";
+ m_t << "}\n";
+ DBG_RTF(m_t << "{\\comment (endDirDepGraph)}\n")
}
/** Tests the integrity of the result by counting brackets.
*
*/
-void testRTFOutput(const char *name)
+void testRTFOutput(const QCString &name)
{
int bcount=0;
int line=1;
int c;
- QFile f(name);
- if (f.open(IO_ReadOnly))
+ std::ifstream f(name.data(),std::ifstream::in);
+ if (f.is_open())
{
- while ((c=f.getch())!=-1)
+ while ((c=f.get())!=-1)
{
if (c=='\\') // escape char
{
- c=f.getch();
+ c=f.get();
if (c==-1) break;
}
else if (c=='{') // open bracket
@@ -2587,178 +2624,184 @@ void testRTFOutput(const char *name)
err:
err("RTF integrity test failed at line %d of %s due to a bracket mismatch.\n"
" Please try to create a small code example that produces this error \n"
- " and send that to doxygen@gmail.com.\n",line,name);
+ " and send that to doxygen@gmail.com.\n",line,qPrint(name));
}
/**
* This is an API to a VERY brittle RTF preprocessor that combines nested
* RTF files. This version replaces the infile with the new file
*/
-bool RTFGenerator::preProcessFileInplace(const char *path,const char *name)
+bool RTFGenerator::preProcessFileInplace(const QCString &path,const QCString &name)
{
- QDir d(path);
+ Dir d(path.str());
// store the original directory
if (!d.exists())
{
- err("Output dir %s does not exist!\n",path);
+ err("Output dir %s does not exist!\n",qPrint(path));
return FALSE;
}
- QCString oldDir = QDir::currentDirPath().utf8();
+ std::string oldDir = Dir::currentDirPath();
// go to the html output directory (i.e. path)
- QDir::setCurrent(d.absPath());
- QDir thisDir;
+ Dir::setCurrent(d.absPath());
+ Dir thisDir;
- QCString combinedName = (QCString)path+"/combined.rtf";
- QCString mainRTFName = (QCString)path+"/"+name;
+ QCString combinedName = path+"/combined.rtf";
+ QCString mainRTFName = path+"/"+name;
- QFile outf(combinedName);
- if (!outf.open(IO_WriteOnly))
+ std::ofstream f(combinedName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
err("Failed to open %s for writing!\n",combinedName.data());
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return FALSE;
}
- FTextStream outt(&outf);
+ TextStream outt(&f);
if (!preProcessFile(thisDir,mainRTFName,outt))
{
// it failed, remove the temp file
- outf.close();
- thisDir.remove(combinedName);
- QDir::setCurrent(oldDir);
+ outt.flush();
+ f.close();
+ thisDir.remove(combinedName.str());
+ Dir::setCurrent(oldDir);
return FALSE;
}
// everything worked, move the files
- outf.close();
- thisDir.remove(mainRTFName);
- thisDir.rename(combinedName,mainRTFName);
+ outt.flush();
+ f.close();
+ thisDir.remove(mainRTFName.str());
+ thisDir.rename(combinedName.str(),mainRTFName.str());
testRTFOutput(mainRTFName);
- QDir::setCurrent(oldDir);
+ Dir::setCurrent(oldDir);
return TRUE;
}
void RTFGenerator::startMemberGroupHeader(bool hasHeader)
{
- DBG_RTF(t << "{\\comment startMemberGroupHeader}" << endl)
- t << "{" << endl;
+ DBG_RTF(m_t << "{\\comment startMemberGroupHeader}\n")
+ m_t << "{\n";
if (hasHeader) incrementIndentLevel();
- t << rtf_Style_Reset << rtf_Style["GroupHeader"].reference();
+ m_t << rtf_Style_Reset << rtf_Style["GroupHeader"].reference();
}
void RTFGenerator::endMemberGroupHeader()
{
- DBG_RTF(t << "{\\comment endMemberGroupHeader}" << endl)
+ DBG_RTF(m_t << "{\\comment endMemberGroupHeader}\n")
newParagraph();
- t << rtf_Style_Reset << rtf_CList_DepthStyle();
+ m_t << rtf_Style_Reset << rtf_CList_DepthStyle();
}
void RTFGenerator::startMemberGroupDocs()
{
- DBG_RTF(t << "{\\comment startMemberGroupDocs}" << endl)
+ DBG_RTF(m_t << "{\\comment startMemberGroupDocs}\n")
startEmphasis();
}
void RTFGenerator::endMemberGroupDocs()
{
- DBG_RTF(t << "{\\comment endMemberGroupDocs}" << endl)
+ DBG_RTF(m_t << "{\\comment endMemberGroupDocs}\n")
endEmphasis();
newParagraph();
}
void RTFGenerator::startMemberGroup()
{
- DBG_RTF(t << "{\\comment startMemberGroup}" << endl)
- t << rtf_Style_Reset << rtf_BList_DepthStyle() << endl;
+ DBG_RTF(m_t << "{\\comment startMemberGroup}\n")
+ m_t << rtf_Style_Reset << rtf_BList_DepthStyle() << "\n";
}
void RTFGenerator::endMemberGroup(bool hasHeader)
{
- DBG_RTF(t << "{\\comment endMemberGroup}" << endl)
+ DBG_RTF(m_t << "{\\comment endMemberGroup}\n")
if (hasHeader) decrementIndentLevel();
- t << "}";
+ m_t << "}";
}
void RTFGenerator::startExamples()
{
- DBG_RTF(t << "{\\comment (startExamples)}" << endl)
- t << "{"; // ends at endDescList
- t << "{"; // ends at endDescTitle
+ DBG_RTF(m_t << "{\\comment (startExamples)}\n")
+ m_t << "{"; // ends at endDescList
+ m_t << "{"; // ends at endDescTitle
startBold();
newParagraph();
docify(theTranslator->trExamples());
endBold();
- t << "}";
+ m_t << "}";
newParagraph();
incrementIndentLevel();
- t << rtf_Style_Reset << rtf_DList_DepthStyle();
+ m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
}
void RTFGenerator::endExamples()
{
- DBG_RTF(t << "{\\comment (endExamples)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endExamples)}\n")
m_omitParagraph = FALSE;
newParagraph();
decrementIndentLevel();
m_omitParagraph = TRUE;
- t << "}";
+ m_t << "}";
}
-void RTFGenerator::startParamList(ParamListTypes,const char *title)
+void RTFGenerator::startParamList(ParamListTypes,const QCString &title)
{
- DBG_RTF(t << "{\\comment (startParamList)}" << endl)
- t << "{"; // ends at endParamList
- t << "{"; // ends at endDescTitle
+ DBG_RTF(m_t << "{\\comment (startParamList)}\n")
+ m_t << "{"; // ends at endParamList
+ m_t << "{"; // ends at endDescTitle
startBold();
newParagraph();
docify(title);
endBold();
- t << "}";
+ m_t << "}";
newParagraph();
incrementIndentLevel();
- t << rtf_Style_Reset << rtf_DList_DepthStyle();
+ m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
}
void RTFGenerator::endParamList()
{
- DBG_RTF(t << "{\\comment (endParamList)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endParamList)}\n")
newParagraph();
decrementIndentLevel();
m_omitParagraph = TRUE;
- t << "}";
+ m_t << "}";
}
-void RTFGenerator::startParameterType(bool first,const char *key)
+void RTFGenerator::startParameterType(bool first,const QCString &key)
{
- DBG_RTF(t << "{\\comment (startParameterType)}" << endl)
- if (!first && key)
+ DBG_RTF(m_t << "{\\comment (startParameterType)}\n")
+ if (!first && !key.isEmpty())
{
- t << " " << key << " ";
+ m_t << " " << key << " ";
}
}
void RTFGenerator::endParameterType()
{
- DBG_RTF(t << "{\\comment (endParameterType)}" << endl)
- t << " ";
+ DBG_RTF(m_t << "{\\comment (endParameterType)}\n")
+ m_t << " ";
}
-void RTFGenerator::exceptionEntry(const char* prefix,bool closeBracket)
+void RTFGenerator::exceptionEntry(const QCString &prefix,bool closeBracket)
{
- DBG_RTF(t << "{\\comment (exceptionEntry)}" << endl)
- if (prefix)
- t << " " << prefix << "(";
+ DBG_RTF(m_t << "{\\comment (exceptionEntry)}\n")
+ if (!prefix.isEmpty())
+ {
+ m_t << " " << prefix << "(";
+ }
else if (closeBracket)
- t << ")";
- t << " ";
+ {
+ m_t << ")";
+ }
+ m_t << " ";
}
void RTFGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *,int)
{
- RTFDocVisitor *visitor = new RTFDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""));
+ RTFDocVisitor *visitor = new RTFDocVisitor(m_t,*this,ctx?ctx->getDefFileExtension():QCString(""));
n->accept(visitor);
delete visitor;
m_omitParagraph = TRUE;
@@ -2766,26 +2809,26 @@ void RTFGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *,i
void RTFGenerator::rtfwriteRuler_doubleline()
{
- DBG_RTF(t << "{\\comment (rtfwriteRuler_doubleline)}" << endl)
- t << "{\\pard\\widctlpar\\brdrb\\brdrdb\\brdrw15\\brsp20 \\adjustright \\par}" << endl;
+ DBG_RTF(m_t << "{\\comment (rtfwriteRuler_doubleline)}\n")
+ m_t << "{\\pard\\widctlpar\\brdrb\\brdrdb\\brdrw15\\brsp20 \\adjustright \\par}\n";
}
void RTFGenerator::rtfwriteRuler_emboss()
{
- DBG_RTF(t << "{\\comment (rtfwriteRuler_emboss)}" << endl)
- t << "{\\pard\\widctlpar\\brdrb\\brdremboss\\brdrw15\\brsp20 \\adjustright \\par}" << endl;
+ DBG_RTF(m_t << "{\\comment (rtfwriteRuler_emboss)}\n")
+ m_t << "{\\pard\\widctlpar\\brdrb\\brdremboss\\brdrw15\\brsp20 \\adjustright \\par}\n";
}
void RTFGenerator::rtfwriteRuler_thick()
{
- DBG_RTF(t << "{\\comment (rtfwriteRuler_thick)}" << endl)
- t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw75\\brsp20 \\adjustright \\par}" << endl;
+ DBG_RTF(m_t << "{\\comment (rtfwriteRuler_thick)}\n")
+ m_t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw75\\brsp20 \\adjustright \\par}\n";
}
void RTFGenerator::rtfwriteRuler_thin()
{
- DBG_RTF(t << "{\\comment (rtfwriteRuler_thin)}" << endl)
- t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}" << endl;
+ DBG_RTF(m_t << "{\\comment (rtfwriteRuler_thin)}\n")
+ m_t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}\n";
}
#if 0
@@ -2819,116 +2862,116 @@ void RTFGenerator::postProcess(QByteArray &a)
}
#endif
-void RTFGenerator::startConstraintList(const char *header)
+void RTFGenerator::startConstraintList(const QCString &header)
{
- DBG_RTF(t << "{\\comment (startConstraintList)}" << endl)
- t << "{"; // ends at endConstraintList
- t << "{";
+ DBG_RTF(m_t << "{\\comment (startConstraintList)}\n")
+ m_t << "{"; // ends at endConstraintList
+ m_t << "{";
startBold();
newParagraph();
docify(header);
endBold();
- t << "}";
+ m_t << "}";
newParagraph();
incrementIndentLevel();
- t << rtf_Style_Reset << rtf_DList_DepthStyle();
+ m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
}
void RTFGenerator::startConstraintParam()
{
- DBG_RTF(t << "{\\comment (startConstraintParam)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startConstraintParam)}\n")
startEmphasis();
}
void RTFGenerator::endConstraintParam()
{
- DBG_RTF(t << "{\\comment (endConstraintParam)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endConstraintParam)}\n")
endEmphasis();
- t << " : ";
+ m_t << " : ";
}
void RTFGenerator::startConstraintType()
{
- DBG_RTF(t << "{\\comment (startConstraintType)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startConstraintType)}\n")
startEmphasis();
}
void RTFGenerator::endConstraintType()
{
- DBG_RTF(t << "{\\comment (endConstraintType)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endConstraintType)}\n")
endEmphasis();
- t << " ";
+ m_t << " ";
}
void RTFGenerator::startConstraintDocs()
{
- DBG_RTF(t << "{\\comment (startConstraintDocs)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startConstraintDocs)}\n")
}
void RTFGenerator::endConstraintDocs()
{
- DBG_RTF(t << "{\\comment (endConstraintDocs)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endConstraintDocs)}\n")
newParagraph();
}
void RTFGenerator::endConstraintList()
{
- DBG_RTF(t << "{\\comment (endConstraintList)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endConstraintList)}\n")
newParagraph();
decrementIndentLevel();
m_omitParagraph = TRUE;
- t << "}";
+ m_t << "}";
}
void RTFGenerator::startIndexListItem()
{
- DBG_RTF(t << "{\\comment (startIndexListItem)}" << endl)
+ DBG_RTF(m_t << "{\\comment (startIndexListItem)}\n")
}
void RTFGenerator::endIndexListItem()
{
- DBG_RTF(t << "{\\comment (endIndexListItem)}" << endl)
- t << "\\par" << endl;
+ DBG_RTF(m_t << "{\\comment (endIndexListItem)}\n")
+ m_t << "\\par\n";
}
void RTFGenerator::startInlineHeader()
{
- DBG_RTF(t << "{\\comment (startInlineHeader)}" << endl)
- t << "{" << endl;
- t << rtf_Style_Reset << rtf_Style["Heading5"].reference();
+ DBG_RTF(m_t << "{\\comment (startInlineHeader)}\n")
+ m_t << "{\n";
+ m_t << rtf_Style_Reset << rtf_Style["Heading5"].reference();
startBold();
}
void RTFGenerator::endInlineHeader()
{
- DBG_RTF(t << "{\\comment (endInlineHeader)}" << endl)
+ DBG_RTF(m_t << "{\\comment (endInlineHeader)}\n")
endBold();
- t << "\\par";
- t << "}" << endl;
+ m_t << "\\par";
+ m_t << "}\n";
}
void RTFGenerator::startMemberDocSimple(bool isEnum)
{
- DBG_RTF(t << "{\\comment (startMemberDocSimple)}" << endl)
- t << "{\\par" << endl;
- t << "{" << rtf_Style["Heading5"].reference() << endl;
+ DBG_RTF(m_t << "{\\comment (startMemberDocSimple)}\n")
+ m_t << "{\\par\n";
+ m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
if (isEnum)
{
- t << theTranslator->trEnumerationValues();
+ m_t << theTranslator->trEnumerationValues();
}
else
{
- t << theTranslator->trCompoundMembers();
+ m_t << theTranslator->trCompoundMembers();
}
- t << ":\\par}" << endl;
- t << rtf_Style_Reset << rtf_DList_DepthStyle();
- t << "\\trowd \\trgaph108\\trleft426\\tblind426"
+ m_t << ":\\par}\n";
+ m_t << rtf_Style_Reset << rtf_DList_DepthStyle();
+ m_t << "\\trowd \\trgaph108\\trleft426\\tblind426"
"\\trbrdrt\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrl\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrb\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 "
"\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 "
- "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< endl;
+ "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 \n";
int i,n=3,columnPos[3] = { 25, 50, 100 };
if (isEnum)
{
@@ -2938,59 +2981,59 @@ void RTFGenerator::startMemberDocSimple(bool isEnum)
}
for (i=0;i<n;i++)
{
- t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
+ m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrb\\brdrs\\brdrw10\\brdrcf15 "
"\\clbrdrr \\brdrs\\brdrw10\\brdrcf15 "
"\\cltxlrtb "
- "\\cellx" << (rtf_pageWidth*columnPos[i]/100) << endl;
+ "\\cellx" << (rtf_pageWidth*columnPos[i]/100) << "\n";
}
- t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
+ m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
}
void RTFGenerator::endMemberDocSimple(bool)
{
- DBG_RTF(t << "{\\comment (endMemberDocSimple)}" << endl)
- t << "}" << endl;
+ DBG_RTF(m_t << "{\\comment (endMemberDocSimple)}\n")
+ m_t << "}\n";
}
void RTFGenerator::startInlineMemberType()
{
- DBG_RTF(t << "{\\comment (startInlineMemberType)}" << endl)
- t << "{\\qr ";
+ DBG_RTF(m_t << "{\\comment (startInlineMemberType)}\n")
+ m_t << "{\\qr ";
}
void RTFGenerator::endInlineMemberType()
{
- DBG_RTF(t << "{\\comment (endInlineMemberType)}" << endl)
- t << "\\cell }";
+ DBG_RTF(m_t << "{\\comment (endInlineMemberType)}\n")
+ m_t << "\\cell }";
}
void RTFGenerator::startInlineMemberName()
{
- DBG_RTF(t << "{\\comment (startInlineMemberName)}" << endl)
- t << "{";
+ DBG_RTF(m_t << "{\\comment (startInlineMemberName)}\n")
+ m_t << "{";
}
void RTFGenerator::endInlineMemberName()
{
- DBG_RTF(t << "{\\comment (endInlineMemberName)}" << endl)
- t << "\\cell }";
+ DBG_RTF(m_t << "{\\comment (endInlineMemberName)}\n")
+ m_t << "\\cell }";
}
void RTFGenerator::startInlineMemberDoc()
{
- DBG_RTF(t << "{\\comment (startInlineMemberDoc)}" << endl)
- t << "{";
+ DBG_RTF(m_t << "{\\comment (startInlineMemberDoc)}\n")
+ m_t << "{";
}
void RTFGenerator::endInlineMemberDoc()
{
- DBG_RTF(t << "{\\comment (endInlineMemberDoc)}" << endl)
- t << "\\cell }{\\row }" << endl;
+ DBG_RTF(m_t << "{\\comment (endInlineMemberDoc)}\n")
+ m_t << "\\cell }{\\row }\n";
}
-void RTFGenerator::writeLineNumber(const char *ref,const char *fileName,const char *anchor,int l)
+void RTFGenerator::writeLineNumber(const QCString &ref,const QCString &fileName,const QCString &anchor,int l)
{
bool rtfHyperlinks = Config_getBool(RTF_HYPERLINKS);
@@ -2999,23 +3042,23 @@ void RTFGenerator::writeLineNumber(const char *ref,const char *fileName,const ch
lineNumber.sprintf("%05d",l);
if (m_prettyCode)
{
- if (fileName && !m_sourceFileName.isEmpty() && rtfHyperlinks)
+ if (!fileName.isEmpty() && !m_sourceFileName.isEmpty() && rtfHyperlinks)
{
QCString lineAnchor;
lineAnchor.sprintf("_l%05d",l);
lineAnchor.prepend(stripExtensionGeneral(m_sourceFileName, ".rtf"));
- t << "{\\bkmkstart ";
- t << rtfFormatBmkStr(lineAnchor);
- t << "}";
- t << "{\\bkmkend ";
- t << rtfFormatBmkStr(lineAnchor);
- t << "}" << endl;
+ m_t << "{\\bkmkstart ";
+ m_t << rtfFormatBmkStr(lineAnchor);
+ m_t << "}";
+ m_t << "{\\bkmkend ";
+ m_t << rtfFormatBmkStr(lineAnchor);
+ m_t << "}\n";
}
- t << lineNumber << " ";
+ m_t << lineNumber << " ";
}
else
{
- t << l << " ";
+ m_t << l << " ";
}
m_col=0;
}
@@ -3034,17 +3077,17 @@ void RTFGenerator::startLabels()
{
}
-void RTFGenerator::writeLabel(const char *l,bool isLast)
+void RTFGenerator::writeLabel(const QCString &l,bool isLast)
{
- t << "{\\f2 [" << l << "]}";
- if (!isLast) t << ", ";
+ m_t << "{\\f2 [" << l << "]}";
+ if (!isLast) m_t << ", ";
}
void RTFGenerator::endLabels()
{
}
-void RTFGenerator::startFontClass(const char *name)
+void RTFGenerator::startFontClass(const QCString &name)
{
int cod = 2;
QCString qname(name);
@@ -3059,10 +3102,10 @@ void RTFGenerator::startFontClass(const char *name)
else if (qname == "vhdlchar") cod = 25;
else if (qname == "vhdlkeyword") cod = 26;
else if (qname == "vhdllogic") cod = 27;
- t << "{\\cf" << cod << " ";
+ m_t << "{\\cf" << cod << " ";
}
void RTFGenerator::endFontClass()
{
- t << "}";
+ m_t << "}";
}
diff --git a/src/rtfgen.h b/src/rtfgen.h
index 0aebd15..c9a069e 100644
--- a/src/rtfgen.h
+++ b/src/rtfgen.h
@@ -21,8 +21,6 @@
#include "config.h"
#include "outputgen.h"
-class QFile;
-
/** Generator for RTF output. */
class RTFGenerator : public OutputGenerator
{
@@ -34,8 +32,8 @@ class RTFGenerator : public OutputGenerator
virtual std::unique_ptr<OutputGenerator> clone() const;
static void init();
- static void writeStyleSheetFile(QFile &f);
- static void writeExtensionsFile(QFile &file);
+ static void writeStyleSheetFile(TextStream &t);
+ static void writeExtensionsFile(TextStream &t);
OutputType type() const { return RTF; }
void setRelativePath(const QCString &path);
@@ -43,28 +41,28 @@ class RTFGenerator : public OutputGenerator
void writeDoc(DocNode *,const Definition *,const MemberDef *,int);
- void startFile(const char *name,const char *manName,const char *title,int id);
+ void startFile(const QCString &name,const QCString &manName,const QCString &title,int id);
void writeSearchInfo() {}
- void writeFooter(const char *) {}
+ void writeFooter(const QCString &) {}
void endFile();
void clearBuffer();
//void postProcess(QByteArray &);
void startIndexSection(IndexSections);
void endIndexSection(IndexSections);
- void writePageLink(const char *,bool);
+ void writePageLink(const QCString &,bool);
void startProjectNumber();
void endProjectNumber();
void writeStyleInfo(int part);
- void startTitleHead(const char *);
+ void startTitleHead(const QCString &);
void startTitle();
- void endTitleHead(const char *,const char *name);
+ void endTitleHead(const QCString &,const QCString &name);
void endTitle() {}
void newParagraph();
- void startParagraph(const char *classDef);
+ void startParagraph(const QCString &classDef);
void endParagraph();
- void writeString(const char *text);
+ void writeString(const QCString &text);
void startIndexListItem();
void endIndexListItem();
void startIndexList();
@@ -72,27 +70,27 @@ class RTFGenerator : public OutputGenerator
void startIndexKey();
void endIndexKey();
void startIndexValue(bool);
- void endIndexValue(const char *,bool);
+ void endIndexValue(const QCString &,bool);
void startItemList();
void endItemList();
- void startIndexItem(const char *ref,const char *file);
- void endIndexItem(const char *ref,const char *file);
- void docify(const char *text);
- void codify(const char *text);
- void writeObjectLink(const char *ref,const char *file,
- const char *anchor,const char *name);
- void writeCodeLink(const char *ref, const char *file,
- const char *anchor,const char *name,
- const char *tooltip);
- void writeTooltip(const char *, const DocLinkInfo &, const char *,
- const char *, const SourceLinkInfo &, const SourceLinkInfo &
+ void startIndexItem(const QCString &ref,const QCString &file);
+ void endIndexItem(const QCString &ref,const QCString &file);
+ void docify(const QCString &text);
+ void codify(const QCString &text);
+ void writeObjectLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name);
+ void writeCodeLink(const QCString &ref, const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip);
+ void writeTooltip(const QCString &, const DocLinkInfo &, const QCString &,
+ const QCString &, const SourceLinkInfo &, const SourceLinkInfo &
) {}
- void startTextLink(const char *f,const char *anchor);
+ void startTextLink(const QCString &f,const QCString &anchor);
void endTextLink();
- void startHtmlLink(const char *url);
+ void startHtmlLink(const QCString &url);
void endHtmlLink();
- void startTypewriter() { t << "{\\f2 "; }
- void endTypewriter() { t << "}"; }
+ void startTypewriter() { m_t << "{\\f2 "; }
+ void endTypewriter() { m_t << "}"; }
void startGroupHeader(int);
void endGroupHeader(int);
//void writeListItem();
@@ -103,7 +101,7 @@ class RTFGenerator : public OutputGenerator
void endMemberSections() {}
void startHeaderSection() {}
void endHeaderSection() {}
- void startMemberHeader(const char *,int) { startGroupHeader(FALSE); }
+ void startMemberHeader(const QCString &,int) { startGroupHeader(FALSE); }
void endMemberHeader() { endGroupHeader(FALSE); }
void startMemberSubtitle();
void endMemberSubtitle();
@@ -115,84 +113,86 @@ class RTFGenerator : public OutputGenerator
void endInlineHeader();
void startAnonTypeScope(int) {}
void endAnonTypeScope(int) {}
- void startMemberItem(const char *,int,const char *);
+ void startMemberItem(const QCString &,int,const QCString &);
void endMemberItem();
void startMemberTemplateParams() {}
- void endMemberTemplateParams(const char *,const char *) {}
+ void endMemberTemplateParams(const QCString &,const QCString &) {}
+ void startCompoundTemplateParams() { startSubsubsection(); }
+ void endCompoundTemplateParams() { endSubsubsection(); }
void insertMemberAlign(bool) {}
void insertMemberAlignLeft(int,bool){}
void writeRuler() { rtfwriteRuler_thin(); }
- void writeAnchor(const char *fileName,const char *name);
- void startCodeFragment(const char *style);
- void endCodeFragment(const char *style);
- void writeLineNumber(const char *,const char *,const char *,int l);
+ void writeAnchor(const QCString &fileName,const QCString &name);
+ void startCodeFragment(const QCString &style);
+ void endCodeFragment(const QCString &style);
+ void writeLineNumber(const QCString &,const QCString &,const QCString &,int l);
void startCodeLine(bool);
void endCodeLine();
- void startEmphasis() { t << "{\\i "; }
- void endEmphasis() { t << "}"; }
- void startBold() { t << "{\\b "; }
- void endBold() { t << "}"; }
+ void startEmphasis() { m_t << "{\\i "; }
+ void endEmphasis() { m_t << "}"; }
+ void startBold() { m_t << "{\\b "; }
+ void endBold() { m_t << "}"; }
void startDescription();
void endDescription();
void startDescItem();
void endDescItem();
- void lineBreak(const char *style=0);
- void startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool);
+ void lineBreak(const QCString &style=QCString());
+ void startMemberDoc(const QCString &,const QCString &,const QCString &,const QCString &,int,int,bool);
void endMemberDoc(bool);
- void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *);
- void endDoxyAnchor(const char *,const char *);
+ void startDoxyAnchor(const QCString &,const QCString &,const QCString &,const QCString &,const QCString &);
+ void endDoxyAnchor(const QCString &,const QCString &);
void writeChar(char c);
- void writeLatexSpacing() {};//{ t << "\\hspace{0.3cm}"; }
- void writeStartAnnoItem(const char *type,const char *file,
- const char *path,const char *name);
- void writeEndAnnoItem(const char *name);
+ void writeLatexSpacing() {};//{ m_t << "\\hspace{0.3cm}"; }
+ void writeStartAnnoItem(const QCString &type,const QCString &file,
+ const QCString &path,const QCString &name);
+ void writeEndAnnoItem(const QCString &name);
void startSubsection();
void endSubsection();
void startSubsubsection();
void endSubsubsection();
- void startCenter() { t << "{\\qc" << endl; }
- void endCenter() { t << "}"; }
- void startSmall() { t << "{\\sub "; }
- void endSmall() { t << "}"; }
+ void startCenter() { m_t << "{\\qc\n"; }
+ void endCenter() { m_t << "}"; }
+ void startSmall() { m_t << "{\\sub "; }
+ void endSmall() { m_t << "}"; }
- void startMemberDescription(const char *,const char *,bool);
+ void startMemberDescription(const QCString &,const QCString &,bool);
void endMemberDescription();
void startMemberDeclaration() {}
- void endMemberDeclaration(const char *,const char *) {}
- void writeInheritedSectionTitle(const char *,const char *,const char *,
- const char *,const char *,const char *) {}
+ void endMemberDeclaration(const QCString &,const QCString &) {}
+ void writeInheritedSectionTitle(const QCString &,const QCString &,const QCString &,
+ const QCString &,const QCString &,const QCString &) {}
void startDescList(SectionTypes);
void startExamples();
void endExamples();
- void startParamList(ParamListTypes,const char *);
+ void startParamList(ParamListTypes,const QCString &);
void endParamList();
//void writeDescItem();
void startDescForItem();
void endDescForItem();
- void startSection(const char *,const char *,SectionType);
- void endSection(const char *,SectionType);
- void addIndexItem(const char *,const char *);
+ void startSection(const QCString &,const QCString &,SectionType);
+ void endSection(const QCString &,SectionType);
+ void addIndexItem(const QCString &,const QCString &);
void startIndent();
void endIndent();
void writeSynopsis() {}
void startClassDiagram();
- void endClassDiagram(const ClassDiagram &,const char *filename,const char *name);
+ void endClassDiagram(const ClassDiagram &,const QCString &filename,const QCString &name);
void startPageRef();
- void endPageRef(const char *,const char *);
+ void endPageRef(const QCString &,const QCString &);
void startQuickIndices() {}
void endQuickIndices() {}
- void writeSplitBar(const char *) {}
- void writeNavigationPath(const char *) {}
+ void writeSplitBar(const QCString &) {}
+ void writeNavigationPath(const QCString &) {}
void writeLogo() {}
- void writeQuickLinks(bool,HighlightedItem,const char *) {}
- void writeSummaryLink(const char *,const char *,const char *,bool) {}
+ void writeQuickLinks(bool,HighlightedItem,const QCString &) {}
+ void writeSummaryLink(const QCString &,const QCString &,const QCString &,bool) {}
void startContents() {}
void endContents() {}
void writeNonBreakableSpace(int);
- void startDescTable(const char *title);
+ void startDescTable(const QCString &title);
void endDescTable();
void startDescTableRow();
void endDescTableRow();
@@ -228,15 +228,15 @@ class RTFGenerator : public OutputGenerator
void endMemberDocPrefixItem() {}
void startMemberDocName(bool) {}
void endMemberDocName() {}
- void startParameterType(bool,const char *);
+ void startParameterType(bool,const QCString &);
void endParameterType();
void startParameterName(bool) {}
void endParameterName(bool,bool,bool) {}
void startParameterList(bool) {}
void endParameterList() {}
- void exceptionEntry(const char*,bool);
+ void exceptionEntry(const QCString &,bool);
- void startConstraintList(const char *);
+ void startConstraintList(const QCString &);
void startConstraintParam();
void endConstraintParam();
void startConstraintType();
@@ -255,25 +255,25 @@ class RTFGenerator : public OutputGenerator
void endInlineMemberDoc();
void startLabels();
- void writeLabel(const char *l,bool isLast);
+ void writeLabel(const QCString &l,bool isLast);
void endLabels();
- void startFontClass(const char *);
+ void startFontClass(const QCString &);
void endFontClass();
- void writeCodeAnchor(const char *) {}
- void setCurrentDoc(const Definition *,const char *,bool) {}
- void addWord(const char *,bool) {}
+ void writeCodeAnchor(const QCString &) {}
+ void setCurrentDoc(const Definition *,const QCString &,bool) {}
+ void addWord(const QCString &,bool) {}
- static bool preProcessFileInplace(const char *path,const char *name);
+ static bool preProcessFileInplace(const QCString &path,const QCString &name);
private:
- const char *rtf_BList_DepthStyle();
- const char *rtf_CList_DepthStyle();
- const char *rtf_EList_DepthStyle();
- const char *rtf_LCList_DepthStyle();
- const char *rtf_DList_DepthStyle();
- const char *rtf_Code_DepthStyle();
+ QCString rtf_BList_DepthStyle();
+ QCString rtf_CList_DepthStyle();
+ QCString rtf_EList_DepthStyle();
+ QCString rtf_LCList_DepthStyle();
+ QCString rtf_DList_DepthStyle();
+ QCString rtf_Code_DepthStyle();
void incrementIndentLevel();
void decrementIndentLevel();
void beginRTFDocument();
@@ -283,7 +283,7 @@ class RTFGenerator : public OutputGenerator
void rtfwriteRuler_emboss();
void rtfwriteRuler_thick();
void rtfwriteRuler_thin();
- void writeRTFReference(const char *label);
+ void writeRTFReference(const QCString &label);
QCString m_sourceFileName;
int m_col = 0;
diff --git a/src/rtfstyle.cpp b/src/rtfstyle.cpp
index d279eab..07bc3dd 100644
--- a/src/rtfstyle.cpp
+++ b/src/rtfstyle.cpp
@@ -272,15 +272,15 @@ bool StyleData::setStyle(const std::string &command, const std::string &styleNam
}
-void loadStylesheet(const char *name, StyleDataMap& map)
+void loadStylesheet(const QCString &name, StyleDataMap& map)
{
- std::ifstream file(name);
+ std::ifstream file(name.str());
if (!file.is_open())
{
- err("Can't open RTF style sheet file %s. Using defaults.",name);
+ err("Can't open RTF style sheet file %s. Using defaults.",qPrint(name));
return;
}
- msg("Loading RTF style sheet %s...\n",name);
+ msg("Loading RTF style sheet %s...\n",qPrint(name));
uint lineNr=1;
@@ -314,15 +314,15 @@ void loadStylesheet(const char *name, StyleDataMap& map)
StyleDataMap rtf_Style;
-void loadExtensions(const char *name)
+void loadExtensions(const QCString &name)
{
- std::ifstream file(name);
+ std::ifstream file(name.str());
if (!file.is_open())
{
- err("Can't open RTF extensions file %s. Using defaults.",name);
+ err("Can't open RTF extensions file %s. Using defaults.",qPrint(name));
return;
}
- msg("Loading RTF extensions %s...\n",name);
+ msg("Loading RTF extensions %s...\n",qPrint(name));
uint lineNr=1;
diff --git a/src/rtfstyle.h b/src/rtfstyle.h
index 140d31f..8f7e3f3 100644
--- a/src/rtfstyle.h
+++ b/src/rtfstyle.h
@@ -18,7 +18,8 @@
#include <map>
#include <string>
-#include <qcstring.h>
+
+#include "qcstring.h"
// used for table column width calculation
const int rtf_pageWidth = 8748;
@@ -79,7 +80,7 @@ using StyleDataMap = std::map<std::string,StyleData>;
extern StyleDataMap rtf_Style;
-void loadExtensions(const char *name);
-void loadStylesheet(const char *name, StyleDataMap& map);
+void loadExtensions(const QCString &name);
+void loadStylesheet(const QCString &name, StyleDataMap& map);
#endif
diff --git a/src/scanner.h b/src/scanner.h
index cefc934..57b54e6 100644
--- a/src/scanner.h
+++ b/src/scanner.h
@@ -31,12 +31,12 @@ class COutlineParser : public OutlineParserInterface
public:
COutlineParser();
virtual ~COutlineParser();
- void parseInput(const char *fileName,
+ void parseInput(const QCString &fileName,
const char *fileBuf,
const std::shared_ptr<Entry> &root,
ClangTUParser *clangParser);
bool needsPreprocessing(const QCString &extension) const;
- void parsePrototype(const char *text);
+ void parsePrototype(const QCString &text);
private:
struct Private;
std::unique_ptr<Private> p;
diff --git a/src/scanner.l b/src/scanner.l
index 6b4cda3..f03304a 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -29,14 +29,13 @@
#include <algorithm>
#include <vector>
#include <utility>
+#include <atomic>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
-#include <qfile.h>
-
#include "scanner.h"
#include "entry.h"
#include "message.h"
@@ -75,6 +74,7 @@ struct scannerYY_state
int lastStringContext = 0;
int lastCurlyContext = 0;
int lastRoundContext = 0;
+ int lastSharpContext = 0;
int lastSquareContext = 0;
int lastInitializerContext = 0;
int lastClassTemplSpecContext = 0;
@@ -140,6 +140,7 @@ struct scannerYY_state
int currentArgumentContext = 0;
int lastCopyArgStringContext = 0;
int lastCopyArgContext = 0;
+ int requiresContext = 0;
QCString *copyArgString = 0;
QCString fullArgString;
QCString dummyRawString;
@@ -147,17 +148,18 @@ struct scannerYY_state
ArgumentList *currentArgumentList = 0;
char lastCopyArgChar = '\0';
- QCString *pCopyQuotedString = 0;
- QCString *pCopyRoundString = 0;
- QCString *pCopyCurlyString = 0;
- QCString *pCopyRawString = 0;
- QGString *pCopyCurlyGString = 0;
- QGString *pCopyRoundGString = 0;
- QGString *pCopySquareGString = 0;
- QGString *pCopyQuotedGString = 0;
- QGString *pCopyHereDocGString = 0;
- QGString *pCopyRawGString = 0;
- QGString *pSkipVerbString = 0;
+ QCString *pCopyQuotedString = 0;
+ QCString *pCopyRoundString = 0;
+ QCString *pCopyCurlyString = 0;
+ QCString *pCopySharpString = 0;
+ QCString *pCopyRawString = 0;
+ TextStream *pCopyCurlyGString = 0;
+ TextStream *pCopyRoundGString = 0;
+ TextStream *pCopySquareGString = 0;
+ TextStream *pCopyQuotedGString = 0;
+ TextStream *pCopyHereDocGString = 0;
+ TextStream *pCopyRawGString = 0;
+ TextStream *pSkipVerbString = 0;
bool insideFormula = false;
bool insideTryBlock = false;
@@ -171,7 +173,7 @@ struct scannerYY_state
QCString briefBackup;
int docBlockContext = 0;
- QGString docBlock;
+ TextStream docBlock;
QCString docBlockName;
bool docBlockInBody = false;
bool docBlockAutoBrief = false;
@@ -191,6 +193,7 @@ struct scannerYY_state
uint fencedSize = 0;
bool nestedComment = false;
std::vector< std::pair<Entry*,std::shared_ptr<Entry> > > outerScopeEntries;
+ QCString programStr;
ClangTUParser * clangParser = 0;
};
@@ -383,6 +386,7 @@ NONLopt [^\n]*
%x CopyGString
%x CopyPHPGString
%x CopyRound
+%x CopySharp
%x CopyCurly
%x GCopyRound
%x GCopySquare
@@ -438,6 +442,12 @@ NONLopt [^\n]*
%x DocBlock
%x DocCopyBlock
+ /** C++20 concepts */
+
+%x RequiresClause
+%x RequiresExpression
+%x ConceptName
+
%%
<NextSemi>"{" {
@@ -686,7 +696,7 @@ NONLopt [^\n]*
}
<CliPropertyType>"{" {
yyextra->curlyCount=0;
- //printf("event: '%s' '%s'\n",yyextra->current->type.data(),yyextra->current->name.data());
+ //printf("event: '%s' '%s'\n",qPrint(yyextra->current->type),qPrint(yyextra->current->name));
BEGIN( CSAccessorDecl );
}
<CliPropertyType>";" {
@@ -872,14 +882,14 @@ NONLopt [^\n]*
yyextra->current->argList.setNoParameters(TRUE);
}
yyextra->current->args = argListToString(yyextra->current->argList);
- //printf("argList=%s\n",yyextra->current->args.data());
+ //printf("argList=%s\n",qPrint(yyextra->current->args));
unput(';');
BEGIN( Function );
}
<ObjCMethod,ObjCParams>(";"{BN}+)?"{" { // start of a method body
lineCount(yyscanner);
//printf("Type=%s Name=%s args=%s\n",
- // yyextra->current->type.data(),yyextra->current->name.data(),argListToString(yyextra->current->argList).data()
+ // qPrint(yyextra->current->type),qPrint(yyextra->current->name),qPrint(argListToString(yyextra->current->argList))
// );
if (!yyextra->current->argList.empty() && yyextra->current->argList.back().type.isEmpty())
{
@@ -1614,6 +1624,19 @@ NONLopt [^\n]*
if (yytext[yyleng-1]=='{') unput('{');
BEGIN( CompoundName ) ;
}
+<FindMembers>{B}*"concept"{BN}+ { // C++20 concept
+ yyextra->isTypedef=FALSE;
+ yyextra->current->section = Entry::CONCEPT_SEC;
+ addType(yyscanner);
+ yyextra->current->type += " concept";
+ yyextra->current->fileName = yyextra->yyFileName;
+ yyextra->current->startLine = yyextra->yyLineNr;
+ yyextra->current->startColumn = yyextra->yyColNr;
+ yyextra->current->bodyLine = yyextra->yyLineNr;
+ yyextra->current->bodyColumn = yyextra->yyColNr;
+ lineCount(yyscanner) ;
+ BEGIN( ConceptName ) ;
+ }
<Operator>"("{BN}*")"({BN}*"<"[^>]*">"){BNopt}/"(" { // A::operator()<int>(int arg)
lineCount(yyscanner);
yyextra->current->name += "()";
@@ -1660,10 +1683,10 @@ NONLopt [^\n]*
BEGIN( NSAliasArg );
}
<NSAliasArg>({ID}"::")*{ID} {
- //printf("Inserting namespace alias %s::%s->%s\n",yyextra->current_root->name.data(),yyextra->aliasName.data(),yytext);
+ //printf("Inserting namespace alias %s::%s->%s\n",qPrint(yyextra->current_root->name),qPrint(yyextra->aliasName),yytext);
// TODO: namespace aliases are now treated as global entities
// while they should be aware of the scope they are in
- Doxygen::namespaceAliasMap.insert({yyextra->aliasName.data(),std::string(yytext)});
+ Doxygen::namespaceAliasMap.insert({yyextra->aliasName.str(),std::string(yytext)});
}
<NSAliasArg>";" {
BEGIN( FindMembers );
@@ -1676,7 +1699,7 @@ NONLopt [^\n]*
<PHPUse>({ID}{BN}*"\\"{BN}*)*{ID} {
lineCount(yyscanner);
yyextra->current->name=removeRedundantWhiteSpace(substitute(yytext,"\\","::"));
- //printf("PHP: adding use relation: %s\n",yyextra->current->name.data());
+ //printf("PHP: adding use relation: %s\n",qPrint(yyextra->current->name));
yyextra->current->fileName = yyextra->yyFileName;
// add a using declaration
yyextra->current->section=Entry::USINGDECL_SEC;
@@ -1693,12 +1716,12 @@ NONLopt [^\n]*
<PHPUseAs>{PHPUSEKW} {
}
<PHPUseAs>{ID} {
- //printf("PHP: adding use as relation: %s->%s\n",yytext,yyextra->aliasName.data());
+ //printf("PHP: adding use as relation: %s->%s\n",yytext,qPrint(yyextra->aliasName));
if (!yyextra->aliasName.isEmpty())
{
Doxygen::namespaceAliasMap.insert({yytext,
std::string(removeRedundantWhiteSpace(
- substitute(yyextra->aliasName,"\\","::")).data())});
+ substitute(yyextra->aliasName,"\\","::")).str())});
}
yyextra->aliasName.resize(0);
}
@@ -1733,7 +1756,7 @@ NONLopt [^\n]*
}
else
{
- //printf("import name = %s -> %s\n",yytext,yyextra->current->name.data());
+ //printf("import name = %s -> %s\n",yytext,qPrint(yyextra->current->name));
yyextra->current->section=Entry::USINGDECL_SEC;
}
yyextra->previous = yyextra->current;
@@ -1793,7 +1816,7 @@ NONLopt [^\n]*
( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
lineCount(yyscanner);
yyextra->docBlockTerm = ';';
@@ -1906,7 +1929,7 @@ NONLopt [^\n]*
// *yyextra->currentTemplateSpec+='>';
if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
{
- //printf("Found %s\n",yyextra->current->name.data());
+ //printf("Found %s\n",qPrint(yyextra->current->name));
BEGIN(FindMembers);
}
}
@@ -1914,17 +1937,23 @@ NONLopt [^\n]*
lineCount(yyscanner);
yyextra->current->name+='>';
// *yyextra->currentTemplateSpec+='>';
- if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
+ --yyextra->sharpCount;
+ if (yyextra->roundCount==0 && yyextra->sharpCount<=0)
{
yyextra->current->bodyLine = yyextra->yyLineNr;
yyextra->current->bodyColumn = yyextra->yyColNr;
yyextra->current->args = "(";
yyextra->currentArgumentContext = FuncQual;
- yyextra->fullArgString = yyextra->current->args.copy();
+ yyextra->fullArgString = yyextra->current->args;
yyextra->copyArgString = &yyextra->current->args;
- //printf("Found %s\n",yyextra->current->name.data());
+ //printf("Found %s\n",qPrint(yyextra->current->name));
BEGIN( ReadFuncArgType ) ;
}
+ else if (yyextra->sharpCount<=0)
+ {
+ yyextra->current->name+="(";
+ yyextra->roundCount++;
+ }
}
<EndTemplate>">"{BNopt}/"("({BN}*{ID}{BN}*"::")*({BN}*"*"{BN}*)+ { // function pointer returning a template instance
lineCount(yyscanner);
@@ -1965,12 +1994,12 @@ NONLopt [^\n]*
}
<CopyHereDoc>{ID} { // PHP heredoc
yyextra->delimiter = yytext;
- *yyextra->pCopyHereDocGString += yytext;
+ *yyextra->pCopyHereDocGString << yytext;
BEGIN(CopyHereDocEnd);
}
<CopyHereDoc>"'"{ID}/"'" { // PHP nowdoc
yyextra->delimiter = &yytext[1];
- *yyextra->pCopyHereDocGString += yytext;
+ *yyextra->pCopyHereDocGString << yytext;
BEGIN(CopyHereDocEnd);
}
<HereDoc>{ID} { // PHP heredoc
@@ -1989,7 +2018,7 @@ NONLopt [^\n]*
}
<HereDocEnd>. { }
<CopyHereDocEnd>^{ID} { // id at start of the line could mark the end of the block
- *yyextra->pCopyHereDocGString += yytext;
+ *yyextra->pCopyHereDocGString << yytext;
if (yyextra->delimiter==yytext) // it is the end marker
{
BEGIN(yyextra->lastHereDocContext);
@@ -1997,13 +2026,13 @@ NONLopt [^\n]*
}
<CopyHereDocEnd>\n {
lineCount(yyscanner);
- *yyextra->pCopyHereDocGString += yytext;
+ *yyextra->pCopyHereDocGString << yytext;
}
<CopyHereDocEnd>{ID} {
- *yyextra->pCopyHereDocGString += yytext;
+ *yyextra->pCopyHereDocGString << yytext;
}
<CopyHereDocEnd>. {
- *yyextra->pCopyHereDocGString += yytext;
+ *yyextra->pCopyHereDocGString << yytext;
}
<FindMembers>"Q_OBJECT" { // Qt object macro
}
@@ -2061,10 +2090,81 @@ NONLopt [^\n]*
}
<FindMembers>"friend"{BN}+("class"|"union"|"struct"){BN}+ {
yyextra->current->name=yytext;
+ lineCount(yyscanner) ;
BEGIN(FindMembers);
}
+<FindMembers>"requires" { // C++20 requires clause
+ yyextra->current->req.resize(0);
+ yyextra->requiresContext = YY_START;
+ BEGIN(RequiresClause);
+ }
+<RequiresClause>"requires"{BN}*"(" { // requires requires(T x) { ... }
+ lineCount(yyscanner) ;
+ yyextra->current->req+=yytext;
+ yyextra->lastRoundContext=RequiresExpression;
+ yyextra->pCopyRoundString=&yyextra->current->req;
+ yyextra->roundCount=0;
+ BEGIN( CopyRound ) ;
+ }
+<RequiresExpression>"{" {
+ yyextra->current->req+=yytext;
+ yyextra->lastCurlyContext=RequiresClause;
+ yyextra->pCopyCurlyString=&yyextra->current->req;
+ yyextra->curlyCount=0;
+ BEGIN( CopyCurly ) ;
+ }
+<RequiresExpression>\n {
+ yyextra->current->req+=' ';
+ lineCount(yyextra);
+ }
+<RequiresExpression>. {
+ yyextra->current->req+=yytext;
+ }
+<RequiresClause>"(" { // requires "(A && B)"
+ yyextra->current->req+=yytext;
+ yyextra->lastRoundContext=RequiresClause;
+ yyextra->pCopyRoundString=&yyextra->current->req;
+ yyextra->roundCount=0;
+ BEGIN( CopyRound ) ;
+ }
+<RequiresClause>{ID} { // something like "requires true"
+ if (yyextra->current->req.stripWhiteSpace().isEmpty())
+ {
+ yyextra->current->req=yytext;
+ BEGIN(yyextra->requiresContext);
+ }
+ else
+ {
+ REJECT;
+ }
+ }
+<RequiresClause>{SCOPENAME}{BNopt}"(" { // "requires func(x)"
+ yyextra->current->req+=yytext;
+ yyextra->lastRoundContext=RequiresClause;
+ yyextra->pCopyRoundString=&yyextra->current->req;
+ yyextra->roundCount=0;
+ BEGIN( CopyRound );
+ }
+<RequiresClause>{SCOPENAME}{BNopt}"<" { // "requires C<S,T>"
+ yyextra->current->req+=yytext;
+ yyextra->lastSharpContext=RequiresClause;
+ yyextra->pCopySharpString=&yyextra->current->req;
+ yyextra->sharpCount=0;
+ BEGIN( CopySharp );
+ }
+<RequiresClause>"||"|"&&" { // "requires A || B" or "requires A && B"
+ yyextra->current->req+=yytext;
+ }
+<RequiresClause>{BN}+ {
+ yyextra->current->req+=' ';
+ lineCount(yyscanner) ;
+ }
+<RequiresClause>. {
+ unput(*yytext);
+ yyextra->current->req=yyextra->current->req.simplifyWhiteSpace();
+ BEGIN(yyextra->requiresContext);
+ }
<FindMembers,FindMemberName>{SCOPENAME} {
-
if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC))
{
yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,yytext);
@@ -2309,7 +2409,7 @@ NONLopt [^\n]*
YY_START==ReadNSBody ||
YY_START==ReadBodyIntf)
{
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
BEGIN( PreLineCtrl );
}
@@ -2319,7 +2419,7 @@ NONLopt [^\n]*
yyextra->lastPreLineCtrlContext==ReadNSBody ||
yyextra->lastPreLineCtrlContext==ReadBodyIntf)
{
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
}
<PreLineCtrl>. {
@@ -2327,7 +2427,7 @@ NONLopt [^\n]*
yyextra->lastPreLineCtrlContext==ReadNSBody ||
yyextra->lastPreLineCtrlContext==ReadBodyIntf)
{
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
}
<PreLineCtrl>\n {
@@ -2335,7 +2435,7 @@ NONLopt [^\n]*
yyextra->lastPreLineCtrlContext==ReadNSBody ||
yyextra->lastPreLineCtrlContext==ReadBodyIntf)
{
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
lineCount(yyscanner);
BEGIN( yyextra->lastPreLineCtrlContext );
@@ -2352,7 +2452,7 @@ NONLopt [^\n]*
yyextra->current->bodyLine = yyextra->yyLineNr;
yyextra->current->bodyColumn = yyextra->yyColNr;
yyextra->currentArgumentContext = DefineEnd;
- yyextra->fullArgString=yyextra->current->args.copy();
+ yyextra->fullArgString=yyextra->current->args;
yyextra->copyArgString=&yyextra->current->args;
BEGIN( ReadFuncArgType ) ;
}
@@ -2378,7 +2478,7 @@ NONLopt [^\n]*
BEGIN(DefineEnd);
}
<DefineEnd>\n {
- //printf("End define: doc=%s docFile=%s docLine=%d\n",yyextra->current->doc.data(),yyextra->current->docFile.data(),yyextra->current->docLine);
+ //printf("End define: doc=%s docFile=%s docLine=%d\n",qPrint(yyextra->current->doc),qPrint(yyextra->current->docFile),yyextra->current->docLine);
yyextra->current->fileName = yyextra->yyFileName;
yyextra->current->startLine = yyextra->yyLineNr;
yyextra->current->startColumn = yyextra->yyColNr;
@@ -2398,10 +2498,10 @@ NONLopt [^\n]*
yyextra->current->startColumn = yyextra->yyColNr;
yyextra->current->type.resize(0);
yyextra->current->type = "const";
- QCString init = yyextra->current->initializer.data();
+ QCString init = yyextra->current->initializer.str();
init = init.simplifyWhiteSpace();
init = init.left(init.length()-1);
- yyextra->current->initializer = init;
+ yyextra->current->initializer.str(init.str());
yyextra->current->name = yyextra->current->name.stripWhiteSpace();
yyextra->current->section = Entry::VARIABLE_SEC;
yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
@@ -2465,7 +2565,7 @@ NONLopt [^\n]*
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
//printf("indent=%d\n",computeIndent(yytext+1,yyextra->column));
lineCount(yyscanner);
@@ -2495,7 +2595,7 @@ NONLopt [^\n]*
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
lineCount(yyscanner);
yyextra->docBlockTerm = ',';
@@ -2528,7 +2628,7 @@ NONLopt [^\n]*
( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
lineCount(yyscanner);
yyextra->docBlockTerm = 0;
@@ -2565,7 +2665,7 @@ NONLopt [^\n]*
yyextra->docBlockContext = YY_START;
yyextra->docBlockInBody = FALSE;
yyextra->docBlockAutoBrief = FALSE;
- yyextra->docBlock.resize(0);
+ yyextra->docBlock.str(std::string());
yyextra->docBlockTerm = 0;
startCommentBlock(yyscanner,TRUE);
BEGIN(DocLine);
@@ -2582,7 +2682,7 @@ NONLopt [^\n]*
{
yyextra->docBlockContext = YY_START;
yyextra->docBlockInBody = FALSE;
- yyextra->docBlock.resize(0);
+ yyextra->docBlock.str(std::string());
yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
yyextra->docBlockTerm = 0;
@@ -2605,7 +2705,7 @@ NONLopt [^\n]*
if (!yyextra->insideCS) REJECT;
yyextra->current->bodyLine = yyextra->yyLineNr;
yyextra->current->bodyColumn = yyextra->yyColNr;
- yyextra->current->initializer = yytext;
+ yyextra->current->initializer.str(yytext);
yyextra->lastInitializerContext = YY_START;
yyextra->initBracketCount=0;
yyextra->current->mtype = yyextra->mtype = Property;
@@ -2615,7 +2715,7 @@ NONLopt [^\n]*
<FindMembers>"=" { // in PHP code this could also be due to "<?="
yyextra->current->bodyLine = yyextra->yyLineNr;
yyextra->current->bodyColumn = yyextra->yyColNr;
- yyextra->current->initializer = yytext;
+ yyextra->current->initializer.str(yytext);
yyextra->lastInitializerContext = YY_START;
yyextra->initBracketCount=0;
BEGIN(ReadInitializer);
@@ -2634,7 +2734,7 @@ NONLopt [^\n]*
yyextra->lastRoundContext=YY_START;
yyextra->pCopyRoundGString=&yyextra->current->initializer;
yyextra->roundCount=0;
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
BEGIN(GCopyRound);
}
<ReadInitializer,ReadInitializerPtr>"[" {
@@ -2642,18 +2742,18 @@ NONLopt [^\n]*
yyextra->lastSquareContext=YY_START;
yyextra->pCopySquareGString=&yyextra->current->initializer;
yyextra->squareCount=0;
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
BEGIN(GCopySquare);
}
<ReadInitializer,ReadInitializerPtr>"{" {
yyextra->lastCurlyContext=YY_START;
yyextra->pCopyCurlyGString=&yyextra->current->initializer;
yyextra->curlyCount=0;
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
BEGIN(GCopyCurly);
}
<ReadInitializer,ReadInitializerPtr>[;,] {
- //printf(">> initializer '%s' <<\n",yyextra->current->initializer.data());
+ //printf(">> initializer '%s' <<\n",qPrint(yyextra->current->initializer));
if (*yytext==';' && (yyextra->current_root->spec&Entry::Enum))
{
yyextra->current->fileName = yyextra->yyFileName;
@@ -2669,18 +2769,18 @@ NONLopt [^\n]*
else if (*yytext==';' || (yyextra->lastInitializerContext==FindFields && yyextra->initBracketCount==0)) // yyextra->initBracketCount==0 was added for bug 665778
{
unput(*yytext);
- if (YY_START == ReadInitializerPtr) yyextra->current->initializer.resize(0);
+ if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
BEGIN(yyextra->lastInitializerContext);
}
else if (*yytext==',' && yyextra->initBracketCount==0) // for "int a=0,b=0"
{
unput(*yytext);
- if (YY_START == ReadInitializerPtr) yyextra->current->initializer.resize(0);
+ if (YY_START == ReadInitializerPtr) yyextra->current->initializer.str(std::string());
BEGIN(yyextra->lastInitializerContext);
}
else
{
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
}
}
<ReadInitializer,ReadInitializerPtr>{RAWBEGIN} { // C++11 raw string
@@ -2691,18 +2791,18 @@ NONLopt [^\n]*
else
{
QCString text=yytext;
- yyextra->current->initializer+=text;
+ yyextra->current->initializer << text;
int i=text.find('"');
yyextra->delimiter = yytext+i+1;
yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
yyextra->lastRawStringContext = YY_START;
yyextra->pCopyRawGString = &yyextra->current->initializer;
BEGIN(RawGString);
- //printf("RawGString delimiter='%s'\n",delimiter.data());
+ //printf("RawGString delimiter='%s'\n",qPrint(delimiter));
}
}
<RawGString>{RAWEND} {
- *yyextra->pCopyRawGString+=yytext;
+ *yyextra->pCopyRawGString << yytext;
QCString delimiter = yytext+1;
delimiter=delimiter.left(delimiter.length()-1);
if (delimiter==yyextra->delimiter)
@@ -2711,13 +2811,13 @@ NONLopt [^\n]*
}
}
<RawGString>[^)\n]+ {
- *yyextra->pCopyRawGString+=yytext;
+ *yyextra->pCopyRawGString << yytext;
}
<RawGString>. {
- *yyextra->pCopyRawGString+=yytext;
+ *yyextra->pCopyRawGString << yytext;
}
<RawGString>\n {
- *yyextra->pCopyRawGString+=yytext;
+ *yyextra->pCopyRawGString << yytext;
lineCount(yyscanner);
}
<RawString>{RAWEND} {
@@ -2731,15 +2831,15 @@ NONLopt [^\n]*
}
}
<RawString>[^)]+ {
- *yyextra->pCopyRawString+=yytext;
+ *yyextra->pCopyRawString += yytext;
yyextra->fullArgString+=yytext;
}
<RawString>. {
- *yyextra->pCopyRawString+=yytext;
+ *yyextra->pCopyRawString += yytext;
yyextra->fullArgString+=yytext;
}
<RawString>\n {
- *yyextra->pCopyRawString+=yytext;
+ *yyextra->pCopyRawString += yytext;
yyextra->fullArgString+=yytext;
lineCount(yyscanner);
}
@@ -2751,39 +2851,39 @@ NONLopt [^\n]*
else
{
yyextra->lastStringContext=YY_START;
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
yyextra->pCopyQuotedGString=&yyextra->current->initializer;
BEGIN(CopyGString);
}
}
<ReadInitializer,ReadInitializerPtr>"->" {
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
}
<ReadInitializer,ReadInitializerPtr>"<<" {
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
}
<ReadInitializer,ReadInitializerPtr>">>" {
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
}
<ReadInitializer,ReadInitializerPtr>[<\[{(] {
yyextra->initBracketCount++;
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
}
<ReadInitializer,ReadInitializerPtr>[>\]})] {
yyextra->initBracketCount--;
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
}
<ReadInitializer,ReadInitializerPtr>\' {
if (yyextra->insidePHP)
{
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
yyextra->pCopyQuotedGString = &yyextra->current->initializer;
yyextra->lastStringContext=YY_START;
BEGIN(CopyPHPGString);
}
else
{
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
}
}
<ReadInitializer,ReadInitializerPtr>{CHARLIT} {
@@ -2793,16 +2893,16 @@ NONLopt [^\n]*
}
else
{
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
}
}
<ReadInitializer,ReadInitializerPtr>\n {
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
lineCount(yyscanner);
}
<ReadInitializer,ReadInitializerPtr>"@\"" {
//printf("yyextra->insideCS=%d\n",yyextra->insideCS);
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
if (!yyextra->insideCS && !yyextra->insideObjC)
{
REJECT;
@@ -2816,30 +2916,30 @@ NONLopt [^\n]*
}
}
<SkipVerbString>[^\n"]+ {
- *yyextra->pSkipVerbString+=yytext;
+ *yyextra->pSkipVerbString << yytext;
}
<SkipVerbString>"\"\"" { // quote escape
- *yyextra->pSkipVerbString+=yytext;
+ *yyextra->pSkipVerbString << yytext;
}
<SkipVerbString>"\"" {
- *yyextra->pSkipVerbString+=*yytext;
+ *yyextra->pSkipVerbString << *yytext;
BEGIN(yyextra->lastSkipVerbStringContext);
}
<SkipVerbString>\n {
- *yyextra->pSkipVerbString+=*yytext;
+ *yyextra->pSkipVerbString << *yytext;
lineCount(yyscanner);
}
<SkipVerbString>. {
- *yyextra->pSkipVerbString+=*yytext;
+ *yyextra->pSkipVerbString << *yytext;
}
<ReadInitializer,ReadInitializerPtr>"?>" {
if (yyextra->insidePHP)
BEGIN( FindMembersPHP );
else
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
}
<ReadInitializer,ReadInitializerPtr>. {
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
}
/* generic quoted string copy rules */
@@ -2867,62 +2967,62 @@ NONLopt [^\n]*
/* generic quoted growable string copy rules */
<CopyGString,CopyPHPGString>\\. {
- *yyextra->pCopyQuotedGString+=yytext;
+ *yyextra->pCopyQuotedGString << yytext;
}
<CopyGString>\" {
- *yyextra->pCopyQuotedGString+=*yytext;
+ *yyextra->pCopyQuotedGString << *yytext;
BEGIN( yyextra->lastStringContext );
}
<CopyPHPGString>\' {
- *yyextra->pCopyQuotedGString+=*yytext;
+ *yyextra->pCopyQuotedGString << *yytext;
BEGIN( yyextra->lastStringContext );
}
<CopyGString,CopyPHPGString>"<?php" { // we had an odd number of quotes.
- *yyextra->pCopyQuotedGString += yytext;
+ *yyextra->pCopyQuotedGString << yytext;
BEGIN( yyextra->lastStringContext );
}
<CopyGString,CopyPHPGString>{CCS}|{CCE}|{CPPC} {
- *yyextra->pCopyQuotedGString+=yytext;
+ *yyextra->pCopyQuotedGString << yytext;
}
<CopyGString,CopyPHPGString>\n {
- *yyextra->pCopyQuotedGString+=*yytext;
+ *yyextra->pCopyQuotedGString << *yytext;
lineCount(yyscanner);
}
<CopyGString,CopyPHPGString>. {
- *yyextra->pCopyQuotedGString+=*yytext;
+ *yyextra->pCopyQuotedGString << *yytext;
}
/* generic round bracket list copy rules */
<CopyRound>\" {
- *yyextra->pCopyRoundString+=*yytext;
+ *yyextra->pCopyRoundString += *yytext;
yyextra->pCopyQuotedString=yyextra->pCopyRoundString;
yyextra->lastStringContext=YY_START;
BEGIN(CopyString);
}
<CopyRound>"(" {
- *yyextra->pCopyRoundString+=*yytext;
+ *yyextra->pCopyRoundString += *yytext;
yyextra->roundCount++;
}
<CopyRound>")" {
- *yyextra->pCopyRoundString+=*yytext;
+ *yyextra->pCopyRoundString += *yytext;
if (--yyextra->roundCount<0)
BEGIN(yyextra->lastRoundContext);
}
<CopyRound>\n {
lineCount(yyscanner);
- *yyextra->pCopyRoundString+=*yytext;
+ *yyextra->pCopyRoundString += *yytext;
}
<CopyRound>\' {
if (yyextra->insidePHP)
{
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
yyextra->pCopyQuotedString = yyextra->pCopyRoundString;
yyextra->lastStringContext=YY_START;
BEGIN(CopyPHPString);
}
else
{
- *yyextra->pCopyRoundString+=yytext;
+ *yyextra->pCopyRoundString += yytext;
}
}
<CopyRound>{CHARLIT} {
@@ -2942,37 +3042,90 @@ NONLopt [^\n]*
*yyextra->pCopyRoundString+=*yytext;
}
+ /* generic sharp bracket list copy rules */
+<CopySharp>\" {
+ *yyextra->pCopySharpString += *yytext;
+ yyextra->pCopyQuotedString=yyextra->pCopySharpString;
+ yyextra->lastStringContext=YY_START;
+ BEGIN(CopyString);
+ }
+<CopySharp>"<" {
+ *yyextra->pCopySharpString += *yytext;
+ yyextra->sharpCount++;
+ }
+<CopySharp>">" {
+ *yyextra->pCopySharpString += *yytext;
+ if (--yyextra->sharpCount<0)
+ {
+ BEGIN(yyextra->lastSharpContext);
+ }
+ }
+<CopySharp>\n {
+ lineCount(yyscanner);
+ *yyextra->pCopySharpString += *yytext;
+ }
+<CopySharp>\' {
+ if (yyextra->insidePHP)
+ {
+ yyextra->current->initializer << yytext;
+ yyextra->pCopyQuotedString = yyextra->pCopySharpString;
+ yyextra->lastStringContext=YY_START;
+ BEGIN(CopyPHPString);
+ }
+ else
+ {
+ *yyextra->pCopySharpString += yytext;
+ }
+ }
+<CopySharp>{CHARLIT} {
+ if (yyextra->insidePHP)
+ {
+ REJECT;
+ }
+ else
+ {
+ *yyextra->pCopySharpString+=yytext;
+ }
+ }
+<CopySharp>[^"'<>\n,]+ {
+ *yyextra->pCopySharpString+=yytext;
+ }
+<CopySharp>. {
+ *yyextra->pCopySharpString+=*yytext;
+ }
+
+
/* generic round bracket list copy rules for growable strings */
<GCopyRound>\" {
- *yyextra->pCopyRoundGString+=*yytext;
+ *yyextra->pCopyRoundGString << *yytext;
yyextra->pCopyQuotedGString=yyextra->pCopyRoundGString;
yyextra->lastStringContext=YY_START;
BEGIN(CopyGString);
}
<GCopyRound>"(" {
- *yyextra->pCopyRoundGString+=*yytext;
+ *yyextra->pCopyRoundGString << *yytext;
yyextra->roundCount++;
}
<GCopyRound>")" {
- *yyextra->pCopyRoundGString+=*yytext;
+ *yyextra->pCopyRoundGString << *yytext;
if (--yyextra->roundCount<0)
BEGIN(yyextra->lastRoundContext);
}
<GCopyRound>\n {
lineCount(yyscanner);
- *yyextra->pCopyRoundGString+=*yytext;
+ *yyextra->pCopyRoundGString << *yytext;
}
<GCopyRound>\' {
if (yyextra->insidePHP)
{
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
yyextra->pCopyQuotedGString = yyextra->pCopyRoundGString;
yyextra->lastStringContext=YY_START;
BEGIN(CopyPHPGString);
}
else
{
- *yyextra->pCopyRoundGString+=yytext;
+ *yyextra->pCopyRoundGString << yytext;
}
}
<GCopyRound>{CHARLIT} {
@@ -2982,47 +3135,47 @@ NONLopt [^\n]*
}
else
{
- *yyextra->pCopyRoundGString+=yytext;
+ *yyextra->pCopyRoundGString << yytext;
}
}
<GCopyRound>[^"'()\n\/,]+ {
- *yyextra->pCopyRoundGString+=yytext;
+ *yyextra->pCopyRoundGString << yytext;
}
<GCopyRound>. {
- *yyextra->pCopyRoundGString+=*yytext;
+ *yyextra->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 the round bracket version */
<GCopySquare>\" {
- *yyextra->pCopySquareGString+=*yytext;
+ *yyextra->pCopySquareGString << *yytext;
yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
yyextra->lastStringContext=YY_START;
BEGIN(CopyGString);
}
<GCopySquare>"[" {
- *yyextra->pCopySquareGString+=*yytext;
+ *yyextra->pCopySquareGString << *yytext;
yyextra->squareCount++;
}
<GCopySquare>"]" {
- *yyextra->pCopySquareGString+=*yytext;
+ *yyextra->pCopySquareGString << *yytext;
if (--yyextra->squareCount<0)
BEGIN(yyextra->lastSquareContext);
}
<GCopySquare>\n {
lineCount(yyscanner);
- *yyextra->pCopySquareGString+=*yytext;
+ *yyextra->pCopySquareGString << *yytext;
}
<GCopySquare>\' {
if (yyextra->insidePHP)
{
- yyextra->current->initializer+=yytext;
+ yyextra->current->initializer << yytext;
yyextra->pCopyQuotedGString = yyextra->pCopySquareGString;
yyextra->lastStringContext=YY_START;
BEGIN(CopyPHPGString);
}
else
{
- *yyextra->pCopySquareGString+=yytext;
+ *yyextra->pCopySquareGString << yytext;
}
}
<GCopySquare>{CHARLIT} {
@@ -3032,25 +3185,25 @@ NONLopt [^\n]*
}
else
{
- *yyextra->pCopySquareGString+=yytext;
+ *yyextra->pCopySquareGString << yytext;
}
}
<GCopySquare>[^"\[\]\n\/,]+ {
- *yyextra->pCopySquareGString+=yytext;
+ *yyextra->pCopySquareGString << yytext;
}
<GCopySquare>. {
- *yyextra->pCopySquareGString+=*yytext;
+ *yyextra->pCopySquareGString << *yytext;
}
/* generic curly bracket list copy rules */
<CopyCurly>\" {
- *yyextra->pCopyCurlyString+=*yytext;
+ *yyextra->pCopyCurlyString += *yytext;
yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
yyextra->lastStringContext=YY_START;
BEGIN(CopyString);
}
<CopyCurly>\' {
- *yyextra->pCopyCurlyString+=*yytext;
+ *yyextra->pCopyCurlyString += *yytext;
if (yyextra->insidePHP)
{
yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
@@ -3059,11 +3212,11 @@ NONLopt [^\n]*
}
}
<CopyCurly>"{" {
- *yyextra->pCopyCurlyString+=*yytext;
+ *yyextra->pCopyCurlyString += *yytext;
yyextra->curlyCount++;
}
<CopyCurly>"}" {
- *yyextra->pCopyCurlyString+=*yytext;
+ *yyextra->pCopyCurlyString += *yytext;
if (--yyextra->curlyCount<0)
BEGIN(yyextra->lastCurlyContext);
}
@@ -3073,19 +3226,19 @@ NONLopt [^\n]*
}
else
{
- *yyextra->pCopyCurlyString+=yytext;
+ *yyextra->pCopyCurlyString += yytext;
}
}
<CopyCurly>[^"'{}\/\n,]+ {
- *yyextra->pCopyCurlyString+=yytext;
+ *yyextra->pCopyCurlyString += yytext;
}
-<CopyCurly>"/" { *yyextra->pCopyCurlyString+=yytext; }
+<CopyCurly>"/" { *yyextra->pCopyCurlyString += yytext; }
<CopyCurly>\n {
lineCount(yyscanner);
- *yyextra->pCopyCurlyString+=*yytext;
+ *yyextra->pCopyCurlyString += *yytext;
}
<CopyCurly>. {
- *yyextra->pCopyCurlyString+=*yytext;
+ *yyextra->pCopyCurlyString += *yytext;
}
/* generic curly bracket list copy rules for growable strings */
@@ -3103,13 +3256,13 @@ NONLopt [^\n]*
}
}
<GCopyCurly>\" {
- *yyextra->pCopyCurlyGString+=*yytext;
+ *yyextra->pCopyCurlyGString << *yytext;
yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
yyextra->lastStringContext=YY_START;
BEGIN(CopyGString);
}
<GCopyCurly>\' {
- *yyextra->pCopyCurlyGString+=*yytext;
+ *yyextra->pCopyCurlyGString << *yytext;
if (yyextra->insidePHP)
{
yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
@@ -3118,11 +3271,11 @@ NONLopt [^\n]*
}
}
<GCopyCurly>"{" {
- *yyextra->pCopyCurlyGString+=*yytext;
+ *yyextra->pCopyCurlyGString << *yytext;
yyextra->curlyCount++;
}
<GCopyCurly>"}" {
- *yyextra->pCopyCurlyGString+=*yytext;
+ *yyextra->pCopyCurlyGString << *yytext;
if (--yyextra->curlyCount<0)
BEGIN(yyextra->lastCurlyContext);
}
@@ -3132,22 +3285,22 @@ NONLopt [^\n]*
}
else
{
- *yyextra->pCopyCurlyGString+=yytext;
+ *yyextra->pCopyCurlyGString << yytext;
}
}
<GCopyCurly>[^"'{}\/\n,]+ {
- *yyextra->pCopyCurlyGString+=yytext;
+ *yyextra->pCopyCurlyGString << yytext;
}
<GCopyCurly>[,]+ {
- *yyextra->pCopyCurlyGString+=yytext;
+ *yyextra->pCopyCurlyGString << yytext;
}
-<GCopyCurly>"/" { *yyextra->pCopyCurlyGString+=yytext; }
+<GCopyCurly>"/" { *yyextra->pCopyCurlyGString << yytext; }
<GCopyCurly>\n {
lineCount(yyscanner);
- *yyextra->pCopyCurlyGString+=*yytext;
+ *yyextra->pCopyCurlyGString << *yytext;
}
<GCopyCurly>. {
- *yyextra->pCopyCurlyGString+=*yytext;
+ *yyextra->pCopyCurlyGString << *yytext;
}
/* ---------------------- */
@@ -3199,7 +3352,12 @@ NONLopt [^\n]*
yyextra->current->type.prepend("typedef ");
}
bool stat = yyextra->current->stat;
- if (!yyextra->current->name.isEmpty() && yyextra->current->section!=Entry::ENUM_SEC)
+ if (yyextra->current->section==Entry::CONCEPT_SEC) // C++20 concept
+ {
+ yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
+ initEntry(yyscanner);
+ }
+ else if (!yyextra->current->name.isEmpty() && yyextra->current->section!=Entry::ENUM_SEC)
{
yyextra->current->type=yyextra->current->type.simplifyWhiteSpace();
yyextra->current->args=removeRedundantWhiteSpace(yyextra->current->args);
@@ -3222,7 +3380,7 @@ NONLopt [^\n]*
yyextra->current->args.resize(0);
yyextra->current->brief.resize(0);
yyextra->current->doc.resize(0);
- yyextra->current->initializer.resize(0);
+ yyextra->current->initializer.str(std::string());
yyextra->current->bitfields.resize(0);
int i=oldType.length();
while (i>0 && (oldType[i-1]=='*' || oldType[i-1]=='&' || oldType[i-1]==' ')) i--;
@@ -3425,7 +3583,7 @@ NONLopt [^\n]*
yyextra->idlProp = yytext;
}
<IDLProp>{BN}*{ID}{BN}*"," { // Rare: Another parameter ([propput] HRESULT Item(int index, [in] Type theRealProperty);)
- if (!yyextra->current->args)
+ if (yyextra->current->args.isEmpty())
yyextra->current->args = "(";
else
yyextra->current->args += ", ";
@@ -3446,7 +3604,7 @@ NONLopt [^\n]*
yyextra->current->fileName = yyextra->yyFileName;
yyextra->current->type = yyextra->idlProp;
yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
- if (yyextra->current->args)
+ if (!yyextra->current->args.isEmpty())
yyextra->current->args += ")";
yyextra->current->name = yyextra->current->name.stripWhiteSpace();
yyextra->current->section = Entry::VARIABLE_SEC;
@@ -3509,13 +3667,13 @@ NONLopt [^\n]*
unput('(');
yyextra->lastInitializerContext = YY_START;
yyextra->initBracketCount=0;
- yyextra->current->initializer = "=";
+ yyextra->current->initializer.str("=");
BEGIN(ReadInitializer);
}
<FindFields>"=" {
yyextra->lastInitializerContext = YY_START;
yyextra->initBracketCount=0;
- yyextra->current->initializer = yytext;
+ yyextra->current->initializer.str(yytext);
BEGIN(ReadInitializer);
}
<FindFields>";" {
@@ -3550,8 +3708,8 @@ NONLopt [^\n]*
<SkipRemainder>[^\n]*
<FindFields>"," {
//printf("adding '%s' '%s' '%s' to enum '%s' (mGrpId=%d)\n",
- // yyextra->current->type.data(), yyextra->current->name.data(),
- // yyextra->current->args.data(), yyextra->current_root->name.data(),yyextra->current->mGrpId);
+ // qPrint(yyextra->current->type), qPrint(yyextra->current->name),
+ // qPrint(yyextra->current->args), qPrint(yyextra->current_root->name),yyextra->current->mGrpId);
if (!yyextra->current->name.isEmpty())
{
yyextra->current->fileName = yyextra->yyFileName;
@@ -3572,7 +3730,7 @@ NONLopt [^\n]*
{
// add to the scope surrounding the enum (copy!)
// we cannot during it directly as that would invalidate the iterator in parseCompounds.
- //printf("*** adding outer scope entry for %s\n",yyextra->current->name.data());
+ //printf("*** adding outer scope entry for %s\n",qPrint(yyextra->current->name));
yyextra->outerScopeEntries.emplace_back(yyextra->current_root->parent(), std::make_shared<Entry>(*yyextra->current));
}
yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
@@ -3592,21 +3750,21 @@ NONLopt [^\n]*
/*
<FindFieldArg>"," { unput(*yytext); BEGIN(FindFields); }
*/
-<ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<]* { yyextra->current->program += yytext ; }
-<ReadBody,ReadNSBody,ReadBodyIntf>{CPPC}.* { yyextra->current->program += yytext ; }
+<ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<]* { yyextra->current->program << yytext ; }
+<ReadBody,ReadNSBody,ReadBodyIntf>{CPPC}.* { yyextra->current->program << yytext ; }
<ReadBody,ReadNSBody,ReadBodyIntf>"#".* { if (!yyextra->insidePHP)
REJECT;
// append PHP comment.
- yyextra->current->program += yytext ;
+ yyextra->current->program << yytext ;
}
-<ReadBody,ReadNSBody,ReadBodyIntf>@\" { yyextra->current->program += yytext ;
+<ReadBody,ReadNSBody,ReadBodyIntf>@\" { yyextra->current->program << yytext ;
yyextra->pSkipVerbString = &yyextra->current->program;
yyextra->lastSkipVerbStringContext=YY_START;
BEGIN( SkipVerbString );
}
<ReadBody,ReadNSBody,ReadBodyIntf>"<<<" { if (yyextra->insidePHP)
{
- yyextra->current->program += yytext ;
+ yyextra->current->program << yytext ;
yyextra->pCopyHereDocGString = &yyextra->current->program;
yyextra->lastHereDocContext=YY_START;
BEGIN( CopyHereDoc );
@@ -3616,16 +3774,16 @@ NONLopt [^\n]*
REJECT;
}
}
-<ReadBody,ReadNSBody,ReadBodyIntf>\" { yyextra->current->program += yytext ;
+<ReadBody,ReadNSBody,ReadBodyIntf>\" { yyextra->current->program << yytext ;
yyextra->pCopyQuotedGString = &yyextra->current->program;
yyextra->lastStringContext=YY_START;
BEGIN( CopyGString );
}
-<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{B}* { yyextra->current->program += yytext ;
+<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{B}* { yyextra->current->program << yytext ;
yyextra->lastContext = YY_START ;
BEGIN( Comment ) ;
}
-<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{BL} { yyextra->current->program += yytext ;
+<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{BL} { yyextra->current->program << yytext ;
++yyextra->yyLineNr ;
yyextra->lastContext = YY_START ;
BEGIN( Comment ) ;
@@ -3633,11 +3791,11 @@ NONLopt [^\n]*
<ReadBody,ReadNSBody,ReadBodyIntf>"'" {
if (!yyextra->insidePHP)
{
- yyextra->current->program += yytext;
+ yyextra->current->program << yytext;
}
else
{ // begin of single quoted string
- yyextra->current->program += yytext;
+ yyextra->current->program << yytext;
yyextra->pCopyQuotedGString = &yyextra->current->program;
yyextra->lastStringContext=YY_START;
BEGIN(CopyPHPGString);
@@ -3651,20 +3809,20 @@ NONLopt [^\n]*
}
else
{
- yyextra->current->program += yytext;
+ yyextra->current->program << yytext;
}
}
-<ReadBody,ReadNSBody,ReadBodyIntf>"{" { yyextra->current->program += yytext ;
+<ReadBody,ReadNSBody,ReadBodyIntf>"{" { yyextra->current->program << yytext ;
++yyextra->curlyCount ;
}
<ReadBodyIntf>"}" {
- yyextra->current->program += yytext ;
+ yyextra->current->program << yytext ;
--yyextra->curlyCount ;
}
<ReadBody,ReadNSBody>"}" { //err("ReadBody count=%d\n",yyextra->curlyCount);
if ( yyextra->curlyCount>0 )
{
- yyextra->current->program += yytext ;
+ yyextra->current->program << yytext ;
--yyextra->curlyCount ;
}
else
@@ -3691,7 +3849,7 @@ NONLopt [^\n]*
while ((split_point = yyextra->current->name.find("::")) != -1)
{
std::shared_ptr<Entry> new_current = std::make_shared<Entry>(*yyextra->current);
- yyextra->current->program = "";
+ yyextra->current->program.str(std::string());
new_current->name = yyextra->current->name.mid(split_point + 2);
yyextra->current->name = yyextra->current->name.left(split_point);
if (!yyextra->current_root->name.isEmpty()) yyextra->current->name.prepend(yyextra->current_root->name+"::");
@@ -3709,8 +3867,8 @@ NONLopt [^\n]*
yyextra->current->briefFile = briefFile;
}
QCString &cn = yyextra->current->name;
- QCString rn = yyextra->current_root->name.copy();
- //printf("cn='%s' rn='%s' yyextra->isTypedef=%d\n",cn.data(),rn.data(),yyextra->isTypedef);
+ QCString rn = yyextra->current_root->name;
+ //printf("cn='%s' rn='%s' yyextra->isTypedef=%d\n",qPrint(cn),qPrint(rn),yyextra->isTypedef);
if (!cn.isEmpty() && !rn.isEmpty())
{
prependScope(yyscanner);
@@ -3724,14 +3882,14 @@ NONLopt [^\n]*
{
if ((yyextra->current->section == Entry::ENUM_SEC) || (yyextra->current->spec&Entry::Enum))
{
- yyextra->current->program+=','; // add field terminator
+ yyextra->current->program << ','; // add field terminator
}
// add compound definition to the tree
yyextra->current->args=removeRedundantWhiteSpace(yyextra->current->args);
// was: yyextra->current->args.simplifyWhiteSpace();
yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
yyextra->current->name = yyextra->current->name.stripWhiteSpace();
- //printf("adding '%s' '%s' '%s' brief=%s yyextra->insideObjC=%d %x\n",yyextra->current->type.data(),yyextra->current->name.data(),yyextra->current->args.data(),yyextra->current->brief.data(),yyextra->insideObjC,yyextra->current->section);
+ //printf("adding '%s' '%s' '%s' brief=%s yyextra->insideObjC=%d %x\n",qPrint(yyextra->current->type),qPrint(yyextra->current->name),qPrint(yyextra->current->args),qPrint(yyextra->current->brief),yyextra->insideObjC,yyextra->current->section);
if (yyextra->insideObjC &&
((yyextra->current->spec&Entry::Interface) || (yyextra->current->spec==Entry::Category))
) // method definition follows
@@ -3775,7 +3933,7 @@ NONLopt [^\n]*
lineCount(yyscanner);
if ( yyextra->curlyCount>0 )
{
- yyextra->current->program += yytext ;
+ yyextra->current->program << yytext ;
--yyextra->curlyCount ;
}
else
@@ -3783,7 +3941,7 @@ NONLopt [^\n]*
yyextra->isTypedef = TRUE;
yyextra->current->endBodyLine = yyextra->yyLineNr;
QCString &cn = yyextra->current->name;
- QCString rn = yyextra->current_root->name.copy();
+ QCString rn = yyextra->current_root->name;
if (!cn.isEmpty() && !rn.isEmpty())
{
prependScope(yyscanner);
@@ -3798,13 +3956,13 @@ NONLopt [^\n]*
<TypedefName>{ID} {
if ((yyextra->current->section == Entry::ENUM_SEC) || (yyextra->current->spec&Entry::Enum))
{
- yyextra->current->program+=","; // add field terminator
+ yyextra->current->program << ","; // add field terminator
}
yyextra->current->name=yytext;
prependScope(yyscanner);
yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
- //printf("Adding compound %s %s %s\n",yyextra->current->type.data(),yyextra->current->name.data(),yyextra->current->args.data());
+ //printf("Adding compound %s %s %s\n",qPrint(yyextra->current->type),qPrint(yyextra->current->name),qPrint(yyextra->current->args));
if (!yyextra->firstTypedefEntry)
{
yyextra->firstTypedefEntry = yyextra->current;
@@ -3818,7 +3976,7 @@ NONLopt [^\n]*
yyextra->current->name.sprintf("@%d",anonCount++);
if ((yyextra->current->section == Entry::ENUM_SEC) || (yyextra->current->spec&Entry::Enum))
{
- yyextra->current->program+=','; // add field terminator
+ yyextra->current->program << ','; // add field terminator
}
// add compound definition to the tree
yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
@@ -3883,13 +4041,13 @@ NONLopt [^\n]*
// only look for class scopes, not namespace scopes
if ((p->section & Entry::COMPOUND_MASK) && !p->name.isEmpty())
{
- //printf("Trying scope '%s'\n",p->name.data());
+ //printf("Trying scope '%s'\n",qPrint(p->name));
int i=p->name.findRev("::");
int pi = (i==-1) ? 0 : i+2;
if (p->name.at(pi)=='@')
{
// anonymous compound yyextra->inside -> insert dummy variable name
- //printf("Adding anonymous variable for scope %s\n",p->name.data());
+ //printf("Adding anonymous variable for scope %s\n",qPrint(p->name));
yyextra->msName.sprintf("@%d",anonCount++);
break;
}
@@ -3898,7 +4056,7 @@ NONLopt [^\n]*
if (p==yyextra->current.get()) p=yyextra->current_root.get(); else p=p->parent();
}
}
- //printf("yyextra->msName=%s yyextra->current->name=%s\n",yyextra->msName.data(),yyextra->current->name.data());
+ //printf("yyextra->msName=%s yyextra->current->name=%s\n",qPrint(yyextra->msName),qPrint(yyextra->current->name));
if (!yyextra->msName.isEmpty()
/*&& yyextra->msName!=yyextra->current->name*/) // skip typedef T {} T;, removed due to bug608493
{
@@ -3929,7 +4087,7 @@ NONLopt [^\n]*
if (yyextra->isTypedef)
{
varEntry->type.prepend("typedef ");
- // //printf("yyextra->current->name = %s %s\n",yyextra->current->name.data(),yyextra->msName.data());
+ // //printf("yyextra->current->name = %s %s\n",qPrint(yyextra->current->name),qPrint(yyextra->msName));
}
if (typedefHidesStruct &&
yyextra->isTypedef &&
@@ -3946,16 +4104,16 @@ NONLopt [^\n]*
varEntry->fileName = yyextra->yyFileName;
varEntry->startLine = yyextra->yyLineNr;
varEntry->startColumn = yyextra->yyColNr;
- varEntry->doc = yyextra->current->doc.copy();
- varEntry->brief = yyextra->current->brief.copy();
+ varEntry->doc = yyextra->current->doc;
+ varEntry->brief = yyextra->current->brief;
varEntry->mGrpId = yyextra->current->mGrpId;
- varEntry->initializer = yyextra->current->initializer;
+ varEntry->initializer.str(yyextra->current->initializer.str());
varEntry->groups = yyextra->current->groups;
varEntry->sli = yyextra->current->sli;
//printf("Add: type='%s',name='%s',args='%s' brief=%s doc=%s\n",
- // varEntry->type.data(),varEntry->name.data(),
- // varEntry->args.data(),varEntry->brief.data(),varEntry->doc.data());
+ // qPrint(varEntry->type),qPrint(varEntry->name),
+ // qPrint(varEntry->args),qPrint(varEntry->brief),qPrint(varEntry->doc));
yyextra->current_root->moveToSubEntryAndKeep(varEntry);
}
}
@@ -3992,7 +4150,7 @@ NONLopt [^\n]*
<MemberSpec>"=" {
yyextra->lastInitializerContext=YY_START;
yyextra->initBracketCount=0;
- yyextra->current->initializer = yytext;
+ yyextra->current->initializer.str(yytext);
BEGIN(ReadInitializer);
/* BEGIN(MemberSpecSkip); */
}
@@ -4006,7 +4164,7 @@ NONLopt [^\n]*
*/
<MemberSpecSkip>"," { BEGIN(MemberSpec); }
<MemberSpecSkip>";" { unput(';'); BEGIN(MemberSpec); }
-<ReadBody,ReadNSBody,ReadBodyIntf>{BN}{1,80} { yyextra->current->program += yytext ;
+<ReadBody,ReadNSBody,ReadBodyIntf>{BN}{1,80} { yyextra->current->program << yytext ;
lineCount(yyscanner) ;
}
<ReadBodyIntf>"@end"/[^a-z_A-Z0-9] { // end of Objective C block
@@ -4016,7 +4174,7 @@ NONLopt [^\n]*
yyextra->insideObjC=FALSE;
BEGIN( FindMembers );
}
-<ReadBody,ReadNSBody,ReadBodyIntf>. { yyextra->current->program += yytext ; }
+<ReadBody,ReadNSBody,ReadBodyIntf>. { yyextra->current->program << yytext ; }
<FindMembers>"("/{BN}*"::"*{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" | /* typedef void (A<int>::func_t)(args...) */
<FindMembers>("("({BN}*"::"*{BN}*{TSCOPE}{BN}*"::")*({BN}*[*&\^]{BN}*)+)+ { /* typedef void (A::*ptr_t)(args...) or int (*func(int))[], the ^ is for Obj-C blocks */
@@ -4075,7 +4233,7 @@ NONLopt [^\n]*
}
<EndFuncPtr>")"{BNopt}/";" { // a variable with extra braces
lineCount(yyscanner);
- yyextra->current->type+=yyextra->funcPtrType.data()+1;
+ yyextra->current->type+=yyextra->funcPtrType.mid(1);
BEGIN(FindMembers);
}
<EndFuncPtr>")"{BNopt}/"(" { // a function pointer
@@ -4085,7 +4243,7 @@ NONLopt [^\n]*
}
<EndFuncPtr>")"{BNopt}/"[" { // an array of variables
lineCount(yyscanner);
- yyextra->current->type+=yyextra->funcPtrType.data();
+ yyextra->current->type+=yyextra->funcPtrType;
yyextra->current->args += ")";
BEGIN(FindMembers);
}
@@ -4097,7 +4255,7 @@ NONLopt [^\n]*
yyextra->current->bodyLine = yyextra->yyLineNr;
yyextra->current->bodyColumn = yyextra->yyColNr;
yyextra->currentArgumentContext = FuncFuncEnd;
- yyextra->fullArgString=yyextra->current->args.copy();
+ yyextra->fullArgString=yyextra->current->args;
yyextra->copyArgString=&yyextra->current->args;
BEGIN( ReadFuncArgType ) ;
}
@@ -4127,7 +4285,7 @@ NONLopt [^\n]*
}
<FuncFuncEnd>")"{BNopt}/[;{] {
lineCount(yyscanner);
- yyextra->current->type+=yyextra->funcPtrType.data()+1;
+ yyextra->current->type+=yyextra->funcPtrType.mid(1);
BEGIN(Function);
}
<FuncFuncEnd>")"{BNopt}/"[" { // function returning a pointer to an array
@@ -4169,7 +4327,7 @@ NONLopt [^\n]*
yyextra->current->bodyLine = yyextra->yyLineNr;
yyextra->current->bodyColumn = yyextra->yyColNr;
yyextra->currentArgumentContext = FuncQual;
- yyextra->fullArgString=yyextra->current->args.copy();
+ yyextra->fullArgString=yyextra->current->args;
yyextra->copyArgString=&yyextra->current->args;
BEGIN( ReadFuncArgType ) ;
//printf(">>> Read function arguments!\n");
@@ -4190,7 +4348,7 @@ NONLopt [^\n]*
yyextra->current->bodyLine = yyextra->yyLineNr;
yyextra->current->bodyColumn = yyextra->yyColNr;
yyextra->currentArgumentContext = FuncQual;
- yyextra->fullArgString=yyextra->current->args.copy();
+ yyextra->fullArgString=yyextra->current->args;
yyextra->copyArgString=&yyextra->current->args;
BEGIN( ReadFuncArgType ) ;
//printf(">>> Read function arguments yyextra->current->argList.size()=%d\n",yyextra->current->argList.size());
@@ -4406,7 +4564,7 @@ NONLopt [^\n]*
<ReadTempArgs>">" {
*yyextra->copyArgString+=*yytext;
yyextra->fullArgString+=*yytext;
- //printf("end template list '%s'\n",yyextra->copyArgString->data());
+ //printf("end template list '%s'\n",qPrint(*yyextra->copyArgString));
*yyextra->currentArgumentList = *stringToArgumentList(yyextra->language, yyextra->fullArgString);
BEGIN( yyextra->currentArgumentContext );
}
@@ -4621,6 +4779,11 @@ NONLopt [^\n]*
unput(*yytext);
BEGIN(FuncQual);
}
+<TrailingReturn>"requires"{BN}+ {
+ yyextra->requiresContext = FuncQual;
+ yyextra->current->req+=' ';
+ BEGIN(RequiresClause);
+ }
<TrailingReturn>"(" {
yyextra->roundCount++;
yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
@@ -4635,7 +4798,7 @@ NONLopt [^\n]*
{
warn(yyextra->yyFileName,yyextra->yyLineNr,
"Found ')' without opening '(' for trailing return type '%s)...'",
- yyextra->current->argList.trailingReturnType().data());
+ qPrint(yyextra->current->argList.trailingReturnType()));
}
yyextra->current->argList.setTrailingReturnType(yyextra->current->argList.trailingReturnType()+yytext);
yyextra->current->args+=yytext;
@@ -4674,7 +4837,7 @@ NONLopt [^\n]*
// typically an initialized function pointer
yyextra->lastInitializerContext=YY_START;
yyextra->initBracketCount=0;
- yyextra->current->initializer = yytext;
+ yyextra->current->initializer.str(yytext);
BEGIN(ReadInitializer);
}
}
@@ -4728,8 +4891,15 @@ NONLopt [^\n]*
yyextra->current->args += *yytext;
lineCount(yyscanner);
}
-<FuncQual>{ID} { // typically a K&R style C function
- if (yyextra->insideCS && qstrcmp(yytext,"where")==0)
+<FuncQual>{ID} {
+ if (yyextra->insideCpp && qstrcmp(yytext,"requires")==0)
+ {
+ // c++20 trailing requires clause
+ yyextra->requiresContext = YY_START;
+ yyextra->current->req+=' ';
+ BEGIN(RequiresClause);
+ }
+ else if (yyextra->insideCS && qstrcmp(yytext,"where")==0)
{
// type constraint for a method
yyextra->current->typeConstr.clear();
@@ -4737,7 +4907,7 @@ NONLopt [^\n]*
yyextra->lastCSConstraint = YY_START;
BEGIN( CSConstraintName );
}
- else if (checkForKnRstyleC(yyscanner))
+ else if (checkForKnRstyleC(yyscanner)) // K&R style C function
{
yyextra->current->args = yytext;
yyextra->oldStyleArgType.resize(0);
@@ -4755,12 +4925,12 @@ NONLopt [^\n]*
QCString doc,brief;
if (yyextra->current->doc!=yyextra->docBackup)
{
- doc=yyextra->current->doc.copy();
+ doc=yyextra->current->doc;
yyextra->current->doc=yyextra->docBackup;
}
if (yyextra->current->brief!=yyextra->briefBackup)
{
- brief=yyextra->current->brief.copy();
+ brief=yyextra->current->brief;
yyextra->current->brief=yyextra->briefBackup;
}
addKnRArgInfo(yyscanner,yyextra->oldStyleArgType+oldStyleArgPtr,
@@ -4867,7 +5037,7 @@ NONLopt [^\n]*
(!isFunction || yyextra->current->type.left(8)=="typedef "));
//printf("type=%s ts=%d te=%d ti=%d isFunction=%d\n",
- // yyextra->current->type.data(),ts,te,ti,isFunction);
+ // qPrint(yyextra->current->type),ts,te,ti,isFunction);
if (*yytext!=';' || (yyextra->current_root->section&Entry::COMPOUND_MASK) )
{
@@ -4876,7 +5046,7 @@ NONLopt [^\n]*
if (tempArg==-1) tempName=yyextra->current->name; else tempName=yyextra->current->name.left(tempArg);
if (isVariable)
{
- //printf("Scanner.l: found in class variable: '%s' '%s' '%s'\n", yyextra->current->type.data(),yyextra->current->name.data(),yyextra->current->args.data());
+ //printf("Scanner.l: found in class variable: '%s' '%s' '%s'\n", qPrint(yyextra->current->type),qPrint(yyextra->current->name),qPrint(yyextra->current->args));
if (yyextra->isTypedef && yyextra->current->type.left(8)!="typedef ")
{
yyextra->current->type.prepend("typedef ");
@@ -4885,14 +5055,14 @@ NONLopt [^\n]*
}
else
{
- //printf("Scanner.l: found in class function: '%s' '%s' '%s'\n", yyextra->current->type.data(),yyextra->current->name.data(),yyextra->current->args.data());
+ //printf("Scanner.l: found in class function: '%s' '%s' '%s'\n", qPrint(yyextra->current->type),qPrint(yyextra->current->name),qPrint(yyextra->current->args));
yyextra->current->section = Entry::FUNCTION_SEC ;
yyextra->current->proto = *yytext==';';
}
}
else // a global function prototype or function variable
{
- //printf("Scanner.l: prototype? type='%s' name='%s' args='%s'\n",yyextra->current->type.data(),yyextra->current->name.data(),yyextra->current->args.data());
+ //printf("Scanner.l: prototype? type='%s' name='%s' args='%s'\n",qPrint(yyextra->current->type),qPrint(yyextra->current->name),qPrint(yyextra->current->args));
if (isVariable)
{
if (yyextra->isTypedef && yyextra->current->type.left(8)!="typedef ")
@@ -4909,7 +5079,7 @@ NONLopt [^\n]*
yyextra->current->proto = TRUE;
}
}
- //printf("Adding entry '%s'\n",yyextra->current->name.data());
+ //printf("Adding entry '%s'\n",qPrint(yyextra->current->name));
if ( yyextra->insidePHP)
{
if (findAndRemoveWord(yyextra->current->type,"final"))
@@ -5041,7 +5211,7 @@ NONLopt [^\n]*
yyextra->docBlockInBody = FALSE;
yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
- yyextra->docBlock.resize(0);
+ yyextra->docBlock.str(std::string());
yyextra->docBlockTerm = '}';
if (yytext[yyleng-3]=='/')
{
@@ -5060,7 +5230,7 @@ NONLopt [^\n]*
yyextra->docBlockInBody = FALSE;
yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
- yyextra->docBlock.resize(0);
+ yyextra->docBlock.str(std::string());
yyextra->docBlockTerm = '}';
if (yytext[yyleng-3]=='/')
{
@@ -5110,12 +5280,12 @@ NONLopt [^\n]*
}
<SkipCurly,SkipCurlyCpp>{B}*{RAWBEGIN} {
QCString raw=QCString(yytext).stripWhiteSpace();
- yyextra->delimiter = raw.data()+2;
+ yyextra->delimiter = raw.mid(2);
yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
yyextra->lastRawStringContext = YY_START;
yyextra->dummyRawString.resize(0);
yyextra->pCopyRawString = &yyextra->dummyRawString;
- *yyextra->pCopyRawString+=yytext;
+ *yyextra->pCopyRawString += yytext;
BEGIN(RawString);
}
<SkipCurly,SkipCurlyCpp>[^\n#"'@\\/{}<]+ {
@@ -5311,9 +5481,9 @@ NONLopt [^\n]*
// a purpose of its own
yyextra->current->name = yytext;
yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
- //printf("template class declaration for %s!\n",yyextra->current->name.data());
- QCString rn = yyextra->current_root->name.copy();
- //printf("cn='%s' rn='%s' yyextra->isTypedef=%d\n",cn.data(),rn.data(),yyextra->isTypedef);
+ //printf("template class declaration for %s!\n",qPrint(yyextra->current->name));
+ QCString rn = yyextra->current_root->name;
+ //printf("cn='%s' rn='%s' yyextra->isTypedef=%d\n",qPrint(cn),qPrint(rn),yyextra->isTypedef);
if (!yyextra->current->name.isEmpty() && !rn.isEmpty())
{
prependScope(yyscanner);
@@ -5387,6 +5557,17 @@ NONLopt [^\n]*
}
<AlignAsEnd>\n { lineCount(yyscanner); }
<AlignAsEnd>.
+<ConceptName>{ID} {
+ yyextra->current->name = yytext ;
+ }
+<ConceptName>"=" {
+ yyextra->current->bodyLine = yyextra->yyLineNr;
+ yyextra->current->bodyColumn = yyextra->yyColNr;
+ yyextra->current->initializer.str(std::string());
+ yyextra->lastInitializerContext = FindMembers;
+ yyextra->initBracketCount=0;
+ BEGIN(ReadInitializer);
+ }
<CompoundName>{SCOPENAME}/{BN}*"," { // multiple forward declarations on one line
// e.g. @protocol A,B;
yyextra->current->reset();
@@ -5659,7 +5840,7 @@ NONLopt [^\n]*
else
{
lineCount(yyscanner);
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
yyextra->current->fileName = yyextra->yyFileName ;
yyextra->current->startLine = yyextra->yyLineNr ;
yyextra->current->startColumn = yyextra->yyColNr;
@@ -5678,7 +5859,7 @@ NONLopt [^\n]*
else
{
lineCount(yyscanner);
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
yyextra->current->fileName = yyextra->yyFileName ;
yyextra->current->startLine = yyextra->yyLineNr ;
yyextra->current->startColumn = yyextra->yyColNr;
@@ -5687,7 +5868,7 @@ NONLopt [^\n]*
}
}
<CompoundName,ClassVar>{B}*"{"{B}* {
- yyextra->current->program.resize(0);
+ yyextra->current->program.str(std::string());
yyextra->current->fileName = yyextra->yyFileName ;
yyextra->current->bodyLine = yyextra->yyLineNr;
yyextra->current->bodyColumn = yyextra->yyColNr;
@@ -5940,7 +6121,7 @@ NONLopt [^\n]*
}
}
<Bases>{B}*"{"{B}* {
- yyextra->current->program.resize(0);
+ yyextra->current->program.str(std::string());
yyextra->current->fileName = yyextra->yyFileName ;
yyextra->current->bodyLine = yyextra->yyLineNr;
yyextra->current->bodyColumn = yyextra->yyColNr;
@@ -5970,24 +6151,24 @@ NONLopt [^\n]*
}
<SkipUnionSwitch>\n { lineCount(yyscanner); }
<SkipUnionSwitch>.
-<Comment>{BN}+ { yyextra->current->program += yytext ;
+<Comment>{BN}+ { yyextra->current->program << yytext ;
lineCount(yyscanner) ;
}
-<Comment>{CCS} { yyextra->current->program += yytext ; }
-<Comment>{CPPC} { yyextra->current->program += yytext ; }
+<Comment>{CCS} { yyextra->current->program << yytext ; }
+<Comment>{CPPC} { yyextra->current->program << yytext ; }
<Comment>{CMD}("code"|"verbatim") {
yyextra->insideCode=TRUE;
- yyextra->current->program += yytext ;
+ yyextra->current->program << yytext ;
}
<Comment>{CMD}("endcode"|"endverbatim") {
yyextra->insideCode=FALSE;
- yyextra->current->program += yytext ;
+ yyextra->current->program << yytext ;
}
-<Comment>[^ \.\t\r\n\/\*]+ { yyextra->current->program += yytext ; }
-<Comment>{CCE} { yyextra->current->program += yytext ;
+<Comment>[^ \.\t\r\n\/\*]+ { yyextra->current->program << yytext ; }
+<Comment>{CCE} { yyextra->current->program << yytext ;
if (!yyextra->insideCode) BEGIN( yyextra->lastContext ) ;
}
-<Comment>. { yyextra->current->program += *yytext ; }
+<Comment>. { yyextra->current->program << *yytext ; }
<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,SkipC11Attribute,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"!" {
//printf("Start doc block at %d\n",yyextra->yyLineNr);
@@ -6012,7 +6193,7 @@ NONLopt [^\n]*
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
if (yyextra->docBlockAutoBrief)
{
@@ -6044,7 +6225,7 @@ NONLopt [^\n]*
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
if (yyextra->docBlockAutoBrief)
{
@@ -6056,7 +6237,7 @@ NONLopt [^\n]*
}
else
{
- yyextra->current->program += yytext ;
+ yyextra->current->program << yytext ;
yyextra->lastContext = YY_START ;
BEGIN( Comment ) ;
}
@@ -6078,7 +6259,7 @@ NONLopt [^\n]*
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
if (yyextra->docBlockAutoBrief)
{
@@ -6100,7 +6281,7 @@ NONLopt [^\n]*
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
startCommentBlock(yyscanner,yyextra->current->brief.isEmpty());
BEGIN( DocLine );
@@ -6116,7 +6297,7 @@ NONLopt [^\n]*
yyextra->docBlockAutoBrief = FALSE;
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
startCommentBlock(yyscanner,yyextra->current->brief.isEmpty());
BEGIN( DocLine );
}
@@ -6187,7 +6368,7 @@ NONLopt [^\n]*
// C++11 style initializer list
yyextra->current->bodyLine = yyextra->yyLineNr;
yyextra->current->bodyColumn = yyextra->yyColNr;
- yyextra->current->initializer = yytext;
+ yyextra->current->initializer.str(yytext);
yyextra->lastInitializerContext = YY_START;
yyextra->initBracketCount=1;
BEGIN(ReadInitializer);
@@ -6198,7 +6379,7 @@ NONLopt [^\n]*
<CSAccessorDecl>"}"{B}*"=" {
// fall back to next rule if it's not the right bracket
if (yyextra->curlyCount != 0) REJECT;
- yyextra->current->initializer = "=";
+ yyextra->current->initializer.str("=");
yyextra->current->endBodyLine=yyextra->yyLineNr;
yyextra->lastInitializerContext = FindMembers;
BEGIN(ReadInitializer);
@@ -6302,57 +6483,56 @@ NONLopt [^\n]*
/* ---- Single line comments ------ */
<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? { // continuation of multiline C++-style comment
- yyextra->docBlock+=yytext;
int markerLen = yytext[yyleng-1]=='<' ? 4 : 3;
- yyextra->docBlock.resize(yyextra->docBlock.length() - markerLen);
+ yyextra->docBlock << std::string(yytext).substr(0,yyleng-markerLen);
lineCount(yyscanner);
}
<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" { // ignore marker line (see bug700345)
- handleCommentBlock(yyscanner,yyextra->docBlock.data(),yyextra->current->brief.isEmpty());
+ handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
BEGIN( yyextra->docBlockContext );
}
<DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" { // next line is an end group marker, see bug 752712
- yyextra->docBlock+=yytext;
- handleCommentBlock(yyscanner,yyextra->docBlock.data(),yyextra->current->brief.isEmpty());
+ yyextra->docBlock << yytext;
+ handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
BEGIN( yyextra->docBlockContext );
}
<DocLine>{NONLopt}/"\n" { // whole line
- yyextra->docBlock+=yytext;
- handleCommentBlock(yyscanner,yyextra->docBlock.data(),yyextra->current->brief.isEmpty());
+ yyextra->docBlock << yytext;
+ handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
BEGIN( yyextra->docBlockContext );
}
/* ---- Comments blocks ------ */
<DocBlock>"*"*{CCE} { // end of comment block
- handleCommentBlock(yyscanner,yyextra->docBlock.data(),FALSE);
+ handleCommentBlock(yyscanner,yyextra->docBlock.str(),FALSE);
BEGIN(yyextra->docBlockContext);
}
<DocBlock>^{B}*"*"+/[^/] {
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock+=indent;
+ yyextra->docBlock << indent;
}
<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] { // start of a comment line
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock+=indent;
+ yyextra->docBlock << indent;
}
<DocBlock>^{B}*({CPPC}){B}* { // strip embedded C++ comments if at the start of a line
}
<DocBlock>{CPPC} { // slashes in the middle of a comment block
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
}
<DocBlock>{CCS} { // start of a new comment in the
// middle of a comment block
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
}
<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] { // escaped command
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
}
<DocBlock>{CMD}("f$"|"f["|"f{") {
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
yyextra->docBlockName=&yytext[1];
if (yyextra->docBlockName.at(1)=='{')
{
@@ -6363,14 +6543,14 @@ NONLopt [^\n]*
BEGIN(DocCopyBlock);
}
<DocBlock>{B}*"<"{PRE}">" {
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
yyextra->docBlockName="<pre>";
yyextra->fencedSize=0;
yyextra->nestedComment=FALSE;
BEGIN(DocCopyBlock);
}
<DocBlock>{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"rtfonly"|"docbookonly"|"dot"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!)
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
yyextra->docBlockName=&yytext[1];
yyextra->fencedSize=0;
yyextra->nestedComment=FALSE;
@@ -6379,7 +6559,7 @@ NONLopt [^\n]*
<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
QCString pat = substitute(yytext,"*"," ");
- yyextra->docBlock+=pat;
+ yyextra->docBlock << pat;
yyextra->docBlockName="~~~";
yyextra->fencedSize=pat.stripWhiteSpace().length();
yyextra->nestedComment=FALSE;
@@ -6387,7 +6567,7 @@ NONLopt [^\n]*
}
<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
QCString pat = substitute(yytext,"*"," ");
- yyextra->docBlock+=pat;
+ yyextra->docBlock << pat;
yyextra->docBlockName="```";
yyextra->fencedSize=pat.stripWhiteSpace().length();
yyextra->nestedComment=FALSE;
@@ -6396,7 +6576,7 @@ NONLopt [^\n]*
<DocBlock>{B}*"<code>" {
if (yyextra->insideCS)
{
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
yyextra->docBlockName="<code>";
yyextra->nestedComment=FALSE;
BEGIN(DocCopyBlock);
@@ -6407,38 +6587,38 @@ NONLopt [^\n]*
}
}
<DocBlock>[^@*~\/\\\n]+ { // any character that isn't special
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
}
<DocBlock>\n { // newline
lineCount(yyscanner);
- yyextra->docBlock+=*yytext;
+ yyextra->docBlock << *yytext;
}
<DocBlock>. { // command block
- yyextra->docBlock+=*yytext;
+ yyextra->docBlock << *yytext;
}
/* ---- Copy verbatim sections ------ */
<DocCopyBlock>"</"{PRE}">" { // end of a <pre> block
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
if (yyextra->docBlockName=="<pre>")
{
BEGIN(DocBlock);
}
}
<DocCopyBlock>"</"{CODE}">" { // end of a <code> block
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
if (yyextra->docBlockName=="<code>")
{
BEGIN(DocBlock);
}
}
<DocCopyBlock>[\\@]("f$"|"f]"|"f}") {
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
BEGIN(DocBlock);
}
<DocCopyBlock>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
if (&yytext[4]==yyextra->docBlockName)
{
BEGIN(DocBlock);
@@ -6457,7 +6637,7 @@ NONLopt [^\n]*
{
QCString indent;
indent.fill(' ',computeIndent(yytext,0));
- yyextra->docBlock+=indent;
+ yyextra->docBlock << indent;
}
}
<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* { // start of a comment line with two *'s
@@ -6465,7 +6645,7 @@ NONLopt [^\n]*
{
QCString indent;
indent.fill(' ',computeIndent(yytext,0));
- yyextra->docBlock+=indent;
+ yyextra->docBlock << indent;
}
else
{
@@ -6477,7 +6657,7 @@ NONLopt [^\n]*
{
QCString indent;
indent.fill(' ',computeIndent(yytext,-1));
- yyextra->docBlock+=indent+"*";
+ yyextra->docBlock << indent+"*";
}
else
{
@@ -6491,12 +6671,12 @@ NONLopt [^\n]*
if (yyextra->nestedComment) // keep * it is part of the code
{
indent.fill(' ',computeIndent(yytext,-1));
- yyextra->docBlock+=indent+"*";
+ yyextra->docBlock << indent+"*";
}
else // remove * it is part of the comment block
{
indent.fill(' ',computeIndent(yytext,0));
- yyextra->docBlock+=indent;
+ yyextra->docBlock << indent;
}
}
else
@@ -6506,7 +6686,7 @@ NONLopt [^\n]*
}
<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
QCString pat = substitute(yytext,"*"," ");
- yyextra->docBlock+=pat;
+ yyextra->docBlock << pat;
if (yyextra->fencedSize==pat.stripWhiteSpace().length())
{
BEGIN(DocBlock);
@@ -6514,14 +6694,14 @@ NONLopt [^\n]*
}
<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
QCString pat = substitute(yytext,"*"," ");
- yyextra->docBlock+=pat;
+ yyextra->docBlock << pat;
if (yyextra->fencedSize==pat.stripWhiteSpace().length())
{
BEGIN(DocBlock);
}
}
<DocCopyBlock>[^\<@/\*\]~\$\\\n]+ { // any character that is not special
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
}
<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
if (yytext[1]=='*')
@@ -6532,20 +6712,20 @@ NONLopt [^\n]*
{
yyextra->nestedComment=FALSE;
}
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
}
<DocCopyBlock>\n { // newline
- yyextra->docBlock+=*yytext;
+ yyextra->docBlock << *yytext;
lineCount(yyscanner);
}
<DocCopyBlock>. { // any other character
- yyextra->docBlock+=*yytext;
+ yyextra->docBlock << *yytext;
}
<DocCopyBlock><<EOF>> {
warn(yyextra->yyFileName,yyextra->yyLineNr,
"reached end of file while inside a '%s' block!\n"
"The command that should end the block seems to be missing!\n",
- yyextra->docBlockName.data());
+ qPrint(yyextra->docBlockName));
yyterminate();
}
@@ -6558,7 +6738,7 @@ NONLopt [^\n]*
<Prototype>"(" {
yyextra->current->args+=*yytext;
yyextra->currentArgumentContext = PrototypeQual;
- yyextra->fullArgString = yyextra->current->args.copy();
+ yyextra->fullArgString = yyextra->current->args;
yyextra->copyArgString = &yyextra->current->args;
BEGIN( ReadFuncArgType ) ;
}
@@ -6580,7 +6760,7 @@ NONLopt [^\n]*
<PrototypePtr>"(" {
yyextra->current->args+=*yytext;
yyextra->currentArgumentContext = PrototypeQual;
- yyextra->fullArgString = yyextra->current->args.copy();
+ yyextra->fullArgString = yyextra->current->args;
yyextra->copyArgString = &yyextra->current->args;
BEGIN( ReadFuncArgType ) ;
}
@@ -6868,7 +7048,7 @@ static void setContext(yyscan_t yyscanner)
yyextra->language==SrcLangExt_Lex);
//printf("setContext(%s) yyextra->insideIDL=%d yyextra->insideJava=%d yyextra->insideCS=%d "
// "yyextra->insideD=%d yyextra->insidePHP=%d yyextra->insideObjC=%d\n",
- // yyextra->yyFileName.data(),yyextra->insideIDL,yyextra->insideJava,yyextra->insideCS,yyextra->insideD,yyextra->insidePHP,yyextra->insideObjC
+ // qPrint(yyextra->yyFileName),yyextra->insideIDL,yyextra->insideJava,yyextra->insideCS,yyextra->insideD,yyextra->insidePHP,yyextra->insideObjC
// );
}
@@ -6879,7 +7059,7 @@ static void prependScope(yyscan_t yyscanner)
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (yyextra->current_root->section & Entry::SCOPE_MASK)
{
- //printf("--- prependScope %s to %s\n",yyextra->current_root->name.data(),yyextra->current->name.data());
+ //printf("--- prependScope %s to %s\n",qPrint(yyextra->current_root->name),qPrint(yyextra->current->name));
yyextra->current->name.prepend(yyextra->current_root->name+"::");
//printf("prependScope #=%d #yyextra->current=%d\n",yyextra->current_root->tArgLists->count(),yyextra->current->tArgLists->count());
for (const ArgumentList &srcAl : yyextra->current_root->tArgLists)
@@ -6970,7 +7150,7 @@ static void splitKnRArg(yyscan_t yyscanner,QCString &oldStyleArgPtr,QCString &ol
}
else
{
- oldStyleArgName=yyextra->current->args.copy().stripWhiteSpace();
+ oldStyleArgName=yyextra->current->args.stripWhiteSpace();
}
}
}
@@ -6986,7 +7166,7 @@ static void splitKnRArg(yyscan_t yyscanner,QCString &oldStyleArgPtr,QCString &ol
}
else
{
- oldStyleArgName=yyextra->current->args.copy().stripWhiteSpace();
+ oldStyleArgName=yyextra->current->args.stripWhiteSpace();
}
}
}
@@ -7085,7 +7265,7 @@ static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool hideInBodyDocs = Config_getBool(HIDE_IN_BODY_DOCS);
if (yyextra->docBlockInBody && hideInBodyDocs) return;
- //printf("parseCommentBlock [%s] brief=%d\n",doc.data(),brief);
+ //printf("parseCommentBlock [%s] brief=%d\n",qPrint(doc),brief);
int lineNr = brief ? yyextra->current->briefLine : yyextra->current->docLine; // line of block start
// fill in inbodyFile && inbodyLine the first time, see bug 633891
@@ -7117,7 +7297,7 @@ static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief
)
)
{
- //printf("parseCommentBlock position=%d [%s]\n",position,doc.data()+position);
+ //printf("parseCommentBlock position=%d [%s]\n",position,qPrint(doc)+position);
if (needsEntry)
{
QCString docFile = yyextra->current->docFile;
@@ -7144,10 +7324,10 @@ static void handleParametersCommentBlocks(yyscan_t yyscanner,ArgumentList &al)
//printf(">>>>>>> handleParametersCommentBlocks()\n");
for (Argument &a : al)
{
- //printf(" Param %s docs=%s\n",a->name.data(),a->docs.data());
+ //printf(" Param %s docs=%s\n",qPrint(a->name),qPrint(a->docs));
if (!a.docs.isEmpty())
{
- if (!a.name && a.type == "...") a.name= "...";
+ if (a.name.isEmpty() && a.type == "...") a.name= "...";
int position=0;
bool needsEntry;
@@ -7160,7 +7340,7 @@ static void handleParametersCommentBlocks(yyscan_t yyscanner,ArgumentList &al)
yyextra->current->doc.resize(0);
yyextra->current->brief.resize(0);
- //printf("handleParametersCommentBlock [%s]\n",doc.data());
+ //printf("handleParametersCommentBlock [%s]\n",qPrint(doc));
while (yyextra->commentScanner.parseCommentBlock(
yyextra->thisParser,
yyextra->current.get(),
@@ -7177,7 +7357,7 @@ static void handleParametersCommentBlocks(yyscan_t yyscanner,ArgumentList &al)
)
)
{
- //printf("handleParametersCommentBlock position=%d [%s]\n",position,doc.data()+position);
+ //printf("handleParametersCommentBlock position=%d [%s]\n",position,qPrint(doc)+position);
if (needsEntry) newEntry(yyscanner);
}
if (needsEntry)
@@ -7201,18 +7381,19 @@ static void handleParametersCommentBlocks(yyscan_t yyscanner,ArgumentList &al)
static void parseCompounds(yyscan_t yyscanner,const std::shared_ptr<Entry> &rt)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- //printf("parseCompounds(%s)\n",rt->name.data());
+ //printf("parseCompounds(%s)\n",qPrint(rt->name));
for (const auto &ce : rt->children())
{
- if (!ce->program.isEmpty())
+ if (!ce->program.empty())
{
//printf("-- %s ---------\n%s\n---------------\n",
- // ce->name.data(),ce->program.data());
+ // qPrint(ce->name),qPrint(ce->program));
// init scanner state
yyextra->padCount=0;
//depthIf = 0;
yyextra->column=0;
- yyextra->inputString = ce->program;
+ yyextra->programStr = ce->program.str();
+ yyextra->inputString = yyextra->programStr.data();
yyextra->inputPosition = 0;
if (ce->section==Entry::ENUM_SEC || (ce->spec&Entry::Enum))
BEGIN( FindFields ) ;
@@ -7282,7 +7463,7 @@ static void parseCompounds(yyscan_t yyscanner,const std::shared_ptr<Entry> &rt)
}
yyextra->mtype = Method;
yyextra->virt = Normal;
- //printf("name=%s yyextra->current->stat=%d yyextra->stat=%d\n",ce->name.data(),yyextra->current->stat,yyextra->stat);
+ //printf("name=%s yyextra->current->stat=%d yyextra->stat=%d\n",qPrint(ce->name),yyextra->current->stat,yyextra->stat);
//memberGroupId = DOX_NOGROUP;
//memberGroupRelates.resize(0);
@@ -7296,7 +7477,8 @@ static void parseCompounds(yyscan_t yyscanner,const std::shared_ptr<Entry> &rt)
yyextra->commentScanner.leaveCompound(yyextra->yyFileName,yyextra->yyLineNr,name);
- ce->program.resize(0);
+ yyextra->programStr.resize(0);
+ ce->program.str(std::string());
//if (depthIf>0)
@@ -7311,7 +7493,7 @@ static void parseCompounds(yyscan_t yyscanner,const std::shared_ptr<Entry> &rt)
//----------------------------------------------------------------------------
static void parseMain(yyscan_t yyscanner,
- const char *fileName,
+ const QCString &fileName,
const char *fileBuf,
const std::shared_ptr<Entry> &rt,
ClangTUParser *clangParser)
@@ -7337,7 +7519,7 @@ static void parseMain(yyscan_t yyscanner,
yyextra->clangParser = clangParser;
setContext(yyscanner);
rt->lang = yyextra->language;
- msg("Parsing file %s...\n",yyextra->yyFileName.data());
+ msg("Parsing file %s...\n",qPrint(yyextra->yyFileName));
yyextra->current_root = rt;
initParser(yyscanner);
@@ -7373,7 +7555,8 @@ static void parseMain(yyscan_t yyscanner,
//forceEndGroup();
yyextra->commentScanner.leaveFile(yyextra->yyFileName,yyextra->yyLineNr);
- rt->program.resize(0);
+ yyextra->programStr.resize(0);
+ rt->program.str(std::string());
parseCompounds(yyscanner,rt);
@@ -7382,7 +7565,7 @@ static void parseMain(yyscan_t yyscanner,
// add additional entries that were created during processing
for (auto &kv: yyextra->outerScopeEntries)
{
- //printf(">>> adding '%s' to scope '%s'\n",kv.second->name.data(),kv.first->name.data());
+ //printf(">>> adding '%s' to scope '%s'\n",qPrint(kv.second->name),qPrint(kv.first->name));
kv.first->moveToSubEntryAndKeep(kv.second);
}
yyextra->outerScopeEntries.clear();
@@ -7394,7 +7577,7 @@ static void parseMain(yyscan_t yyscanner,
static void parsePrototype(yyscan_t yyscanner,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- //printf("**** parsePrototype(%s) begin\n",text.data());
+ //printf("**** parsePrototype(%s) begin\n",qPrint(text));
if (text.isEmpty())
{
warn(yyextra->yyFileName,yyextra->yyLineNr,"Empty prototype found!");
@@ -7416,7 +7599,7 @@ static void parsePrototype(yyscan_t yyscanner,const QCString &text)
orgInputPosition = yyextra->inputPosition;
// set new string
- yyextra->inputString = text;
+ yyextra->inputString = text.data();
yyextra->inputPosition = 0;
yyextra->column = 0;
scannerYYrestart(0, yyscanner);
@@ -7472,19 +7655,19 @@ COutlineParser::~COutlineParser()
scannerYYlex_destroy(p->yyscanner);
}
-void COutlineParser::parseInput(const char *fileName,
- const char *fileBuf,
- const std::shared_ptr<Entry> &root,
- ClangTUParser *clangParser)
+void COutlineParser::parseInput(const QCString &fileName,
+ const char *fileBuf,
+ const std::shared_ptr<Entry> &root,
+ ClangTUParser *clangParser)
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
yyextra->thisParser = this;
- printlex(yy_flex_debug, TRUE, __FILE__, fileName);
+ printlex(yy_flex_debug, TRUE, __FILE__, qPrint(fileName));
::parseMain(p->yyscanner,fileName,fileBuf,root,clangParser);
- printlex(yy_flex_debug, FALSE, __FILE__, fileName);
+ printlex(yy_flex_debug, FALSE, __FILE__, qPrint(fileName));
}
@@ -7498,7 +7681,7 @@ bool COutlineParser::needsPreprocessing(const QCString &extension) const
);
}
-void COutlineParser::parsePrototype(const char *text)
+void COutlineParser::parsePrototype(const QCString &text)
{
::parsePrototype(p->yyscanner,text);
}
diff --git a/src/scopedtypevariant.h b/src/scopedtypevariant.h
index d544434..a1bece7 100644
--- a/src/scopedtypevariant.h
+++ b/src/scopedtypevariant.h
@@ -18,7 +18,8 @@
#include <utility>
#include <vector>
-#include <qcstring.h>
+
+#include "qcstring.h"
#include "definition.h"
//! Class representing a local class definition found while
@@ -277,7 +278,7 @@ class CallContext
void clear()
{
m_stvList.clear();
- m_stvList.push_back(Ctx("",""));
+ m_stvList.push_back(Ctx(QCString(),QCString()));
}
const ScopedTypeVariant getScope() const
{
diff --git a/src/searchindex.cpp b/src/searchindex.cpp
index 61d2d6c..cf09e67 100644
--- a/src/searchindex.cpp
+++ b/src/searchindex.cpp
@@ -16,8 +16,7 @@
#include <ctype.h>
#include <assert.h>
-
-#include <qfile.h>
+#include <sstream>
#include "searchindex.h"
#include "config.h"
@@ -36,6 +35,8 @@
#include "resourcemgr.h"
#include "namespacedef.h"
#include "classdef.h"
+#include "utf8.h"
+#include "classlist.h"
//---------------------------------------------------------------------------------------------
// the following part is for the server based search engine
@@ -81,7 +82,7 @@ SearchIndex::SearchIndex() : SearchIndexIntf(Internal)
m_index.resize(numIndexEntries);
}
-void SearchIndex::setCurrentDoc(const Definition *ctx,const char *anchor,bool isSourceFile)
+void SearchIndex::setCurrentDoc(const Definition *ctx,const QCString &anchor,bool isSourceFile)
{
if (ctx==0) return;
assert(!isSourceFile || ctx->definitionType()==Definition::TypeFile);
@@ -89,7 +90,7 @@ void SearchIndex::setCurrentDoc(const Definition *ctx,const char *anchor,bool is
QCString url=isSourceFile ? (toFileDef(ctx))->getSourceFileBase() : ctx->getOutputFileBase();
url+=Config_getString(HTML_FILE_EXTENSION);
QCString baseUrl = url;
- if (anchor) url+=QCString("#")+anchor;
+ if (!anchor.isEmpty()) url+=QCString("#")+anchor;
if (!isSourceFile) baseUrl=url;
QCString name=ctx->qualifiedName();
if (ctx->definitionType()==Definition::TypeMember)
@@ -147,7 +148,7 @@ void SearchIndex::setCurrentDoc(const Definition *ctx,const char *anchor,bool is
case Definition::TypeGroup:
{
const GroupDef *gd = toGroupDef(ctx);
- if (gd->groupTitle())
+ if (!gd->groupTitle().isEmpty())
{
name = theTranslator->trGroup(TRUE,TRUE)+" "+gd->groupTitle();
}
@@ -175,9 +176,9 @@ void SearchIndex::setCurrentDoc(const Definition *ctx,const char *anchor,bool is
}
}
-static int charsToIndex(const char *word)
+static int charsToIndex(const QCString &word)
{
- if (word==0) return -1;
+ if (word.length()<2) return -1;
// Fast string hashing algorithm
//register ushort h=0;
@@ -190,18 +191,16 @@ static int charsToIndex(const char *word)
//return h;
// Simple hashing that allows for substring searching
- uint c1=((uchar *)word)[0];
- if (c1==0) return -1;
- uint c2=((uchar *)word)[1];
- if (c2==0) return -1;
+ uint c1=(uchar)word[0];
+ uint c2=(uchar)word[1];
return c1*256+c2;
}
-void SearchIndex::addWord(const char *word,bool hiPriority,bool recurse)
+void SearchIndex::addWord(const QCString &word,bool hiPriority,bool recurse)
{
- if (word==0 || word[0]=='\0') return;
+ if (word.isEmpty()) return;
QCString wStr = QCString(word).lower();
- //printf("SearchIndex::addWord(%s,%d) wStr=%s\n",word,hiPriority,wStr.data());
+ //printf("SearchIndex::addWord(%s,%d) wStr=%s\n",word,hiPriority,qPrint(wStr));
int idx=charsToIndex(wStr);
if (idx<0 || idx>=static_cast<int>(m_index.size())) return;
auto it = m_words.find(wStr.str());
@@ -219,7 +218,7 @@ void SearchIndex::addWord(const char *word,bool hiPriority,bool recurse)
i=getPrefixIndex(word);
if (i>0)
{
- addWord(word+i,hiPriority,TRUE);
+ addWord(word.data()+i,hiPriority,TRUE);
found=TRUE;
}
}
@@ -234,32 +233,32 @@ void SearchIndex::addWord(const char *word,bool hiPriority,bool recurse)
}
if (word[i]!=0 && i>=1)
{
- addWord(word+i+1,hiPriority,TRUE);
+ addWord(word.data()+i+1,hiPriority,TRUE);
}
}
}
-void SearchIndex::addWord(const char *word,bool hiPriority)
+void SearchIndex::addWord(const QCString &word,bool hiPriority)
{
addWord(word,hiPriority,FALSE);
}
-static void writeInt(QFile &f,size_t index)
+static void writeInt(std::ostream &f,size_t index)
{
- f.putch(static_cast<int>(index>>24));
- f.putch(static_cast<int>((index>>16)&0xff));
- f.putch(static_cast<int>((index>>8)&0xff));
- f.putch(static_cast<int>(index&0xff));
+ f.put(static_cast<int>(index>>24));
+ f.put(static_cast<int>((index>>16)&0xff));
+ f.put(static_cast<int>((index>>8)&0xff));
+ f.put(static_cast<int>(index&0xff));
}
-static void writeString(QFile &f,const char *s)
+static void writeString(std::ostream &f,const QCString &s)
{
- const char *p = s;
- while (*p) f.putch(*p++);
- f.putch(0);
+ uint l = s.length();
+ for (uint i=0;i<l;i++) f.put(s[i]);
+ f.put(0);
}
-void SearchIndex::write(const char *fileName)
+void SearchIndex::write(const QCString &fileName)
{
size_t i;
size_t size=4; // for the header
@@ -332,11 +331,11 @@ void SearchIndex::write(const char *fileName)
}
//printf("Total size %x bytes (word=%x stats=%x urls=%x)\n",size,wordsOffset,statsOffset,urlsOffset);
- QFile f(fileName);
- if (f.open(IO_WriteOnly))
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (f.is_open())
{
// write header
- f.putch('D'); f.putch('O'); f.putch('X'); f.putch('S');
+ f.put('D'); f.put('O'); f.put('X'); f.put('S');
// write index
for (i=0;i<numIndexEntries;i++)
{
@@ -354,11 +353,11 @@ void SearchIndex::write(const char *fileName)
writeString(f,iw.word());
writeInt(f,wordStatOffsets[count++]);
}
- f.putch(0);
+ f.put(0);
}
}
// write extra padding bytes
- for (i=0;i<padding;i++) f.putch(0);
+ for (i=0;i<padding;i++) f.put(0);
// write word statistics
for (i=0;i<numIndexEntries;i++)
{
@@ -452,6 +451,8 @@ static QCString definitionToName(const Definition *ctx)
return "file";
case Definition::TypeNamespace:
return "namespace";
+ case Definition::TypeConcept:
+ return "concept";
case Definition::TypeGroup:
return "group";
case Definition::TypePackage:
@@ -467,12 +468,12 @@ static QCString definitionToName(const Definition *ctx)
return "unknown";
}
-void SearchIndexExternal::setCurrentDoc(const Definition *ctx,const char *anchor,bool isSourceFile)
+void SearchIndexExternal::setCurrentDoc(const Definition *ctx,const QCString &anchor,bool isSourceFile)
{
static QCString extId = stripPath(Config_getString(EXTERNAL_SEARCH_ID));
QCString baseName = isSourceFile ? (toFileDef(ctx))->getSourceFileBase() : ctx->getOutputFileBase();
QCString url = baseName + Doxygen::htmlFileExtension;
- if (anchor) url+=QCString("#")+anchor;
+ if (!anchor.isEmpty()) url+=QCString("#")+anchor;
QCString key = extId+";"+url;
auto it = p->docEntries.find(key.str());
@@ -488,54 +489,53 @@ void SearchIndexExternal::setCurrentDoc(const Definition *ctx,const char *anchor
e.extId = extId;
e.url = url;
it = p->docEntries.insert({key.str(),e}).first;
- //printf("searchIndexExt %s : %s\n",e->name.data(),e->url.data());
+ //printf("searchIndexExt %s : %s\n",qPrint(e->name),qPrint(e->url));
}
p->current = &it->second;
}
-void SearchIndexExternal::addWord(const char *word,bool hiPriority)
+void SearchIndexExternal::addWord(const QCString &word,bool hiPriority)
{
- if (word==0 || !isId(*word) || p->current==0) return;
+ if (word.isEmpty() || !isId(word[0]) || p->current==0) return;
GrowBuf *pText = hiPriority ? &p->current->importantText : &p->current->normalText;
if (pText->getPos()>0) pText->addChar(' ');
pText->addStr(word);
//printf("addWord %s\n",word);
}
-void SearchIndexExternal::write(const char *fileName)
+void SearchIndexExternal::write(const QCString &fileName)
{
- QFile f(fileName);
- if (f.open(IO_WriteOnly))
+ std::ofstream t(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (t.is_open())
{
- FTextStream t(&f);
- t << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
- t << "<add>" << endl;
+ t << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ t << "<add>\n";
for (auto &kv : p->docEntries)
{
SearchDocEntry &doc = kv.second;
doc.normalText.addChar(0); // make sure buffer ends with a 0 terminator
doc.importantText.addChar(0); // make sure buffer ends with a 0 terminator
- t << " <doc>" << endl;
- t << " <field name=\"type\">" << doc.type << "</field>" << endl;
- t << " <field name=\"name\">" << convertToXML(doc.name) << "</field>" << endl;
+ t << " <doc>\n";
+ t << " <field name=\"type\">" << doc.type << "</field>\n";
+ t << " <field name=\"name\">" << convertToXML(doc.name) << "</field>\n";
if (!doc.args.isEmpty())
{
- t << " <field name=\"args\">" << convertToXML(doc.args) << "</field>" << endl;
+ t << " <field name=\"args\">" << convertToXML(doc.args) << "</field>\n";
}
if (!doc.extId.isEmpty())
{
- t << " <field name=\"tag\">" << convertToXML(doc.extId) << "</field>" << endl;
+ t << " <field name=\"tag\">" << convertToXML(doc.extId) << "</field>\n";
}
- t << " <field name=\"url\">" << convertToXML(doc.url) << "</field>" << endl;
- t << " <field name=\"keywords\">" << convertToXML(doc.importantText.get()) << "</field>" << endl;
- t << " <field name=\"text\">" << convertToXML(doc.normalText.get()) << "</field>" << endl;
- t << " </doc>" << endl;
+ t << " <field name=\"url\">" << convertToXML(doc.url) << "</field>\n";
+ t << " <field name=\"keywords\">" << convertToXML(doc.importantText.get()) << "</field>\n";
+ t << " <field name=\"text\">" << convertToXML(doc.normalText.get()) << "</field>\n";
+ t << " </doc>\n";
}
- t << "</add>" << endl;
+ t << "</add>\n";
}
else
{
- err("Failed to open file %s for writing!\n",fileName);
+ err("Failed to open file %s for writing!\n",qPrint(fileName));
}
}
@@ -552,29 +552,25 @@ QCString searchName(const Definition *d)
QCString searchId(const Definition *d)
{
- QCString s = searchName(d);
- int c;
- uint i;
- QCString result;
- for (i=0;i<s.length();i++)
+ std::string s = searchName(d).str();
+ TextStream t;
+ for (size_t i=0;i<s.length();i++)
{
- c=s.at(i);
- if (c>0x7f || c<0) // part of multibyte character
- {
- result+=(char)c;
- }
- else if (isalnum(c)) // simply alpha numerical character
+ if (isIdJS(s[i]))
{
- result+=(char)tolower(c);
+ t << s[i];
}
- else // other 'unprintable' characters
+ else // escape non-identifier characters
{
- char val[4];
- sprintf(val,"_%02x",(uchar)c);
- result+=val;
+ static const char *hex = "0123456789ABCDEF";
+ unsigned char uc = static_cast<unsigned char>(s[i]);
+ t << '_';
+ t << hex[uc>>4];
+ t << hex[uc&0xF];
}
}
- return result;
+
+ return convertUTF8ToLower(t.str());
}
@@ -598,6 +594,7 @@ QCString searchId(const Definition *d)
#define SEARCH_INDEX_DEFINES 17
#define SEARCH_INDEX_GROUPS 18
#define SEARCH_INDEX_PAGES 19
+#define SEARCH_INDEX_CONCEPTS 20
static std::array<SearchIndexInfo,NUM_SEARCH_INDICES> g_searchIndexInfo =
{ {
@@ -627,7 +624,8 @@ static std::array<SearchIndexInfo,NUM_SEARCH_INDICES> g_searchIndexInfo =
{ /* SEARCH_INDEX_RELATED */ "related" , []() { return theTranslator->trFriends(); }, {} },
{ /* SEARCH_INDEX_DEFINES */ "defines" , []() { return theTranslator->trDefines(); }, {} },
{ /* SEARCH_INDEX_GROUPS */ "groups" , []() { return theTranslator->trGroup(TRUE,FALSE); }, {} },
- { /* SEARCH_INDEX_PAGES */ "pages" , []() { return theTranslator->trPage(TRUE,FALSE); }, {} }
+ { /* SEARCH_INDEX_PAGES */ "pages" , []() { return theTranslator->trPage(TRUE,FALSE); }, {} },
+ { /* SEARCH_INDEX_CONCEPTS */ "concepts" , []() { return theTranslator->trConcept(true,false); }, {} }
} };
static void addMemberToSearchIndex(const MemberDef *md)
@@ -645,11 +643,10 @@ static void addMemberToSearchIndex(const MemberDef *md)
)
)
{
- QCString n = md->name();
- if (!n.isEmpty())
+ std::string n = md->name().str();
+ if (!n.empty())
{
- char letter[MAX_UTF8_CHAR_SIZE];
- getUtf8Char(n,letter,CaseModifier::ToLower);
+ std::string letter = convertUTF8ToLower(getUTF8CharAt(n,0));
bool isFriendToHide = hideFriendCompounds &&
(QCString(md->typeString())=="friend class" ||
QCString(md->typeString())=="friend struct" ||
@@ -707,11 +704,10 @@ static void addMemberToSearchIndex(const MemberDef *md)
)
)
{
- QCString n = md->name();
- if (!n.isEmpty())
+ std::string n = md->name().str();
+ if (!n.empty())
{
- char letter[MAX_UTF8_CHAR_SIZE];
- getUtf8Char(n,letter,CaseModifier::ToLower);
+ std::string letter = convertUTF8ToLower(getUTF8CharAt(n,0));
g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,md);
if (md->isFunction())
@@ -757,8 +753,7 @@ void createJavaScriptSearchIndex()
// index classes
for (const auto &cd : *Doxygen::classLinkedMap)
{
- char letter[MAX_UTF8_CHAR_SIZE];
- getUtf8Char(cd->localName(),letter,CaseModifier::ToLower);
+ std::string letter = convertUTF8ToLower(getUTF8CharAt(cd->localName().str(),0));
if (cd->isLinkable())
{
g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,cd.get());
@@ -791,8 +786,7 @@ void createJavaScriptSearchIndex()
// index namespaces
for (const auto &nd : *Doxygen::namespaceLinkedMap)
{
- char letter[MAX_UTF8_CHAR_SIZE];
- getUtf8Char(nd->name(),letter,CaseModifier::ToLower);
+ std::string letter = convertUTF8ToLower(getUTF8CharAt(nd->name().str(),0));
if (nd->isLinkable())
{
g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,nd.get());
@@ -800,13 +794,23 @@ void createJavaScriptSearchIndex()
}
}
+ // index concepts
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ std::string letter = convertUTF8ToLower(getUTF8CharAt(cd->name().str(),0));
+ if (cd->isLinkable())
+ {
+ g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,cd.get());
+ g_searchIndexInfo[SEARCH_INDEX_CONCEPTS].add(letter,cd.get());
+ }
+ }
+
// index files
for (const auto &fn : *Doxygen::inputNameLinkedMap)
{
for (const auto &fd : *fn)
{
- char letter[MAX_UTF8_CHAR_SIZE];
- getUtf8Char(fd->name(),letter,CaseModifier::ToLower);
+ std::string letter = convertUTF8ToLower(getUTF8CharAt(fd->name().str(),0));
if (fd->isLinkable())
{
g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,fd.get());
@@ -846,11 +850,10 @@ void createJavaScriptSearchIndex()
{
if (gd->isLinkable())
{
- QCString title = gd->groupTitle();
- if (!title.isEmpty()) // TODO: able searching for all word in the title
+ std::string title = gd->groupTitle().str();
+ if (!title.empty()) // TODO: able searching for all word in the title
{
- char letter[MAX_UTF8_CHAR_SIZE];
- getUtf8Char(title,letter,CaseModifier::ToLower);
+ std::string letter = convertUTF8ToLower(getUTF8CharAt(title,0));
g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,gd.get());
g_searchIndexInfo[SEARCH_INDEX_GROUPS].add(letter,gd.get());
}
@@ -862,11 +865,10 @@ void createJavaScriptSearchIndex()
{
if (pd->isLinkable())
{
- QCString title = pd->title();
- if (!title.isEmpty())
+ std::string title = pd->title().str();
+ if (!title.empty())
{
- char letter[MAX_UTF8_CHAR_SIZE];
- getUtf8Char(title,letter,CaseModifier::ToLower);
+ std::string letter = convertUTF8ToLower(getUTF8CharAt(title,0));
g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,pd.get());
g_searchIndexInfo[SEARCH_INDEX_PAGES].add(letter,pd.get());
}
@@ -874,11 +876,10 @@ void createJavaScriptSearchIndex()
}
if (Doxygen::mainPage)
{
- QCString title = Doxygen::mainPage->title();
- if (!title.isEmpty())
+ std::string title = Doxygen::mainPage->title().str();
+ if (!title.empty())
{
- char letter[MAX_UTF8_CHAR_SIZE];
- getUtf8Char(title,letter,CaseModifier::ToLower);
+ std::string letter = convertUTF8ToLower(getUTF8CharAt(title,0));
g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,Doxygen::mainPage.get());
g_searchIndexInfo[SEARCH_INDEX_PAGES].add(letter,Doxygen::mainPage.get());
}
@@ -918,58 +919,55 @@ void writeJavaScriptSearchIndex()
QCString fileName = searchDirName + "/"+baseName+Doxygen::htmlFileExtension;
QCString dataFileName = searchDirName + "/"+baseName+".js";
- QFile outFile(fileName);
- QFile dataOutFile(dataFileName);
- if (outFile.open(IO_WriteOnly) && dataOutFile.open(IO_WriteOnly))
+ std::ofstream t(fileName.str(), std::ofstream::out | std::ofstream::binary);
+ std::ofstream ti(dataFileName.str(), std::ofstream::out | std::ofstream::binary);
+ if (t.is_open() && ti.is_open())
{
{
- FTextStream t(&outFile);
-
t << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\""
- " \"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" << endl;
- t << "<html xmlns=\"http://www.w3.org/1999/xhtml\">" << endl;
- t << "<head><title></title>" << endl;
- t << "<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>" << endl;
- t << "<meta name=\"generator\" content=\"Doxygen " << getDoxygenVersion() << "\"/>" << endl;
- t << "<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>" << endl;
- t << "<script type=\"text/javascript\" src=\"" << baseName << ".js\"></script>" << endl;
- t << "<script type=\"text/javascript\" src=\"search.js\"></script>" << endl;
- t << "</head>" << endl;
- t << "<body class=\"SRPage\">" << endl;
- t << "<div id=\"SRIndex\">" << endl;
- t << "<div class=\"SRStatus\" id=\"Loading\">" << theTranslator->trLoading() << "</div>" << endl;
- t << "<div id=\"SRResults\"></div>" << endl; // here the results will be inserted
- t << "<script type=\"text/javascript\">" << endl;
+ " \"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
+ t << "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
+ t << "<head><title></title>\n";
+ t << "<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n";
+ t << "<meta name=\"generator\" content=\"Doxygen " << getDoxygenVersion() << "\"/>\n";
+ t << "<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n";
+ t << "<script type=\"text/javascript\" src=\"" << baseName << ".js\"></script>\n";
+ t << "<script type=\"text/javascript\" src=\"search.js\"></script>\n";
+ t << "</head>\n";
+ t << "<body class=\"SRPage\">\n";
+ t << "<div id=\"SRIndex\">\n";
+ t << "<div class=\"SRStatus\" id=\"Loading\">" << theTranslator->trLoading() << "</div>\n";
+ t << "<div id=\"SRResults\"></div>\n"; // here the results will be inserted
+ t << "<script type=\"text/javascript\">\n";
t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
- t << "createResults();" << endl; // this function will insert the results
+ t << "createResults();\n"; // this function will insert the results
t << "/* @license-end */\n";
- t << "</script>" << endl;
+ t << "</script>\n";
t << "<div class=\"SRStatus\" id=\"Searching\">"
- << theTranslator->trSearching() << "</div>" << endl;
+ << theTranslator->trSearching() << "</div>\n";
t << "<div class=\"SRStatus\" id=\"NoMatches\">"
- << theTranslator->trNoMatches() << "</div>" << endl;
+ << theTranslator->trNoMatches() << "</div>\n";
- t << "<script type=\"text/javascript\">" << endl;
+ t << "<script type=\"text/javascript\">\n";
t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
- t << "document.getElementById(\"Loading\").style.display=\"none\";" << endl;
- t << "document.getElementById(\"NoMatches\").style.display=\"none\";" << endl;
- t << "var searchResults = new SearchResults(\"searchResults\");" << endl;
- t << "searchResults.Search();" << endl;
- t << "window.addEventListener(\"message\", function(event) {" << endl;
- t << " if (event.data == \"take_focus\") {" << endl;
- t << " var elem = searchResults.NavNext(0);" << endl;
- t << " if (elem) elem.focus();" << endl;
- t << " }" << endl;
- t << "});" << endl;
+ t << "document.getElementById(\"Loading\").style.display=\"none\";\n";
+ t << "document.getElementById(\"NoMatches\").style.display=\"none\";\n";
+ t << "var searchResults = new SearchResults(\"searchResults\");\n";
+ t << "searchResults.Search();\n";
+ t << "window.addEventListener(\"message\", function(event) {\n";
+ t << " if (event.data == \"take_focus\") {\n";
+ t << " var elem = searchResults.NavNext(0);\n";
+ t << " if (elem) elem.focus();\n";
+ t << " }\n";
+ t << "});\n";
t << "/* @license-end */\n";
- t << "</script>" << endl;
- t << "</div>" << endl; // SRIndex
- t << "</body>" << endl;
- t << "</html>" << endl;
+ t << "</script>\n";
+ t << "</div>\n"; // SRIndex
+ t << "</body>\n";
+ t << "</html>\n";
}
- FTextStream ti(&dataOutFile);
- ti << "var searchData=" << endl;
+ ti << "var searchData=\n";
// format
// searchData[] = array of items
// searchData[x][0] = id
@@ -980,7 +978,7 @@ void writeJavaScriptSearchIndex()
// searchData[x][1][y+1][1] = 1 => target="_parent"
// searchData[x][1][y+1][2] = scope
- ti << "[" << endl;
+ ti << "[\n";
bool firstEntry=TRUE;
int childCount=0;
@@ -997,7 +995,7 @@ void writeJavaScriptSearchIndex()
if (!firstEntry)
{
ti << "]]]";
- ti << "," << endl;
+ ti << ",\n";
}
firstEntry=FALSE;
@@ -1124,96 +1122,96 @@ void writeJavaScriptSearchIndex()
}
if (!firstEntry)
{
- ti << "]]]" << endl;
+ ti << "]]]\n";
}
- ti << "];" << endl;
+ ti << "];\n";
}
else
{
- err("Failed to open file '%s' for writing...\n",fileName.data());
+ err("Failed to open file '%s' for writing...\n",qPrint(fileName));
}
p++;
}
}
{
- QFile f(searchDirName+"/searchdata.js");
- if (f.open(IO_WriteOnly))
+ std::ofstream t(searchDirName.str()+"/searchdata.js",
+ std::ofstream::out | std::ofstream::binary);
+ if (t.is_open())
{
- FTextStream t(&f);
- t << "var indexSectionsWithContent =" << endl;
- t << "{" << endl;
+ t << "var indexSectionsWithContent =\n";
+ t << "{\n";
int j=0;
for (const auto &sii : g_searchIndexInfo)
{
if (!sii.symbolMap.empty())
{
- if (j>0) t << "," << endl;
+ if (j>0) t << ",\n";
t << " " << j << ": \"";
for (const auto &kv : sii.symbolMap)
{
if ( kv.first == "\"" ) t << "\\";
- t << kv.first.c_str();
+ t << kv.first;
}
t << "\"";
j++;
}
}
if (j>0) t << "\n";
- t << "};" << endl << endl;
- t << "var indexSectionNames =" << endl;
- t << "{" << endl;
+ t << "};\n\n";
+ t << "var indexSectionNames =\n";
+ t << "{\n";
j=0;
for (const auto &sii : g_searchIndexInfo)
{
if (!sii.symbolMap.empty())
{
- if (j>0) t << "," << endl;
+ if (j>0) t << ",\n";
t << " " << j << ": \"" << sii.name << "\"";
j++;
}
}
if (j>0) t << "\n";
- t << "};" << endl << endl;
- t << "var indexSectionLabels =" << endl;
- t << "{" << endl;
+ t << "};\n\n";
+ t << "var indexSectionLabels =\n";
+ t << "{\n";
j=0;
for (const auto &sii : g_searchIndexInfo)
{
if (!sii.symbolMap.empty())
{
- if (j>0) t << "," << endl;
+ if (j>0) t << ",\n";
t << " " << j << ": \"" << convertToXML(sii.getText()) << "\"";
j++;
}
}
if (j>0) t << "\n";
- t << "};" << endl << endl;
+ t << "};\n\n";
}
ResourceMgr::instance().copyResource("search.js",searchDirName);
}
{
- QFile f(searchDirName+"/nomatches"+Doxygen::htmlFileExtension);
- if (f.open(IO_WriteOnly))
+ QCString noMatchesFileName =searchDirName+"/nomatches"+Doxygen::htmlFileExtension;
+ std::ofstream t(noMatchesFileName.str(), std::ofstream::out | std::ofstream::binary);
+ if (t.is_open())
{
- FTextStream t(&f);
t << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" "
- "\"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" << endl;
- t << "<html xmlns=\"http://www.w3.org/1999/xhtml\">" << endl;
- t << "<head><title></title>" << endl;
- t << "<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>" << endl;
- t << "<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>" << endl;
- t << "<script type=\"text/javascript\" src=\"search.js\"></script>" << endl;
- t << "</head>" << endl;
- t << "<body class=\"SRPage\">" << endl;
- t << "<div id=\"SRIndex\">" << endl;
+ "\"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
+ t << "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
+ t << "<head><title></title>\n";
+ t << "<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n";
+ t << "<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n";
+ t << "<script type=\"text/javascript\" src=\"search.js\"></script>\n";
+ t << "</head>\n";
+ t << "<body class=\"SRPage\">\n";
+ t << "<div id=\"SRIndex\">\n";
t << "<div class=\"SRStatus\" id=\"NoMatches\">"
- << theTranslator->trNoMatches() << "</div>" << endl;
- t << "</div>" << endl;
- t << "</body>" << endl;
- t << "</html>" << endl;
+ << theTranslator->trNoMatches() << "</div>\n";
+ t << "</div>\n";
+ t << "</body>\n";
+ t << "</html>\n";
}
}
Doxygen::indexList->addStyleSheetFile("search/search.js");
@@ -1221,7 +1219,7 @@ void writeJavaScriptSearchIndex()
void SearchIndexInfo::add(const std::string &letter,const Definition *def)
{
- //printf("%p: %s->%s (full=%s)\n",this,letter.data(),searchName(def).data(),def->name().data());
+ //printf("%p: %s->%s (full=%s)\n",this,qPrint(letter),qPrint(searchName(def)),qPrint(def->name()));
auto it = symbolMap.find(letter);
if (it!=symbolMap.end())
{
diff --git a/src/searchindex.h b/src/searchindex.h
index 9039f00..893440e 100644
--- a/src/searchindex.h
+++ b/src/searchindex.h
@@ -24,7 +24,7 @@
#include <array>
#include <functional>
-#include <qcstring.h>
+#include "qcstring.h"
class Definition;
@@ -70,9 +70,9 @@ class SearchIndexIntf
enum Kind { Internal, External };
SearchIndexIntf(Kind k) : m_kind(k) {}
virtual ~SearchIndexIntf() {}
- virtual void setCurrentDoc(const Definition *ctx,const char *anchor,bool isSourceFile) = 0;
- virtual void addWord(const char *word,bool hiPriority) = 0;
- virtual void write(const char *file) = 0;
+ virtual void setCurrentDoc(const Definition *ctx,const QCString &anchor,bool isSourceFile) = 0;
+ virtual void addWord(const QCString &word,bool hiPriority) = 0;
+ virtual void write(const QCString &file) = 0;
Kind kind() const { return m_kind; }
private:
Kind m_kind;
@@ -82,11 +82,11 @@ class SearchIndex : public SearchIndexIntf
{
public:
SearchIndex();
- void setCurrentDoc(const Definition *ctx,const char *anchor,bool isSourceFile) override;
- void addWord(const char *word,bool hiPriority) override;
- void write(const char *file) override;
+ void setCurrentDoc(const Definition *ctx,const QCString &anchor,bool isSourceFile) override;
+ void addWord(const QCString &word,bool hiPriority) override;
+ void write(const QCString &file) override;
private:
- void addWord(const char *word,bool hiPrio,bool recurse);
+ void addWord(const QCString &word,bool hiPrio,bool recurse);
std::unordered_map<std::string,int> m_words;
std::vector< std::vector< IndexWord> > m_index;
std::unordered_map<std::string,int> m_url2IdMap;
@@ -100,16 +100,16 @@ class SearchIndexExternal : public SearchIndexIntf
struct Private;
public:
SearchIndexExternal();
- void setCurrentDoc(const Definition *ctx,const char *anchor,bool isSourceFile);
- void addWord(const char *word,bool hiPriority);
- void write(const char *file);
+ void setCurrentDoc(const Definition *ctx,const QCString &anchor,bool isSourceFile);
+ void addWord(const QCString &word,bool hiPriority);
+ void write(const QCString &file);
private:
std::unique_ptr<Private> p;
};
//------- client side search index ----------------------
-#define NUM_SEARCH_INDICES 20
+#define NUM_SEARCH_INDICES 21
QCString searchId(const Definition *d);
QCString searchName(const Definition *d);
diff --git a/src/section.h b/src/section.h
index 74eb04b..e5bbfc5 100644
--- a/src/section.h
+++ b/src/section.h
@@ -19,8 +19,7 @@
#include <string>
#include <unordered_map>
-#include <qcstring.h>
-
+#include "qcstring.h"
#include "linkedmap.h"
class Definition;
@@ -50,8 +49,8 @@ inline constexpr bool isSection(SectionType type)
class SectionInfo
{
public:
- SectionInfo(const char *label, const char *fileName, int lineNr,
- const char *title, SectionType type, int level,const char *ref) :
+ SectionInfo(const QCString &label, const QCString &fileName, int lineNr,
+ const QCString &title, SectionType type, int level,const QCString &ref) :
m_label(label), m_title(title), m_type(type), m_ref(ref),
m_lineNr(lineNr), m_fileName(fileName), m_level(level)
{
@@ -74,10 +73,10 @@ class SectionInfo
Definition *definition() const { return m_definition; }
// setters
- void setFileName(const char *fn) { m_fileName = fn; }
- void setType(SectionType t) { m_type = t; }
- void setGenerated(bool b) { m_generated = b; }
- void setDefinition(Definition *d) { m_definition = d; }
+ void setFileName(const QCString &fn) { m_fileName = fn; }
+ void setType(SectionType t) { m_type = t; }
+ void setGenerated(bool b) { m_generated = b; }
+ void setDefinition(Definition *d) { m_definition = d; }
private:
QCString m_label;
@@ -100,9 +99,9 @@ class SectionRefs
//! Returns a constant pointer to the section info given a section label or nullptr
//! if no section with the given label can be found.
- const SectionInfo *find(const char *label) const
+ const SectionInfo *find(const QCString &label) const
{
- auto it = m_lookup.find(label);
+ auto it = m_lookup.find(label.str());
return it!=m_lookup.end() ? it->second : nullptr;
}
@@ -131,15 +130,16 @@ class SectionManager : public LinkedMap<SectionInfo>
//! Returns a non-owning pointer to the newly added section.
SectionInfo *add(const SectionInfo &si)
{
- return LinkedMap<SectionInfo>::add(si.label(),si.fileName(),si.lineNr(),si.title(),si.type(),si.level(),si.ref());
+ return LinkedMap<SectionInfo>::add(si.label(),si.fileName(),
+ si.lineNr(),si.title(),si.type(),si.level(),si.ref());
}
//! Add a new section
//! Return a non-owning pointer to the newly added section
- SectionInfo *add(const char *label, const char *fileName, int lineNr,
- const char *title, SectionType type, int level,const char *ref=0)
+ SectionInfo *add(const QCString &label, const QCString &fileName, int lineNr,
+ const QCString &title, SectionType type, int level,const QCString &ref=QCString())
{
- return LinkedMap<SectionInfo>::add(label,fileName,lineNr,title,type,level,ref);
+ return LinkedMap<SectionInfo>::add(label.data(),fileName,lineNr,title,type,level,ref);
}
//! returns a reference to the singleton
diff --git a/src/sqlcode.h b/src/sqlcode.h
index aa465d7..64d7d06 100644
--- a/src/sqlcode.h
+++ b/src/sqlcode.h
@@ -33,11 +33,11 @@ class SQLCodeParser : public CodeParserInterface
SQLCodeParser();
virtual ~SQLCodeParser();
void parseCode(CodeOutputInterface &codeOutIntf,
- const char *scopeName,
+ const QCString &scopeName,
const QCString &input,
SrcLangExt,
bool isExampleBlock,
- const char *exampleName=0,
+ const QCString &exampleName=QCString(),
FileDef *fileDef=0,
int startLine=-1,
int endLine=-1,
diff --git a/src/sqlcode.l b/src/sqlcode.l
index b3a71d9..ffa8eaa 100644
--- a/src/sqlcode.l
+++ b/src/sqlcode.l
@@ -231,7 +231,7 @@ static void startCodeLine(yyscan_t yyscanner)
{
yyextra->currentDefinition = d;
yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
- yyextra->classScope = d->name().copy();
+ yyextra->classScope = d->name();
QCString lineAnchor;
lineAnchor.sprintf("l%05d",yyextra->yyLineNr);
if (yyextra->currentMemberDef)
@@ -245,13 +245,13 @@ static void startCodeLine(yyscan_t yyscanner)
{
yyextra->code->writeLineNumber(d->getReference(),
d->getOutputFileBase(),
- 0,yyextra->yyLineNr);
+ QCString(),yyextra->yyLineNr);
setCurrentDoc(yyscanner,lineAnchor);
}
}
else
{
- yyextra->code->writeLineNumber(0,0,0,yyextra->yyLineNr);
+ yyextra->code->writeLineNumber(QCString(),QCString(),QCString(),yyextra->yyLineNr);
}
}
@@ -396,11 +396,11 @@ void SQLCodeParser::resetCodeParserState()
}
void SQLCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
- const char *scopeName,
+ const QCString &scopeName,
const QCString &input,
SrcLangExt,
bool isExampleBlock,
- const char *exampleName,
+ const QCString &exampleName,
FileDef *fileDef,
int startLine,
int endLine,
@@ -416,10 +416,10 @@ void SQLCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
if (input.isEmpty()) return;
- printlex(yy_flex_debug, true, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
+ printlex(yy_flex_debug, true, __FILE__, fileDef ? qPrint(fileDef->fileName()): NULL);
yyextra->code = &codeOutIntf;
- yyextra->inputString = input;
+ yyextra->inputString = input.data();
yyextra->inputPosition = 0;
yyextra->currentFontClass = 0;
yyextra->needsTermination = false;
@@ -444,7 +444,7 @@ void SQLCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
if (isExampleBlock && fileDef==0)
{
// create a dummy filedef for the example
- yyextra->sourceFileDef = createFileDef("",(exampleName?exampleName:"generated"));
+ yyextra->sourceFileDef = createFileDef(QCString(),!exampleName.isEmpty() ? exampleName : QCString("generated"));
cleanupSourceDef = true;
}
@@ -472,7 +472,7 @@ void SQLCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
yyextra->sourceFileDef=0;
}
- printlex(yy_flex_debug, false, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
+ printlex(yy_flex_debug, false, __FILE__, fileDef ? qPrint(fileDef->fileName()): NULL);
}
//---------------------------------------------------------------------------------
diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp
index 222b076..7824fca 100644
--- a/src/sqlite3gen.cpp
+++ b/src/sqlite3gen.cpp
@@ -15,12 +15,13 @@
#include <stdlib.h>
#include <stdio.h>
+#include <sstream>
+
#include "settings.h"
#include "message.h"
#if USE_SQLITE3
-#include "qtbc.h"
#include "sqlite3gen.h"
#include "doxygen.h"
#include "xmlgen.h"
@@ -44,9 +45,10 @@
#include "pagedef.h"
#include "dirdef.h"
#include "section.h"
+#include "fileinfo.h"
+#include "dir.h"
#include <sys/stat.h>
-#include <qdir.h>
#include <string.h>
#include <sqlite3.h>
@@ -827,22 +829,22 @@ class TextGeneratorSqlite3Impl : public TextGeneratorIntf
{
public:
TextGeneratorSqlite3Impl(StringVector &l) : m_list(l) { }
- void writeString(const char * /*s*/,bool /*keepSpaces*/) const
+ void writeString(const QCString & /*s*/,bool /*keepSpaces*/) const
{
}
void writeBreak(int) const
{
DBG_CTX(("writeBreak\n"));
}
- void writeLink(const char * /*extRef*/,const char *file,
- const char *anchor,const char * /*text*/
+ void writeLink(const QCString & /*extRef*/,const QCString &file,
+ const QCString &anchor,const QCString & /*text*/
) const
{
- std::string rs = file;
- if (anchor)
+ std::string rs = file.str();
+ if (!anchor.isEmpty())
{
rs+="_1";
- rs+=anchor;
+ rs+=anchor.str();
}
m_list.push_back(rs);
}
@@ -852,14 +854,14 @@ class TextGeneratorSqlite3Impl : public TextGeneratorIntf
};
-static bool bindTextParameter(SqlStmt &s,const char *name,const char *value, bool _static=FALSE)
+static bool bindTextParameter(SqlStmt &s,const char *name,const QCString &value, bool _static=FALSE)
{
int idx = sqlite3_bind_parameter_index(s.stmt, name);
if (idx==0) {
err("sqlite3_bind_parameter_index(%s)[%s] failed: %s\n", name, s.query, sqlite3_errmsg(s.db));
return false;
}
- int rv = sqlite3_bind_text(s.stmt, idx, value, -1, _static==TRUE?SQLITE_STATIC:SQLITE_TRANSIENT);
+ int rv = sqlite3_bind_text(s.stmt, idx, value.data(), -1, _static==TRUE?SQLITE_STATIC:SQLITE_TRANSIENT);
if (rv!=SQLITE_OK) {
err("sqlite3_bind_text(%s)[%s] failed: %s\n", name, s.query, sqlite3_errmsg(s.db));
return false;
@@ -934,17 +936,17 @@ static void recordMetadata()
struct Refid {
int rowid;
- const char *refid;
+ QCString refid;
bool created;
};
-struct Refid insertRefid(const char *refid)
+struct Refid insertRefid(const QCString &refid)
{
- struct Refid ret;
+ Refid ret;
ret.rowid=-1;
ret.refid=refid;
ret.created = FALSE;
- if (refid==0) return ret;
+ if (refid.isEmpty()) return ret;
bindTextParameter(refid_select,":refid",refid);
ret.rowid=step(refid_select,TRUE,TRUE);
@@ -1370,9 +1372,15 @@ static void writeMemberTemplateLists(const MemberDef *md)
{
writeTemplateArgumentList(md->templateArguments(),md->getClassDef(),md->getFileDef());
}
+
static void writeTemplateList(const ClassDef *cd)
{
- writeTemplateArgumentList(cd->templateArguments(),cd,0);
+ writeTemplateArgumentList(cd->templateArguments(),cd,cd->getFileDef());
+}
+
+static void writeTemplateList(const ConceptDef *cd)
+{
+ writeTemplateArgumentList(cd->getTemplateParameterList(),cd,cd->getFileDef());
}
QCString getSQLDocBlock(const Definition *scope,
@@ -1381,9 +1389,9 @@ QCString getSQLDocBlock(const Definition *scope,
const QCString &fileName,
int lineNr)
{
- QGString s;
- if (doc.isEmpty()) return s.data();
- FTextStream t(&s);
+ if (doc.isEmpty()) return "";
+
+ TextStream t;
DocNode *root = validatingParseDoc(
fileName,
lineNr,
@@ -1399,15 +1407,15 @@ QCString getSQLDocBlock(const Definition *scope,
);
XMLCodeGenerator codeGen(t);
// create a parse tree visitor for XML
- XmlDocVisitor *visitor = new XmlDocVisitor(t,codeGen,scope?scope->getDefFileExtension():QCString(""));
+ XmlDocVisitor *visitor = new XmlDocVisitor(t,codeGen,
+ scope ? scope->getDefFileExtension() : QCString(""));
root->accept(visitor);
delete visitor;
delete root;
- QCString result = convertCharEntitiesToUTF8(s.data());
- return result.data();
+ return convertCharEntitiesToUTF8(t.str().c_str());
}
-static void getSQLDesc(SqlStmt &s,const char *col,const char *value,const Definition *def)
+static void getSQLDesc(SqlStmt &s,const char *col,const QCString &value,const Definition *def)
{
bindTextParameter(
s,
@@ -1650,7 +1658,7 @@ static void generateSqlite3ForMember(const MemberDef *md, struct Refid scope_ref
bindIntParameter(memberdef_insert,":maybevoid",md->isMaybeVoid());
bindIntParameter(memberdef_insert,":maybedefault",md->isMaybeDefault());
bindIntParameter(memberdef_insert,":maybeambiguous",md->isMaybeAmbiguous());
- if (md->bitfieldString())
+ if (!md->bitfieldString().isEmpty())
{
QCString bitfield = md->bitfieldString();
if (bitfield.at(0)==':') bitfield=bitfield.mid(1);
@@ -1715,17 +1723,17 @@ static void generateSqlite3ForMember(const MemberDef *md, struct Refid scope_ref
stripQualifiers(typeStr);
StringVector list;
linkifyText(TextGeneratorSqlite3Impl(list), def, md->getBodyDef(),md,typeStr);
- if (typeStr)
+ if (!typeStr.isEmpty())
{
bindTextParameter(memberdef_insert,":type",typeStr);
}
- if (md->definition())
+ if (!md->definition().isEmpty())
{
bindTextParameter(memberdef_insert,":definition",md->definition());
}
- if (md->argsString())
+ if (!md->argsString().isEmpty())
{
bindTextParameter(memberdef_insert,":argsstring",md->argsString());
}
@@ -1745,9 +1753,9 @@ static void generateSqlite3ForMember(const MemberDef *md, struct Refid scope_ref
if (md->getBodyDef())
{
DBG_CTX(("initializer:%s %s %s %d\n",
- md->anchor().data(),
+ qPrint(md->anchor()),
s.c_str(),
- md->getBodyDef()->getDefFileName().data(),
+ qPrint(md->getBodyDef()->getDefFileName()),
md->getStartBodyLine()));
QCString qsrc_refid = md->getOutputFileBase() + "_1" + md->anchor();
struct Refid src_refid = insertRefid(qsrc_refid);
@@ -1757,7 +1765,7 @@ static void generateSqlite3ForMember(const MemberDef *md, struct Refid scope_ref
}
}
- if ( md->getScopeString() )
+ if ( !md->getScopeString().isEmpty() )
{
bindTextParameter(memberdef_insert,":scope",md->getScopeString());
}
@@ -1802,7 +1810,7 @@ static void generateSqlite3ForMember(const MemberDef *md, struct Refid scope_ref
insertMemberFunctionParams(memberdef_id,md,def);
}
else if (md->memberType()==MemberType_Define &&
- md->argsString())
+ !md->argsString().isEmpty())
{
insertMemberDefineParams(memberdef_id,md,def);
}
@@ -1825,8 +1833,8 @@ static void generateSqlite3Section( const Definition *d,
const MemberList *ml,
struct Refid scope_refid,
const char * /*kind*/,
- const char * /*header*/=0,
- const char * /*documentation*/=0)
+ const QCString & /*header*/=QCString(),
+ const QCString & /*documentation*/=QCString())
{
if (ml==0) return;
for (const auto &md : *ml)
@@ -1933,10 +1941,10 @@ static void generateSqlite3ForClass(const ClassDef *cd)
{
insertPath(ii->fileDef->absFilePath(),!ii->fileDef->isReference());
}
- DBG_CTX(("-----> ClassDef includeInfo for %s\n", nm.data()));
+ DBG_CTX(("-----> ClassDef includeInfo for %s\n", qPrint(nm)));
DBG_CTX((" local : %d\n", ii->local));
DBG_CTX((" imported : %d\n", ii->imported));
- DBG_CTX(("header: %s\n", ii->fileDef->absFilePath().data()));
+ DBG_CTX(("header: %s\n", qPrint(ii->fileDef->absFilePath())));
DBG_CTX((" file_id : %d\n", file_id));
DBG_CTX((" header_id: %d\n", header_id));
@@ -2002,6 +2010,30 @@ static void generateSqlite3ForClass(const ClassDef *cd)
associateAllClassMembers(cd, refid);
}
+static void generateSqlite3ForConcept(const ConceptDef *cd)
+{
+ if (cd->isReference() || cd->isHidden()) return; // skip external references
+
+ struct Refid refid = insertRefid(cd->getOutputFileBase());
+ if(!refid.created && compounddefExists(refid)){return;}
+ bindIntParameter(compounddef_insert,":rowid", refid.rowid);
+ bindTextParameter(compounddef_insert,":name",cd->name());
+ bindTextParameter(compounddef_insert,":kind","concept");
+
+ int file_id = insertPath(cd->getDefFileName());
+ bindIntParameter(compounddef_insert,":file_id",file_id);
+ bindIntParameter(compounddef_insert,":line",cd->getDefLine());
+ bindIntParameter(compounddef_insert,":column",cd->getDefColumn());
+
+ getSQLDesc(compounddef_insert,":briefdescription",cd->briefDescription(),cd);
+ getSQLDesc(compounddef_insert,":detaileddescription",cd->documentation(),cd);
+
+ step(compounddef_insert);
+
+ // + template argument list(s)
+ writeTemplateList(cd);
+}
+
// kinds: constants library module namespace package
static void generateSqlite3ForNamespace(const NamespaceDef *nd)
{
@@ -2106,7 +2138,7 @@ static void generateSqlite3ForFile(const FileDef *fd)
{
// strip tagfile from path
QCString tagfile = ii.fileDef->getReference();
- dst_path = ii.fileDef->absFilePath().copy();
+ dst_path = ii.fileDef->absFilePath();
dst_path.stripPrefix(tagfile+":");
}
else
@@ -2120,12 +2152,12 @@ static void generateSqlite3ForFile(const FileDef *fd)
dst_id = insertPath(ii.includeName,ii.local,FALSE);
}
- DBG_CTX(("-----> FileDef includeInfo for %s\n", ii.includeName.data()));
+ DBG_CTX(("-----> FileDef includeInfo for %s\n", qPrint(ii.includeName)));
DBG_CTX((" local: %d\n", ii.local));
DBG_CTX((" imported: %d\n", ii.imported));
if(ii.fileDef)
{
- DBG_CTX(("include: %s\n", ii.fileDef->absFilePath().data()));
+ DBG_CTX(("include: %s\n", qPrint(ii.fileDef->absFilePath())));
}
DBG_CTX((" src_id : %d\n", src_id));
DBG_CTX((" dst_id: %d\n", dst_id));
@@ -2154,7 +2186,7 @@ static void generateSqlite3ForFile(const FileDef *fd)
{
// strip tagfile from path
QCString tagfile = ii.fileDef->getReference();
- src_path = ii.fileDef->absFilePath().copy();
+ src_path = ii.fileDef->absFilePath();
src_path.stripPrefix(tagfile+":");
}
else
@@ -2348,7 +2380,7 @@ static void generateSqlite3ForPage(const PageDef *pd,bool isExample)
{
if (mainPageHasTitle())
{
- title = filterTitle(convertCharEntitiesToUTF8(Doxygen::mainPage->title()).str());
+ title = filterTitle(convertCharEntitiesToUTF8(Doxygen::mainPage->title()));
}
else
{
@@ -2362,8 +2394,10 @@ static void generateSqlite3ForPage(const PageDef *pd,bool isExample)
{
title = si->title();
}
-
- if(!title){title = pd->title();}
+ if (title.isEmpty())
+ {
+ title = pd->title();
+ }
}
// + title
@@ -2392,7 +2426,6 @@ static sqlite3* openDbConnection()
{
QCString outputDirectory = Config_getString(SQLITE3_OUTPUT);
- QDir sqlite3Dir(outputDirectory);
sqlite3 *db;
int rc;
@@ -2403,14 +2436,14 @@ static sqlite3* openDbConnection()
return NULL;
}
- QCString dbFileName = "doxygen_sqlite3.db";
- QFileInfo fi(outputDirectory+"/"+dbFileName);
+ std::string dbFileName = "doxygen_sqlite3.db";
+ FileInfo fi(outputDirectory.str()+"/"+dbFileName);
if (fi.exists())
{
if (Config_getBool(SQLITE3_RECREATE_DB))
{
- QDir().remove(fi.absFilePath());
+ Dir().remove(fi.absFilePath());
}
else
{
@@ -2420,7 +2453,7 @@ static sqlite3* openDbConnection()
}
rc = sqlite3_open_v2(
- fi.absFilePath().utf8(),
+ fi.absFilePath().c_str(),
&db,
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
0
@@ -2473,14 +2506,21 @@ void generateSqlite3()
// + classes
for (const auto &cd : *Doxygen::classLinkedMap)
{
- msg("Generating Sqlite3 output for class %s\n",cd->name().data());
+ msg("Generating Sqlite3 output for class %s\n",qPrint(cd->name()));
generateSqlite3ForClass(cd.get());
}
+ // + concepts
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ msg("Generating Sqlite3 output for concept %s\n",qPrint(cd->name()));
+ generateSqlite3ForConcept(cd.get());
+ }
+
// + namespaces
for (const auto &nd : *Doxygen::namespaceLinkedMap)
{
- msg("Generating Sqlite3 output for namespace %s\n",nd->name().data());
+ msg("Generating Sqlite3 output for namespace %s\n",qPrint(nd->name()));
generateSqlite3ForNamespace(nd.get());
}
@@ -2489,7 +2529,7 @@ void generateSqlite3()
{
for (const auto &fd : *fn)
{
- msg("Generating Sqlite3 output for file %s\n",fd->name().data());
+ msg("Generating Sqlite3 output for file %s\n",qPrint(fd->name()));
generateSqlite3ForFile(fd.get());
}
}
@@ -2497,28 +2537,28 @@ void generateSqlite3()
// + groups
for (const auto &gd : *Doxygen::groupLinkedMap)
{
- msg("Generating Sqlite3 output for group %s\n",gd->name().data());
+ msg("Generating Sqlite3 output for group %s\n",qPrint(gd->name()));
generateSqlite3ForGroup(gd.get());
}
// + page
for (const auto &pd : *Doxygen::pageLinkedMap)
{
- msg("Generating Sqlite3 output for page %s\n",pd->name().data());
+ msg("Generating Sqlite3 output for page %s\n",qPrint(pd->name()));
generateSqlite3ForPage(pd.get(),FALSE);
}
// + dirs
for (const auto &dd : *Doxygen::dirLinkedMap)
{
- msg("Generating Sqlite3 output for dir %s\n",dd->name().data());
+ msg("Generating Sqlite3 output for dir %s\n",qPrint(dd->name()));
generateSqlite3ForDir(dd.get());
}
// + examples
for (const auto &pd : *Doxygen::exampleLinkedMap)
{
- msg("Generating Sqlite3 output for example %s\n",pd->name().data());
+ msg("Generating Sqlite3 output for example %s\n",qPrint(pd->name()));
generateSqlite3ForPage(pd.get(),TRUE);
}
diff --git a/src/stlsupport.cpp b/src/stlsupport.cpp
index 096291a..569314a 100644
--- a/src/stlsupport.cpp
+++ b/src/stlsupport.cpp
@@ -149,7 +149,7 @@ static void addSTLMember(const std::shared_ptr<Entry> &root,const char *type,con
root->moveToSubEntryAndKeep(memEntry);
}
-static void addSTLIterator(const std::shared_ptr<Entry> &classEntry,const char *name)
+static void addSTLIterator(const std::shared_ptr<Entry> &classEntry,const QCString &name)
{
std::shared_ptr<Entry> iteratorClassEntry = std::make_shared<Entry>();
iteratorClassEntry->fileName = "[STL]";
diff --git a/src/symbolmap.h b/src/symbolmap.h
index 0f837d4..a277846 100644
--- a/src/symbolmap.h
+++ b/src/symbolmap.h
@@ -36,15 +36,15 @@ class SymbolMap
using const_iterator = typename Map::const_iterator;
//! Add a symbol \a def into the map under key \a name
- void add(const char *name,Ptr def)
+ void add(const QCString &name,Ptr def)
{
- m_map.insert({std::string(name),def});
+ m_map.insert({name.str(),def});
}
//! Remove a symbol \a def from the map that was stored under key \a name
- void remove(const char *name,Ptr def)
+ void remove(const QCString &name,Ptr def)
{
- auto range = find(name);
+ auto range = find(name.str());
for (auto it=range.first; it!=range.second; )
{
if (it->second==def) it = m_map.erase(it); else ++it;
@@ -53,16 +53,16 @@ class SymbolMap
//! Find the list of symbols stored under key \a name
//! Returns a pair of iterators pointing to the start and end of the range of matching symbols
- std::pair<const_iterator,const_iterator> find(const char *name) const
+ std::pair<const_iterator,const_iterator> find(const QCString &name) const
{
- return m_map.equal_range(name ? name : "");
+ return m_map.equal_range(name.str());
}
//! Find the list of symbols stored under key \a name
//! Returns a pair of iterators pointing to the start and end of the range of matching symbols
- std::pair<iterator,iterator> find(const char *name)
+ std::pair<iterator,iterator> find(const QCString &name)
{
- return m_map.equal_range(name ? name : "");
+ return m_map.equal_range(name.str());
}
iterator begin() { return m_map.begin(); }
diff --git a/src/symbolresolver.cpp b/src/symbolresolver.cpp
index dd9e0f7..f509c7d 100644
--- a/src/symbolresolver.cpp
+++ b/src/symbolresolver.cpp
@@ -104,7 +104,7 @@ struct SymbolResolver::Private
const ClassDef *getResolvedClassRec(
const Definition *scope, // in
- const char *n, // in
+ const QCString &n, // in
const MemberDef **pTypeDef, // out
QCString *pTemplSpec, // out
QCString *pResolvedType); // out
@@ -164,14 +164,14 @@ struct SymbolResolver::Private
const ClassDef *SymbolResolver::Private::getResolvedClassRec(
const Definition *scope,
- const char *n,
+ const QCString &n,
const MemberDef **pTypeDef,
QCString *pTemplSpec,
QCString *pResolvedType)
{
- if (n==0 || *n=='\0') return 0;
+ if (n.isEmpty()) return 0;
//static int level=0;
- //fprintf(stderr,"%d [getResolvedClassRec(%s,%s)\n",level++,scope?scope->name().data():"<global>",n);
+ //fprintf(stderr,"%d [getResolvedClassRec(%s,%s)\n",level++,scope?qPrint(scope->name()):"<global>",n);
QCString name;
QCString explicitScopePart;
QCString strippedTemplateParams;
@@ -185,7 +185,7 @@ const ClassDef *SymbolResolver::Private::getResolvedClassRec(
}
int qualifierIndex = computeQualifiedIndex(name);
- //printf("name=%s qualifierIndex=%d\n",name.data(),qualifierIndex);
+ //printf("name=%s qualifierIndex=%d\n",qPrint(name),qualifierIndex);
if (qualifierIndex!=-1) // qualified name
{
// split off the explicit scope part
@@ -201,7 +201,7 @@ const ClassDef *SymbolResolver::Private::getResolvedClassRec(
return 0; // empty name
}
- //printf("Looking for symbol %s\n",name.data());
+ //printf("Looking for symbol %s\n",qPrint(name));
auto range = Doxygen::symbolMap.find(name);
// the -g (for C# generics) and -p (for ObjC protocols) are now already
// stripped from the key used in the symbolMap, so that is not needed here.
@@ -236,11 +236,11 @@ const ClassDef *SymbolResolver::Private::getResolvedClassRec(
// QCString key=scope->name()+"+"+name+"+"+explicitScopePart;
QCString key(scopeNameLen+nameLen+explicitPartLen+fileScopeLen+1);
char *pk=key.rawData();
- qstrcpy(pk,scope->name()); *(pk+scopeNameLen-1)='+';
+ qstrcpy(pk,scope->name().data()); *(pk+scopeNameLen-1)='+';
pk+=scopeNameLen;
- qstrcpy(pk,name); *(pk+nameLen-1)='+';
+ qstrcpy(pk,name.data()); *(pk+nameLen-1)='+';
pk+=nameLen;
- qstrcpy(pk,explicitScopePart);
+ qstrcpy(pk,explicitScopePart.data());
pk+=explicitPartLen;
// if a file scope is given and it contains using statements we should
@@ -252,7 +252,7 @@ const ClassDef *SymbolResolver::Private::getResolvedClassRec(
// below is a more efficient coding of
// key+="+"+m_fileScope->name();
*pk++='+';
- qstrcpy(pk,m_fileScope->absFilePath());
+ qstrcpy(pk,m_fileScope->absFilePath().data());
pk+=fileScopeLen-1;
}
*pk='\0';
@@ -261,17 +261,17 @@ const ClassDef *SymbolResolver::Private::getResolvedClassRec(
{
std::lock_guard<std::mutex> lock(g_cacheMutex);
pval=Doxygen::lookupCache->find(key.str());
- //printf("Searching for %s result=%p\n",key.data(),pval);
+ //printf("Searching for %s result=%p\n",qPrint(key),pval);
if (pval)
{
//printf("LookupInfo %p %p '%s' %p\n",
- // pval->classDef, pval->typeDef, pval->templSpec.data(),
- // pval->resolvedType.data());
+ // pval->classDef, pval->typeDef, qPrint(pval->templSpec),
+ // qPrint(pval->resolvedType));
if (pTemplSpec) *pTemplSpec=pval->templSpec;
if (pTypeDef) *pTypeDef=pval->typeDef;
if (pResolvedType) *pResolvedType=pval->resolvedType;
//fprintf(stderr,"%d ] cachedMatch=%s\n",--level,
- // pval->classDef?pval->classDef->name().data():"<none>");
+ // pval->classDef?qPrint(pval->classDef->name()):"<none>");
//if (pTemplSpec)
// printf("templSpec=%s\n",pTemplSpec->data());
return pval->classDef;
@@ -310,7 +310,7 @@ const ClassDef *SymbolResolver::Private::getResolvedClassRec(
}
//printf("getResolvedClassRec: bestMatch=%p pval->resolvedType=%s\n",
- // bestMatch,bestResolvedType.data());
+ // bestMatch,qPrint(bestResolvedType));
if (pval)
{
@@ -321,7 +321,7 @@ const ClassDef *SymbolResolver::Private::getResolvedClassRec(
pval->resolvedType = bestResolvedType;
}
//fprintf(stderr,"%d ] bestMatch=%s distance=%d\n",--level,
- // bestMatch?bestMatch->name().data():"<none>",minDistance);
+ // bestMatch?qPrint(bestMatch->name()):"<none>",minDistance);
//if (pTemplSpec)
// printf("templSpec=%s\n",pTemplSpec->data());
return bestMatch;
@@ -339,7 +339,7 @@ void SymbolResolver::Private::getResolvedSymbol(
QCString &bestResolvedType // out
)
{
- //fprintf(stderr,"getResolvedSymbol(%s,%s)\n",scope->name().data(),d->qualifiedName().data());
+ //fprintf(stderr,"getResolvedSymbol(%s,%s)\n",qPrint(scope->name()),qPrint(d->qualifiedName()));
// only look at classes and members that are enums or typedefs
if (d->definitionType()==Definition::TypeClass ||
(d->definitionType()==Definition::TypeMember &&
@@ -352,14 +352,14 @@ void SymbolResolver::Private::getResolvedSymbol(
AccessStack accessStack;
// test accessibility of definition within scope.
int distance = isAccessibleFromWithExpScope(visitedNamespaces,accessStack,scope,d,explicitScopePart);
- //fprintf(stderr," %s; distance %s (%p) is %d\n",scope->name().data(),d->name().data(),d,distance);
+ //fprintf(stderr," %s; distance %s (%p) is %d\n",qPrint(scope->name()),qPrint(d->name()),d,distance);
if (distance!=-1) // definition is accessible
{
// see if we are dealing with a class or a typedef
if (d->definitionType()==Definition::TypeClass) // d is a class
{
const ClassDef *cd = toClassDef(d);
- //printf("cd=%s\n",cd->name().data());
+ //printf("cd=%s\n",qPrint(cd->name()));
if (!cd->isTemplateArgument()) // skip classes that
// are only there to
// represent a template
@@ -425,7 +425,7 @@ void SymbolResolver::Private::getResolvedSymbol(
const ClassDef *cd = newResolveTypedef(scope,md,&enumType,&spec,&type,actTemplParams);
if (cd) // type resolves to a class
{
- //printf(" bestTypeDef=%p spec=%s type=%s\n",md,spec.data(),type.data());
+ //printf(" bestTypeDef=%p spec=%s type=%s\n",md,qPrint(spec),qPrint(type));
bestMatch = cd;
bestTypedef = md;
bestTemplSpec = spec;
@@ -483,7 +483,7 @@ void SymbolResolver::Private::getResolvedSymbol(
//printf(" Not accessible!\n");
}
} // if definition is a class or member
- //printf(" bestMatch=%p bestResolvedType=%s\n",bestMatch,bestResolvedType.data());
+ //printf(" bestMatch=%p bestResolvedType=%s\n",bestMatch,qPrint(bestResolvedType));
}
const ClassDef *SymbolResolver::Private::newResolveTypedef(
@@ -499,9 +499,9 @@ const ClassDef *SymbolResolver::Private::newResolveTypedef(
if (isCached)
{
//printf("Already cached %s->%s [%s]\n",
- // md->name().data(),
- // md->getCachedTypedefVal()?md->getCachedTypedefVal()->name().data():"<none>",
- // md->getCachedResolvedTypedef()?md->getCachedResolvedTypedef().data():"<none>");
+ // qPrint(md->name()),
+ // md->getCachedTypedefVal()?qPrint(md->getCachedTypedefVal()->name()):"<none>",
+ // md->getCachedResolvedTypedef()?qPrint(md->getCachedResolvedTypedef()):"<none>");
if (pTemplSpec) *pTemplSpec = md->getCachedTypedefTemplSpec();
if (pResolvedType) *pResolvedType = md->getCachedResolvedTypedef();
@@ -521,7 +521,7 @@ const ClassDef *SymbolResolver::Private::newResolveTypedef(
if (typeClass && typeClass->isTemplate() &&
actTemplParams && !actTemplParams->empty())
{
- type = substituteTemplateArgumentsInString(type.str(),
+ type = substituteTemplateArgumentsInString(type,
typeClass->templateArguments(),actTemplParams);
}
QCString typedefValue = type;
@@ -552,7 +552,7 @@ const ClassDef *SymbolResolver::Private::newResolveTypedef(
*pMemType = memTypeDef;
}
- //printf("type=%s result=%p\n",type.data(),result);
+ //printf("type=%s result=%p\n",qPrint(type),result);
if (result==0)
{
// try unspecialized version if type is template
@@ -605,7 +605,7 @@ done:
// introduced while parsing code fragments are being cached here.
{
//printf("setting cached typedef %p in result %p\n",md,result);
- //printf("==> %s (%s,%d)\n",result->name().data(),result->getDefFileName().data(),result->getDefLine());
+ //printf("==> %s (%s,%d)\n",qPrint(result->name()),qPrint(result->getDefFileName()),result->getDefLine());
//printf("*pResolvedType=%s\n",pResolvedType?pResolvedType->data():"<none>");
MemberDefMutable *mdm = toMemberDefMutable(md);
if (mdm)
@@ -642,19 +642,19 @@ int SymbolResolver::Private::isAccessibleFromWithExpScope(
accessStack.push(scope,m_fileScope,item,explicitScopePart);
- //printf(" <isAccessibleFromWithExpScope(%s,%s,%s)\n",scope?scope->name().data():"<global>",
- // item?item->name().data():"<none>",
- // explicitScopePart.data());
+ //printf(" <isAccessibleFromWithExpScope(%s,%s,%s)\n",scope?qPrint(scope->name()):"<global>",
+ // item?qPrint(item->name()):"<none>",
+ // qPrint(explicitScopePart));
int result=0; // assume we found it
const Definition *newScope = followPath(scope,explicitScopePart);
if (newScope) // explicitScope is inside scope => newScope is the result
{
Definition *itemScope = item->getOuterScope();
- //printf(" scope traversal successful %s<->%s!\n",itemScope->name().data(),newScope->name().data());
+ //printf(" scope traversal successful %s<->%s!\n",qPrint(itemScope->name()),qPrint(newScope->name()));
//if (newScope && newScope->definitionType()==Definition::TypeClass)
//{
// ClassDef *cd = (ClassDef *)newScope;
- // printf("---> Class %s: bases=%p\n",cd->name().data(),cd->baseClasses());
+ // printf("---> Class %s: bases=%p\n",qPrint(cd->name()),cd->baseClasses());
//}
if (itemScope==newScope) // exact match of scopes => distance==0
{
@@ -676,7 +676,7 @@ int SymbolResolver::Private::isAccessibleFromWithExpScope(
result=1;
//printf("scope(%s) is base class of newScope(%s)\n",
- // scope->name().data(),newScope->name().data());
+ // qPrint(scope->name()),qPrint(newScope->name()));
}
else
{
@@ -687,11 +687,11 @@ int SymbolResolver::Private::isAccessibleFromWithExpScope(
// this part deals with the case where item is a class
// A::B::C but is explicit referenced as A::C, where B is imported
// in A via a using directive.
- //printf("newScope is a namespace: %s!\n",newScope->name().data());
+ //printf("newScope is a namespace: %s!\n",qPrint(newScope->name()));
const NamespaceDef *nscope = toNamespaceDef(newScope);
for (const auto &cd : nscope->getUsedClasses())
{
- //printf("Trying for class %s\n",cd->name().data());
+ //printf("Trying for class %s\n",qPrint(cd->name()));
if (cd==item)
{
goto done;
@@ -701,7 +701,7 @@ int SymbolResolver::Private::isAccessibleFromWithExpScope(
{
if (visitedNamespaces.find(nd->name().str())==visitedNamespaces.end())
{
- //printf("Trying for namespace %s\n",nd->name().data());
+ //printf("Trying for namespace %s\n",qPrint(nd->name()));
i = isAccessibleFromWithExpScope(visitedNamespaces,accessStack,scope,item,nd->name());
if (i!=-1)
{
@@ -722,7 +722,7 @@ int SymbolResolver::Private::isAccessibleFromWithExpScope(
}
else // failed to resolve explicitScope
{
- //printf(" failed to resolve: scope=%s\n",scope->name().data());
+ //printf(" failed to resolve: scope=%s\n",qPrint(scope->name()));
if (scope->definitionType()==Definition::TypeNamespace)
{
const NamespaceDef *nscope = toNamespaceDef(scope);
@@ -767,28 +767,28 @@ const Definition *SymbolResolver::Private::followPath(const Definition *start,co
int l;
const Definition *current=start;
ps=0;
- //printf("followPath: start='%s' path='%s'\n",start?start->name().data():"<none>",path.data());
+ //printf("followPath: start='%s' path='%s'\n",start?qPrint(start->name()):"<none>",qPrint(path));
// for each part of the explicit scope
while ((is=getScopeFragment(path,ps,&l))!=-1)
{
// try to resolve the part if it is a typedef
const MemberDef *memTypeDef=0;
QCString qualScopePart = substTypedef(current,path.mid(is,l),&memTypeDef);
- //printf(" qualScopePart=%s\n",qualScopePart.data());
+ //printf(" qualScopePart=%s\n",qPrint(qualScopePart));
if (memTypeDef)
{
const ClassDef *type = newResolveTypedef(m_fileScope,memTypeDef,0,0,0);
if (type)
{
- //printf("Found type %s\n",type->name().data());
+ //printf("Found type %s\n",qPrint(type->name()));
return type;
}
}
const Definition *next = current->findInnerCompound(qualScopePart);
//printf("++ Looking for %s inside %s result %s\n",
- // qualScopePart.data(),
- // current->name().data(),
- // next?next->name().data():"<null>");
+ // qPrint(qualScopePart),
+ // qPrint(current->name()),
+ // next?qPrint(next->name()):"<null>");
if (next==0) // failed to follow the path
{
//printf("==> next==0!\n");
@@ -813,7 +813,7 @@ const Definition *SymbolResolver::Private::followPath(const Definition *start,co
ps=is+l;
}
//printf("followPath(start=%s,path=%s) result=%s\n",
- // start->name().data(),path.data(),current?current->name().data():"<null>");
+ // qPrint(start->name()),qPrint(path),current?qPrint(current->name()):"<null>");
return current; // path could be followed
}
@@ -836,7 +836,7 @@ bool SymbolResolver::Private::accessibleViaUsingNamespace(StringUnorderedSet &vi
{
for (const auto &und : nl) // check used namespaces for the class
{
- //printf("[Trying via used namespace %s: count=%d/%d\n",und->name().data(),
+ //printf("[Trying via used namespace %s: count=%d/%d\n",qPrint(und->name()),
// count,nl->count());
const Definition *sc = explicitScopePart.isEmpty() ? und : followPath(und,explicitScopePart);
if (sc && item->getOuterScope()==sc)
@@ -872,7 +872,7 @@ bool SymbolResolver::Private::accessibleViaUsingClass(const LinkedRefMap<const C
{
for (const auto &ucd : cl)
{
- //printf("Trying via used class %s\n",ucd->name().data());
+ //printf("Trying via used class %s\n",qPrint(ucd->name()));
const Definition *sc = explicitScopePart.isEmpty() ? ucd : followPath(ucd,explicitScopePart);
if (sc && sc==item) return true;
//printf("Try via used class done\n");
@@ -885,7 +885,7 @@ int SymbolResolver::Private::isAccessibleFrom(AccessStack &accessStack,
const Definition *item)
{
//printf("<isAccessibleFrom(scope=%s,item=%s itemScope=%s)\n",
- // scope->name().data(),item->name().data(),item->getOuterScope()->name().data());
+ // qPrint(scope->name()),qPrint(item->name()),qPrint(item->getOuterScope()->name()));
if (accessStack.find(scope,m_fileScope,item))
{
@@ -942,7 +942,7 @@ int SymbolResolver::Private::isAccessibleFrom(AccessStack &accessStack,
if (scope->definitionType()==Definition::TypeNamespace)
{
const NamespaceDef *nscope = toNamespaceDef(scope);
- //printf(" %s is namespace with %d used classes\n",nscope->name().data(),nscope->getUsedClasses());
+ //printf(" %s is namespace with %d used classes\n",qPrint(nscope->name()),nscope->getUsedClasses());
if (accessibleViaUsingClass(nscope->getUsedClasses(),item))
{
//printf("> found via used class\n");
@@ -1009,8 +1009,8 @@ QCString SymbolResolver::Private::substTypedef(
if (pTypeDef) *pTypeDef=bestMatch;
}
- //printf("substTypedef(%s,%s)=%s\n",scope?scope->name().data():"<global>",
- // name.data(),result.data());
+ //printf("substTypedef(%s,%s)=%s\n",scope?qPrint(scope->name()):"<global>",
+ // qPrint(name),qPrint(result));
return result;
}
@@ -1028,7 +1028,7 @@ SymbolResolver::~SymbolResolver()
const ClassDef *SymbolResolver::resolveClass(const Definition *scope,
- const char *name,
+ const QCString &name,
bool mayBeUnlinkable,
bool mayBeHidden)
{
@@ -1044,7 +1044,7 @@ const ClassDef *SymbolResolver::resolveClass(const Definition *scope,
scope=Doxygen::globalScope;
}
//fprintf(stderr,"------------ resolveClass(scope=%s,name=%s,mayUnlinkable=%d)\n",
- // scope?scope->name().data():"<global>",
+ // scope?qPrint(scope->name()):"<global>",
// name,
// mayBeUnlinkable
// );
@@ -1067,12 +1067,12 @@ const ClassDef *SymbolResolver::resolveClass(const Definition *scope,
{
if (!mayBeHidden || !result->isHidden())
{
- //printf("result was %s\n",result?result->name().data():"<none>");
+ //printf("result was %s\n",result?qPrint(result->name()):"<none>");
result=0; // don't link to artificial/hidden classes unless explicitly allowed
}
}
- //fprintf(stderr,"ResolvedClass(%s,%s)=%s\n",scope?scope->name().data():"<global>",
- // name,result?result->name().data():"<none>");
+ //fprintf(stderr,"ResolvedClass(%s,%s)=%s\n",scope?qPrint(scope->name()):"<global>",
+ // name,result?qPrint(result->name()):"<none>");
return result;
}
diff --git a/src/symbolresolver.h b/src/symbolresolver.h
index 5536c1e..89c3e6d 100644
--- a/src/symbolresolver.h
+++ b/src/symbolresolver.h
@@ -17,6 +17,7 @@
#define SYMBOLRESOLVER_H
#include <memory>
+
#include "qcstring.h"
#include "classdef.h"
@@ -44,7 +45,7 @@ class SymbolResolver
* getTemplateSpec(), and getResolvedType() are set as well.
*/
const ClassDef *resolveClass(const Definition *scope,
- const char *name,
+ const QCString &name,
bool maybeUnlinkable=false,
bool mayBeHidden=false);
@@ -52,7 +53,7 @@ class SymbolResolver
* the class object or a nullptr if the symbol is immutable.
*/
ClassDefMutable *resolveClassMutable(const Definition *scope,
- const char *name,
+ const QCString &name,
bool mayBeUnlinkable=false,
bool mayBeHidden=false)
{
diff --git a/src/tagreader.cpp b/src/tagreader.cpp
index 0a7c8f1..4aa59d8 100644
--- a/src/tagreader.cpp
+++ b/src/tagreader.cpp
@@ -44,32 +44,32 @@
class TagAnchorInfo
{
public:
- TagAnchorInfo(const std::string &f,
- const std::string &l,
- const std::string &t=std::string())
+ TagAnchorInfo(const QCString &f,
+ const QCString &l,
+ const QCString &t=QCString())
: label(l), fileName(f), title(t) {}
- std::string label;
- std::string fileName;
- std::string title;
+ QCString label;
+ QCString fileName;
+ QCString title;
};
/** Container for enum values that are scoped within an enum */
class TagEnumValueInfo
{
public:
- std::string name;
- std::string file;
- std::string anchor;
- std::string clangid;
+ QCString name;
+ QCString file;
+ QCString anchor;
+ QCString clangid;
};
/** Container for include info that can be read from a tagfile */
class TagIncludeInfo
{
public:
- std::string id;
- std::string name;
- std::string text;
+ QCString id;
+ QCString name;
+ QCString text;
bool isLocal;
bool isImported;
};
@@ -78,13 +78,13 @@ class TagIncludeInfo
class TagMemberInfo
{
public:
- std::string type;
- std::string name;
- std::string anchorFile;
- std::string anchor;
- std::string arglist;
- std::string kind;
- std::string clangId;
+ QCString type;
+ QCString name;
+ QCString anchorFile;
+ QCString anchor;
+ QCString arglist;
+ QCString kind;
+ QCString clangId;
std::vector<TagAnchorInfo> docAnchors;
Protection prot = Public;
Specifier virt = Normal;
@@ -96,13 +96,13 @@ class TagMemberInfo
class TagCompoundInfo
{
public:
- enum class CompoundType { Class, Namespace, Package, File, Group, Page, Dir };
+ enum class CompoundType { Class, Concept, Namespace, Package, File, Group, Page, Dir };
explicit TagCompoundInfo(CompoundType type) : m_type(type) {}
virtual ~TagCompoundInfo() {}
CompoundType compoundType() const { return m_type; }
std::vector<TagMemberInfo> members;
- std::string name;
- std::string filename;
+ QCString name;
+ QCString filename;
std::vector<TagAnchorInfo> docAnchors;
private:
CompoundType m_type;
@@ -114,8 +114,8 @@ class TagClassInfo : public TagCompoundInfo
public:
enum class Kind { None=-1, Class, Struct, Union, Interface, Exception, Protocol, Category, Enum, Service, Singleton };
TagClassInfo(Kind k) : TagCompoundInfo(CompoundType::Class), kind(k) {}
- std::string clangId;
- std::string anchor;
+ QCString clangId;
+ QCString anchor;
std::vector<BaseInfo> bases;
StringVector templateArguments;
StringVector classList;
@@ -131,13 +131,30 @@ class TagClassInfo : public TagCompoundInfo
}
};
+/** Container for concept specific info that can be read from a tagfile */
+class TagConceptInfo : public TagCompoundInfo
+{
+ public:
+ TagConceptInfo() :TagCompoundInfo(CompoundType::Concept) {}
+ QCString clangId;
+ static TagConceptInfo *get(std::unique_ptr<TagCompoundInfo> &t)
+ {
+ return dynamic_cast<TagConceptInfo*>(t.get());
+ }
+ static const TagConceptInfo *get(const std::unique_ptr<TagCompoundInfo> &t)
+ {
+ return dynamic_cast<const TagConceptInfo*>(t.get());
+ }
+};
+
/** Container for namespace specific info that can be read from a tagfile */
class TagNamespaceInfo : public TagCompoundInfo
{
public:
TagNamespaceInfo() :TagCompoundInfo(CompoundType::Namespace) {}
- std::string clangId;
+ QCString clangId;
StringVector classList;
+ StringVector conceptList;
StringVector namespaceList;
static TagNamespaceInfo *get(std::unique_ptr<TagCompoundInfo> &t)
{
@@ -170,8 +187,9 @@ class TagFileInfo : public TagCompoundInfo
{
public:
TagFileInfo() : TagCompoundInfo(CompoundType::File) { }
- std::string path;
+ QCString path;
StringVector classList;
+ StringVector conceptList;
StringVector namespaceList;
std::vector<TagIncludeInfo> includes;
static TagFileInfo *get(std::unique_ptr<TagCompoundInfo> &t)
@@ -189,9 +207,10 @@ class TagGroupInfo : public TagCompoundInfo
{
public:
TagGroupInfo() : TagCompoundInfo(CompoundType::Group) { }
- std::string title;
+ QCString title;
StringVector subgroupList;
StringVector classList;
+ StringVector conceptList;
StringVector namespaceList;
StringVector fileList;
StringVector pageList;
@@ -211,7 +230,7 @@ class TagPageInfo : public TagCompoundInfo
{
public:
TagPageInfo() : TagCompoundInfo(CompoundType::Page) {}
- std::string title;
+ QCString title;
static TagPageInfo *get(std::unique_ptr<TagCompoundInfo> &t)
{
return dynamic_cast<TagPageInfo*>(t.get());
@@ -227,7 +246,7 @@ class TagDirInfo : public TagCompoundInfo
{
public:
TagDirInfo() : TagCompoundInfo(CompoundType::Dir) {}
- std::string path;
+ QCString path;
StringVector subdirList;
StringVector fileList;
static TagDirInfo *get(std::unique_ptr<TagCompoundInfo> &t)
@@ -261,12 +280,12 @@ class TagFileParser
m_state = Invalid;
}
- void startElement( const std::string &name, const XMLHandlers::Attributes& attrib );
- void endElement( const std::string &name );
- void characters ( const std::string & ch ) { m_curString+=ch; }
- void error( const std::string &fileName,int lineNr,const std::string &msg)
+ void startElement( const QCString &name, const XMLHandlers::Attributes& attrib );
+ void endElement( const QCString &name );
+ void characters ( const QCString & ch ) { m_curString+=ch; }
+ void error( const QCString &fileName,int lineNr,const QCString &msg)
{
- ::warn(fileName.c_str(),lineNr,"%s",msg.c_str());
+ ::warn(fileName,lineNr,"%s",qPrint(msg));
}
void dump();
@@ -279,6 +298,7 @@ class TagFileParser
switch (m_state)
{
case InClass:
+ case InConcept:
case InFile:
case InNamespace:
case InGroup:
@@ -297,9 +317,9 @@ class TagFileParser
{
m_curMember = TagMemberInfo();
m_curMember.kind = XMLHandlers::value(attrib,"kind");
- std::string protStr = XMLHandlers::value(attrib,"protection");
- std::string virtStr = XMLHandlers::value(attrib,"virtualness");
- std::string staticStr = XMLHandlers::value(attrib,"static");
+ QCString protStr = XMLHandlers::value(attrib,"protection");
+ QCString virtStr = XMLHandlers::value(attrib,"virtualness");
+ QCString staticStr = XMLHandlers::value(attrib,"static");
if (protStr=="protected")
{
m_curMember.prot = Protected;
@@ -363,7 +383,7 @@ class TagFileParser
void endEnumValue()
{
- m_curEnumValue.name = QCString(m_curString).stripWhiteSpace();
+ m_curEnumValue.name = QCString(m_curString).stripWhiteSpace().str();
m_state = m_stateStack.top();
m_stateStack.pop();
if (m_state==InMember)
@@ -379,6 +399,7 @@ class TagFileParser
switch(m_state)
{
case InClass:
+ case InConcept:
case InFile:
case InNamespace:
case InGroup:
@@ -386,7 +407,7 @@ class TagFileParser
case InMember:
case InPackage:
case InDir:
- if (m_curString.rfind("autotoc_md",0)==0) return;
+ if (m_curString.right(10)=="autotoc_md") return;
break;
default:
warn("Unexpected tag 'docanchor' found");
@@ -395,6 +416,7 @@ class TagFileParser
switch(m_state)
{
case InClass:
+ case InConcept:
case InFile:
case InNamespace:
case InGroup:
@@ -415,19 +437,19 @@ class TagFileParser
switch(m_state)
{
case InClass:
- TagClassInfo::get(m_curCompound)->classList.push_back(m_curString);
+ TagClassInfo::get(m_curCompound)->classList.push_back(m_curString.str());
break;
case InFile:
- TagFileInfo::get(m_curCompound)->classList.push_back(m_curString);
+ TagFileInfo::get(m_curCompound)->classList.push_back(m_curString.str());
break;
case InNamespace:
- TagNamespaceInfo::get(m_curCompound)->classList.push_back(m_curString);
+ TagNamespaceInfo::get(m_curCompound)->classList.push_back(m_curString.str());
break;
case InGroup:
- TagGroupInfo::get(m_curCompound)->classList.push_back(m_curString);
+ TagGroupInfo::get(m_curCompound)->classList.push_back(m_curString.str());
break;
case InPackage:
- TagPackageInfo::get(m_curCompound)->classList.push_back(m_curString);
+ TagPackageInfo::get(m_curCompound)->classList.push_back(m_curString.str());
break;
default:
warn("Unexpected tag 'class' found");
@@ -435,18 +457,37 @@ class TagFileParser
}
}
+ void endConcept()
+ {
+ switch(m_state)
+ {
+ case InNamespace:
+ TagNamespaceInfo::get(m_curCompound)->conceptList.push_back(m_curString.str());
+ break;
+ case InFile:
+ TagFileInfo::get(m_curCompound)->conceptList.push_back(m_curString.str());
+ break;
+ case InGroup:
+ TagGroupInfo::get(m_curCompound)->conceptList.push_back(m_curString.str());
+ break;
+ default:
+ warn("Unexpected tag 'concept' found");
+ break;
+ }
+ }
+
void endNamespace()
{
switch(m_state)
{
case InNamespace:
- TagNamespaceInfo::get(m_curCompound)->namespaceList.push_back(m_curString);
+ TagNamespaceInfo::get(m_curCompound)->namespaceList.push_back(m_curString.str());
break;
case InFile:
- TagFileInfo::get(m_curCompound)->namespaceList.push_back(m_curString);
+ TagFileInfo::get(m_curCompound)->namespaceList.push_back(m_curString.str());
break;
case InGroup:
- TagGroupInfo::get(m_curCompound)->namespaceList.push_back(m_curString);
+ TagGroupInfo::get(m_curCompound)->namespaceList.push_back(m_curString.str());
break;
default:
warn("Unexpected tag 'namespace' found");
@@ -459,10 +500,10 @@ class TagFileParser
switch(m_state)
{
case InGroup:
- TagGroupInfo::get(m_curCompound)->fileList.push_back(m_curString);
+ TagGroupInfo::get(m_curCompound)->fileList.push_back(m_curString.str());
break;
case InDir:
- TagDirInfo::get(m_curCompound)->fileList.push_back(m_curString);
+ TagDirInfo::get(m_curCompound)->fileList.push_back(m_curString.str());
break;
default:
warn("Unexpected tag 'file' found");
@@ -475,7 +516,7 @@ class TagFileParser
switch(m_state)
{
case InGroup:
- TagGroupInfo::get(m_curCompound)->fileList.push_back(m_curString);
+ TagGroupInfo::get(m_curCompound)->fileList.push_back(m_curString.str());
break;
default:
warn("Unexpected tag 'page' found");
@@ -488,7 +529,7 @@ class TagFileParser
switch(m_state)
{
case InDir:
- TagDirInfo::get(m_curCompound)->subdirList.push_back(m_curString);
+ TagDirInfo::get(m_curCompound)->subdirList.push_back(m_curString.str());
break;
default:
warn("Unexpected tag 'dir' found");
@@ -525,6 +566,7 @@ class TagFileParser
switch (m_state)
{
case InClass:
+ case InConcept:
case InFile:
case InNamespace:
case InGroup:
@@ -547,8 +589,8 @@ class TagFileParser
m_curString="";
if (m_state==InClass && m_curCompound)
{
- std::string protStr = XMLHandlers::value(attrib,"protection");
- std::string virtStr = XMLHandlers::value(attrib,"virtualness");
+ QCString protStr = XMLHandlers::value(attrib,"protection");
+ QCString virtStr = XMLHandlers::value(attrib,"virtualness");
Protection prot = Public;
Specifier virt = Normal;
if (protStr=="protected")
@@ -563,7 +605,7 @@ class TagFileParser
{
virt = Virtual;
}
- TagClassInfo::get(m_curCompound)->bases.push_back(BaseInfo(m_curString.c_str(),prot,virt));
+ TagClassInfo::get(m_curCompound)->bases.push_back(BaseInfo(m_curString,prot,virt));
}
else
{
@@ -610,7 +652,7 @@ class TagFileParser
{
if (m_state==InClass && m_curCompound)
{
- TagClassInfo::get(m_curCompound)->templateArguments.push_back(m_curString);
+ TagClassInfo::get(m_curCompound)->templateArguments.push_back(m_curString.str());
}
else
{
@@ -623,6 +665,7 @@ class TagFileParser
switch (m_state)
{
case InClass:
+ case InConcept:
case InNamespace:
case InFile:
case InGroup:
@@ -735,7 +778,7 @@ class TagFileParser
{
if (m_state==InGroup)
{
- TagGroupInfo::get(m_curCompound)->subgroupList.push_back(m_curString);
+ TagGroupInfo::get(m_curCompound)->subgroupList.push_back(m_curString.str());
}
else
{
@@ -757,6 +800,7 @@ class TagFileParser
enum State { Invalid,
InClass,
+ InConcept,
InFile,
InNamespace,
InGroup,
@@ -771,14 +815,14 @@ class TagFileParser
void warn(const char *fmt)
{
- std::string fileName = m_locator->fileName();
- ::warn(fileName.c_str(),m_locator->lineNr(),"%s", fmt);
+ QCString fileName = m_locator->fileName();
+ ::warn(fileName,m_locator->lineNr(),"%s", fmt);
}
void warn(const char *fmt,const char *s)
{
- std::string fileName = m_locator->fileName();
- ::warn(fileName.c_str(),m_locator->lineNr(),fmt,s);
+ QCString fileName = m_locator->fileName();
+ ::warn(fileName,m_locator->lineNr(),fmt,s);
}
@@ -791,10 +835,10 @@ class TagFileParser
TagEnumValueInfo m_curEnumValue;
TagIncludeInfo m_curIncludes;
- std::string m_curString;
- std::string m_tagName;
- std::string m_fileName;
- std::string m_title;
+ QCString m_curString;
+ QCString m_tagName;
+ QCString m_fileName;
+ QCString m_title;
State m_state = Invalid;
std::stack<State> m_stateStack;
const XMLLocator *m_locator = nullptr;
@@ -839,6 +883,7 @@ static const std::map< std::string, ElementCallbacks > g_elementHandlers =
{ "title", { startCb(&TagFileParser::startStringValue ), endCb(&TagFileParser::endTitle ) } },
{ "subgroup", { startCb(&TagFileParser::startStringValue ), endCb(&TagFileParser::endSubgroup ) } },
{ "class", { startCb(&TagFileParser::startStringValue ), endCb(&TagFileParser::endClass ) } },
+ { "concept", { startCb(&TagFileParser::startStringValue ), endCb(&TagFileParser::endConcept ) } },
{ "namespace", { startCb(&TagFileParser::startStringValue ), endCb(&TagFileParser::endNamespace ) } },
{ "file", { startCb(&TagFileParser::startStringValue ), endCb(&TagFileParser::endFile ) } },
{ "dir", { startCb(&TagFileParser::startStringValue ), endCb(&TagFileParser::endDir ) } },
@@ -874,6 +919,7 @@ static const std::map< std::string, CompoundFactory > g_compoundFactory =
{ "singleton", { TagFileParser::InClass, []() { return std::make_unique<TagClassInfo>(TagClassInfo::Kind::Singleton); } } },
{ "file", { TagFileParser::InFile, []() { return std::make_unique<TagFileInfo>(); } } },
{ "namespace", { TagFileParser::InNamespace, []() { return std::make_unique<TagNamespaceInfo>(); } } },
+ { "concept", { TagFileParser::InConcept, []() { return std::make_unique<TagConceptInfo>(); } } },
{ "group", { TagFileParser::InGroup, []() { return std::make_unique<TagGroupInfo>(); } } },
{ "page", { TagFileParser::InPage, []() { return std::make_unique<TagPageInfo>(); } } },
{ "package", { TagFileParser::InPackage, []() { return std::make_unique<TagPackageInfo>(); } } },
@@ -882,31 +928,31 @@ static const std::map< std::string, CompoundFactory > g_compoundFactory =
//---------------------------------------------------------------------------------------------------------------
-void TagFileParser::startElement( const std::string &name, const XMLHandlers::Attributes& attrib )
+void TagFileParser::startElement( const QCString &name, const XMLHandlers::Attributes& attrib )
{
- //printf("startElement '%s'\n",name.data());
- auto it = g_elementHandlers.find(name);
+ //printf("startElement '%s'\n",qPrint(name));
+ auto it = g_elementHandlers.find(name.str());
if (it!=std::end(g_elementHandlers))
{
it->second.startCb(*this,attrib);
}
else
{
- warn("Unknown start tag '%s' found!",name.data());
+ warn("Unknown start tag '%s' found!",qPrint(name));
}
}
-void TagFileParser::endElement( const std::string &name )
+void TagFileParser::endElement( const QCString &name )
{
- //printf("endElement '%s'\n",name.data());
- auto it = g_elementHandlers.find(name);
+ //printf("endElement '%s'\n",qPrint(name));
+ auto it = g_elementHandlers.find(name.str());
if (it!=std::end(g_elementHandlers))
{
it->second.endCb(*this);
}
else
{
- warn("Unknown end tag '%s' found!",name.data());
+ warn("Unknown end tag '%s' found!",qPrint(name));
}
}
@@ -945,23 +991,34 @@ void TagFileParser::dump()
if (comp->compoundType()==TagCompoundInfo::CompoundType::Class)
{
const TagClassInfo *cd = TagClassInfo::get(comp);
- msg("class '%s'\n",cd->name.data());
- msg(" filename '%s'\n",cd->filename.data());
+ msg("class '%s'\n",qPrint(cd->name));
+ msg(" filename '%s'\n",qPrint(cd->filename));
for (const BaseInfo &bi : cd->bases)
{
- msg( " base: %s \n", bi.name.data() );
+ msg( " base: %s \n", bi.name.isEmpty() ? "" : qPrint(bi.name) );
}
for (const auto &md : cd->members)
{
msg(" member:\n");
- msg(" kind: '%s'\n",md.kind.data());
- msg(" name: '%s'\n",md.name.data());
- msg(" anchor: '%s'\n",md.anchor.data());
- msg(" arglist: '%s'\n",md.arglist.data());
+ msg(" kind: '%s'\n",qPrint(md.kind));
+ msg(" name: '%s'\n",qPrint(md.name));
+ msg(" anchor: '%s'\n",qPrint(md.anchor));
+ msg(" arglist: '%s'\n",qPrint(md.arglist));
}
}
}
+ //============== CONCEPTS
+ for (const auto &comp : m_tagFileCompounds)
+ {
+ if (comp->compoundType()==TagCompoundInfo::CompoundType::Concept)
+ {
+ const TagConceptInfo *cd = TagConceptInfo::get(comp);
+
+ msg("concept '%s'\n",qPrint(cd->name));
+ msg(" filename '%s'\n",qPrint(cd->filename));
+ }
+ }
//============== NAMESPACES
for (const auto &comp : m_tagFileCompounds)
{
@@ -969,8 +1026,8 @@ void TagFileParser::dump()
{
const TagNamespaceInfo *nd = TagNamespaceInfo::get(comp);
- msg("namespace '%s'\n",nd->name.data());
- msg(" filename '%s'\n",nd->filename.data());
+ msg("namespace '%s'\n",qPrint(nd->name));
+ msg(" filename '%s'\n",qPrint(nd->filename));
for (const auto &cls : nd->classList)
{
msg( " class: %s \n", cls.c_str() );
@@ -979,10 +1036,10 @@ void TagFileParser::dump()
for (const auto &md : nd->members)
{
msg(" member:\n");
- msg(" kind: '%s'\n",md.kind.data());
- msg(" name: '%s'\n",md.name.data());
- msg(" anchor: '%s'\n",md.anchor.data());
- msg(" arglist: '%s'\n",md.arglist.data());
+ msg(" kind: '%s'\n",qPrint(md.kind));
+ msg(" name: '%s'\n",qPrint(md.name));
+ msg(" anchor: '%s'\n",qPrint(md.anchor));
+ msg(" arglist: '%s'\n",qPrint(md.arglist));
}
}
}
@@ -994,8 +1051,8 @@ void TagFileParser::dump()
{
const TagFileInfo *fd = TagFileInfo::get(comp);
- msg("file '%s'\n",fd->name.data());
- msg(" filename '%s'\n",fd->filename.data());
+ msg("file '%s'\n",qPrint(fd->name));
+ msg(" filename '%s'\n",qPrint(fd->filename));
for (const auto &ns : fd->namespaceList)
{
msg( " namespace: %s \n", ns.c_str() );
@@ -1008,15 +1065,15 @@ void TagFileParser::dump()
for (const auto &md : fd->members)
{
msg(" member:\n");
- msg(" kind: '%s'\n",md.kind.data());
- msg(" name: '%s'\n",md.name.data());
- msg(" anchor: '%s'\n",md.anchor.data());
- msg(" arglist: '%s'\n",md.arglist.data());
+ msg(" kind: '%s'\n",qPrint(md.kind));
+ msg(" name: '%s'\n",qPrint(md.name));
+ msg(" anchor: '%s'\n",qPrint(md.anchor));
+ msg(" arglist: '%s'\n",qPrint(md.arglist));
}
for (const auto &ii : fd->includes)
{
- msg(" includes id: %s name: %s\n",ii.id.data(),ii.name.data());
+ msg(" includes id: %s name: %s\n",qPrint(ii.id),qPrint(ii.name));
}
}
}
@@ -1027,8 +1084,8 @@ void TagFileParser::dump()
if (comp->compoundType()==TagCompoundInfo::CompoundType::Group)
{
const TagGroupInfo *gd = TagGroupInfo::get(comp);
- msg("group '%s'\n",gd->name.data());
- msg(" filename '%s'\n",gd->filename.data());
+ msg("group '%s'\n",qPrint(gd->name));
+ msg(" filename '%s'\n",qPrint(gd->filename));
for (const auto &ns : gd->namespaceList)
{
@@ -1054,10 +1111,10 @@ void TagFileParser::dump()
for (const auto &md : gd->members)
{
msg(" member:\n");
- msg(" kind: '%s'\n",md.kind.data());
- msg(" name: '%s'\n",md.name.data());
- msg(" anchor: '%s'\n",md.anchor.data());
- msg(" arglist: '%s'\n",md.arglist.data());
+ msg(" kind: '%s'\n",qPrint(md.kind));
+ msg(" name: '%s'\n",qPrint(md.name));
+ msg(" anchor: '%s'\n",qPrint(md.anchor));
+ msg(" arglist: '%s'\n",qPrint(md.arglist));
}
}
}
@@ -1068,9 +1125,9 @@ void TagFileParser::dump()
if (comp->compoundType()==TagCompoundInfo::CompoundType::Page)
{
const TagPageInfo *pd = TagPageInfo::get(comp);
- msg("page '%s'\n",pd->name.data());
- msg(" title '%s'\n",pd->title.data());
- msg(" filename '%s'\n",pd->filename.data());
+ msg("page '%s'\n",qPrint(pd->name));
+ msg(" title '%s'\n",qPrint(pd->title));
+ msg(" filename '%s'\n",qPrint(pd->filename));
}
}
@@ -1081,8 +1138,8 @@ void TagFileParser::dump()
{
const TagDirInfo *dd = TagDirInfo::get(comp);
{
- msg("dir '%s'\n",dd->name.data());
- msg(" path '%s'\n",dd->path.data());
+ msg("dir '%s'\n",qPrint(dd->name));
+ msg(" path '%s'\n",qPrint(dd->path));
for (const auto &fi : dd->fileList)
{
msg( " file: %s \n", fi.c_str() );
@@ -1100,18 +1157,18 @@ void TagFileParser::addDocAnchors(const std::shared_ptr<Entry> &e,const std::vec
{
for (const auto &ta : l)
{
- if (SectionManager::instance().find(ta.label.c_str())==0)
+ if (SectionManager::instance().find(QCString(ta.label))==0)
{
//printf("New sectionInfo file=%s anchor=%s\n",
- // ta->fileName.data(),ta->label.data());
+ // qPrint(ta->fileName),qPrint(ta->label));
SectionInfo *si=SectionManager::instance().add(
- ta.label.c_str(),ta.fileName.c_str(),-1,ta.title.c_str(),
- SectionType::Anchor,0,m_tagName.c_str());
+ ta.label,ta.fileName,-1,ta.title,
+ SectionType::Anchor,0,m_tagName);
e->anchors.push_back(si);
}
else
{
- warn("Duplicate anchor %s found",ta.label.data());
+ warn("Duplicate anchor %s found",qPrint(ta.label));
}
}
}
@@ -1230,19 +1287,6 @@ void TagFileParser::buildMemberList(const std::shared_ptr<Entry> &ce,const std::
}
}
-static QCString stripPath(const QCString &s)
-{
- int i=s.findRev('/');
- if (i!=-1)
- {
- return s.right(s.length()-i-1);
- }
- else
- {
- return s;
- }
-}
-
/*! Injects the info gathered by the XML parser into the Entry tree.
* This tree contains the information extracted from the input in a
* "unrelated" form.
@@ -1313,28 +1357,28 @@ void TagFileParser::buildLists(const std::shared_ptr<Entry> &root)
const TagFileInfo *tfi = TagFileInfo::get(comp);
std::shared_ptr<Entry> fe = std::make_shared<Entry>();
- fe->section = guessSection(tfi->name.c_str());
- fe->name = tfi->name.c_str();
+ fe->section = guessSection(tfi->name);
+ fe->name = tfi->name;
addDocAnchors(fe,tfi->docAnchors);
fe->tagInfoData.tagName = m_tagName;
fe->tagInfoData.fileName = tfi->filename;
fe->hasTagInfo = TRUE;
- std::string fullName = m_tagName+":"+tfi->path+stripPath(tfi->name).str();
+ QCString fullName = m_tagName+":"+tfi->path+stripPath(tfi->name);
fe->fileName = fullName;
- //printf("createFileDef() filename=%s\n",tfi->filename.data());
- std::string tagid = m_tagName+":"+tfi->path;
- std::unique_ptr<FileDef> fd { createFileDef(tagid.c_str(),
- tfi->name.c_str(),m_tagName.c_str(),
- tfi->filename.c_str()) };
+ //printf("createFileDef() filename=%s\n",qPrint(tfi->filename));
+ QCString tagid = m_tagName+":"+tfi->path;
+ std::unique_ptr<FileDef> fd { createFileDef(tagid,
+ tfi->name,m_tagName,
+ tfi->filename) };
FileName *mn;
- if ((mn=Doxygen::inputNameLinkedMap->find(tfi->name.c_str())))
+ if ((mn=Doxygen::inputNameLinkedMap->find(tfi->name)))
{
mn->push_back(std::move(fd));
}
else
{
- mn = Doxygen::inputNameLinkedMap->add(tfi->name.c_str(),fullName.c_str());
+ mn = Doxygen::inputNameLinkedMap->add(tfi->name,fullName);
mn->push_back(std::move(fd));
}
buildMemberList(fe,tfi->members);
@@ -1342,6 +1386,26 @@ void TagFileParser::buildLists(const std::shared_ptr<Entry> &root)
}
}
+ // build concept list
+ for (const auto &comp : m_tagFileCompounds)
+ {
+ if (comp->compoundType()==TagCompoundInfo::CompoundType::Concept)
+ {
+ const TagConceptInfo *tci = TagConceptInfo::get(comp);
+
+ std::shared_ptr<Entry> ce = std::make_shared<Entry>();
+ ce->section = Entry::CONCEPT_SEC;
+ ce->name = tci->name;
+ addDocAnchors(ce,tci->docAnchors);
+ ce->tagInfoData.tagName = m_tagName;
+ ce->tagInfoData.fileName = tci->filename;
+ ce->hasTagInfo = TRUE;
+ ce->id = tci->clangId;
+
+ root->moveToSubEntryAndKeep(ce);
+ }
+ }
+
// build namespace list
for (const auto &comp : m_tagFileCompounds)
{
@@ -1418,7 +1482,7 @@ void TagFileParser::buildLists(const std::shared_ptr<Entry> &root)
[&](const std::shared_ptr<Entry> &e) { return e->name == sg.c_str(); });
if (i!=children.end())
{
- (*i)->groups.push_back(Grouping(tgi->name.c_str(),Grouping::GROUPING_INGROUP));
+ (*i)->groups.push_back(Grouping(tgi->name,Grouping::GROUPING_INGROUP));
}
}
}
@@ -1432,7 +1496,7 @@ void TagFileParser::buildLists(const std::shared_ptr<Entry> &root)
const TagPageInfo *tpi = TagPageInfo::get(comp);
std::shared_ptr<Entry> pe = std::make_shared<Entry>();
- bool isIndex = (stripExtensionGeneral(tpi->filename.c_str(),getFileNameExtension(tpi->filename.c_str()))=="index");
+ bool isIndex = (stripExtensionGeneral(tpi->filename,getFileNameExtension(tpi->filename))=="index");
pe->section = isIndex ? Entry::MAINPAGEDOC_SEC : Entry::PAGEDOC_SEC;
pe->name = tpi->name;
pe->args = tpi->title;
@@ -1452,30 +1516,30 @@ void TagFileParser::addIncludes()
if (comp->compoundType()==TagCompoundInfo::CompoundType::File)
{
const TagFileInfo *tfi = TagFileInfo::get(comp);
- //printf("tag file tagName=%s path=%s name=%s\n",m_tagName.data(),tfi->path.data(),tfi->name.data());
- FileName *fn = Doxygen::inputNameLinkedMap->find(tfi->name.c_str());
+ //printf("tag file tagName=%s path=%s name=%s\n",qPrint(m_tagName),qPrint(tfi->path),qPrint(tfi->name));
+ FileName *fn = Doxygen::inputNameLinkedMap->find(tfi->name);
if (fn)
{
for (const auto &fd : *fn)
{
- //printf("input file path=%s name=%s\n",fd->getPath().data(),fd->name().data());
+ //printf("input file path=%s name=%s\n",qPrint(fd->getPath()),qPrint(fd->name()));
if (fd->getPath()==QCString(m_tagName+":"+tfi->path))
{
//printf("found\n");
for (const auto &ii : tfi->includes)
{
- //printf("ii->name='%s'\n",ii->name.data());
- FileName *ifn = Doxygen::inputNameLinkedMap->find(ii.name.c_str());
+ //printf("ii->name='%s'\n",qPrint(ii->name));
+ FileName *ifn = Doxygen::inputNameLinkedMap->find(ii.name);
ASSERT(ifn!=0);
if (ifn)
{
for (const auto &ifd : *ifn)
{
//printf("ifd->getOutputFileBase()=%s ii->id=%s\n",
- // ifd->getOutputFileBase().data(),ii->id.data());
+ // qPrint(ifd->getOutputFileBase()),qPrint(ii->id));
if (ifd->getOutputFileBase()==QCString(ii.id))
{
- fd->addIncludeDependency(ifd.get(),ii.text.c_str(),ii.isLocal,ii.isImported);
+ fd->addIncludeDependency(ifd.get(),ii.text,ii.isLocal,ii.isImported);
}
}
}
@@ -1494,13 +1558,13 @@ void parseTagFile(const std::shared_ptr<Entry> &root,const char *fullName)
XMLHandlers handlers;
// connect the generic events handlers of the XML parser to the specific handlers of the tagFileParser object
handlers.startDocument = [&tagFileParser]() { tagFileParser.startDocument(); };
- handlers.startElement = [&tagFileParser](const std::string &name,const XMLHandlers::Attributes &attrs) { tagFileParser.startElement(name,attrs); };
- handlers.endElement = [&tagFileParser](const std::string &name) { tagFileParser.endElement(name); };
- handlers.characters = [&tagFileParser](const std::string &chars) { tagFileParser.characters(chars); };
- handlers.error = [&tagFileParser](const std::string &fileName,int lineNr,const std::string &msg) { tagFileParser.error(fileName,lineNr,msg); };
+ handlers.startElement = [&tagFileParser](const std::string &name,const XMLHandlers::Attributes &attrs) { tagFileParser.startElement(QCString(name),attrs); };
+ handlers.endElement = [&tagFileParser](const std::string &name) { tagFileParser.endElement(QCString(name)); };
+ handlers.characters = [&tagFileParser](const std::string &chars) { tagFileParser.characters(QCString(chars)); };
+ handlers.error = [&tagFileParser](const std::string &fileName,int lineNr,const std::string &msg) { tagFileParser.error(QCString(fileName),lineNr,QCString(msg)); };
XMLParser parser(handlers);
tagFileParser.setDocumentLocator(&parser);
- parser.parse(fullName,inputStr,Debug::isFlagSet(Debug::Lex));
+ parser.parse(fullName,inputStr.data(),Debug::isFlagSet(Debug::Lex));
tagFileParser.buildLists(root);
tagFileParser.addIncludes();
//tagFileParser.dump();
diff --git a/src/template.cpp b/src/template.cpp
index 9f1eb92..9ae2c11 100644..100755
--- a/src/template.cpp
+++ b/src/template.cpp
@@ -20,16 +20,17 @@
#include <unordered_map>
#include <deque>
#include <cstdio>
+#include <fstream>
+#include <sstream>
-#include <qfile.h>
-#include <qdir.h>
-
-#include "ftextstream.h"
#include "message.h"
#include "util.h"
#include "resourcemgr.h"
#include "portable.h"
#include "regex.h"
+#include "fileinfo.h"
+#include "dir.h"
+#include "utf8.h"
#define ENABLE_TRACING 0
@@ -97,10 +98,11 @@ static std::vector<QCString> split(const QCString &str,const QCString &sep,
/** Strips spaces surrounding `=` from string \a in, so
* `foo = 10 bar=5 baz= 'hello'` will become `foo=10 bar=5 baz='hello'`
*/
-static QCString removeSpacesAroundEquals(const char *s)
+static QCString removeSpacesAroundEquals(const QCString &s)
{
+ if (s.isEmpty()) return s;
QCString result(s);
- const char *p=result.data();
+ const char *p=s.data();
char *q = result.rawData();
char c;
while ((c=*p++))
@@ -118,14 +120,14 @@ static QCString removeSpacesAroundEquals(const char *s)
}
*q++=c;
}
- if (q<p) result.resize(q-result.data()+1);
+ if (q<p) result.resize(static_cast<uint>(q-result.data())+1);
return result;
}
//----------------------------------------------------------------------------
#if ENABLE_TRACING
-static QCString replace(const char *s,char csrc,char cdst)
+static QCString replace(const QCString &s,char csrc,char cdst)
{
QCString result = s;
for (char *p=result.data();*p;p++)
@@ -267,22 +269,22 @@ int TemplateStruct::release()
return count;
}
-void TemplateStruct::set(const char *name,const TemplateVariant &v)
+void TemplateStruct::set(const QCString &name,const TemplateVariant &v)
{
- auto it = p->fields.find(name);
+ auto it = p->fields.find(name.str());
if (it!=p->fields.end()) // change existing field
{
it->second = v;
}
else // insert new field
{
- p->fields.insert(std::make_pair(name,v));
+ p->fields.insert(std::make_pair(name.str(),v));
}
}
-TemplateVariant TemplateStruct::get(const char *name) const
+TemplateVariant TemplateStruct::get(const QCString &name) const
{
- auto it = p->fields.find(name);
+ auto it = p->fields.find(name.str());
return it!=p->fields.end() ? it->second : TemplateVariant();
}
@@ -511,7 +513,7 @@ class TemplateContextImpl : public TemplateContext
// TemplateContext methods
void push();
void pop();
- void set(const char *name,const TemplateVariant &v);
+ void set(const QCString &name,const TemplateVariant &v);
TemplateVariant get(const QCString &name) const;
const TemplateVariant *getRef(const QCString &name) const;
void setOutputDirectory(const QCString &dir)
@@ -551,7 +553,7 @@ class TemplateContextImpl : public TemplateContext
QCString encoding() const { return m_encoding; }
void setEncoding(const QCString &file,int line,const QCString &enc);
QCString recode(const QCString &s);
- void warn(const char *fileName,int line,const char *fmt,...) const;
+ void warn(const QCString &fileName,int line,const char *fmt,...) const;
// index related functions
void openSubIndex(const QCString &indexName);
@@ -627,12 +629,12 @@ class FilterGet
if (v.isValid() && v.type()==TemplateVariant::Struct && arg.type()==TemplateVariant::String)
{
TemplateVariant result = v.toStruct()->get(arg.toString());
- //printf("\nok[%s]=%d\n",arg.toString().data(),result.type());
+ //printf("\nok[%s]=%d\n",qPrint(arg.toString()),result.type());
return result;
}
else
{
- //printf("\nnok[%s]\n",arg.toString().data());
+ //printf("\nnok[%s]\n",qPrint(arg.toString()));
return FALSE;
}
}
@@ -873,7 +875,7 @@ class FilterListSort
{
if (v.type()==TemplateVariant::List && args.type()==TemplateVariant::String)
{
- //printf("FilterListSort::apply: v=%s args=%s\n",v.toString().data(),args.toString().data());
+ //printf("FilterListSort::apply: v=%s args=%s\n",qPrint(v.toString()),qPrint(args.toString()));
TemplateListIntf::ConstIterator *it = v.toList()->createIterator();
TemplateVariant item;
@@ -890,7 +892,7 @@ class FilterListSort
{
QCString sortKey = determineSortKey(s,args.toString());
sortList.emplace_back(sortKey,item);
- //printf("sortKey=%s\n",sortKey.data());
+ //printf("sortKey=%s\n",qPrint(sortKey));
}
}
delete it;
@@ -898,7 +900,7 @@ class FilterListSort
// sort the list
std::sort(sortList.begin(),
sortList.end(),
- [](const auto &lhs,const auto &rhs) { return qstrcmp(lhs.key,rhs.key)<0; });
+ [](const auto &lhs,const auto &rhs) { return lhs.key < rhs.key; });
// add sorted items to the result list
for (const auto &elem : sortList)
@@ -923,7 +925,7 @@ class FilterListSort
{
QCString var = arg.mid(i+2,j-i-2);
TemplateVariant val=s->get(var);
- //printf("found argument %s value=%s\n",var.data(),val.toString().data());
+ //printf("found argument %s value=%s\n",qPrint(var),qPrint(val.toString()));
result+=val.toString();
p=j+2;
}
@@ -953,7 +955,7 @@ class FilterGroupBy
{
if (v.type()==TemplateVariant::List && args.type()==TemplateVariant::String)
{
- //printf("FilterListSort::apply: v=%s args=%s\n",v.toString().data(),args.toString().data());
+ //printf("FilterListSort::apply: v=%s args=%s\n",qPrint(v.toString()),qPrint(args.toString()));
TemplateListIntf::ConstIterator *it = v.toList()->createIterator();
TemplateVariant item;
@@ -970,7 +972,7 @@ class FilterGroupBy
{
QCString sortKey = determineSortKey(s,args.toString());
sortList.emplace_back(sortKey,item);
- //printf("sortKey=%s\n",sortKey.data());
+ //printf("sortKey=%s\n",qPrint(sortKey));
}
}
delete it;
@@ -978,7 +980,7 @@ class FilterGroupBy
// sort the list
std::sort(sortList.begin(),
sortList.end(),
- [](const auto &lhs,const auto &rhs) { return qstrcmp(lhs.key,rhs.key)<0; });
+ [](const auto &lhs,const auto &rhs) { return lhs.key < rhs.key; });
// add sorted items to the result list
TemplateList *groupList=0;
@@ -1080,10 +1082,10 @@ class FilterAlphaIndex
QCString key;
TemplateVariant value;
};
- static QCString keyToLabel(const char *startLetter)
+ static QCString keyToLabel(const QCString &startLetter)
{
- const char *p = startLetter;
- if (startLetter==0 || *startLetter==0) return "";
+ if (startLetter.isEmpty()) return startLetter;
+ const char *p = startLetter.data();
char c = *p;
QCString result;
if (c<127 && c>31) // printable ASCII character
@@ -1106,7 +1108,10 @@ class FilterAlphaIndex
{
TemplateVariant v = s->get(attribName);
int index = getPrefixIndex(v.toString());
- return getUtf8CodeToUpper(v.toString(),index);
+ return getUnicodeForUTF8CharAt(
+ convertUTF8ToUpper(
+ getUTF8CharAt(v.toString().str(),index)
+ ),0);
}
public:
@@ -1114,7 +1119,7 @@ class FilterAlphaIndex
{
if (v.type()==TemplateVariant::List && args.type()==TemplateVariant::String)
{
- //printf("FilterListSort::apply: v=%s args=%s\n",v.toString().data(),args.toString().data());
+ //printf("FilterListSort::apply: v=%s args=%s\n",qPrint(v.toString()),qPrint(args.toString()));
TemplateListIntf::ConstIterator *it = v.toList()->createIterator();
TemplateVariant item;
@@ -1131,7 +1136,7 @@ class FilterAlphaIndex
{
uint sortKey = determineSortKey(s,args.toString());
sortList.emplace_back(sortKey,item);
- //printf("sortKey=%s\n",sortKey.data());
+ //printf("sortKey=%s\n",qPrint(sortKey));
}
}
delete it;
@@ -1139,7 +1144,7 @@ class FilterAlphaIndex
// sort the list
std::sort(sortList.begin(),
sortList.end(),
- [](const auto &lhs,const auto &rhs) { return qstrcmp(lhs.key,rhs.key)<0; });
+ [](const auto &lhs,const auto &rhs) { return lhs.key < rhs.key; });
// create an index from the sorted list
QCString letter;
@@ -1403,7 +1408,7 @@ class ExprAstNumber : public ExprAst
class ExprAstVariable : public ExprAst
{
public:
- ExprAstVariable(const char *name) : m_name(name)
+ ExprAstVariable(const QCString &name) : m_name(name)
{ TRACE(("ExprAstVariable(%s)\n",name)); }
const QCString &name() const { return m_name; }
virtual TemplateVariant resolve(TemplateContext *c)
@@ -1412,7 +1417,7 @@ class ExprAstVariable : public ExprAst
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (!v.isValid())
{
- if (ci) ci->warn(ci->templateName(),ci->line(),"undefined variable '%s' in expression",m_name.data());
+ if (ci) ci->warn(ci->templateName(),ci->line(),"undefined variable '%s' in expression",qPrint(m_name));
}
return v;
}
@@ -1455,7 +1460,7 @@ class ExprAstFunctionVariable : public ExprAst
class ExprAstFilter : public ExprAst
{
public:
- ExprAstFilter(const char *name,ExprAst *arg) : m_name(name), m_arg(arg)
+ ExprAstFilter(const QCString &name,ExprAst *arg) : m_name(name), m_arg(arg)
{ TRACE(("ExprAstFilter(%s)\n",name)); }
~ExprAstFilter() { delete m_arg; }
const QCString &name() const { return m_name; }
@@ -1463,14 +1468,14 @@ class ExprAstFilter : public ExprAst
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return v; // should not happen
- TRACE(("Applying filter '%s' to '%s' (type=%d)\n",m_name.data(),v.toString().data(),v.type()));
+ TRACE(("Applying filter '%s' to '%s' (type=%d)\n",qPrint(m_name),qPrint(v.toString()),v.type()));
TemplateVariant arg;
if (m_arg) arg = m_arg->resolve(c);
bool ok;
TemplateVariant result = TemplateFilterFactory::instance()->apply(m_name,v,arg,ok);
if (!ok)
{
- ci->warn(ci->templateName(),ci->line(),"unknown filter '%s'",m_name.data());
+ ci->warn(ci->templateName(),ci->line(),"unknown filter '%s'",qPrint(m_name));
}
return result;
}
@@ -1500,7 +1505,7 @@ class ExprAstFilterAppl : public ExprAst
class ExprAstLiteral : public ExprAst
{
public:
- ExprAstLiteral(const char *lit) : m_literal(lit)
+ ExprAstLiteral(const QCString &lit) : m_literal(lit)
{ TRACE(("ExprAstLiteral(%s)\n",lit)); }
const QCString &literal() const { return m_literal; }
virtual TemplateVariant resolve(TemplateContext *) { return TemplateVariant(m_literal); }
@@ -1660,7 +1665,7 @@ class TemplateNode
TemplateNode(TemplateNode *parent) : m_parent(parent) {}
virtual ~TemplateNode() {}
- virtual void render(FTextStream &ts, TemplateContext *c) = 0;
+ virtual void render(TextStream &ts, TemplateContext *c) = 0;
TemplateNode *parent() { return m_parent; }
@@ -1675,7 +1680,7 @@ class TemplateToken
{
public:
enum Type { Text, Variable, Block };
- TemplateToken(Type t,const char *d,int l) : type(t), data(d), line(l) {}
+ TemplateToken(Type t,const QCString &d,int l) : type(t), data(d), line(l) {}
Type type = Text;
QCString data;
int line = 0;
@@ -1690,7 +1695,7 @@ using TemplateTokenStream = std::deque< TemplateTokenPtr >;
class TemplateNodeList : public std::vector< std::unique_ptr<TemplateNode> >
{
public:
- void render(FTextStream &ts,TemplateContext *c)
+ void render(TextStream &ts,TemplateContext *c)
{
TRACE(("{TemplateNodeList::render\n"));
for (const auto &tn : *this)
@@ -1718,7 +1723,7 @@ class TemplateParser
void prependToken(TemplateTokenPtr &&token);
const TemplateToken *currentToken() const;
QCString templateName() const { return m_templateName; }
- void warn(const char *fileName,int line,const char *fmt,...) const;
+ void warn(const QCString &fileName,int line,const char *fmt,...) const;
private:
const TemplateEngine *m_engine = 0;
QCString m_templateName;
@@ -1740,10 +1745,10 @@ class ExpressionParser
{
}
- ExprAst *parse(const char *expr)
+ ExprAst *parse(const QCString &expr)
{
- if (expr==0) return 0;
- m_tokenStream = expr;
+ if (expr.isEmpty()) return 0;
+ m_tokenStream = expr.data();
getNextToken();
return parseExpression();
}
@@ -1984,7 +1989,7 @@ class ExpressionParser
ExprAst *parseIdentifier()
{
- TRACE(("{parseIdentifier(%s)\n",m_curToken.id.data()));
+ TRACE(("{parseIdentifier(%s)\n",qPrint(m_curToken.id)));
ExprAst *id = new ExprAstVariable(m_curToken.id);
getNextToken();
TRACE(("}parseIdentifier()\n"));
@@ -1993,7 +1998,7 @@ class ExpressionParser
ExprAst *parseLiteral()
{
- TRACE(("{parseLiteral(%s)\n",m_curToken.id.data()));
+ TRACE(("{parseLiteral(%s)\n",qPrint(m_curToken.id)));
ExprAst *expr = new ExprAstLiteral(m_curToken.id);
getNextToken();
TRACE(("}parseLiteral()\n"));
@@ -2002,7 +2007,7 @@ class ExpressionParser
ExprAst *parseIdentifierOptionalArgs()
{
- TRACE(("{parseIdentifierOptionalArgs(%s)\n",m_curToken.id.data()));
+ TRACE(("{parseIdentifierOptionalArgs(%s)\n",qPrint(m_curToken.id)));
ExprAst *expr = parseIdentifier();
if (expr)
{
@@ -2046,7 +2051,7 @@ class ExpressionParser
ExprAstFilter *parseFilter()
{
- TRACE(("{parseFilter(%s)\n",m_curToken.id.data()));
+ TRACE(("{parseFilter(%s)\n",qPrint(m_curToken.id)));
QCString filterName = m_curToken.id;
getNextToken();
ExprAst *argExpr=0;
@@ -2257,7 +2262,7 @@ class ExpressionParser
p++;
}
//TRACE(("token type=%d op=%d num=%d id=%s\n",
- // m_curToken.type,m_curToken.op,m_curToken.num,m_curToken.id.data()));
+ // m_curToken.type,m_curToken.op,m_curToken.num,qPrint(m_curToken.id)));
m_tokenStream = p;
return TRUE;
@@ -2278,7 +2283,7 @@ class TemplateImpl : public TemplateNode, public Template
TemplateImpl(TemplateEngine *e,const QCString &name,const QCString &data,
const QCString &extension);
~TemplateImpl();
- void render(FTextStream &ts, TemplateContext *c);
+ void render(TextStream &ts, TemplateContext *c);
TemplateEngine *engine() const { return m_engine; }
TemplateBlockContext *blockContext() { return &m_blockContext; }
@@ -2299,7 +2304,7 @@ class TemplateStructWeakRef : public TemplateStructIntf
{
public:
TemplateStructWeakRef(TemplateStructIntf *ref) : m_ref(ref), m_refCount(0) {}
- virtual TemplateVariant get(const char *name) const { return m_ref->get(name); }
+ virtual TemplateVariant get(const QCString &name) const { return m_ref->get(name); }
virtual int addRef() { return ++m_refCount; }
virtual int release() { int count=--m_refCount; if (count<=0) { delete this; } return count; }
private:
@@ -2334,18 +2339,18 @@ void TemplateContextImpl::setEncoding(const QCString &templateName,int line,cons
m_encoding=enc;
if (!enc.isEmpty())
{
- m_fromUtf8 = portable_iconv_open(enc,"UTF-8");
+ m_fromUtf8 = portable_iconv_open(enc.data(),"UTF-8");
if (m_fromUtf8==(void*)(-1))
{
- warn(templateName,line,"unsupported character conversion: '%s'->'UTF-8'\n", enc.data());
+ warn(templateName,line,"unsupported character conversion: '%s'->'UTF-8'\n", qPrint(enc));
}
}
- //printf("TemplateContextImpl::setEncoding(%s)\n",enc.data());
+ //printf("TemplateContextImpl::setEncoding(%s)\n",qPrint(enc));
}
QCString TemplateContextImpl::recode(const QCString &s)
{
- //printf("TemplateContextImpl::recode(%s)\n",s.data());
+ //printf("TemplateContextImpl::recode(%s)\n",qPrint(s));
int iSize = s.length();
int oSize = iSize*4+1;
QCString output(oSize);
@@ -2366,15 +2371,15 @@ QCString TemplateContextImpl::recode(const QCString &s)
}
}
-void TemplateContextImpl::set(const char *name,const TemplateVariant &v)
+void TemplateContextImpl::set(const QCString &name,const TemplateVariant &v)
{
auto &ctx = m_contextStack.front();
- auto it = ctx.find(name);
+ auto it = ctx.find(name.str());
if (it!=ctx.end())
{
ctx.erase(it);
}
- ctx.insert(std::make_pair(name,v));
+ ctx.insert(std::make_pair(name.str(),v));
}
TemplateVariant TemplateContextImpl::get(const QCString &name) const
@@ -2391,7 +2396,7 @@ TemplateVariant TemplateContextImpl::get(const QCString &name) const
QCString propName = name.mid(i+1);
while (!propName.isEmpty())
{
- //printf("getPrimary(%s) type=%d:%s\n",objName.data(),v.type(),v.toString().data());
+ //printf("getPrimary(%s) type=%d:%s\n",qPrint(objName),v.type(),qPrint(v.toString()));
if (v.type()==TemplateVariant::Struct)
{
i = propName.find(".");
@@ -2399,7 +2404,7 @@ TemplateVariant TemplateContextImpl::get(const QCString &name) const
v = v.toStruct()->get(propName.left(l));
if (!v.isValid())
{
- warn(m_templateName,m_line,"requesting non-existing property '%s' for object '%s'",propName.left(l).data(),objName.data());
+ warn(m_templateName,m_line,"requesting non-existing property '%s' for object '%s'",qPrint(propName.left(l)),qPrint(objName));
}
if (i!=-1)
{
@@ -2423,7 +2428,7 @@ TemplateVariant TemplateContextImpl::get(const QCString &name) const
}
else
{
- warn(m_templateName,m_line,"list index '%s' is not valid",propName.data());
+ warn(m_templateName,m_line,"list index '%s' is not valid",qPrint(propName));
break;
}
if (i!=-1)
@@ -2437,7 +2442,7 @@ TemplateVariant TemplateContextImpl::get(const QCString &name) const
}
else
{
- warn(m_templateName,m_line,"using . on an object '%s' is not an struct or list",objName.data());
+ warn(m_templateName,m_line,"using . on an object '%s' is not an struct or list",qPrint(objName));
return TemplateVariant();
}
}
@@ -2486,7 +2491,7 @@ TemplateBlockContext *TemplateContextImpl::blockContext()
return &m_blockContext;
}
-void TemplateContextImpl::warn(const char *fileName,int line,const char *fmt,...) const
+void TemplateContextImpl::warn(const QCString &fileName,int line,const char *fmt,...) const
{
va_list args;
va_start(args,fmt);
@@ -2497,11 +2502,11 @@ void TemplateContextImpl::warn(const char *fileName,int line,const char *fmt,...
void TemplateContextImpl::openSubIndex(const QCString &indexName)
{
- //printf("TemplateContextImpl::openSubIndex(%s)\n",indexName.data());
+ //printf("TemplateContextImpl::openSubIndex(%s)\n",qPrint(indexName));
auto kv = m_indexStacks.find(indexName.str());
if (kv==m_indexStacks.end() || kv->second.empty() || kv->second.top().type()==TemplateVariant::List) // error: no stack yet or no entry
{
- warn(m_templateName,m_line,"opensubindex for index %s without preceding indexentry",indexName.data());
+ warn(m_templateName,m_line,"opensubindex for index %s without preceding indexentry",qPrint(indexName));
return;
}
// get the parent entry to add the list to
@@ -2519,11 +2524,11 @@ void TemplateContextImpl::openSubIndex(const QCString &indexName)
void TemplateContextImpl::closeSubIndex(const QCString &indexName)
{
- //printf("TemplateContextImpl::closeSubIndex(%s)\n",indexName.data());
+ //printf("TemplateContextImpl::closeSubIndex(%s)\n",qPrint(indexName));
auto kv = m_indexStacks.find(indexName.str());
if (kv==m_indexStacks.end() || kv->second.size()<3)
{
- warn(m_templateName,m_line,"closesubindex for index %s without matching open",indexName.data());
+ warn(m_templateName,m_line,"closesubindex for index %s without matching open",qPrint(indexName));
}
else
{
@@ -2543,7 +2548,7 @@ void TemplateContextImpl::closeSubIndex(const QCString &indexName)
}
}
}
- //fprintf(stderr,"TemplateContextImpl::closeSubIndex(%s) end g_count=%d\n\n",indexName.data(),g_count);
+ //fprintf(stderr,"TemplateContextImpl::closeSubIndex(%s) end g_count=%d\n\n",qPrint(indexName),g_count);
}
static void getPathListFunc(TemplateStructIntf *entry,TemplateList *list)
@@ -2567,7 +2572,7 @@ static TemplateVariant getPathFunc(const void *ctx, const std::vector<TemplateVa
void TemplateContextImpl::addIndexEntry(const QCString &indexName,const std::vector<TemplateKeyValue> &arguments)
{
auto it = arguments.begin();
- //printf("TemplateContextImpl::addIndexEntry(%s)\n",indexName.data());
+ //printf("TemplateContextImpl::addIndexEntry(%s)\n",qPrint(indexName));
//while (it!=arguments.end())
//{
// printf(" key=%s value=%s\n",(*it).key.data(),(*it).value.toString().data());
@@ -2647,11 +2652,11 @@ class TemplateNodeText : public TemplateNode
TRACE(("TemplateNodeText('%s')\n",replace(data,'\n',' ').data()));
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
- //printf("TemplateNodeText::render(%s) needsRecoding=%d ci=%p\n",m_data.data(),ci->needsRecoding(),ci);
+ //printf("TemplateNodeText::render(%s) needsRecoding=%d ci=%p\n",qPrint(m_data),ci->needsRecoding(),ci);
if (ci->spacelessEnabled())
{
if (ci->needsRecoding())
@@ -2688,12 +2693,12 @@ class TemplateNodeVariable : public TemplateNode
TemplateNodeVariable(TemplateParser *parser,TemplateNode *parent,int line,const QCString &var)
: TemplateNode(parent), m_templateName(parser->templateName()), m_line(line)
{
- TRACE(("TemplateNodeVariable(%s)\n",var.data()));
+ TRACE(("TemplateNodeVariable(%s)\n",qPrint(var)));
ExpressionParser expParser(parser,line);
m_var = expParser.parse(var);
if (m_var==0)
{
- parser->warn(m_templateName,line,"invalid expression '%s' for variable",var.data());
+ parser->warn(m_templateName,line,"invalid expression '%s' for variable",qPrint(var));
}
}
~TemplateNodeVariable()
@@ -2701,7 +2706,7 @@ class TemplateNodeVariable : public TemplateNode
delete m_var;
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -2771,36 +2776,35 @@ template<class T> class TemplateNodeCreator : public TemplateNode
return dynamic_cast<TemplateImpl*>(root);
}
protected:
- void mkpath(TemplateContextImpl *ci,const QCString &fileName)
+ void mkpath(TemplateContextImpl *ci,const std::string &fileName)
{
- int i=fileName.find('/');
- QCString outputDir = ci->outputDirectory();
- QDir d(outputDir);
+ size_t i=fileName.find('/');
+ std::string outputDir = ci->outputDirectory().str();
+ Dir d(outputDir);
if (!d.exists())
{
- QDir rootDir;
- rootDir.setPath(QDir::currentDirPath());
+ Dir rootDir;
if (!rootDir.mkdir(outputDir))
{
err("tag OUTPUT_DIRECTORY: Output directory '%s' does not "
- "exist and cannot be created\n",outputDir.data());
+ "exist and cannot be created\n",outputDir.c_str());
return;
}
d.setPath(outputDir);
}
- int j=0;
- while (i!=-1) // fileName contains path part
+ size_t j=0;
+ while (i!=std::string::npos) // fileName contains path part
{
if (d.exists())
{
- bool ok = d.mkdir(fileName.mid(j,i-j));
+ bool ok = d.mkdir(fileName.substr(j,i-j));
if (!ok)
{
- err("Failed to create directory '%s'\n",(fileName.mid(j,i-j)).data());
+ err("Failed to create directory '%s'\n",(fileName.substr(j,i-j)).c_str());
break;
}
- QCString dirName = outputDir+'/'+fileName.left(i);
- d = QDir(dirName);
+ std::string dirName = outputDir+'/'+fileName.substr(0,i);
+ d = Dir(dirName);
j = i+1;
}
i=fileName.find('/',i+1);
@@ -2819,7 +2823,7 @@ class TemplateNodeIf : public TemplateNodeCreator<TemplateNodeIf>
TemplateNodeIf(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data) :
TemplateNodeCreator<TemplateNodeIf>(parser,parent,line)
{
- TRACE(("{TemplateNodeIf(%s)\n",data.data()));
+ TRACE(("{TemplateNodeIf(%s)\n",qPrint(data)));
if (data.isEmpty())
{
parser->warn(m_templateName,line,"missing argument for if tag");
@@ -2858,13 +2862,13 @@ class TemplateNodeIf : public TemplateNodeCreator<TemplateNodeIf>
parser->parse(this,line,stopAt,m_falseNodes);
parser->removeNextToken(); // skip over endif
}
- TRACE(("}TemplateNodeIf(%s)\n",data.data()));
+ TRACE(("}TemplateNodeIf(%s)\n",qPrint(data)));
}
~TemplateNodeIf()
{
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -2915,19 +2919,19 @@ class TemplateNodeRepeat : public TemplateNodeCreator<TemplateNodeRepeat>
TemplateNodeRepeat(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeRepeat>(parser,parent,line)
{
- TRACE(("{TemplateNodeRepeat(%s)\n",data.data()));
+ TRACE(("{TemplateNodeRepeat(%s)\n",qPrint(data)));
ExpressionParser expParser(parser,line);
m_expr = expParser.parse(data);
StringVector stopAt = { "endrepeat" };
parser->parse(this,line,stopAt,m_repeatNodes);
parser->removeNextToken(); // skip over endrepeat
- TRACE(("}TemplateNodeRepeat(%s)\n",data.data()));
+ TRACE(("}TemplateNodeRepeat(%s)\n",qPrint(data)));
}
~TemplateNodeRepeat()
{
delete m_expr;
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -2969,7 +2973,7 @@ class TemplateNodeRange : public TemplateNodeCreator<TemplateNodeRange>
TemplateNodeRange(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeRange>(parser,parent,line), m_down(FALSE)
{
- TRACE(("{TemplateNodeRange(%s)\n",data.data()));
+ TRACE(("{TemplateNodeRange(%s)\n",qPrint(data)));
QCString start,end;
int i1 = data.find(" from ");
int i2 = data.find(" to ");
@@ -3030,7 +3034,7 @@ class TemplateNodeRange : public TemplateNodeCreator<TemplateNodeRange>
StringVector stopAt = { "endrange" };
parser->parse(this,line,stopAt,m_loopNodes);
parser->removeNextToken(); // skip over endrange
- TRACE(("}TemplateNodeRange(%s)\n",data.data()));
+ TRACE(("}TemplateNodeRange(%s)\n",qPrint(data)));
}
~TemplateNodeRange()
@@ -3039,7 +3043,7 @@ class TemplateNodeRange : public TemplateNodeCreator<TemplateNodeRange>
delete m_endExpr;
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -3138,7 +3142,7 @@ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor>
TemplateNodeFor(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeFor>(parser,parent,line), m_reversed(FALSE)
{
- TRACE(("{TemplateNodeFor(%s)\n",data.data()));
+ TRACE(("{TemplateNodeFor(%s)\n",qPrint(data)));
QCString exprStr;
int i = data.find(" in ");
if (i==-1)
@@ -3189,7 +3193,7 @@ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor>
parser->parse(this,line,stopAt,m_emptyNodes);
parser->removeNextToken(); // skip over endfor
}
- TRACE(("}TemplateNodeFor(%s)\n",data.data()));
+ TRACE(("}TemplateNodeFor(%s)\n",qPrint(data)));
}
~TemplateNodeFor()
@@ -3197,7 +3201,7 @@ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor>
delete m_expr;
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -3271,7 +3275,7 @@ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor>
}
else // simple type...
{
- ci->warn(m_templateName,m_line,"for requires a variable of list type, got type '%s'!",v.typeAsString().data());
+ ci->warn(m_templateName,m_line,"for requires a variable of list type, got type '%s'!",qPrint(v.typeAsString()));
}
}
}
@@ -3299,7 +3303,7 @@ class TemplateNodeMsg : public TemplateNodeCreator<TemplateNodeMsg>
parser->removeNextToken(); // skip over endmsg
TRACE(("}TemplateNodeMsg()\n"));
}
- void render(FTextStream &, TemplateContext *c)
+ void render(TextStream &, TemplateContext *c)
{
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -3308,9 +3312,10 @@ class TemplateNodeMsg : public TemplateNodeCreator<TemplateNodeMsg>
ci->setActiveEscapeIntf(0); // avoid escaping things we send to standard out
bool enable = ci->spacelessEnabled();
ci->enableSpaceless(FALSE);
- FTextStream ts(stdout);
- m_nodes.render(ts,c);
- ts << endl;
+ TextStream t(&std::cout);
+ m_nodes.render(t,c);
+ t.flush();
+ std::cout << "\n";
ci->setActiveEscapeIntf(escIntf);
ci->enableSpaceless(enable);
}
@@ -3328,7 +3333,7 @@ class TemplateNodeBlock : public TemplateNodeCreator<TemplateNodeBlock>
TemplateNodeBlock(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeBlock>(parser,parent,line)
{
- TRACE(("{TemplateNodeBlock(%s)\n",data.data()));
+ TRACE(("{TemplateNodeBlock(%s)\n",qPrint(data)));
m_blockName = data;
if (m_blockName.isEmpty())
{
@@ -3337,10 +3342,10 @@ class TemplateNodeBlock : public TemplateNodeCreator<TemplateNodeBlock>
StringVector stopAt = { "endblock" };
parser->parse(this,line,stopAt,m_nodes);
parser->removeNextToken(); // skip over endblock
- TRACE(("}TemplateNodeBlock(%s)\n",data.data()));
+ TRACE(("}TemplateNodeBlock(%s)\n",qPrint(data)));
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -3353,8 +3358,7 @@ class TemplateNodeBlock : public TemplateNodeCreator<TemplateNodeBlock>
if (nb) // block is overruled
{
ci->push();
- QGString super;
- FTextStream ss(&super);
+ TextStream ss;
// get super block of block nb
TemplateNodeBlock *sb = ci->blockContext()->get(m_blockName);
if (sb && sb!=nb && sb!=this) // nb and sb both overrule this block
@@ -3365,6 +3369,7 @@ class TemplateNodeBlock : public TemplateNodeCreator<TemplateNodeBlock>
{
m_nodes.render(ss,c); // render parent of nb to string
}
+ QCString super = ss.str();
// add 'block.super' variable to allow access to parent block content
TemplateAutoRef<TemplateStruct> superBlock(TemplateStruct::alloc());
superBlock->set("super",TemplateVariant(super.data(),TRUE));
@@ -3405,7 +3410,7 @@ class TemplateNodeExtend : public TemplateNodeCreator<TemplateNodeExtend>
TemplateNodeExtend(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeExtend>(parser,parent,line)
{
- TRACE(("{TemplateNodeExtend(%s)\n",data.data()));
+ TRACE(("{TemplateNodeExtend(%s)\n",qPrint(data)));
ExpressionParser ep(parser,line);
if (data.isEmpty())
{
@@ -3414,14 +3419,14 @@ class TemplateNodeExtend : public TemplateNodeCreator<TemplateNodeExtend>
m_extendExpr = ep.parse(data);
StringVector stopAt;
parser->parse(this,line,stopAt,m_nodes);
- TRACE(("}TemplateNodeExtend(%s)\n",data.data()));
+ TRACE(("}TemplateNodeExtend(%s)\n",qPrint(data)));
}
~TemplateNodeExtend()
{
delete m_extendExpr;
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -3469,7 +3474,7 @@ class TemplateNodeExtend : public TemplateNodeCreator<TemplateNodeExtend>
}
else
{
- ci->warn(m_templateName,m_line,"failed to load template %s for extend",extendFile.data());
+ ci->warn(m_templateName,m_line,"failed to load template %s for extend",qPrint(extendFile));
}
}
}
@@ -3486,7 +3491,7 @@ class TemplateNodeInclude : public TemplateNodeCreator<TemplateNodeInclude>
TemplateNodeInclude(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeInclude>(parser,parent,line)
{
- TRACE(("TemplateNodeInclude(%s)\n",data.data()));
+ TRACE(("TemplateNodeInclude(%s)\n",qPrint(data)));
ExpressionParser ep(parser,line);
if (data.isEmpty())
{
@@ -3498,7 +3503,7 @@ class TemplateNodeInclude : public TemplateNodeCreator<TemplateNodeInclude>
{
delete m_includeExpr;
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -3524,7 +3529,7 @@ class TemplateNodeInclude : public TemplateNodeCreator<TemplateNodeInclude>
}
else
{
- ci->warn(m_templateName,m_line,"failed to load template '%s' for include",includeFile.data()?includeFile.data():"");
+ ci->warn(m_templateName,m_line,"failed to load template '%s' for include",qPrint(includeFile));
}
}
}
@@ -3537,12 +3542,12 @@ class TemplateNodeInclude : public TemplateNodeCreator<TemplateNodeInclude>
//----------------------------------------------------------
-static void stripLeadingWhiteSpace(QGString &s)
+static void stripLeadingWhiteSpace(QCString &s)
{
const char *src = s.data();
if (src)
{
- char *dst = s.data();
+ char *dst = s.rawData();
char c;
bool skipSpaces=TRUE;
while ((c=*src++))
@@ -3562,7 +3567,7 @@ class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate>
TemplateNodeCreate(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeCreate>(parser,parent,line), m_templateExpr(0), m_fileExpr(0)
{
- TRACE(("TemplateNodeCreate(%s)\n",data.data()));
+ TRACE(("TemplateNodeCreate(%s)\n",qPrint(data)));
if (data.isEmpty())
{
parser->warn(m_templateName,line,"create tag is missing arguments");
@@ -3595,7 +3600,7 @@ class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate>
delete m_templateExpr;
delete m_fileExpr;
}
- void render(FTextStream &, TemplateContext *c)
+ void render(TextStream &, TemplateContext *c)
{
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -3628,21 +3633,21 @@ class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate>
TemplateImpl *createTemplate = ct ? dynamic_cast<TemplateImpl*>(ct) : 0;
if (createTemplate)
{
- mkpath(ci,outputFile);
+ mkpath(ci,outputFile.str());
if (!ci->outputDirectory().isEmpty())
{
outputFile.prepend(ci->outputDirectory()+"/");
}
- //printf("NoteCreate(%s)\n",outputFile.data());
- QFile f(outputFile);
- if (f.open(IO_WriteOnly))
+ //printf("NoteCreate(%s)\n",qPrint(outputFile));
+ std::ofstream f(outputFile.str(),std::ofstream::out | std::ofstream::binary);
+ if (f.is_open())
{
+ TextStream ts(&f);
TemplateEscapeIntf *escIntf = ci->escapeIntf();
ci->selectEscapeIntf(extension);
- FTextStream ts(&f);
- QGString out;
- FTextStream os(&out);
+ TextStream os;
createTemplate->render(os,c);
+ QCString out = os.str();
stripLeadingWhiteSpace(out);
ts << out;
t->engine()->unload(t);
@@ -3650,12 +3655,12 @@ class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate>
}
else
{
- ci->warn(m_templateName,m_line,"failed to open output file '%s' for create command",outputFile.data());
+ ci->warn(m_templateName,m_line,"failed to open output file '%s' for create command",qPrint(outputFile));
}
}
else
{
- ci->warn(m_templateName,m_line,"failed to load template '%s' for include",templateFile.data());
+ ci->warn(m_templateName,m_line,"failed to load template '%s' for include",qPrint(templateFile));
}
t->engine()->setOutputExtension("");
}
@@ -3685,7 +3690,7 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree>
TemplateNodeTree(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeTree>(parser,parent,line)
{
- TRACE(("{TemplateNodeTree(%s)\n",data.data()));
+ TRACE(("{TemplateNodeTree(%s)\n",qPrint(data)));
ExpressionParser ep(parser,line);
if (data.isEmpty())
{
@@ -3695,7 +3700,7 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree>
StringVector stopAt = { "endrecursetree" };
parser->parse(this,line,stopAt,m_treeNodes);
parser->removeNextToken(); // skip over endrecursetree
- TRACE(("}TemplateNodeTree(%s)\n",data.data()));
+ TRACE(("}TemplateNodeTree(%s)\n",qPrint(data)));
}
~TemplateNodeTree()
{
@@ -3713,8 +3718,7 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree>
TemplateContext *c = ctx->templateCtx;
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return QCString(); // should not happen
- QGString result;
- FTextStream ss(&result);
+ TextStream ss;
c->push();
TemplateVariant node;
TemplateListIntf::ConstIterator *it = ctx->list->createIterator();
@@ -3740,7 +3744,7 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree>
}
else if (list==0)
{
- ci->warn(m_templateName,m_line,"recursetree: children attribute has type '%s' instead of list\n",v.typeAsString().data());
+ ci->warn(m_templateName,m_line,"recursetree: children attribute has type '%s' instead of list\n",qPrint(v.typeAsString()));
}
}
//else
@@ -3756,9 +3760,9 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree>
}
c->pop();
delete it;
- return result.data();
+ return ss.str();
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
//printf("TemplateNodeTree::render()\n");
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
@@ -3797,7 +3801,7 @@ class TemplateNodeIndexEntry : public TemplateNodeCreator<TemplateNodeIndexEntry
TemplateNodeIndexEntry(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeIndexEntry>(parser,parent,line)
{
- TRACE(("{TemplateNodeIndexEntry(%s)\n",data.data()));
+ TRACE(("{TemplateNodeIndexEntry(%s)\n",qPrint(data)));
ExpressionParser expParser(parser,line);
std::vector<QCString> args = split(data," ");
auto it = args.begin();
@@ -3823,14 +3827,14 @@ class TemplateNodeIndexEntry : public TemplateNodeCreator<TemplateNodeIndexEntry
}
else
{
- parser->warn(parser->templateName(),line,"invalid argument '%s' for indexentry tag",arg.data());
+ parser->warn(parser->templateName(),line,"invalid argument '%s' for indexentry tag",qPrint(arg));
}
++it;
}
}
- TRACE(("}TemplateNodeIndexEntry(%s)\n",data.data()));
+ TRACE(("}TemplateNodeIndexEntry(%s)\n",qPrint(data)));
}
- void render(FTextStream &, TemplateContext *c)
+ void render(TextStream &, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -3859,7 +3863,7 @@ class TemplateNodeOpenSubIndex : public TemplateNodeCreator<TemplateNodeOpenSubI
TemplateNodeOpenSubIndex(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeOpenSubIndex>(parser,parent,line)
{
- TRACE(("{TemplateNodeOpenSubIndex(%s)\n",data.data()));
+ TRACE(("{TemplateNodeOpenSubIndex(%s)\n",qPrint(data)));
m_name = data.stripWhiteSpace();
if (m_name.isEmpty())
{
@@ -3867,12 +3871,12 @@ class TemplateNodeOpenSubIndex : public TemplateNodeCreator<TemplateNodeOpenSubI
}
else if (m_name.find(' ')!=-1)
{
- parser->warn(parser->templateName(),line,"Expected single argument for opensubindex tag got '%s'",data.data());
+ parser->warn(parser->templateName(),line,"Expected single argument for opensubindex tag got '%s'",qPrint(data));
m_name="";
}
- TRACE(("}TemplateNodeOpenSubIndex(%s)\n",data.data()));
+ TRACE(("}TemplateNodeOpenSubIndex(%s)\n",qPrint(data)));
}
- void render(FTextStream &, TemplateContext *c)
+ void render(TextStream &, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -3895,7 +3899,7 @@ class TemplateNodeCloseSubIndex : public TemplateNodeCreator<TemplateNodeCloseSu
TemplateNodeCloseSubIndex(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeCloseSubIndex>(parser,parent,line)
{
- TRACE(("{TemplateNodeCloseSubIndex(%s)\n",data.data()));
+ TRACE(("{TemplateNodeCloseSubIndex(%s)\n",qPrint(data)));
m_name = data.stripWhiteSpace();
if (m_name.isEmpty())
{
@@ -3903,12 +3907,12 @@ class TemplateNodeCloseSubIndex : public TemplateNodeCreator<TemplateNodeCloseSu
}
else if (m_name.find(' ')!=-1 || m_name.isEmpty())
{
- parser->warn(parser->templateName(),line,"Expected single argument for closesubindex tag got '%s'",data.data());
+ parser->warn(parser->templateName(),line,"Expected single argument for closesubindex tag got '%s'",qPrint(data));
m_name="";
}
- TRACE(("}TemplateNodeCloseSubIndex(%s)\n",data.data()));
+ TRACE(("}TemplateNodeCloseSubIndex(%s)\n",qPrint(data)));
}
- void render(FTextStream &, TemplateContext *c)
+ void render(TextStream &, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -3938,7 +3942,7 @@ class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith>
TemplateNodeWith(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeWith>(parser,parent,line)
{
- TRACE(("{TemplateNodeWith(%s)\n",data.data()));
+ TRACE(("{TemplateNodeWith(%s)\n",qPrint(data)));
ExpressionParser expParser(parser,line);
QCString filteredData = removeSpacesAroundEquals(data);
std::vector<QCString> args = split(filteredData," ");
@@ -3957,19 +3961,19 @@ class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith>
}
else
{
- parser->warn(parser->templateName(),line,"invalid argument '%s' for 'with' tag",arg.data());
+ parser->warn(parser->templateName(),line,"invalid argument '%s' for 'with' tag",qPrint(arg));
}
++it;
}
StringVector stopAt = { "endwith" };
parser->parse(this,line,stopAt,m_nodes);
parser->removeNextToken(); // skip over endwith
- TRACE(("}TemplateNodeWith(%s)\n",data.data()));
+ TRACE(("}TemplateNodeWith(%s)\n",qPrint(data)));
}
~TemplateNodeWith()
{
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -3997,7 +4001,7 @@ class TemplateNodeCycle : public TemplateNodeCreator<TemplateNodeCycle>
TemplateNodeCycle(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeCycle>(parser,parent,line)
{
- TRACE(("{TemplateNodeCycle(%s)\n",data.data()));
+ TRACE(("{TemplateNodeCycle(%s)\n",qPrint(data)));
m_index=0;
ExpressionParser expParser(parser,line);
std::vector<QCString> args = split(data," ");
@@ -4015,11 +4019,12 @@ class TemplateNodeCycle : public TemplateNodeCreator<TemplateNodeCycle>
{
parser->warn(parser->templateName(),line,"expected at least two arguments for cycle command, got %zu",m_args.size());
}
- TRACE(("}TemplateNodeCycle(%s)\n",data.data()));
+ TRACE(("}TemplateNodeCycle(%s)\n",qPrint(data)));
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
+ if (ci==0) return; // should not happen
ci->setLocation(m_templateName,m_line);
if (m_index<m_args.size())
{
@@ -4077,7 +4082,7 @@ class TemplateNodeSet : public TemplateNodeCreator<TemplateNodeSet>
TemplateNodeSet(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeSet>(parser,parent,line)
{
- TRACE(("{TemplateNodeSet(%s)\n",data.data()));
+ TRACE(("{TemplateNodeSet(%s)\n",qPrint(data)));
ExpressionParser expParser(parser,line);
// data format: name=expression
int j=data.find('=');
@@ -4086,12 +4091,12 @@ class TemplateNodeSet : public TemplateNodeCreator<TemplateNodeSet>
{
m_mapping = std::make_unique<Mapping>(data.left(j),expr);
}
- TRACE(("}TemplateNodeSet(%s)\n",data.data()));
+ TRACE(("}TemplateNodeSet(%s)\n",qPrint(data)));
}
~TemplateNodeSet()
{
}
- void render(FTextStream &, TemplateContext *c)
+ void render(TextStream &, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -4121,7 +4126,7 @@ class TemplateNodeSpaceless : public TemplateNodeCreator<TemplateNodeSpaceless>
parser->removeNextToken(); // skip over endwith
TRACE(("}TemplateNodeSpaceless()\n"));
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -4144,7 +4149,7 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
TemplateNodeMarkers(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeMarkers>(parser,parent,line), m_listExpr(0), m_patternExpr(0)
{
- TRACE(("{TemplateNodeMarkers(%s)\n",data.data()));
+ TRACE(("{TemplateNodeMarkers(%s)\n",qPrint(data)));
int i = data.find(" in ");
int w = data.find(" with ");
if (i==-1 || w==-1 || w<i)
@@ -4161,14 +4166,14 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
StringVector stopAt = { "endmarkers" };
parser->parse(this,line,stopAt,m_nodes);
parser->removeNextToken(); // skip over endmarkers
- TRACE(("}TemplateNodeMarkers(%s)\n",data.data()));
+ TRACE(("}TemplateNodeMarkers(%s)\n",qPrint(data)));
}
~TemplateNodeMarkers()
{
delete m_listExpr;
delete m_patternExpr;
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -4198,7 +4203,7 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
std::string part = str.substr(index,newIndex-index);
if (ci->needsRecoding())
{
- ts << ci->recode(part); // write text before marker
+ ts << ci->recode(QCString(part)); // write text before marker
}
else
{
@@ -4270,7 +4275,7 @@ class TemplateNodeTabbing : public TemplateNodeCreator<TemplateNodeTabbing>
parser->removeNextToken(); // skip over endtabbing
TRACE(("}TemplateNodeTabbing()\n"));
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -4293,7 +4298,7 @@ class TemplateNodeResource : public TemplateNodeCreator<TemplateNodeResource>
TemplateNodeResource(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeResource>(parser,parent,line)
{
- TRACE(("{TemplateNodeResource(%s)\n",data.data()));
+ TRACE(("{TemplateNodeResource(%s)\n",qPrint(data)));
ExpressionParser ep(parser,line);
int i;
if (data.isEmpty())
@@ -4312,14 +4317,14 @@ class TemplateNodeResource : public TemplateNodeCreator<TemplateNodeResource>
m_resExpr = ep.parse(data);
m_asExpr = 0;
}
- TRACE(("}TemplateNodeResource(%s)\n",data.data()));
+ TRACE(("}TemplateNodeResource(%s)\n",qPrint(data)));
}
~TemplateNodeResource()
{
delete m_resExpr;
delete m_asExpr;
}
- void render(FTextStream &, TemplateContext *c)
+ void render(TextStream &, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -4337,7 +4342,7 @@ class TemplateNodeResource : public TemplateNodeCreator<TemplateNodeResource>
if (m_asExpr)
{
QCString targetFile = m_asExpr->resolve(c).toString();
- mkpath(ci,targetFile);
+ mkpath(ci,targetFile.str());
if (targetFile.isEmpty())
{ ci->warn(m_templateName,m_line,"invalid parameter at right side of 'as' for resource command\n");
}
@@ -4367,7 +4372,7 @@ class TemplateNodeEncoding : public TemplateNodeCreator<TemplateNodeEncoding>
TemplateNodeEncoding(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeEncoding>(parser,parent,line)
{
- TRACE(("{TemplateNodeEncoding(%s)\n",data.data()));
+ TRACE(("{TemplateNodeEncoding(%s)\n",qPrint(data)));
ExpressionParser ep(parser,line);
if (data.isEmpty())
{
@@ -4381,13 +4386,13 @@ class TemplateNodeEncoding : public TemplateNodeCreator<TemplateNodeEncoding>
StringVector stopAt = { "endencoding" };
parser->parse(this,line,stopAt,m_nodes);
parser->removeNextToken(); // skip over endencoding
- TRACE(("}TemplateNodeEncoding(%s)\n",data.data()));
+ TRACE(("}TemplateNodeEncoding(%s)\n",qPrint(data)));
}
~TemplateNodeEncoding()
{
delete m_encExpr;
}
- void render(FTextStream &ts, TemplateContext *c)
+ void render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -4564,7 +4569,7 @@ class TemplateLexer
{ m_openChar=openChar; m_closeChar=closeChar; }
private:
void addToken(TemplateTokenStream &tokens,
- const char *data,int line,int startPos,int endPos,
+ const QCString &data,int line,int startPos,int endPos,
TemplateToken::Type type);
void reset();
const TemplateEngine *m_engine = 0;
@@ -4596,8 +4601,8 @@ void TemplateLexer::tokenize(TemplateTokenStream &tokens)
StateEndVariable
};
+ if (m_data.isEmpty()) return;
const char *p=m_data.data();
- if (p==0) return;
int state=StateText;
int pos=0;
int lastTokenPos=0;
@@ -4664,10 +4669,10 @@ void TemplateLexer::tokenize(TemplateTokenStream &tokens)
{
// found tag!
state=StateText;
- addToken(tokens,m_data.data(),line,lastTokenPos,
+ addToken(tokens,m_data,line,lastTokenPos,
emptyOutputLine ? startLinePos : markStartPos,
TemplateToken::Text);
- addToken(tokens,m_data.data(),line,markStartPos+2,
+ addToken(tokens,m_data,line,markStartPos+2,
pos-1,TemplateToken::Block);
lastTokenPos = pos+1;
}
@@ -4697,7 +4702,7 @@ void TemplateLexer::tokenize(TemplateTokenStream &tokens)
{
// found comment tag!
state=StateText;
- addToken(tokens,m_data.data(),line,lastTokenPos,
+ addToken(tokens,m_data,line,lastTokenPos,
emptyOutputLine ? startLinePos : markStartPos,
TemplateToken::Text);
lastTokenPos = pos+1;
@@ -4745,10 +4750,10 @@ void TemplateLexer::tokenize(TemplateTokenStream &tokens)
{
// found variable tag!
state=StateText;
- addToken(tokens,m_data.data(),line,lastTokenPos,
+ addToken(tokens,m_data,line,lastTokenPos,
emptyOutputLine ? startLinePos : markStartPos,
TemplateToken::Text);
- addToken(tokens,m_data.data(),line,markStartPos+2,
+ addToken(tokens,m_data,line,markStartPos+2,
pos-1,TemplateToken::Variable);
lastTokenPos = pos+1;
}
@@ -4778,22 +4783,21 @@ void TemplateLexer::tokenize(TemplateTokenStream &tokens)
}
if (lastTokenPos<pos)
{
- addToken(tokens,m_data.data(),line,
+ addToken(tokens,m_data,line,
lastTokenPos,pos,
TemplateToken::Text);
}
}
void TemplateLexer::addToken(TemplateTokenStream &tokens,
- const char *data,int line,
+ const QCString &data,int line,
int startPos,int endPos,
TemplateToken::Type type)
{
if (startPos<endPos)
{
int len = endPos-startPos+1;
- QCString text(len);
- qstrncpy(text.rawData(),data+startPos,len);
+ QCString text = data.mid(startPos,len);
if (type!=TemplateToken::Text) text = text.stripWhiteSpace();
tokens.push_back(std::make_unique<TemplateToken>(type,text,line));
}
@@ -4818,7 +4822,7 @@ void TemplateParser::parse(
{
auto tok = takeNextToken();
//printf("%p:Token type=%d data='%s' line=%d\n",
- // parent,tok->type,tok->data.data(),tok->line);
+ // parent,tok->type,qPrint(tok->data),tok->line);
switch(tok->type)
{
case TemplateToken::Text:
@@ -4836,7 +4840,7 @@ void TemplateParser::parse(
command=command.left(sep);
}
TemplateToken *tok_ptr = tok.get();
- if (std::find(stopAt.begin(),stopAt.end(),command)!=stopAt.end())
+ if (std::find(stopAt.begin(),stopAt.end(),command.str())!=stopAt.end())
{
prependToken(std::move(tok));
TRACE(("}TemplateParser::parse: stop\n"));
@@ -4862,11 +4866,11 @@ void TemplateParser::parse(
command=="endrange" || command=="endtabbing" ||
command=="endencoding")
{
- warn(m_templateName,tok_ptr->line,"Found tag '%s' without matching start tag",command.data());
+ warn(m_templateName,tok_ptr->line,"Found tag '%s' without matching start tag",qPrint(command));
}
else
{
- warn(m_templateName,tok_ptr->line,"Unknown tag '%s'",command.data());
+ warn(m_templateName,tok_ptr->line,"Unknown tag '%s'",qPrint(command));
}
}
break;
@@ -4881,7 +4885,7 @@ void TemplateParser::parse(
options+=s.c_str();
}
warn(m_templateName,line,"Unclosed tag in template, expected one of: %s",
- options.data());
+ qPrint(options));
}
TRACE(("}TemplateParser::parse: last token\n"));
}
@@ -4914,7 +4918,7 @@ void TemplateParser::prependToken(TemplateTokenPtr &&token)
m_tokens.push_front(std::move(token));
}
-void TemplateParser::warn(const char *fileName,int line,const char *fmt,...) const
+void TemplateParser::warn(const QCString &fileName,int line,const char *fmt,...) const
{
va_list args;
va_start(args,fmt);
@@ -4947,10 +4951,10 @@ TemplateImpl::TemplateImpl(TemplateEngine *engine,const QCString &name,const QCS
TemplateImpl::~TemplateImpl()
{
- //printf("deleting template %s\n",m_name.data());
+ //printf("deleting template %s\n",qPrint(m_name));
}
-void TemplateImpl::render(FTextStream &ts, TemplateContext *c)
+void TemplateImpl::render(TextStream &ts, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -5003,19 +5007,20 @@ class TemplateEngine::Private
{
//for (int i=0;i<m_indent;i++) printf(" ");
//m_indent++;
- //printf("loadByName(%s,%d) {\n",fileName.data(),line);
+ //printf("loadByName(%s,%d) {\n",qPrint(fileName),line);
m_includeStack.emplace_back(IncludeEntry::Template,fileName,QCString(),line);
auto kv = m_templateCache.find(fileName.str());
if (kv==m_templateCache.end()) // first time template is referenced
{
QCString filePath = m_templateDirName+"/"+fileName;
- QFile f(filePath);
- if (f.open(IO_ReadOnly)) // read template from disk
+ std::ifstream f(filePath.str(),std::ifstream::in | std::ifstream::binary);
+ if (f.is_open()) // read template from disk
{
- QFileInfo fi(filePath);
- int size=fi.size();
+ FileInfo fi(filePath.str());
+ int size=(int)fi.size();
QCString data(size+1);
- if (f.readBlock(data.rawData(),size)==size)
+ f.read(data.rawData(),size);
+ if (!f.fail())
{
kv = m_templateCache.insert(
std::make_pair(fileName.str(),
@@ -5033,7 +5038,7 @@ class TemplateEngine::Private
}
else
{
- err("Could not open template file %s\n",fileName.data());
+ err("Could not open template file %s\n",qPrint(fileName));
}
}
}
@@ -5053,7 +5058,7 @@ class TemplateEngine::Private
{
//for (int i=0;i<m_indent;i++) printf(" ");
//m_indent++;
- //printf("enterBlock(%s,%s,%d) {\n",fileName.data(),blockName.data(),line);
+ //printf("enterBlock(%s,%s,%d) {\n",qPrint(fileName),qPrint(blockName),line);
m_includeStack.emplace_back(IncludeEntry::Block,fileName,blockName,line);
}
@@ -5065,7 +5070,7 @@ class TemplateEngine::Private
m_includeStack.pop_back();
}
- void printIncludeContext(const char *fileName,int line) const
+ void printIncludeContext(const QCString &fileName,int line) const
{
auto it = m_includeStack.rbegin();
while (it!=m_includeStack.rend())
@@ -5077,18 +5082,18 @@ class TemplateEngine::Private
{
if (next)
{
- warn(fileName,line," inside template '%s' included from template '%s' at line %d",ie.fileName().data(),next->fileName().data(),ie.line());
+ warn(fileName,line," inside template '%s' included from template '%s' at line %d",qPrint(ie.fileName()),qPrint(next->fileName()),ie.line());
}
}
else // ie.type()==IncludeEntry::Block
{
- warn(fileName,line," included by block '%s' inside template '%s' at line %d",ie.blockName().data(),
- ie.fileName().data(),ie.line());
+ warn(fileName,line," included by block '%s' inside template '%s' at line %d",qPrint(ie.blockName()),
+ qPrint(ie.fileName()),ie.line());
}
}
}
- void setOutputExtension(const char *extension)
+ void setOutputExtension(const QCString &extension)
{
m_extension = extension;
}
@@ -5098,7 +5103,7 @@ class TemplateEngine::Private
return m_extension;
}
- void setTemplateDir(const char *dirName)
+ void setTemplateDir(const QCString &dirName)
{
m_templateDirName = dirName;
}
@@ -5152,12 +5157,12 @@ void TemplateEngine::leaveBlock()
p->leaveBlock();
}
-void TemplateEngine::printIncludeContext(const char *fileName,int line) const
+void TemplateEngine::printIncludeContext(const QCString &fileName,int line) const
{
p->printIncludeContext(fileName,line);
}
-void TemplateEngine::setOutputExtension(const char *extension)
+void TemplateEngine::setOutputExtension(const QCString &extension)
{
p->setOutputExtension(extension);
}
@@ -5167,7 +5172,7 @@ QCString TemplateEngine::outputExtension() const
return p->outputExtension();
}
-void TemplateEngine::setTemplateDir(const char *dirName)
+void TemplateEngine::setTemplateDir(const QCString &dirName)
{
p->setTemplateDir(dirName);
}
diff --git a/src/template.h b/src/template.h
index c9e9041..dee063d 100644
--- a/src/template.h
+++ b/src/template.h
@@ -16,14 +16,14 @@
#ifndef TEMPLATE_H
#define TEMPLATE_H
-#include <qcstring.h>
#include <vector>
-class FTextStream;
+#include "qcstring.h"
class TemplateListIntf;
class TemplateStructIntf;
class TemplateEngine;
+class TextStream;
/** @defgroup template_api Template API
*
@@ -412,7 +412,7 @@ class TemplateStructIntf
/** Gets the value for a field name.
* @param[in] name The name of the field.
*/
- virtual TemplateVariant get(const char *name) const = 0;
+ virtual TemplateVariant get(const QCString &name) const = 0;
/** Increase object's reference count */
virtual int addRef() = 0;
@@ -427,7 +427,7 @@ class TemplateStruct : public TemplateStructIntf
{
public:
// TemplateStructIntf methods
- virtual TemplateVariant get(const char *name) const;
+ virtual TemplateVariant get(const QCString &name) const;
virtual int addRef();
virtual int release();
@@ -438,7 +438,7 @@ class TemplateStruct : public TemplateStructIntf
* @param[in] name The name of the field.
* @param[in] v The value to set.
*/
- virtual void set(const char *name,const TemplateVariant &v);
+ virtual void set(const QCString &name,const TemplateVariant &v);
private:
@@ -505,7 +505,7 @@ class TemplateContext
* @note When a given key is already present,
* its value will be replaced by \a v
*/
- virtual void set(const char *name,const TemplateVariant &v) = 0;
+ virtual void set(const QCString &name,const TemplateVariant &v) = 0;
/** Gets the value for a given key
* @param[in] name The name of key.
@@ -552,7 +552,7 @@ class Template
* @param[in] c The context containing data that can be used
* when instantiating the template.
*/
- virtual void render(FTextStream &ts,TemplateContext *c) = 0;
+ virtual void render(TextStream &ts,TemplateContext *c) = 0;
};
//------------------------------------------------------------------------
@@ -590,10 +590,10 @@ class TemplateEngine
void unload(Template *t);
/** Prints the current template file include stack */
- void printIncludeContext(const char *fileName,int line) const;
+ void printIncludeContext(const QCString &fileName,int line) const;
/** Sets the search directory where to look for template files */
- void setTemplateDir(const char *dirName);
+ void setTemplateDir(const QCString &dirName);
private:
friend class TemplateNodeBlock;
@@ -605,7 +605,7 @@ class TemplateEngine
/** Sets the extension of the output file. This is used to control the
* format of 'special' tags in the template
*/
- void setOutputExtension(const char *extension);
+ void setOutputExtension(const QCString &extension);
/** Returns the output extension, set via setOutputExtension() */
QCString outputExtension() const;
diff --git a/src/textdocvisitor.cpp b/src/textdocvisitor.cpp
index b6c90e3..47cd56e 100644
--- a/src/textdocvisitor.cpp
+++ b/src/textdocvisitor.cpp
@@ -1,13 +1,13 @@
/******************************************************************************
*
- *
+ *
*
*
* Copyright (C) 1997-2015 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
+ * 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.
*
@@ -16,7 +16,6 @@
*
*/
-#include <qdir.h>
#include "textdocvisitor.h"
#include "message.h"
#include "util.h"
@@ -51,11 +50,11 @@ void TextDocVisitor::visit(DocEmoji *s)
}
}
-void TextDocVisitor::filter(const char *str)
-{
- if (str==0) return;
+void TextDocVisitor::filter(const QCString &str)
+{
+ if (str.isEmpty()) return;
//printf("TextDocVisitor::filter(%s)\n",str);
- const char *p=str;
+ const char *p=str.data();
char c;
while (*p)
{
diff --git a/src/textdocvisitor.h b/src/textdocvisitor.h
index e424529..7439b6b 100644
--- a/src/textdocvisitor.h
+++ b/src/textdocvisitor.h
@@ -19,17 +19,16 @@
#ifndef _TEXTDOCVISITOR_H
#define _TEXTDOCVISITOR_H
+#include "qcstring.h"
#include "docvisitor.h"
#include "docparser.h"
-#include <qcstring.h>
-#include "ftextstream.h"
-
+#include "textstream.h"
/*! @brief Concrete visitor implementation for TEXT output. */
class TextDocVisitor : public DocVisitor
{
public:
- TextDocVisitor(FTextStream &t) : DocVisitor(DocVisitor_Text), m_t(t) {}
+ TextDocVisitor(TextStream &t) : DocVisitor(DocVisitor_Text), m_t(t) {}
//--------------------------------------
// visitor functions for leaf nodes
@@ -135,9 +134,9 @@ class TextDocVisitor : public DocVisitor
private:
- void filter(const char *str);
+ void filter(const QCString &str);
- FTextStream &m_t;
+ TextStream &m_t;
};
#endif
diff --git a/src/textstream.h b/src/textstream.h
new file mode 100644
index 0000000..cee4cb7
--- /dev/null
+++ b/src/textstream.h
@@ -0,0 +1,235 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2021 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.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#ifndef TEXTSTREAM_H
+#define TEXTSTREAM_H
+
+#include <string>
+#include <iostream>
+#include <sstream>
+#include <cstdint>
+#include <cstdio>
+#include <fstream>
+
+#include "qcstring.h"
+
+/** @brief Text streaming class that buffers data.
+ *
+ * Simpler version of std::ostringstream that has much better
+ * performance.
+ */
+class TextStream final
+{
+ static const int INITIAL_CAPACITY = 4096;
+ public:
+ /** Creates an empty stream object.
+ */
+ TextStream()
+ {
+ m_buffer.reserve(INITIAL_CAPACITY);
+ }
+ /** Create a text stream object for writing to a std::ostream.
+ * @note data is buffered until flush() is called or the object is destroyed.
+ */
+ TextStream(std::ostream *s) : m_s(s)
+ {
+ m_buffer.reserve(INITIAL_CAPACITY);
+ }
+ /** Create a text stream, initializing the buffer with string \a s
+ */
+ TextStream(const std::string &s) : m_buffer(s)
+ {
+ m_buffer.reserve(s.length()+INITIAL_CAPACITY);
+ }
+
+ /** Writes any data that is buffered to the attached std::ostream */
+ ~TextStream() { flush(); }
+
+ TextStream(const TextStream &) = delete;
+ TextStream &operator=(const TextStream &) = delete;
+
+ /** Sets or changes the std::ostream to write to.
+ * @note Any data already buffered will be flushed.
+ */
+ void setStream(std::ostream *s)
+ {
+ flush();
+ m_s = s;
+ }
+
+ /** Returns the attached std::ostream object.
+ * @see setStream()
+ */
+ std::ostream *stream() const
+ {
+ return m_s;
+ }
+
+ /** Adds a character to the stream */
+ TextStream &operator<<( char c)
+ {
+ m_buffer+=c;
+ return static_cast<TextStream&>(*this);
+ }
+
+ /** Adds a C-style string to the stream */
+ TextStream &operator<<( const char *s)
+ {
+ if (s) m_buffer+=s;
+ return static_cast<TextStream&>(*this);
+ }
+
+ /** Adds a QCString to the stream */
+ TextStream &operator<<( const QCString &s )
+ {
+ m_buffer+=s.str();
+ return static_cast<TextStream&>(*this);
+ }
+
+ /** Adds a std::string to the stream */
+ TextStream &operator<<( const std::string &s )
+ {
+ m_buffer+=s;
+ return static_cast<TextStream&>(*this);
+ }
+
+ /** Adds a signed short integer to the stream */
+ TextStream &operator<<( signed short i)
+ {
+ output_int32(i,i<0);
+ return static_cast<TextStream&>(*this);
+ }
+
+ /** Adds a unsigned short integer to the stream */
+ TextStream &operator<<( unsigned short i)
+ {
+ output_int32(i,false);
+ return static_cast<TextStream&>(*this);
+ }
+
+ /** Adds a signed integer to the stream */
+ TextStream &operator<<( signed int i)
+ {
+ output_int32(i,i<0);
+ return static_cast<TextStream&>(*this);
+ }
+
+ /** Adds a unsigned integer to the stream */
+ TextStream &operator<<( unsigned int i)
+ {
+ output_int32(i,false);
+ return static_cast<TextStream&>(*this);
+ }
+
+ /** Adds a float to the stream */
+ TextStream &operator<<( float f)
+ {
+ output_double((double)f);
+ return static_cast<TextStream&>(*this);
+ }
+
+ /** Adds a double to the stream */
+ TextStream &operator<<( double d)
+ {
+ output_double(d);
+ return static_cast<TextStream&>(*this);
+ }
+
+ /** Adds a array of character to the stream
+ * @param buf the character buffer
+ * @param len the number of characters in the buffer to write
+ */
+ void write(const char *buf,size_t len)
+ {
+ m_buffer.append(buf,len);
+ }
+
+ /** Flushes the buffer. If a std::ostream is attached, the buffer's
+ * contents will be written to the stream.
+ */
+ void flush()
+ {
+ if (m_s)
+ {
+ m_s->write(m_buffer.c_str(),m_buffer.length());
+ }
+ m_buffer.clear();
+ }
+
+ /** Clears any buffered data */
+ void clear()
+ {
+ m_buffer.clear();
+ }
+
+ /** Return the contents of the buffer as a std::string object */
+ std::string str() const
+ {
+ return m_buffer;
+ }
+
+ /** Sets the buffer's contents to string \a s.
+ * Any data already in the buffer will be flushed.
+ */
+ void str(const std::string &s)
+ {
+ flush();
+ m_buffer=s;
+ }
+
+ /** Sets the buffer's contents to string \a s
+ * Any data already in the buffer will be flushed.
+ */
+ void str(const char *s)
+ {
+ flush();
+ if (s) m_buffer=s;
+ }
+
+ /** Returns true iff the buffer is empty */
+ bool empty() const
+ {
+ return m_buffer.empty();
+ }
+
+ private:
+ /** Writes a string representation of an integer to the buffer
+ * @param n the absolute value of the integer
+ * @param neg indicates if the integer is negative
+ */
+ void output_int32( uint32_t n, bool neg )
+ {
+ char buf[20];
+ char *p = &buf[19];
+ *p = '\0';
+ if ( neg )
+ {
+ n = (uint32_t)(-(int32_t)n);
+ }
+ do { *--p = ((int32_t)(n%10)) + '0'; n /= 10; } while ( n );
+ if ( neg ) *--p = '-';
+ m_buffer+=p;
+ }
+ void output_double( double d)
+ {
+ char buf[64];
+ snprintf(buf,64,"%f",d);
+ m_buffer+=buf;
+ }
+ std::string m_buffer;
+ std::ostream *m_s = nullptr;
+};
+
+#endif
diff --git a/src/tooltip.cpp b/src/tooltip.cpp
index f8222d7..5768b0a 100644
--- a/src/tooltip.cpp
+++ b/src/tooltip.cpp
@@ -56,15 +56,10 @@ TooltipManager::~TooltipManager()
{
}
-static QCString escapeId(const char *s)
+static QCString escapeId(const QCString &s)
{
QCString res=s;
- char *p=res.rawData();
- while (*p)
- {
- if (!isId(*p)) *p='_';
- p++;
- }
+ for (uint i=0;i<res.length();i++) if (!isId(res[i])) res[i]='_';
return res;
}
diff --git a/src/translator.h b/src/translator.h
index bcc70ff..02f2ccf 100644
--- a/src/translator.h
+++ b/src/translator.h
@@ -31,7 +31,7 @@ class Translator
* if the user chooses a language whose translation is not up to date.
* It is implemented by the adapter classes.
*/
- virtual QCString updateNeededMessage() { return ""; }
+ virtual QCString updateNeededMessage() { return QCString(); }
virtual ~Translator() {}
// Please, have a look at comments inside the translator_en.h file
@@ -49,22 +49,22 @@ class Translator
* this routine. In case no font encoding is required the empty string
* can be returned.
*/
- virtual QCString latexFontenc() { return "T1"; }
+ virtual QCString latexFontenc() { return QCString("T1"); }
virtual QCString latexFont() {
- return "\\usepackage[scaled=.90]{helvet}\n"
+ return QCString("\\usepackage[scaled=.90]{helvet}\n"
"\\usepackage{courier}\n"
- "\\renewcommand{\\familydefault}{\\sfdefault}\n";
+ "\\renewcommand{\\familydefault}{\\sfdefault}\n");
}
/*!
* Sets the commands to be inserted directly after the `\\begin{document}`
* in the LaTeX document.
*/
- virtual QCString latexDocumentPre() { return ""; }
+ virtual QCString latexDocumentPre() { return QCString(""); }
/*!
* Sets the commands to be inserted directly before the `\\end{document}`
* in the LaTeX document.
*/
- virtual QCString latexDocumentPost() { return ""; }
+ virtual QCString latexDocumentPost() { return QCString(""); }
/*!
* Set the name to be used as latex command.
*/
@@ -94,7 +94,7 @@ class Translator
virtual QCString trMemberList() = 0;
virtual QCString trThisIsTheListOfAllMembers() = 0;
virtual QCString trIncludingInheritedMembers() = 0;
- virtual QCString trGeneratedAutomatically(const char *s) = 0;
+ virtual QCString trGeneratedAutomatically(const QCString &s) = 0;
virtual QCString trEnumName() = 0;
virtual QCString trEnumValue() = 0;
virtual QCString trDefinedIn() = 0;
@@ -149,9 +149,9 @@ class Translator
virtual QCString trFunctionDocumentation() = 0;
virtual QCString trVariableDocumentation() = 0;
virtual QCString trCompounds() = 0;
- virtual QCString trGeneratedAt(const char *date,const char *projName) = 0;
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName) = 0;
//virtual QCString trWrittenBy() = 0;
- virtual QCString trClassDiagram(const char *clName) = 0;
+ virtual QCString trClassDiagram(const QCString &clName) = 0;
virtual QCString trForInternalUseOnly() = 0;
//virtual QCString trReimplementedForInternalReasons() = 0;
virtual QCString trWarning() = 0;
@@ -182,12 +182,12 @@ class Translator
// new since 0.49-990425
//////////////////////////////////////////////////////////////////////////
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate) = 0;
- virtual QCString trFileReference(const char *fileName) = 0;
- virtual QCString trNamespaceReference(const char *namespaceName) = 0;
+ virtual QCString trFileReference(const QCString &fileName) = 0;
+ virtual QCString trNamespaceReference(const QCString &namespaceName) = 0;
virtual QCString trPublicMembers() = 0;
virtual QCString trPublicSlots() = 0;
@@ -249,8 +249,8 @@ class Translator
// new since 1.0.0
//////////////////////////////////////////////////////////////////////////
- virtual QCString trCollaborationDiagram(const char *clName) = 0;
- virtual QCString trInclDepGraph(const char *fName) = 0;
+ virtual QCString trCollaborationDiagram(const QCString &clName) = 0;
+ virtual QCString trInclDepGraph(const QCString &fName) = 0;
virtual QCString trConstructorDocumentation() = 0;
virtual QCString trGotoSourceCode() = 0;
virtual QCString trGotoDocumentation() = 0;
@@ -331,7 +331,7 @@ class Translator
//virtual QCString trInterfaces() = 0;
virtual QCString trClasses() = 0;
- virtual QCString trPackage(const char *name) = 0;
+ virtual QCString trPackage(const QCString &name) = 0;
virtual QCString trPackageList() = 0;
virtual QCString trPackageListDescription() = 0;
virtual QCString trPackages() = 0;
@@ -497,7 +497,7 @@ class Translator
virtual QCString trDirDocumentation() = 0;
virtual QCString trDirectories() = 0;
virtual QCString trDirDescription() = 0;
- virtual QCString trDirReference(const char *dirName) = 0;
+ virtual QCString trDirReference(const QCString &dirName) = 0;
virtual QCString trDir(bool first_capital, bool singular) = 0;
//////////////////////////////////////////////////////////////////////////
@@ -529,10 +529,10 @@ class Translator
virtual QCString trDataTypes() = 0;
virtual QCString trModulesList() = 0;
virtual QCString trModulesListDescription(bool extractAll) = 0;
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate) = 0;
- virtual QCString trModuleReference(const char *namespaceName) = 0;
+ virtual QCString trModuleReference(const QCString &namespaceName) = 0;
virtual QCString trModulesMembers() = 0;
virtual QCString trModulesMemberDescription(bool extractAll) = 0;
virtual QCString trModulesIndex() = 0;
@@ -547,7 +547,7 @@ class Translator
// new since 1.6.0
//////////////////////////////////////////////////////////////////////////
- virtual QCString trDirRelation(const char *name) = 0;
+ virtual QCString trDirRelation(const QCString &name) = 0;
virtual QCString trLoading() = 0;
virtual QCString trGlobalNamespace() = 0;
virtual QCString trSearching() = 0;
@@ -557,9 +557,9 @@ class Translator
// new since 1.6.3
//////////////////////////////////////////////////////////////////////////
- //virtual QCString trDirDependency(const char *name) = 0;
- virtual QCString trFileIn(const char *name) = 0;
- virtual QCString trIncludesFileIn(const char *name) = 0;
+ //virtual QCString trDirDependency(const QCString &name) = 0;
+ virtual QCString trFileIn(const QCString &name) = 0;
+ virtual QCString trIncludesFileIn(const QCString &name) = 0;
virtual QCString trDateTime(int year,int month,int day,int dayOfWeek,
int hour,int minutes,int seconds,
bool includeTime) = 0;
@@ -570,7 +570,7 @@ class Translator
virtual QCString trCiteReferences() = 0;
virtual QCString trCopyright() = 0;
- virtual QCString trDirDepGraph(const char *name) = 0;
+ virtual QCString trDirDepGraph(const QCString &name) = 0;
//////////////////////////////////////////////////////////////////////////
// new since 1.8.0
@@ -580,8 +580,8 @@ class Translator
virtual QCString trTemplateParameters() = 0;
virtual QCString trAndMore(const QCString &number) = 0;
virtual QCString trEnumGeneratedFromFiles(bool single) = 0;
- virtual QCString trEnumReference(const char *name) = 0;
- virtual QCString trInheritedFrom(const char *members,const char *what) = 0;
+ virtual QCString trEnumReference(const QCString &name) = 0;
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what) = 0;
virtual QCString trAdditionalInheritedMembers() = 0;
//////////////////////////////////////////////////////////////////////////
@@ -602,9 +602,9 @@ class Translator
virtual QCString trInterfaces() = 0;
virtual QCString trServices() = 0;
virtual QCString trConstantGroups() = 0;
- virtual QCString trConstantGroupReference(const char *namespaceName) = 0;
- virtual QCString trServiceReference(const char *sName) = 0;
- virtual QCString trSingletonReference(const char *sName) = 0;
+ virtual QCString trConstantGroupReference(const QCString &namespaceName) = 0;
+ virtual QCString trServiceReference(const QCString &sName) = 0;
+ virtual QCString trSingletonReference(const QCString &sName) = 0;
virtual QCString trServiceGeneratedFromFiles(bool single) = 0;
virtual QCString trSingletonGeneratedFromFiles(bool single) = 0;
@@ -620,7 +620,7 @@ class Translator
virtual QCString trDesignUnits() = 0;
virtual QCString trFunctionAndProc() = 0;
virtual QCString trVhdlType(uint64 type,bool single) = 0;
- virtual QCString trCustomReference(const char *name) = 0;
+ virtual QCString trCustomReference(const QCString &name) = 0;
virtual QCString trConstants() = 0;
virtual QCString trConstantDocumentation() = 0;
@@ -646,7 +646,7 @@ class Translator
virtual QCString trExceptionHierarchy() = 0;
virtual QCString trExceptionHierarchyDescription() = 0;
virtual QCString trExceptionDocumentation() = 0;
- virtual QCString trCompoundReferenceSlice(const char *clName, ClassDef::CompoundType compType, bool isLocal) = 0;
+ virtual QCString trCompoundReferenceSlice(const QCString &clName, ClassDef::CompoundType compType, bool isLocal) = 0;
virtual QCString trOperations() = 0;
virtual QCString trOperationDocumentation() = 0;
virtual QCString trDataMembers() = 0;
@@ -657,6 +657,18 @@ class Translator
//////////////////////////////////////////////////////////////////////////
virtual QCString trDesignUnitDocumentation() = 0;
+
+//////////////////////////////////////////////////////////////////////////
+// new since 1.9.2
+//////////////////////////////////////////////////////////////////////////
+
+ virtual QCString trConcept(bool first_capital, bool singular) = 0;
+ virtual QCString trConceptReference(const QCString &conceptName) = 0;
+ virtual QCString trConceptList() = 0;
+ virtual QCString trConceptIndex() = 0;
+ virtual QCString trConceptDocumentation() = 0;
+ virtual QCString trConceptListDescription(bool extractAll) = 0;
+ virtual QCString trConceptDefinition() = 0;
};
#endif
diff --git a/src/translator_adapter.h b/src/translator_adapter.h
index 388304c..54a0a35 100644
--- a/src/translator_adapter.h
+++ b/src/translator_adapter.h
@@ -41,7 +41,35 @@ class TranslatorAdapterBase : public Translator
};
-class TranslatorAdapter_1_8_19 : public TranslatorAdapterBase
+class TranslatorAdapter_1_9_2 : public TranslatorAdapterBase
+{
+ public:
+ virtual QCString updateNeededMessage()
+ { return createUpdateNeededMessage(idLanguage(),"release 1.9.2"); }
+
+ virtual QCString trConcept(bool first_capital,bool singular)
+ { return english.trConcept(first_capital,singular); }
+
+ virtual QCString trConceptReference(const QCString &conceptName)
+ { return english.trConceptReference(conceptName); }
+
+ virtual QCString trConceptList()
+ { return english.trConceptList(); }
+
+ virtual QCString trConceptIndex()
+ { return english.trConceptIndex(); }
+
+ virtual QCString trConceptDocumentation()
+ { return english.trConceptDocumentation(); }
+
+ virtual QCString trConceptListDescription(bool extractAll)
+ { return english.trConceptListDescription(extractAll); }
+
+ virtual QCString trConceptDefinition()
+ { return english.trConceptDefinition(); }
+};
+
+class TranslatorAdapter_1_8_19 : public TranslatorAdapter_1_9_2
{
public:
virtual QCString updateNeededMessage()
@@ -81,7 +109,7 @@ class TranslatorAdapter_1_8_15 : public TranslatorAdapter_1_8_19
virtual QCString trVhdlType(uint64 type,bool single)
{ return english.trVhdlType(type,single); }
- virtual QCString trCustomReference(const char *name)
+ virtual QCString trCustomReference(const QCString &name)
{ return english.trCustomReference(name); }
virtual QCString trConstants()
@@ -156,7 +184,7 @@ class TranslatorAdapter_1_8_15 : public TranslatorAdapter_1_8_19
virtual QCString trExceptionDocumentation()
{ return english.trExceptionDocumentation(); }
- virtual QCString trCompoundReferenceSlice(const char *clName, ClassDef::CompoundType compType, bool isLocal)
+ virtual QCString trCompoundReferenceSlice(const QCString &clName, ClassDef::CompoundType compType, bool isLocal)
{ return english.trCompoundReferenceSlice(clName,compType,isLocal); }
virtual QCString trOperations()
@@ -187,13 +215,13 @@ class TranslatorAdapter_1_8_4 : public TranslatorAdapter_1_8_15
virtual QCString trConstantGroups()
{ return english.trConstantGroups(); }
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{ return english.trConstantGroupReference(namespaceName); }
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{ return english.trServiceReference(sName); }
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{ return english.trSingletonReference(sName); }
virtual QCString trServiceGeneratedFromFiles(bool single)
@@ -250,10 +278,10 @@ class TranslatorAdapter_1_8_0 : public TranslatorAdapter_1_8_2
virtual QCString trEnumGeneratedFromFiles(bool single)
{ return english.trEnumGeneratedFromFiles(single); }
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return english.trEnumReference(name); }
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return english.trInheritedFrom(members,what); }
virtual QCString trAdditionalInheritedMembers()
@@ -276,12 +304,12 @@ class TranslatorAdapter_1_7_5 : public TranslatorAdapter_1_8_0
virtual QCString trCopyright()
{ return english.trCopyright(); }
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return english.trDirDepGraph(name); }
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{ return english.trFileIn(name); }
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{ return english.trIncludesFileIn(name); }
virtual QCString trDateTime(int year,int month,int day,int dayOfWeek,
int hour,int minutes,int seconds,
@@ -298,7 +326,7 @@ class TranslatorAdapter_1_6_0 : public TranslatorAdapter_1_7_5
virtual QCString updateNeededMessage()
{ return createUpdateNeededMessage(idLanguage(),"release 1.6.0"); }
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{ return english.trDirRelation(name); }
virtual QCString trLoading()
@@ -349,12 +377,12 @@ class TranslatorAdapter_1_6_0 : public TranslatorAdapter_1_7_5
virtual QCString trModulesListDescription(bool extractAll)
{ return english.trModulesListDescription(extractAll); }
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{ return english.trCompoundReferenceFortran(clName,compType,isTemplate); }
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{ return english.trModuleReference(namespaceName); }
virtual QCString trModulesMembers()
diff --git a/src/translator_am.h b/src/translator_am.h
index 812d8fb..6e7a9a8 100644
--- a/src/translator_am.h
+++ b/src/translator_am.h
@@ -108,9 +108,9 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Ավտոմատ ստեղծված է ելքային կոդից, Doxygen-ի միջոցով, ";
- if (s) result+=s+(QCString)" համար:";
+ if (!s.isEmpty()) result+=s+(QCString)" համար:";
return result;
}
@@ -457,16 +457,16 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Ստեղծվել է "+date;
- if (projName) result+=projName+QCString(" -ի համար,");
+ if (!projName.isEmpty()) result+=projName+QCString(" -ի համար,");
result+=(QCString)" հետևյալ համակարգով.";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return clName+QCString(" -ի ժառանգման գծագիրը.");
}
@@ -545,7 +545,7 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -583,13 +583,13 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
return fileName+QCString(" ֆայլեր");
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" անունների տարածություններ";
@@ -787,12 +787,12 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)clName+"-ի համագործակցությունների գծագիր.";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)fName+"-ի ներառումների կախվածությունների գծագիր.";
}
@@ -1074,7 +1074,7 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Փաթեթ "+name;
}
@@ -1446,7 +1446,7 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" Ֆայլադարան"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1572,7 +1572,7 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1609,7 +1609,7 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
return QCString("Մոդուլ ") + namespaceName;
}
@@ -1705,7 +1705,7 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" Կապ";
}
@@ -1742,7 +1742,7 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Ֆայլը " + name + " ում";
}
@@ -1751,7 +1751,7 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Ներառում է ֆայլը " + name + " ում";
}
@@ -1798,7 +1798,7 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0
{ return "Հեղինակային իրավունք"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return name + QCString("-ի ֆայլադարանների կախվածությունների գծագիր:"); }
};
diff --git a/src/translator_ar.h b/src/translator_ar.h
index 0989249..f847f5b 100644
--- a/src/translator_ar.h
+++ b/src/translator_ar.h
@@ -133,9 +133,9 @@ class TranslatorArabic : public TranslatorAdapter_1_4_6
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="تم تكوينها آليا بواسطة Doxygen";
- if (s) result+=(QCString)" لـ "+s;
+ if (!s.isEmpty()) result+=(QCString)" لـ "+s;
result+=" من ملفات المصدر.";
return result;
}
@@ -513,16 +513,16 @@ class TranslatorArabic : public TranslatorAdapter_1_4_6
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Generated on "+date;
- if (projName) result+=(QCString)" for "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" for "+projName;
result+=(QCString)" by";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Inheritance diagram for "+clName+":";
}
@@ -609,7 +609,7 @@ class TranslatorArabic : public TranslatorAdapter_1_4_6
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -631,7 +631,7 @@ class TranslatorArabic : public TranslatorAdapter_1_4_6
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" File Reference";
@@ -639,7 +639,7 @@ class TranslatorArabic : public TranslatorAdapter_1_4_6
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Namespace Reference";
@@ -840,12 +840,12 @@ class TranslatorArabic : public TranslatorAdapter_1_4_6
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"رسم التعاون لـ "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"رسم اعتمادية التضمين لـ "+fName+":";
}
@@ -1131,7 +1131,7 @@ class TranslatorArabic : public TranslatorAdapter_1_4_6
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"حزمة "+name;
}
@@ -1541,7 +1541,7 @@ class TranslatorArabic : public TranslatorAdapter_1_4_6
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=" مرجع الدليل"; result+=dirName; return result; }
/*! This returns the word directory with or without starting capital
diff --git a/src/translator_br.h b/src/translator_br.h
index e180f62..baa4710 100644
--- a/src/translator_br.h
+++ b/src/translator_br.h
@@ -52,7 +52,7 @@
#ifndef TRANSLATOR_BR_H
#define TRANSLATOR_BR_H
-class TranslatorBrazilian : public Translator
+class TranslatorBrazilian : public TranslatorAdapter_1_9_2
{
public:
@@ -164,9 +164,9 @@ class TranslatorBrazilian : public Translator
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Gerado automaticamente por Doxygen";
- if (s) result+=(QCString)" para "+s;
+ if (!s.isEmpty()) result+=(QCString)" para "+s;
result+=" a partir do código-fonte.";
return result;
}
@@ -530,16 +530,16 @@ class TranslatorBrazilian : public Translator
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Gerado em "+date;
- if (projName) result+=(QCString)" para "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" para "+projName;
result+=(QCString)" por";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Diagrama de hierarquia para "+clName+":";
}
@@ -618,7 +618,7 @@ class TranslatorBrazilian : public Translator
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -648,7 +648,7 @@ class TranslatorBrazilian : public Translator
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result = "Referência do Arquivo ";
result += fileName;
@@ -656,7 +656,7 @@ class TranslatorBrazilian : public Translator
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result ="Refência do Namespace ";
result += namespaceName;
@@ -882,12 +882,12 @@ class TranslatorBrazilian : public Translator
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Diagrama de colaboração para "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Gráfico de dependência de inclusões para "+fName+":";
}
@@ -1170,7 +1170,7 @@ class TranslatorBrazilian : public Translator
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Pacote "+name;
}
@@ -1566,7 +1566,7 @@ class TranslatorBrazilian : public Translator
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{
QCString result = "Referência do diretório ";
result += dirName;
@@ -1695,7 +1695,7 @@ class TranslatorBrazilian : public Translator
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1719,7 +1719,7 @@ class TranslatorBrazilian : public Translator
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result = "Referência do Módulo ";
result += namespaceName;
@@ -1826,7 +1826,7 @@ class TranslatorBrazilian : public Translator
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return "Relação " + QCString(name);
}
@@ -1863,7 +1863,7 @@ class TranslatorBrazilian : public Translator
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Arquivo em "+name;
}
@@ -1872,7 +1872,7 @@ class TranslatorBrazilian : public Translator
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Inclui arquivo em "+name;
}
@@ -1921,7 +1921,7 @@ class TranslatorBrazilian : public Translator
}
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Grafo de dependências do diretório ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1952,14 +1952,14 @@ class TranslatorBrazilian : public Translator
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{
QCString result = "Referência da enumeração ";
return result + name;
}
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" herdados de "+what; }
/*! Header of the sections with inherited members specific for the
@@ -2040,21 +2040,21 @@ class TranslatorBrazilian : public Translator
{ return "Grupos de Constantes"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result = "Referência do grupo de constantes ";
result += namespaceName;
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result = "Referência do serviço ";
result += sName;
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
// TODO: Emerson Ferreira proposes to add emphasis around the word
// Singleton but I'm not sure if this will work for non HTML generators.
@@ -2203,7 +2203,7 @@ class TranslatorBrazilian : public Translator
return "Classe";
}
}
- virtual QCString trCustomReference(const char *name)
+ virtual QCString trCustomReference(const QCString &name)
{ return "Referência de " + QCString(name); }
/* Slice */
@@ -2303,7 +2303,7 @@ class TranslatorBrazilian : public Translator
{
return "Exceções";
}
- virtual QCString trCompoundReferenceSlice(const char *clName, ClassDef::CompoundType compType, bool isLocal)
+ virtual QCString trCompoundReferenceSlice(const QCString &clName, ClassDef::CompoundType compType, bool isLocal)
{
QCString result=(QCString)"Referência ";
switch(compType)
@@ -2341,13 +2341,13 @@ class TranslatorBrazilian : public Translator
//////////////////////////////////////////////////////////////////////////
// new since 1.8.19
//////////////////////////////////////////////////////////////////////////
-
+
/** VHDL design unit documentation */
virtual QCString trDesignUnitDocumentation()
- {
- return "Documentação da Unidade de Projeto";
+ {
+ return "Documentação da Unidade de Projeto";
}
-
+
};
#endif
diff --git a/src/translator_ca.h b/src/translator_ca.h
index 7a7e79a..98f2ece 100644
--- a/src/translator_ca.h
+++ b/src/translator_ca.h
@@ -142,9 +142,9 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Generat automàticament per Doxygen";
- if (s) result+=(QCString)" per a "+s;
+ if (!s.isEmpty()) result+=(QCString)" per a "+s;
result+=" a partir del codi font.";
return result;
}
@@ -504,16 +504,16 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Generat a "+date;
- if (projName) result+=(QCString)" per a "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" per a "+projName;
result+=(QCString)" per";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Diagrama d'Herència per a "+clName+":";
}
@@ -592,7 +592,7 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -614,7 +614,7 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result="Referència del Fitxer ";
result+=fileName;
@@ -622,7 +622,7 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result="Referència de l'Espai de Noms ";
result+=namespaceName;
@@ -823,12 +823,12 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Diagrama de col·laboració per a "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Inclou el graf de dependències per a "+fName+":";
}
@@ -1102,7 +1102,7 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Paquet "+name;
}
@@ -1496,7 +1496,7 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result="Referència del Directori "; result+=dirName; return result; }
/*! This returns the word directory with or without starting capital
@@ -1623,7 +1623,7 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1645,7 +1645,7 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result="Referència del Mòdul ";
result+=namespaceName;
@@ -1753,7 +1753,7 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" Relació";
}
@@ -1790,7 +1790,7 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Fitxer a "+name;
}
@@ -1799,7 +1799,7 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Inclou fitxer a "+name;
}
@@ -1844,7 +1844,7 @@ class TranslatorCatalan : public TranslatorAdapter_1_8_0
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Graf de dependència de directoris per a ")+name+":"; }
diff --git a/src/translator_cn.h b/src/translator_cn.h
index a3b5803..8d3aa5e 100644
--- a/src/translator_cn.h
+++ b/src/translator_cn.h
@@ -135,10 +135,10 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result;
result = "由" CN_SPC "Doyxgen" CN_SPC "通过分析" CN_SPC;
- if (s) result += ((QCString)s+CN_SPC "的" CN_SPC);
+ if (!s.isEmpty()) result += ((QCString)s+CN_SPC "的" CN_SPC);
result+= "源代码自动生成.";
return result;
}
@@ -391,14 +391,14 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
}
}
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{ QCString result=(QCString)"生成于" CN_SPC+date;
- if (projName) result+=(QCString)CN_SPC ", 为" CN_SPC+projName;
+ if (!projName.isEmpty()) result+=(QCString)CN_SPC ", 为" CN_SPC+projName;
result+=(QCString)"使用" CN_SPC;
return result;
}
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"类" CN_SPC+clName+CN_SPC "继承关系图:";
}
@@ -459,7 +459,7 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
// new since 0.49-990425
//////////////////////////////////////////////////////////////////////////
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
// used as the title of the HTML page of a class/struct/union
@@ -482,7 +482,7 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=CN_SPC "文件参考";
@@ -490,7 +490,7 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{ QCString result=namespaceName;
result+=CN_SPC "命名空间参考";
return result;
@@ -697,13 +697,13 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)clName+CN_SPC "的协作图:";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)fName+CN_SPC "的引用(Include)关系图:";
}
@@ -1005,7 +1005,7 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"包" CN_SPC+name;
}
@@ -1441,7 +1441,7 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{
QCString result=dirName;
result+=CN_SPC "目录参考";
@@ -1574,7 +1574,7 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1596,7 +1596,7 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result += CN_SPC "模块参考手册";
@@ -1696,7 +1696,7 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
// new since 1.6.0
//////////////////////////////////////////////////////////////////////////
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
// return QCString(name)+" Relation";
// unsure
@@ -1727,12 +1727,12 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
// new since 1.6.3
//////////////////////////////////////////////////////////////////////////
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"文件在"+CN_SPC+name;
}
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"在" CN_SPC+name+CN_SPC "中引用";
}
@@ -1770,7 +1770,7 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
{ return "版权所有"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{
return QCString(name)+CN_SPC "的目录依赖关系图";
}
@@ -1796,11 +1796,11 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
{ return "枚举说明文档从下列文件生成:"; }
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+CN_SPC "枚举类型参考"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+CN_SPC "继承自" CN_SPC+what; }
/*! Header of the sections with inherited members specific for the
@@ -1883,21 +1883,21 @@ class TranslatorChinese : public TranslatorAdapter_1_8_15
{ return "常量组"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+= CN_SPC "常量组参考";
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+= CN_SPC "服务参考";
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+= CN_SPC "单例参考";
diff --git a/src/translator_cz.h b/src/translator_cz.h
index 4fb3bc2..1ce249e 100644
--- a/src/translator_cz.h
+++ b/src/translator_cz.h
@@ -172,10 +172,10 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result("Generováno automaticky programem Doxygen "
"ze zdrojových textů");
- if (s) result += QCString(" projektu ") + s;
+ if (!s.isEmpty()) result += QCString(" projektu ") + s;
result += ".";
return result;
}
@@ -542,18 +542,17 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result("Generováno ");
result += date;
- if (projName)
- result += QCString(" pro projekt ") + projName;
+ if (!projName.isEmpty()) result += QCString(" pro projekt ") + projName;
result += " programem";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return QCString("Diagram dědičnosti pro třídu ") + clName;
}
@@ -630,7 +629,7 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -652,7 +651,7 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result("Dokumentace souboru ");
result+=fileName;
@@ -660,7 +659,7 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result("Dokumentace prostoru jmen ");
result+=namespaceName;
@@ -872,12 +871,12 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Diagram tříd pro "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Graf závislostí na vkládaných souborech "
"pro "+fName+":";
@@ -1162,7 +1161,7 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
return "Třídy";
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return QCString("Balík ") + name;
}
@@ -1535,7 +1534,7 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{
QCString result = "Reference k adresáři ";
result += dirName;
@@ -1671,7 +1670,7 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1693,7 +1692,7 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result="Dokumentace modulu ";
result += namespaceName;
@@ -1793,7 +1792,7 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return "Relace " + QCString(name);
}
@@ -1830,7 +1829,7 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Soubor v "+name;
}
@@ -1839,7 +1838,7 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Vkládá (include) soubor z "+name;
}
@@ -1884,7 +1883,7 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Graf závislosti na adresářích pro ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1914,11 +1913,11 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return "Reference k výčtu "+QCString(name); }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" dědí se z "+what; }
/*! Header of the sections with inherited members specific for the
@@ -1999,21 +1998,21 @@ class TranslatorCzech : public TranslatorAdapter_1_8_15
{ return "Konstantní skupiny"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result="Konstantní skupiny z ";
result += namespaceName;
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result="Popis služby ";
result += sName;
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result="Popis singletonu ";
result += sName;
diff --git a/src/translator_de.h b/src/translator_de.h
index be51653..ff7b704 100644
--- a/src/translator_de.h
+++ b/src/translator_de.h
@@ -233,9 +233,9 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Automatisch erzeugt von Doxygen";
- if (s) result+=(QCString)" für "+s;
+ if (!s.isEmpty()) result+=(QCString)" für "+s;
result+=" aus dem Quellcode.";
return result;
}
@@ -603,16 +603,16 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Erzeugt am "+date;
- if (projName) result+=(QCString)" für "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" für "+projName;
result+=(QCString)" von";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Klassendiagramm für "+clName+":";
}
@@ -691,7 +691,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -713,7 +713,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+="-Dateireferenz";
@@ -721,7 +721,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+="-Namensbereichsreferenz";
@@ -928,13 +928,13 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Zusammengehörigkeiten von "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Include-Abhängigkeitsdiagramm für "+fName+":";
}
@@ -1253,7 +1253,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Paket "+name;
}
@@ -1637,7 +1637,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+="-Verzeichnisreferenz"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1765,7 +1765,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1787,7 +1787,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+="-Modul-Referenz";
@@ -1891,7 +1891,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return "Bezug " + QCString(name);
}
@@ -1928,7 +1928,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Datei in "+name;
}
@@ -1937,7 +1937,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Include-Dateien in "+name;
}
@@ -1982,7 +1982,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Diagramm der Verzeichnisabhängigkeiten für ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -2013,11 +2013,11 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+" Enum-Referenz"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" geerbt von "+what; }
/*! Header of the sections with inherited members specific for the
@@ -2098,7 +2098,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
{ return "Konstante Gruppen"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Konstantengruppen-Referenz";
@@ -2106,7 +2106,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Dienstreferenz";
@@ -2114,7 +2114,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Singleton-Referenz";
@@ -2252,7 +2252,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_15
return "Klasse";
}
}
- virtual QCString trCustomReference(const char *name)
+ virtual QCString trCustomReference(const QCString &name)
{ return QCString(name)+"-Referenz"; }
//////////////////////////////////////////////////////////////////////////
diff --git a/src/translator_dk.h b/src/translator_dk.h
index fa1db9a..1d01f32 100644
--- a/src/translator_dk.h
+++ b/src/translator_dk.h
@@ -185,9 +185,9 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Automatisk genereret af Doxygen";
- if (s) result+=(QCString)" for "+s;
+ if (!s.isEmpty()) result+=(QCString)" for "+s;
result+=" ud fra kildekoden.";
return result;
}
@@ -514,16 +514,16 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Genereret "+date;
- if (projName) result+=(QCString)" for "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" for "+projName;
result+=(QCString)" af";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Stamtræ for "+clName+":";
}
@@ -602,7 +602,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -624,7 +624,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" filreference";
@@ -632,7 +632,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" namespace-reference";
@@ -829,12 +829,12 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Samarbejdsdiagram for "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Inklusions-afhængighedsgraf for "+fName+":";
}
@@ -1080,7 +1080,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Pakke "+name;
}
@@ -1418,7 +1418,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result="Indhold af kataloget "; result+=dirName; return result;}
/*! This returns the word directory with or without starting capital
@@ -1551,7 +1551,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1573,7 +1573,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Modulreference"; // " Module Reference"
@@ -1675,7 +1675,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" Relation"; // " Relation"
}
@@ -1712,7 +1712,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"File i "+name; // "File in "
}
@@ -1721,7 +1721,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Inkluderer file i "+name; // "Includes file in "
}
@@ -1767,7 +1767,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0
return "Copyright";
}
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{
return QCString("Afhængighedsgraf for katalog ")+name+":";
}
diff --git a/src/translator_en.h b/src/translator_en.h
index ba26bc7..3e456cc 100644
--- a/src/translator_en.h
+++ b/src/translator_en.h
@@ -141,9 +141,9 @@ class TranslatorEnglish : public Translator
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Generated automatically by Doxygen";
- if (s) result+=(QCString)" for "+s;
+ if (!s.isEmpty()) result+=(QCString)" for "+s;
result+=" from the source code.";
return result;
}
@@ -515,16 +515,16 @@ class TranslatorEnglish : public Translator
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Generated on "+date;
- if (projName) result+=(QCString)" for "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" for "+projName;
result+=(QCString)" by";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Inheritance diagram for "+clName+":";
}
@@ -603,7 +603,7 @@ class TranslatorEnglish : public Translator
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -625,7 +625,7 @@ class TranslatorEnglish : public Translator
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" File Reference";
@@ -633,7 +633,7 @@ class TranslatorEnglish : public Translator
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Namespace Reference";
@@ -829,12 +829,12 @@ class TranslatorEnglish : public Translator
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Collaboration diagram for "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Include dependency graph for "+fName+":";
}
@@ -1117,7 +1117,7 @@ class TranslatorEnglish : public Translator
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Package "+name;
}
@@ -1511,7 +1511,7 @@ class TranslatorEnglish : public Translator
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" Directory Reference"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1639,7 +1639,7 @@ class TranslatorEnglish : public Translator
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1660,7 +1660,7 @@ class TranslatorEnglish : public Translator
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Module Reference";
@@ -1762,7 +1762,7 @@ class TranslatorEnglish : public Translator
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" Relation";
}
@@ -1799,7 +1799,7 @@ class TranslatorEnglish : public Translator
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"File in "+name;
}
@@ -1808,7 +1808,7 @@ class TranslatorEnglish : public Translator
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Includes file in "+name;
}
@@ -1853,7 +1853,7 @@ class TranslatorEnglish : public Translator
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Directory dependency graph for ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1881,11 +1881,11 @@ class TranslatorEnglish : public Translator
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+" Enum Reference"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" inherited from "+what; }
/*! Header of the sections with inherited members specific for the
@@ -1966,21 +1966,21 @@ class TranslatorEnglish : public Translator
{ return "Constant Groups"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Constant Group Reference";
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Service Reference";
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Singleton Reference";
@@ -2119,7 +2119,7 @@ class TranslatorEnglish : public Translator
return "Class";
}
}
- virtual QCString trCustomReference(const char *name)
+ virtual QCString trCustomReference(const QCString &name)
{ return QCString(name)+" Reference"; }
/* Slice */
@@ -2219,7 +2219,7 @@ class TranslatorEnglish : public Translator
{
return "Exception Documentation";
}
- virtual QCString trCompoundReferenceSlice(const char *clName, ClassDef::CompoundType compType, bool isLocal)
+ virtual QCString trCompoundReferenceSlice(const QCString &clName, ClassDef::CompoundType compType, bool isLocal)
{
QCString result=(QCString)clName;
if (isLocal) result+=" Local";
@@ -2262,6 +2262,51 @@ class TranslatorEnglish : public Translator
virtual QCString trDesignUnitDocumentation()
{ return "Design Unit Documentation"; }
+//////////////////////////////////////////////////////////////////////////
+// new since 1.9.2
+//////////////////////////////////////////////////////////////////////////
+
+ /** C++20 concept */
+ virtual QCString trConcept(bool first_capital, bool singular)
+ {
+ QCString result((first_capital ? "Concept" : "concept"));
+ if (!singular) result+="s";
+ return result;
+ }
+ /*! used as the title of the HTML page of a C++20 concept page */
+ virtual QCString trConceptReference(const QCString &conceptName)
+ {
+ QCString result=conceptName;
+ result+=" Concept Reference";
+ return result;
+ }
+
+ /*! used as the title of page containing all the index of all concepts. */
+ virtual QCString trConceptList()
+ { return "Concept List"; }
+
+ /*! used as the title of chapter containing the index listing all concepts. */
+ virtual QCString trConceptIndex()
+ { return "Concept Index"; }
+
+ /*! used as the title of chapter containing all information about concepts. */
+ virtual QCString trConceptDocumentation()
+ { return "Concept Documentation"; }
+
+ /*! used as an introduction to the concept list */
+ virtual QCString trConceptListDescription(bool extractAll)
+ {
+ QCString result="Here is a list of all ";
+ if (!extractAll) result+="documented ";
+ result+="concepts with brief descriptions:";
+ return result;
+ }
+
+ /*! used to introduce the definition of the C++20 concept */
+ virtual QCString trConceptDefinition()
+ {
+ return "Concept definition";
+ }
};
#endif
diff --git a/src/translator_eo.h b/src/translator_eo.h
index 4ae6ee9..8482b39 100644
--- a/src/translator_eo.h
+++ b/src/translator_eo.h
@@ -143,9 +143,9 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Generita aŭtomate de Doxygen";
- if (s) result+=(QCString)" por "+s;
+ if (!s.isEmpty()) result+=(QCString)" por "+s;
result+=" el la fontkodo.";
return result;
}
@@ -505,16 +505,16 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Generita la "+date;
- if (projName) result+=(QCString)" por "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" por "+projName;
result+=(QCString)" de";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Heredada diagramo por "+clName+":";
}
@@ -593,7 +593,7 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -615,7 +615,7 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" Dosiera referenco";
@@ -623,7 +623,7 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Nomspaca referenco";
@@ -820,12 +820,12 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Kunlaborada diagramo por "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Inkluzivaĵa dependeca diagramo por "+fName+":";
}
@@ -1105,7 +1105,7 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Pakaĵo "+name;
}
@@ -1499,7 +1499,7 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" Dosieruja Referenco"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1627,7 +1627,7 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1648,7 +1648,7 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Modula Referenco";
@@ -1747,7 +1747,7 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" Rilato";
}
@@ -1784,7 +1784,7 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Dosiero en "+name;
}
@@ -1793,7 +1793,7 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Inkluzivas dosieron en "+name;
}
@@ -1846,7 +1846,7 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
{ return "Kopirajto"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Dosieruja dependa diagramo por ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1874,11 +1874,11 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+" Enum Referenco"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" heredita el "+what; }
/*! Header of the sections with inherited members specific for the
diff --git a/src/translator_es.h b/src/translator_es.h
index 554c487..41dbd8f 100644
--- a/src/translator_es.h
+++ b/src/translator_es.h
@@ -135,9 +135,9 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Generado automáticamente por Doxygen";
- if (s) result+=(QCString)" para "+s;
+ if (!s.isEmpty()) result+=(QCString)" para "+s;
result+=" del código fuente.";
return result;
}
@@ -495,16 +495,16 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Generado el "+date;
- if (projName) result+=(QCString)" para "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" para "+projName;
result+=(QCString)" por";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Diagrama de herencias de "+clName;
}
@@ -583,7 +583,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -605,7 +605,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result="Referencia del Archivo ";
result+=fileName;
@@ -613,7 +613,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result="Referencia del Namespace ";
result+=namespaceName;
@@ -820,13 +820,13 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Diagrama de colaboración para "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Dependencia gráfica adjunta para "+fName+":";
}
@@ -1139,7 +1139,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Paquetes "+name;
}
@@ -1546,7 +1546,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{
QCString result="Referencia del directorio ";
result+=dirName;
@@ -1684,7 +1684,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1706,7 +1706,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result="Referencia módulo ";
result+=namespaceName;
@@ -1809,7 +1809,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" relación";
}
@@ -1846,7 +1846,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Fichero en "+name;
}
@@ -1855,7 +1855,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Incluye ficheros en "+name;
}
@@ -1903,7 +1903,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Gráfico de dependencias de directorios para ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1933,11 +1933,11 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString("Referencia del enum ") + QCString(name); }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" heredados desde "+what; }
/*! Header of the sections with inherited members specific for the
@@ -2018,21 +2018,21 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
{ return "Grupos constantes"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" referencia de grupos constantes";
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Referencia servicio";
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" referencia Singleton";
@@ -2171,7 +2171,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
return "Clase";
}
}
- virtual QCString trCustomReference(const char *name)
+ virtual QCString trCustomReference(const QCString &name)
{ return "Referencia"+QCString(name); }
virtual QCString trConstants()
@@ -2270,7 +2270,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_8_15
{
return "Documentación de excepción";
}
- virtual QCString trCompoundReferenceSlice(const char *clName, ClassDef::CompoundType compType, bool isLocal)
+ virtual QCString trCompoundReferenceSlice(const QCString &clName, ClassDef::CompoundType compType, bool isLocal)
{
QCString result="Referencia de";
switch(compType)
diff --git a/src/translator_fa.h b/src/translator_fa.h
index 56ba3da..cec2da1 100644
--- a/src/translator_fa.h
+++ b/src/translator_fa.h
@@ -158,9 +158,9 @@ class TranslatorPersian : public TranslatorAdapter_1_7_5
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="تولید شده توسط نرم افزار دی اکسیژن ";
- if (s) result+=(QCString)" برای "+s;
+ if (!s.isEmpty()) result+=(QCString)" برای "+s;
result+=" از کد برنامه ";
return result;
}
@@ -502,16 +502,16 @@ class TranslatorPersian : public TranslatorAdapter_1_7_5
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result = HtmlDivEnd + HtmlRightToLeft + QCString("توليد شده در ") +date ;
- if (projName) result+=(QCString)" برای "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" برای "+projName;
result+=(QCString)" توسط";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)""+clName+" نمودار وراثت برای :";
}
@@ -590,7 +590,7 @@ class TranslatorPersian : public TranslatorAdapter_1_7_5
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -612,7 +612,7 @@ class TranslatorPersian : public TranslatorAdapter_1_7_5
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" مرجع پرونده";
@@ -620,7 +620,7 @@ class TranslatorPersian : public TranslatorAdapter_1_7_5
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" مرجع فضای نام";
@@ -814,12 +814,12 @@ class TranslatorPersian : public TranslatorAdapter_1_7_5
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Collaboration diagram for "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"نمودار شامل شدن ها برای "+fName+":";
}
@@ -1099,7 +1099,7 @@ class TranslatorPersian : public TranslatorAdapter_1_7_5
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Package "+name;
}
@@ -1492,7 +1492,7 @@ class TranslatorPersian : public TranslatorAdapter_1_7_5
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" مرجع شاخه ی"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1596,7 +1596,7 @@ class TranslatorPersian : public TranslatorAdapter_1_7_5
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1617,7 +1617,7 @@ class TranslatorPersian : public TranslatorAdapter_1_7_5
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Module Reference";
@@ -1706,7 +1706,7 @@ class TranslatorPersian : public TranslatorAdapter_1_7_5
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name) + " Relation";
}
@@ -1743,7 +1743,7 @@ class TranslatorPersian : public TranslatorAdapter_1_7_5
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"پرونده ای در "+name;
}
@@ -1752,7 +1752,7 @@ class TranslatorPersian : public TranslatorAdapter_1_7_5
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Includes file in "+name;
}
diff --git a/src/translator_fi.h b/src/translator_fi.h
index dd2d38c..1db2372 100644
--- a/src/translator_fi.h
+++ b/src/translator_fi.h
@@ -197,7 +197,7 @@ class TranslatorFinnish : public TranslatorAdapter_1_6_0
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result=(QCString)"Automaattisesti luotu Doxygenilla "
"lähdekoodista projektille "+s; // "Generated automatically by Doxygen" ... "for" ... "from the sourcecode"
//if (s) result+=(QCString)" voor "+s;
@@ -565,20 +565,20 @@ class TranslatorFinnish : public TranslatorAdapter_1_6_0
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
// funktio on hiukan vaikea kääntää prepositioihin sidotun rakenteen vuoksi.
// Muutetaan siis lauserakennetta suomalaisemmaksi
// Generated on $date for $project by:
// -> Generated for $project on $date by:
QCString result=(QCString)"Generoinut ";
- if (projName) result+=(QCString)"projektille "+projName+" ";
+ if (!projName.isEmpty()) result+=(QCString)"projektille "+projName+" ";
result+=(QCString)date+" ";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return "Luokan "+(QCString)clName+" luokkakaavio"; // "Inheritance diagram for "
}
@@ -657,7 +657,7 @@ class TranslatorFinnish : public TranslatorAdapter_1_6_0
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -679,7 +679,7 @@ class TranslatorFinnish : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" tiedostoreferenssi"; // " File Reference"
@@ -687,7 +687,7 @@ class TranslatorFinnish : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" nimiavaruusreferenssi"; // " Namespace Reference"
@@ -884,12 +884,12 @@ class TranslatorFinnish : public TranslatorAdapter_1_6_0
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Yhteistyökaavio luokalle "+clName+":"; // "Collaboration diagram for "+clName+":"
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Sisällytysriippuvuuskaavio tiedostolle "+fName+":"; // "Include dependency graph for "+fName+":"
}
@@ -1221,7 +1221,7 @@ class TranslatorFinnish : public TranslatorAdapter_1_6_0
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Paketti "+name; // "Package "
}
@@ -1616,7 +1616,7 @@ class TranslatorFinnish : public TranslatorAdapter_1_6_0
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" hakemistoreferenssi"; return result; }
// " Directory Reference"
@@ -1748,7 +1748,7 @@ class TranslatorFinnish : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1769,7 +1769,7 @@ class TranslatorFinnish : public TranslatorAdapter_1_6_0
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" moduulin referenssi"; // " Module Reference"
diff --git a/src/translator_fr.h b/src/translator_fr.h
index a4eafc2..9bbcf2c 100644
--- a/src/translator_fr.h
+++ b/src/translator_fr.h
@@ -202,9 +202,9 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Généré automatiquement par Doxygen";
- if (s) result+=(QCString)" pour "+s;
+ if (!s.isEmpty()) result+=(QCString)" pour "+s;
result+=" à partir du code source.";
return result;
}
@@ -569,16 +569,16 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Généré le "+date;
- if (projName) result+=(QCString)" pour "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" pour "+projName;
result+=(QCString)" par";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Graphe d'héritage de "+clName+":";
}
@@ -657,7 +657,7 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -680,7 +680,7 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result= "Référence du fichier ";
result+=fileName;
@@ -688,7 +688,7 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result= "Référence de l'espace de nommage ";
result+=namespaceName;
@@ -888,12 +888,12 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Graphe de collaboration de "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Graphe des dépendances par inclusion de "+fName+":";
}
@@ -1173,7 +1173,7 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Paquetage "+name;
}
@@ -1568,7 +1568,7 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result="Répertoire de référence de "; result+=dirName; return result; }
/*! This returns the word directory with or without starting capital
@@ -1695,7 +1695,7 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1716,7 +1716,7 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result="Référence du module ";
result+= namespaceName;
@@ -1818,7 +1818,7 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return "Relation " + QCString(name);
}
@@ -1855,7 +1855,7 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Fichier dans "+name;
}
@@ -1864,7 +1864,7 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Inclut le fichier dans "+name;
}
@@ -1909,7 +1909,7 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Graphe des dépendances de répertoires pour ")+name+":"; }
@@ -1938,11 +1938,11 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+" Référence de l'énumération"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" hérités de "+what; }
/*! Header of the sections with inherited members specific for the
@@ -2023,21 +2023,21 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
{ return "Groupes constants"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result="Référence du groupe constant ";
result+=namespaceName;
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result="Référence du service ";
result+=(QCString)sName;
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result="Référence du singleton ";
result+=(QCString)sName;
@@ -2176,7 +2176,7 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
return "Classe";
}
}
- virtual QCString trCustomReference(const char *name)
+ virtual QCString trCustomReference(const QCString &name)
{ return QCString("Référence ") + QCString(name); }
virtual QCString trConstants()
@@ -2275,7 +2275,7 @@ class TranslatorFrench : public TranslatorAdapter_1_8_15
{
return "Documentation des exceptions";
}
- virtual QCString trCompoundReferenceSlice(const char *clName, ClassDef::CompoundType compType, bool isLocal)
+ virtual QCString trCompoundReferenceSlice(const QCString &clName, ClassDef::CompoundType compType, bool isLocal)
{
QCString result = "Référence ";
bool feminine = true;
diff --git a/src/translator_gr.h b/src/translator_gr.h
index a0511b7..b40b2ec 100644
--- a/src/translator_gr.h
+++ b/src/translator_gr.h
@@ -140,9 +140,9 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Δημιουργήθηκε αυτόματα από το Doxygen";
- if (s) result+=(QCString)" για "+s;
+ if (!s.isEmpty()) result+=(QCString)" για "+s;
result+=" από τον πηγαίο κώδικα.";
return result;
}
@@ -501,16 +501,16 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Δημιουργήθηκε στις "+date;
- if (projName) result+=(QCString)" για "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" για "+projName;
result+=(QCString)" από";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Διάγραμμα κληρονομικότητας για την "+clName+":";
}
@@ -589,7 +589,7 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -611,7 +611,7 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result="Τεκμηρίωση Αρχείου ";
result+=fileName;
@@ -619,7 +619,7 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result="Τεκμηρίωση Χώρου Ονομάτων ";
result+=namespaceName;
@@ -816,12 +816,12 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Διάγραμμα Συνεργασίας για την κλάση "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Διάγραμμα εξάρτησης αρχείου συμπερίληψης για το "+fName+":";
}
@@ -1104,7 +1104,7 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Πακέτο "+name;
}
@@ -1508,7 +1508,7 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=QCString("Αναφορά του Καταλόγου ") + dirName; return result; }
/*! This returns the word directory with or without starting capital
@@ -1636,7 +1636,7 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1657,7 +1657,7 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Δηλώσεις Υπομονάδων";
@@ -1757,7 +1757,7 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return "Σχέση του "+QCString(name);
}
@@ -1794,7 +1794,7 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Αρχείο σε "+name;
}
@@ -1803,7 +1803,7 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Εσωκλείει το αρχείο στο "+name;
}
@@ -1848,7 +1848,7 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Διάγραμμα εξάρτησης φακέλων για ")+name+":"; }
@@ -1877,11 +1877,11 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString("Αναφορά Απαρίθμησης ") + QCString(name); }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" κληρονόμησαν από "+what; }
/*! Header of the sections with inherited members specific for the
@@ -1962,21 +1962,21 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15
{ return "Ομάδες Σταθερών"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Τεκμηρίωση Ομάδας Σταθερών";
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Τεκμηρίωση Υπηρεσίας";
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Τεκμηρίωση Μονοσύνολου";
diff --git a/src/translator_hr.h b/src/translator_hr.h
index 3f9f492..9f9f841 100644
--- a/src/translator_hr.h
+++ b/src/translator_hr.h
@@ -118,9 +118,9 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
{ return "Ovo je popis svih članova"; }
QCString trIncludingInheritedMembers()
{ return ", uključujući naslijeđene članove."; }
- QCString trGeneratedAutomatically(const char *s)
+ QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="napravljeno automatski Doxygen-om";
- if (s) result+=(QCString)" za "+s;
+ if (!s.isEmpty()) result+=(QCString)" za "+s;
result+=" iz programskog koda.";
return result;
}
@@ -285,14 +285,14 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
{ return "Dokumentacija varijable"; }
QCString trCompounds()
{ return "Strukture"; }
- QCString trGeneratedAt(const char *date,const char *projName)
+ QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Napravljeno "+date;
- if (projName) result+=(QCString)" projekt: "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" projekt: "+projName;
result+=" generator: ";
return result;
}
- QCString trClassDiagram(const char *clName)
+ QCString trClassDiagram(const QCString &clName)
{
return QCString("Dijagram klasa za ")+clName;
}
@@ -342,7 +342,7 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
// new since 0.49-990425
//////////////////////////////////////////////////////////////////////////
- QCString trCompoundReference(const char *clName,
+ QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool /*isTemplate*/)
// used as the title of the HTML page of a class/struct/union
@@ -362,14 +362,14 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
result += clName;
return result;
}
- QCString trFileReference(const char *fileName)
+ QCString trFileReference(const QCString &fileName)
// used as the title of the HTML page of a file
{
QCString result="Opis datoteke ";
result+=fileName;
return result;
}
- QCString trNamespaceReference(const char *namespaceName)
+ QCString trNamespaceReference(const QCString &namespaceName)
// used as the title of the HTML page of a namespace
{
QCString result ="Opis imenika ";
@@ -559,12 +559,12 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- QCString trCollaborationDiagram(const char *clName)
+ QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Kolaboracijski dijagram za "+clName+ ":";
}
/*! this text is put before an include dependency graph */
- QCString trInclDepGraph(const char *fName)
+ QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Graf include međuovisnosti za "+fName+":";
}
@@ -824,7 +824,7 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
return "Klase";
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Paket "+name;
}
@@ -1194,7 +1194,7 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result= "Opis direktorija "; result += dirName; return result; }
/*! This returns the word directory with or without starting capital
@@ -1320,7 +1320,7 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1341,7 +1341,7 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" - Sadržaj modula";
@@ -1438,7 +1438,7 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString("Relacije ") + QCString(name);
}
@@ -1475,7 +1475,7 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Datoteka u "+name;
}
@@ -1484,7 +1484,7 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Uključuje datotake u "+name;
}
@@ -1528,7 +1528,7 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Direktoriji o kojima ovisi ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1556,11 +1556,11 @@ class TranslatorCroatian : public TranslatorAdapter_1_8_2
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return "Opis enumeracije " + QCString(name); }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" naslijeđeni od "+what; }
/*! Header of the sections with inherited members specific for the
diff --git a/src/translator_hu.h b/src/translator_hu.h
index ae2e169..67f3570 100644
--- a/src/translator_hu.h
+++ b/src/translator_hu.h
@@ -167,9 +167,9 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Ezt a dokumentációt a Doxygen készítette ";
- if (s) result+=(QCString)" a" + zed(s[0])+s+(QCString)" projekthez";
+ if (!s.isEmpty()) result+=(QCString)" a" + zed(s[0])+s+(QCString)" projekthez";
result+=" a forráskódból.";
return result;
}
@@ -530,16 +530,16 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"";
- if (projName) result+=(QCString)"Projekt: "+projName;
+ if (!projName.isEmpty()) result+=(QCString)"Projekt: "+projName;
result+=(QCString)" Készült: "+date+" Készítette: ";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"A"+zed(clName[0])+clName+" osztály származási diagramja:";
}
@@ -618,7 +618,7 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -640,7 +640,7 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" fájlreferencia";
@@ -648,7 +648,7 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" névtér-referencia";
@@ -845,12 +845,12 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"A"+zed(clName[0])+clName+" osztály együttműködési diagramja:";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"A"+zed(fName[0])+fName+" definíciós fájl függési gráfja:";
}
@@ -1131,7 +1131,7 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return name+(QCString)" csomag";
}
@@ -1526,7 +1526,7 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" könyvtárreferencia"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1653,7 +1653,7 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1674,7 +1674,7 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" modul hivatkozás";
@@ -1777,7 +1777,7 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" kapcsolat";
}
@@ -1814,7 +1814,7 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Fájl a(z) "+name+" könyvtárban";
}
@@ -1823,7 +1823,7 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Tartalmazott fájl a(z) "+name+" könyvtárban";
}
@@ -1868,7 +1868,7 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
{ return "Szerzői jog"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Könyvtár függőségi gráf a(z) ")+name+"-könyvtárhoz:"; }
//////////////////////////////////////////////////////////////////////////
@@ -1896,11 +1896,11 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+" felsoroló referencia"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" a(z) "+what+" osztályból származnak"; }
/*! Header of the sections with inherited members specific for the
@@ -1981,21 +1981,21 @@ class TranslatorHungarian : public TranslatorAdapter_1_8_15
{ return "Konstans csoportok"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" konstans csoport referencia";
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" szolgáltatás referencia";
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" egyke példány referencia";
diff --git a/src/translator_id.h b/src/translator_id.h
index 4b5626a..cb7ae2e 100644
--- a/src/translator_id.h
+++ b/src/translator_id.h
@@ -125,9 +125,9 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Dibangkitkan secara otomatis oleh Doxygen";
- if (s) result+=(QCString)" untuk "+s;
+ if (!s.isEmpty()) result+=(QCString)" untuk "+s;
result+=" dari kode sumber.";
return result;
}
@@ -486,16 +486,16 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Dibangkitkan pada tanggal "+date;
- if (projName) result+=(QCString)" untuk "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" untuk "+projName;
result+=(QCString)" oleh";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Diagram hierarki kelas untuk "+clName+":";
}
@@ -574,7 +574,7 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -596,7 +596,7 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result="Referensi File ";
result+=fileName;
@@ -604,7 +604,7 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result="Referensi Namespace ";
result+=namespaceName;
@@ -802,12 +802,12 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Diagram kolaborasi untuk "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Bagan kebergantungan pemuatan untuk "+fName+":";
}
@@ -1086,7 +1086,7 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Paket "+name;
}
@@ -1479,7 +1479,7 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result="Referensi Direktori "; result+=dirName; return result; }
/*! This returns the word directory with or without starting capital
@@ -1606,7 +1606,7 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1627,7 +1627,7 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result="Referensi Modul ";
result+=namespaceName;
@@ -1727,7 +1727,7 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return "Relasi "+QCString(name);
}
@@ -1764,7 +1764,7 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"File dimuat dalam "+name;
}
@@ -1773,7 +1773,7 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Memuat file dalam "+name;
}
@@ -1818,7 +1818,7 @@ class TranslatorIndonesian : public TranslatorAdapter_1_8_0
{ return "Hak Cipta"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Bagan dependensi directori untuk ")+name+":"; }
};
diff --git a/src/translator_it.h b/src/translator_it.h
index 4b12dae..87361d3 100644
--- a/src/translator_it.h
+++ b/src/translator_it.h
@@ -179,10 +179,10 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- QCString trGeneratedAutomatically(const char *s)
+ QCString trGeneratedAutomatically(const QCString &s)
{
QCString result="Generato automaticamente da Doxygen";
- if (s) result+=(QCString)" per "+s;
+ if (!s.isEmpty()) result+=(QCString)" per "+s;
result+=" a partire dal codice sorgente.";
return result;
}
@@ -518,16 +518,16 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- QCString trGeneratedAt(const char *date,const char *projName)
+ QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Generato "+date;
- if (projName) result+=(QCString)" per "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" per "+projName;
result+=(QCString)" da";
return result;
}
/*! this text is put before a class diagram */
- QCString trClassDiagram(const char *clName)
+ QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Diagramma delle classi per "+clName;
}
@@ -607,7 +607,7 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- QCString trCompoundReference(const char *clName,
+ QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -630,7 +630,7 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- QCString trFileReference(const char *fileName)
+ QCString trFileReference(const QCString &fileName)
{
QCString result="Riferimenti per il file ";
result+=(QCString)fileName;
@@ -638,7 +638,7 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a namespace */
- QCString trNamespaceReference(const char *namespaceName)
+ QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result="Riferimenti per il namespace ";
result+=(QCString)namespaceName;
@@ -838,12 +838,12 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- QCString trCollaborationDiagram(const char *clName)
+ QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Diagramma di collaborazione per "+clName+":";
}
/*! this text is put before an include dependency graph */
- QCString trInclDepGraph(const char *fName)
+ QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Grafo delle dipendenze di inclusione per "+fName+":";
}
@@ -1117,7 +1117,7 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Package "+name;
}
@@ -1483,7 +1483,7 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result="Riferimenti per la directory "; result+=dirName; return result; }
/*! This returns the word directory with or without starting capital
@@ -1609,7 +1609,7 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1631,7 +1631,7 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result="Riferimenti per il modulo ";
result+=namespaceName;
@@ -1733,7 +1733,7 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return "Relazione per "+QCString(name);
}
@@ -1770,7 +1770,7 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"File in "+name;
}
@@ -1779,7 +1779,7 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Include il file in "+name;
}
@@ -1824,7 +1824,7 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Grafo di dipendenza delle directory per ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1853,11 +1853,11 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString("Riferimenti per il tipo enumerato ") + QCString(name); }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" ereditati da "+what; }
/*! Header of the sections with inherited members specific for the
@@ -1938,21 +1938,21 @@ class TranslatorItalian : public TranslatorAdapter_1_8_15
{ return "Gruppi di costanti"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result="Riferimenti per il gruppo di costanti ";
result+=namespaceName;
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)"Riferimenti per il servizio ";
result+=sName;
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)"Riferimenti per il singleton ";
result+=sName;
diff --git a/src/translator_jp.h b/src/translator_jp.h
index 7985823..0f9cdf7 100644
--- a/src/translator_jp.h
+++ b/src/translator_jp.h
@@ -167,9 +167,9 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result = "Doxygen により";
- if (s) result=(QCString)" "+s+"の";
+ if (!s.isEmpty()) result=(QCString)" "+s+"の";
result+="ソースコードから抽出しました。";
return result;
}
@@ -534,16 +534,16 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result = (QCString)date+"作成";
- if (projName) result+=(QCString)" - " + projName;
+ if (!projName.isEmpty()) result+=(QCString)" - " + projName;
result+=" / 構成: ";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)clName+" の継承関係図";
}
@@ -623,7 +623,7 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -644,14 +644,14 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=(QCString)fileName+" ファイル";
return result;
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=(QCString)namespaceName+" 名前空間";
return result;
@@ -850,12 +850,12 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
}
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)clName+" 連携図";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)fName+" の依存先関係図:";
}
@@ -1128,7 +1128,7 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)name+" パッケージ";
}
@@ -1507,7 +1507,7 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" ディレクトリリファレンス"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1634,7 +1634,7 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1655,7 +1655,7 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+="モジュール";
@@ -1744,7 +1744,7 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" 関係";
}
@@ -1781,7 +1781,7 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)name+"にあるファイル";
}
@@ -1790,7 +1790,7 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)name+"にあるファイルを include している";
}
@@ -1834,7 +1834,7 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
{ return "著作権所有"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString(name)+" のディレクトリ依存関係図"; }
//////////////////////////////////////////////////////////////////////////
@@ -1860,11 +1860,11 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString("列挙 ")+name+" 詳解"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString("基底クラス ")+what+" に属する継承"+members; }
/*! Header of the sections with inherited members specific for the
@@ -1946,21 +1946,21 @@ class TranslatorJapanese : public TranslatorAdapter_1_8_15
{ return "定数グループ"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" 定数グループ詳解";
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" サービス詳解";
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Singleton 詳解";
diff --git a/src/translator_kr.h b/src/translator_kr.h
index dda8f6e..c0ae658 100644
--- a/src/translator_kr.h
+++ b/src/translator_kr.h
@@ -165,9 +165,9 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="소스 코드로부터 ";
- if (s) result+=s+(QCString)"를 위해 ";
+ if (!s.isEmpty()) result+=s+(QCString)"를 위해 ";
result+="Doxygen에 의해 자동으로 생성됨.";
return result;
}
@@ -529,16 +529,16 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"생성시간 : "+date;
- if (projName) result+=(QCString)", 프로젝트명 : "+projName;
+ if (!projName.isEmpty()) result+=(QCString)", 프로젝트명 : "+projName;
result+=(QCString)", 생성자 : ";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)clName+"에 대한 상속 다이어그램 : ";
}
@@ -617,7 +617,7 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -639,7 +639,7 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" 파일 참조";
@@ -647,7 +647,7 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" 네임스페이스 참조";
@@ -845,12 +845,12 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)clName+"에 대한 협력 다이어그램:";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)fName+"에 대한 include 의존 그래프";
}
@@ -1124,7 +1124,7 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return name+(QCString)" 패키지";
}
@@ -1517,7 +1517,7 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" 디렉토리 참조"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1645,7 +1645,7 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1666,7 +1666,7 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" 모듈 참조";
@@ -1767,7 +1767,7 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" 관계";
}
@@ -1804,7 +1804,7 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return QCString(name) + "의 파일";
}
@@ -1813,7 +1813,7 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return QCString(name) + "의 파일 포함";
}
@@ -1858,7 +1858,7 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString(name) + QCString("에 대한 디렉토리 의존성 그래프:"); }
//////////////////////////////////////////////////////////////////////////
@@ -1884,11 +1884,11 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+" Enum Reference"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(what) + QCString("(으)로부터 상속된 ") + QCString(members); }
/*! Header of the sections with inherited members specific for the
@@ -1969,21 +1969,21 @@ class TranslatorKorean : public TranslatorAdapter_1_8_15
{ return "상수 그룹들"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" 상수 그룹 레퍼런스";
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" 서비스 레퍼런스";
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" 싱글톤 레퍼런스";
diff --git a/src/translator_lt.h b/src/translator_lt.h
index 1be20d2..ad88331 100644
--- a/src/translator_lt.h
+++ b/src/translator_lt.h
@@ -132,9 +132,9 @@ class TranslatorLithuanian : public TranslatorAdapter_1_4_6
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Automatiškai sugeneruota Doxygen įrankiu";
- if (s) result+=(QCString)" "+s;
+ if (!s.isEmpty()) result+=(QCString)" "+s;
result+=" iš programos kodo.";
return result;
}
@@ -494,16 +494,16 @@ class TranslatorLithuanian : public TranslatorAdapter_1_4_6
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Sugeneruota "+date;/*FIXME*/
- if (projName) result+=(QCString)" "+projName;/*FIXME*/
+ if (!projName.isEmpty()) result+=(QCString)" "+projName;/*FIXME*/
result+=(QCString)" ";/*FIXME*/
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Paveldimumo diagrama "+clName+":"; /*FIXME*/
}
@@ -582,7 +582,7 @@ class TranslatorLithuanian : public TranslatorAdapter_1_4_6
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -603,7 +603,7 @@ class TranslatorLithuanian : public TranslatorAdapter_1_4_6
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" Failo Nuoroda";
@@ -611,7 +611,7 @@ class TranslatorLithuanian : public TranslatorAdapter_1_4_6
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Vardų Srities Nuoroda";
@@ -808,12 +808,12 @@ class TranslatorLithuanian : public TranslatorAdapter_1_4_6
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Bendradarbiavimo diagrama "+clName+":";/*FIXME*/
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Įtraukimo priklausomybių diagrama "+fName+":";/*FIXME*/
}
@@ -1094,7 +1094,7 @@ class TranslatorLithuanian : public TranslatorAdapter_1_4_6
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Paketas "+name;
}
@@ -1492,7 +1492,7 @@ class TranslatorLithuanian : public TranslatorAdapter_1_4_6
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" Directorijos aprašas"; return result; }
/*! This returns the word directory with or without starting capital
diff --git a/src/translator_lv.h b/src/translator_lv.h
index 8dcc45b..7367502 100644
--- a/src/translator_lv.h
+++ b/src/translator_lv.h
@@ -147,9 +147,9 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Automātiski ģenerēts izmantojot Doxygen";
- if (s) result+=(QCString)" priekš "+s;
+ if (!s.isEmpty()) result+=(QCString)" priekš "+s;
result+=" no pirmkoda.";
return result;
}
@@ -509,16 +509,16 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Ģenerēts "+date;
- if (projName) result+=(QCString)" projektam "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" projektam "+projName;
result+=(QCString)" ar";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Mantojamības diagramma klasei "+clName+":";
}
@@ -597,7 +597,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -619,7 +619,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" faila apraksts";
@@ -627,7 +627,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" nosaukumvietas apraksts";
@@ -823,12 +823,12 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Sadarbības diagramma klasei "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Include dependency graph for "+fName+":";
}
@@ -1111,7 +1111,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Pakotne "+name;
}
@@ -1505,7 +1505,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result="Direktorijas "; result+=dirName; result+=" atsauce"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1633,7 +1633,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1654,7 +1654,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" moduļu atsauce";
@@ -1756,7 +1756,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" relācija";
}
@@ -1793,7 +1793,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"File in "+name;
}
@@ -1802,7 +1802,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Includes file in "+name;
}
@@ -1847,7 +1847,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
{ return "Autortiesības"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Atkarību grafs direktorijai ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1877,11 +1877,11 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+" uzskaitījumliterāļa atsauce"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" manto no "+what; }
/*! Header of the sections with inherited members specific for the
diff --git a/src/translator_mk.h b/src/translator_mk.h
index 97a55dc..6db452e 100644
--- a/src/translator_mk.h
+++ b/src/translator_mk.h
@@ -128,9 +128,9 @@ class TranslatorMacedonian : public TranslatorAdapter_1_6_0
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Автоматски создадено од Doxygen";
- if (s) result+=(QCString)" за "+s;
+ if (!s.isEmpty()) result+=(QCString)" за "+s;
result+=" изворниот код.";
return result;
}
@@ -489,16 +489,16 @@ class TranslatorMacedonian : public TranslatorAdapter_1_6_0
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Создадено на "+date;
- if (projName) result+=(QCString)" за "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" за "+projName;
result+=(QCString)" од";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Диаграм на наследување за "+clName+":";
}
@@ -577,7 +577,7 @@ class TranslatorMacedonian : public TranslatorAdapter_1_6_0
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -599,7 +599,7 @@ class TranslatorMacedonian : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result = "Опис на Датотекaта ";
result += fileName;
@@ -607,7 +607,7 @@ class TranslatorMacedonian : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result = "Опис на Имeто на Простор ";
result += namespaceName;
@@ -804,12 +804,12 @@ class TranslatorMacedonian : public TranslatorAdapter_1_6_0
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Диаграм на соработка за "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Вклучен дијаграм на зависност за "+fName+":";
}
@@ -1089,7 +1089,7 @@ class TranslatorMacedonian : public TranslatorAdapter_1_6_0
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Пакет "+name;
}
@@ -1481,7 +1481,7 @@ class TranslatorMacedonian : public TranslatorAdapter_1_6_0
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result= "Опис на Именикот "; result += dirName; return result; }
/*! This returns the word directory with or without starting capital
@@ -1608,7 +1608,7 @@ class TranslatorMacedonian : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1628,7 +1628,7 @@ class TranslatorMacedonian : public TranslatorAdapter_1_6_0
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" - Содржина на Модул";
diff --git a/src/translator_nl.h b/src/translator_nl.h
index 413d353..7bf8db3 100644
--- a/src/translator_nl.h
+++ b/src/translator_nl.h
@@ -62,9 +62,9 @@ class TranslatorDutch : public Translator
{ return "Dit is de complete lijst van alle members voor"; }
QCString trIncludingInheritedMembers()
{ return ", inclusief alle overge&euml;rfde members."; }
- QCString trGeneratedAutomatically(const char *s)
+ QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Automatisch gegenereerd door Doxygen";
- if (s) result+=(QCString)" voor "+s;
+ if (!s.isEmpty()) result+=(QCString)" voor "+s;
result+=" uit de programmatekst.";
return result;
}
@@ -202,14 +202,14 @@ class TranslatorDutch : public Translator
{ return "Documentatie van variabelen"; }
QCString trCompounds()
{ return "Klassen"; }
- QCString trGeneratedAt(const char *date,const char *projName)
+ QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Gegenereerd op "+date;
- if (projName) result+=(QCString)" voor "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" voor "+projName;
result+=(QCString)" door";
return result;
}
- QCString trClassDiagram(const char *clName)
+ QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Klasse diagram voor "+clName;
}
@@ -259,7 +259,7 @@ class TranslatorDutch : public Translator
// new since 0.49-990425
//////////////////////////////////////////////////////////////////////////
- QCString trCompoundReference(const char *clName,
+ QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
// used as the title of the HTML page of a class/struct/union
@@ -280,14 +280,14 @@ class TranslatorDutch : public Translator
result+=" Referentie";
return result;
}
- QCString trFileReference(const char *fileName)
+ QCString trFileReference(const QCString &fileName)
// used as the title of the HTML page of a file
{
QCString result=fileName;
result+=" Bestand Referentie";
return result;
}
- QCString trNamespaceReference(const char *namespaceName)
+ QCString trNamespaceReference(const QCString &namespaceName)
// used as the title of the HTML page of a namespace
{
QCString result=namespaceName;
@@ -479,12 +479,12 @@ class TranslatorDutch : public Translator
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- QCString trCollaborationDiagram(const char *clName)
+ QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Collaboratie diagram voor "+clName+":";
}
/*! this text is put before an include dependency graph */
- QCString trInclDepGraph(const char *fName)
+ QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Include afhankelijkheidsgraaf voor "+fName+":";
}
@@ -749,7 +749,7 @@ class TranslatorDutch : public Translator
return "Klassen";
}
/*! Used as the title of a Java package */
- QCString trPackage(const char *name)
+ QCString trPackage(const QCString &name)
{
return (QCString)"Package "+name;
}
@@ -1137,7 +1137,7 @@ class TranslatorDutch : public Translator
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" Folder Referentie"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1249,7 +1249,7 @@ class TranslatorDutch : public Translator
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1270,7 +1270,7 @@ class TranslatorDutch : public Translator
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Module Referentie";
@@ -1367,7 +1367,7 @@ class TranslatorDutch : public Translator
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" Relatie";
}
@@ -1404,7 +1404,7 @@ class TranslatorDutch : public Translator
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Bestand in "+name;
}
@@ -1413,7 +1413,7 @@ class TranslatorDutch : public Translator
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Includeert bestand in "+name;
}
@@ -1447,7 +1447,7 @@ class TranslatorDutch : public Translator
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Folder afhankelijkheidsgraaf voor ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1476,11 +1476,11 @@ class TranslatorDutch : public Translator
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+" Enum Referentie"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" overge&euml;rfd van "+what; }
/*! Header of the sections with inherited members specific for the
@@ -1561,21 +1561,21 @@ class TranslatorDutch : public Translator
{ return "Konstanten Groepen"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Konstanten Groepen Referentie";
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Service Referentie";
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Singleton Referentie";
@@ -1712,7 +1712,7 @@ class TranslatorDutch : public Translator
return "Klasse";
}
}
- virtual QCString trCustomReference(const char *name)
+ virtual QCString trCustomReference(const QCString &name)
{ return QCString(name)+" Referentie"; }
/* Slice */
@@ -1764,7 +1764,7 @@ class TranslatorDutch : public Translator
{ return "Deze inheritance lijst is min of meer alfabetisch gesorteerd:"; }
virtual QCString trExceptionDocumentation()
{ return "Documentatie van exceptions"; }
- virtual QCString trCompoundReferenceSlice(const char *clName, ClassDef::CompoundType compType, bool isLocal)
+ virtual QCString trCompoundReferenceSlice(const QCString &clName, ClassDef::CompoundType compType, bool isLocal)
{
QCString result=(QCString)clName;
if (isLocal) result+=" Lokale";
@@ -1796,6 +1796,46 @@ class TranslatorDutch : public Translator
//////////////////////////////////////////////////////////////////////////
virtual QCString trDesignUnitDocumentation()
{ return "Ontwerp Eenheid Documentatie"; }
+
+//////////////////////////////////////////////////////////////////////////
+// new since 1.9.2
+//////////////////////////////////////////////////////////////////////////
+ virtual QCString trConcept(bool first_capital, bool singular)
+ {
+ QCString result((first_capital ? "Concept" : "concept"));
+ if (!singular) result+="en";
+ return result;
+ }
+
+ virtual QCString trConceptReference(const QCString &conceptName)
+ {
+ QCString result=conceptName;
+ result+=" Concept Referentie";
+ return result;
+ }
+
+ virtual QCString trConceptList()
+ { return "Concept Lijst"; }
+
+ virtual QCString trConceptIndex()
+ { return "Concept Index"; }
+
+ virtual QCString trConceptDocumentation()
+ { return "Concept Documentatie"; }
+
+ virtual QCString trConceptListDescription(bool extractAll)
+ {
+ QCString result="Hieronder volgt de lijst met alle ";
+ if (!extractAll) result+="gedocumenteerde ";
+ result+="concepten, elk met een korte beschrijving:";
+ return result;
+ }
+
+ virtual QCString trConceptDefinition()
+ {
+ return "Concept definitie";
+ }
+
};
#endif
diff --git a/src/translator_no.h b/src/translator_no.h
index dee96d0..0444047 100755
--- a/src/translator_no.h
+++ b/src/translator_no.h
@@ -142,9 +142,9 @@ class TranslatorNorwegian : public TranslatorAdapter_1_4_6
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Generert automatisk av Doxygen";
- if (s) result+=(QCString)" for "+s;
+ if (!s.isEmpty()) result+=(QCString)" for "+s;
result+=" fra kildekoden.";
return result;
}
@@ -524,16 +524,16 @@ class TranslatorNorwegian : public TranslatorAdapter_1_4_6
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Generert "+date;
- if (projName) result+=(QCString)" for "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" for "+projName;
result+=(QCString)" av";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Arvediagram for "+clName+":";
}
@@ -620,7 +620,7 @@ class TranslatorNorwegian : public TranslatorAdapter_1_4_6
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -642,7 +642,7 @@ class TranslatorNorwegian : public TranslatorAdapter_1_4_6
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" filreferanse";
@@ -650,7 +650,7 @@ class TranslatorNorwegian : public TranslatorAdapter_1_4_6
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" navneromsreferanse";
@@ -851,12 +851,12 @@ class TranslatorNorwegian : public TranslatorAdapter_1_4_6
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Samarbeidsdiagram for "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Avhengighetsgraf for "+fName+":";
}
@@ -1136,7 +1136,7 @@ class TranslatorNorwegian : public TranslatorAdapter_1_4_6
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Package "+name;
}
@@ -1546,7 +1546,7 @@ class TranslatorNorwegian : public TranslatorAdapter_1_4_6
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" Katalog referanse"; return result; }
/*! This returns the word directory with or without starting capital
diff --git a/src/translator_pl.h b/src/translator_pl.h
index 86bc72b..1a094d6 100644
--- a/src/translator_pl.h
+++ b/src/translator_pl.h
@@ -121,9 +121,9 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- QCString trGeneratedAutomatically(const char *s)
+ QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Wygenerowano automatycznie z kodu źródłowego programem Doxygen";
- if (s) result+=(QCString)" dla "+s;
+ if (!s.isEmpty()) result+=(QCString)" dla "+s;
result+=".";
return result;
}
@@ -497,16 +497,16 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- QCString trGeneratedAt(const char *date,const char *projName)
+ QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Wygenerowano "+date;
- if (projName) result+=(QCString)" dla "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" dla "+projName;
result+=(QCString)" programem";
return result;
}
/*! this text is put before a class diagram */
- QCString trClassDiagram(const char *clName)
+ QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Diagram dziedziczenia dla "+clName;
}
@@ -591,7 +591,7 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- QCString trCompoundReference(const char *clName,
+ QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -613,7 +613,7 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
}
/*! used as the title of the HTML page of a file */
- QCString trFileReference(const char *fileName)
+ QCString trFileReference(const QCString &fileName)
{
QCString result="Dokumentacja pliku ";
result+=fileName;
@@ -621,7 +621,7 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
}
/*! used as the title of the HTML page of a namespace */
- QCString trNamespaceReference(const char *namespaceName)
+ QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result="Dokumentacja przestrzeni nazw ";
result+=namespaceName;
@@ -823,12 +823,12 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- QCString trCollaborationDiagram(const char *clName)
+ QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Diagram współpracy dla "+clName+":";
}
/*! this text is put before an include dependency graph */
- QCString trInclDepGraph(const char *fName)
+ QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Wykres zależności załączania dla "+fName+":";
}
@@ -1110,7 +1110,7 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Pakiet "+name;
}
@@ -1497,7 +1497,7 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result="Dokumentacja katalogu "; result+=dirName; return result; }
/*! This returns the word directory with or without starting capital
@@ -1624,7 +1624,7 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1645,7 +1645,7 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result="Dokumentacja modułu ";
result+=namespaceName;
@@ -1744,7 +1744,7 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return "Relacja "+ QCString(name);
}
@@ -1781,7 +1781,7 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Plik w "+name;
}
@@ -1790,7 +1790,7 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Zawiera plik w "+name;
}
@@ -1835,7 +1835,7 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Wykres zależności katalogu dla ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1862,11 +1862,11 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ QCString result="Dokumentacja wyliczenia "; result+=name; return result; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" dziedziczone z "+what; }
/*! Header of the sections with inherited members specific for the
diff --git a/src/translator_pt.h b/src/translator_pt.h
index 2273c97..223ca53 100644
--- a/src/translator_pt.h
+++ b/src/translator_pt.h
@@ -27,7 +27,7 @@
* ---------------
* History:
* 20200112:
- * - Updated to 1.9.1;
+ * - Updated to 1.9.1;
* 20190203:
* - Slice methods added;
* 20180612:
@@ -63,7 +63,7 @@
#define TRANSLATOR_PT_H
-class TranslatorPortuguese : public Translator
+class TranslatorPortuguese : public TranslatorAdapter_1_9_2
{
public:
@@ -165,9 +165,9 @@ class TranslatorPortuguese : public Translator
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- QCString trGeneratedAutomatically(const char *s)
+ QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Gerado automaticamente por Doxygen";
- if (s) result+=(QCString)" para "+s;
+ if (!s.isEmpty()) result+=(QCString)" para "+s;
result+=" a partir do código fonte.";
return result;
}
@@ -515,16 +515,16 @@ class TranslatorPortuguese : public Translator
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- QCString trGeneratedAt(const char *date,const char *projName)
+ QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Gerado em "+date;
- if (projName) result+=(QCString)" para "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" para "+projName;
result+=(QCString)" por";
return result;
}
/*! this text is put before a class diagram */
- QCString trClassDiagram(const char *clName)
+ QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Diagrama de heranças da classe "+clName;
}
@@ -603,7 +603,7 @@ class TranslatorPortuguese : public Translator
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -625,7 +625,7 @@ class TranslatorPortuguese : public Translator
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result= "Referência ao ficheiro ";
result += fileName;
@@ -633,7 +633,7 @@ class TranslatorPortuguese : public Translator
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result= "Referência ao namespace ";
result += namespaceName;
@@ -834,12 +834,12 @@ class TranslatorPortuguese : public Translator
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Diagrama de colaboração para "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Diagrama de dependências de inclusão para "+fName+":";
}
@@ -1112,7 +1112,7 @@ class TranslatorPortuguese : public Translator
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Pacote "+name;
}
@@ -1504,7 +1504,7 @@ class TranslatorPortuguese : public Translator
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{
QCString result = "Referência do diretório ";
result += dirName;
@@ -1632,7 +1632,7 @@ class TranslatorPortuguese : public Translator
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1656,7 +1656,7 @@ class TranslatorPortuguese : public Translator
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result = "Referência do Módulo ";
result += namespaceName;
@@ -1761,7 +1761,7 @@ class TranslatorPortuguese : public Translator
/*! directory relation for \a name
*/
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return "Relação " + QCString(name);
}
@@ -1798,7 +1798,7 @@ class TranslatorPortuguese : public Translator
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Ficheiro em "+name;
}
@@ -1807,7 +1807,7 @@ class TranslatorPortuguese : public Translator
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Inclui ficheiro em "+name;
}
@@ -1856,7 +1856,7 @@ class TranslatorPortuguese : public Translator
}
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Grafo de dependências do directório ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1887,14 +1887,14 @@ class TranslatorPortuguese : public Translator
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{
QCString result = "Referência da enumeração ";
return result + name;
}
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" herdados de "+what; }
/*! Header of the sections with inherited members specific for the
@@ -1975,7 +1975,7 @@ class TranslatorPortuguese : public Translator
{ return "Grupos de Constantes"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result = "Referência do grupo de constantes ";
result += namespaceName;
@@ -1983,7 +1983,7 @@ class TranslatorPortuguese : public Translator
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result = "Referência do serviço ";
result += sName;
@@ -1991,7 +1991,7 @@ class TranslatorPortuguese : public Translator
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result = "Referência do Singleton ";
result += sName;
@@ -2141,7 +2141,7 @@ class TranslatorPortuguese : public Translator
return "Classe";
}
}
- virtual QCString trCustomReference(const char *name)
+ virtual QCString trCustomReference(const QCString &name)
{ return "Referência de " + QCString(name); }
/* Slice */
@@ -2241,7 +2241,7 @@ class TranslatorPortuguese : public Translator
{
return "Exceções";
}
- virtual QCString trCompoundReferenceSlice(const char *clName, ClassDef::CompoundType compType, bool isLocal)
+ virtual QCString trCompoundReferenceSlice(const QCString &clName, ClassDef::CompoundType compType, bool isLocal)
{
QCString result=(QCString)"Referência ";
switch(compType)
@@ -2279,11 +2279,11 @@ class TranslatorPortuguese : public Translator
//////////////////////////////////////////////////////////////////////////
// new since 1.8.19
//////////////////////////////////////////////////////////////////////////
-
+
/** VHDL design unit documentation */
virtual QCString trDesignUnitDocumentation()
- {
- return "Documentação da Unidade de Projeto";
+ {
+ return "Documentação da Unidade de Projeto";
}
};
diff --git a/src/translator_ro.h b/src/translator_ro.h
index 01765a6..6536009 100644
--- a/src/translator_ro.h
+++ b/src/translator_ro.h
@@ -142,9 +142,9 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Generat automat de Doxygen";
- if (s) result+=(QCString)" pentru "+s;
+ if (!s.isEmpty()) result+=(QCString)" pentru "+s;
result+=" din codul sursă.";
return result;
}
@@ -516,16 +516,16 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Generat "+date;
- if (projName) result+=(QCString)" pentru "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" pentru "+projName;
result+=(QCString)" de către";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Diagrama de relaţii pentru "+clName;
}
@@ -603,7 +603,7 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -626,7 +626,7 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result="Referinţă la fişierul ";
result+=fileName;
@@ -634,7 +634,7 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result="Referinţă la Namespace-ul ";
result+=namespaceName;
@@ -833,12 +833,12 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Diagrama de relaţii pentru "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Graful dependenţelor prin incluziune pentru "+fName+":";
}
@@ -1115,7 +1115,7 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Pachet "+name;
}
@@ -1509,7 +1509,7 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{
QCString result="Director-referinţă "; result+=dirName;
return result;
@@ -1639,7 +1639,7 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1660,7 +1660,7 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result="Referinţă la Modulul ";
result += namespaceName;
@@ -1762,7 +1762,7 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" Relație";
}
@@ -1799,7 +1799,7 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Fișierul din "+name;
}
@@ -1808,7 +1808,7 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Include fișierul din "+name;
}
@@ -1853,7 +1853,7 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Grafic de dependență a directoarelor pentru ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1883,11 +1883,11 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+" Referință Enum"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" moștenit(e) din "+what; }
/*! Header of the sections with inherited members specific for the
@@ -1968,21 +1968,21 @@ class TranslatorRomanian : public TranslatorAdapter_1_8_15
{ return "Grupuri Constante"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Referință Grup Constant";
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Referință Serviciu";
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Referință Singleton";
diff --git a/src/translator_ru.h b/src/translator_ru.h
index 3e3f7dc..6a699d4 100644
--- a/src/translator_ru.h
+++ b/src/translator_ru.h
@@ -110,9 +110,9 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Автоматически создано Doxygen";
- if (s) result+=QCString(" для ")+s;
+ if (!s.isEmpty()) result+=QCString(" для ")+s;
result+=" из исходного текста.";
return result;
}
@@ -455,17 +455,17 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result="Документация ";
- if (projName) result+=QCString("по ")+projName;
+ if (!projName.isEmpty()) result+=QCString("по ")+projName;
result+=QCString(". Последние изменения: ")+date;
result+=". Создано системой";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return QCString("Граф наследования:")+clName+":";
}
@@ -545,7 +545,7 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -584,13 +584,13 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
return QCString("Файл ")+fileName;
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
return QCString("Пространство имен ")+namespaceName;
}
@@ -802,12 +802,12 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Граф связей класса "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Граф включаемых заголовочных файлов для "+fName+":";
}
@@ -1089,7 +1089,7 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return QCString("Пакет ")+name;
}
@@ -1459,7 +1459,7 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=QCString("Содержание директории ")+ dirName; return result; }
/*! This returns the word directory with or without starting capital
@@ -1589,7 +1589,7 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1626,7 +1626,7 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
return QCString("Модуль ") + namespaceName;
}
@@ -1722,7 +1722,7 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" Связь";
}
@@ -1759,7 +1759,7 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Файл в "+name;
}
@@ -1768,7 +1768,7 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Включает файл в "+name;
}
@@ -1813,7 +1813,7 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
{ return "Авторство"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Директория графа зависимостей ")+name+":"; }
///////////////////////////////////////////////////////////////////////
@@ -1841,11 +1841,11 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+" Ссылки на перечисление"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" унаследованные от "+what; }
/*! Header of the sections with inherited members specific for the
@@ -1926,21 +1926,21 @@ class TranslatorRussian : public TranslatorAdapter_1_8_15
{ return "Постоянные группы"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Ссылка на постоянную группу";
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Ссылка на сервис";
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Ссылка на одиночку";
diff --git a/src/translator_sc.h b/src/translator_sc.h
index b8b5b42..c5924b8 100644
--- a/src/translator_sc.h
+++ b/src/translator_sc.h
@@ -145,9 +145,9 @@ class TranslatorSerbianCyrillic : public TranslatorAdapter_1_6_0
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Аутоматски направљено помоћу Doxygen-а";
- if (s) result+=(QCString)" за "+s;
+ if (!s.isEmpty()) result+=(QCString)" за "+s;
result+=" из изворног кода.";
return result;
}
@@ -507,16 +507,16 @@ class TranslatorSerbianCyrillic : public TranslatorAdapter_1_6_0
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Направљено "+date;
- if (projName) result+=(QCString)" за "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" за "+projName;
result+=(QCString)" помоћу";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Дијаграм наслеђивања за "+clName+":";
}
@@ -595,7 +595,7 @@ class TranslatorSerbianCyrillic : public TranslatorAdapter_1_6_0
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -634,7 +634,7 @@ class TranslatorSerbianCyrillic : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" Референца датотеке";
@@ -642,7 +642,7 @@ class TranslatorSerbianCyrillic : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Референца простора имена";
@@ -839,12 +839,12 @@ class TranslatorSerbianCyrillic : public TranslatorAdapter_1_6_0
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Дијаграм сарадње за "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Дијаграм зависности укључивања за "+fName+":";
}
@@ -1125,7 +1125,7 @@ class TranslatorSerbianCyrillic : public TranslatorAdapter_1_6_0
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Пакет "+name;
}
@@ -1531,7 +1531,7 @@ class TranslatorSerbianCyrillic : public TranslatorAdapter_1_6_0
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" Референца директоријума"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1658,7 +1658,7 @@ class TranslatorSerbianCyrillic : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1679,7 +1679,7 @@ class TranslatorSerbianCyrillic : public TranslatorAdapter_1_6_0
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Референца модула";
diff --git a/src/translator_si.h b/src/translator_si.h
index 5a03a71..c199ef6 100644
--- a/src/translator_si.h
+++ b/src/translator_si.h
@@ -64,9 +64,9 @@ class TranslatorSlovene : public TranslatorAdapter_1_4_6
{ return "Seznam metod razreda "; }
QCString trIncludingInheritedMembers()
{ return ", vključujoč dedovane metode in atribute."; }
- QCString trGeneratedAutomatically(const char *s)
+ QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="zgenerirano z Doxygen-om";
- if (s) result+=(QCString)" za "+s;
+ if (!s.isEmpty()) result+=(QCString)" za "+s;
result+=" iz izvorne kode.";
return result;
}
@@ -186,14 +186,14 @@ class TranslatorSlovene : public TranslatorAdapter_1_4_6
{ return "Opis spremenljivke"; }
QCString trCompounds()
{ return "Strukture"; }
- QCString trGeneratedAt(const char *date,const char *projName)
+ QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Generirano "+date;
- if (projName) result+=(QCString)" projekt: "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" projekt: "+projName;
result+=(QCString)" generator: ";
return result;
}
- QCString trClassDiagram(const char *clName)
+ QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Diagram razredov za "+clName;
}
@@ -249,7 +249,7 @@ class TranslatorSlovene : public TranslatorAdapter_1_4_6
// new since 0.49-990425
//////////////////////////////////////////////////////////////////////////
- QCString trCompoundReference(const char *clName,
+ QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool /*isTemplate*/)
// used as the title of the HTML page of a class/struct/union
@@ -270,14 +270,14 @@ class TranslatorSlovene : public TranslatorAdapter_1_4_6
return result;
}
- QCString trFileReference(const char *fileName)
+ QCString trFileReference(const QCString &fileName)
// used as the title of the HTML page of a file
{
QCString result="Datoteka ";
result+=fileName;
return result;
}
- QCString trNamespaceReference(const char *namespaceName)
+ QCString trNamespaceReference(const QCString &namespaceName)
// used as the title of the HTML page of a namespace
{
QCString result ="Imenski prostor ";
@@ -472,12 +472,12 @@ class TranslatorSlovene : public TranslatorAdapter_1_4_6
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- QCString trCollaborationDiagram(const char *clName)
+ QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Kolaboracijski diagram razreda "+clName+":";
}
/*! this text is put before an include dependency graph */
- QCString trInclDepGraph(const char *fName)
+ QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Graf prikazuje seznam datotek, "
"ki jih datoteka \""+fName+"\" "
@@ -765,7 +765,7 @@ class TranslatorSlovene : public TranslatorAdapter_1_4_6
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"JAVA paket "+name;
}
@@ -1178,7 +1178,7 @@ class TranslatorSlovene : public TranslatorAdapter_1_4_6
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName;
result+=" imeniške reference"; /* not sure for context */
return result;
diff --git a/src/translator_sk.h b/src/translator_sk.h
index 1e5d258..1691ff5 100644
--- a/src/translator_sk.h
+++ b/src/translator_sk.h
@@ -115,10 +115,10 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result("Generované automaticky programom Doxygen "
"zo zdrojových textov");
- if (s)
+ if (!s.isEmpty())
result+=(QCString)" projektu "+s;
result+=".";
return result;
@@ -478,16 +478,16 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Generované "+date;
- if (projName) result+=(QCString)" pre projekt "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" pre projekt "+projName;
result+=(QCString)" programom";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Diagram dedičnosti pre triedu "+clName;
}
@@ -564,7 +564,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -586,7 +586,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result("Dokumentácia súboru ");
result+=fileName;
@@ -594,7 +594,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result("Dokumentácia priestoru mien ");
result+=namespaceName;
@@ -806,12 +806,12 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Diagram tried pre "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Graf závislostí na vkladaných súboroch "
"pre "+fName+":";
@@ -1090,7 +1090,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
return "Triedy";
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Balík "+name;
}
@@ -1462,7 +1462,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{
QCString result = "Referencia k adresáru ";
result += dirName;
@@ -1595,7 +1595,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1617,7 +1617,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result="Dokumentácia modulu ";
result += namespaceName;
@@ -1717,7 +1717,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return "Relácia " + QCString(name);
}
@@ -1754,7 +1754,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Súbor v "+name;
}
@@ -1763,7 +1763,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Vkladá (include) súbor z "+name;
}
@@ -1808,7 +1808,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Graf závislosti na priečinkoch pre ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1827,7 +1827,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
virtual QCString trAndMore(const QCString &number)
{
QCString result("a " + number + " ďaľší");
- if (atoi(number) >= 5)
+ if (number.toInt() >= 5)
result += "ch";
return result + "...";
}
@@ -1843,11 +1843,11 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return "Referencia k enumerácii "+QCString(name); }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" dedí sa z "+what; }
/*! Header of the sections with inherited members specific for the
@@ -1928,21 +1928,21 @@ class TranslatorSlovak : public TranslatorAdapter_1_8_15
{ return "Konštantné skupiny"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result="Konštantné skupiny z ";
result += namespaceName;
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result="Popis služby ";
result += sName;
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result="Popis singletonu ";
result += sName;
diff --git a/src/translator_sr.h b/src/translator_sr.h
index cb080ea..e5a6cf7 100644
--- a/src/translator_sr.h
+++ b/src/translator_sr.h
@@ -128,9 +128,9 @@ class TranslatorSerbian : public TranslatorAdapter_1_6_0
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Napravljeno automatski korišćenjem alata Doxygen";
- if( s ) result+=(QCString)" za projekat " + s;
+ if (!s.isEmpty()) result+=(QCString)" za projekat " + s;
result+=" od izvornog koda.";
return result;
}
@@ -487,16 +487,16 @@ class TranslatorSerbian : public TranslatorAdapter_1_6_0
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"[" + date + "] Napravljeno automatski ";
- if ( projName ) result+=(QCString)" za projekat " + projName;
+ if (!projName.isEmpty()) result+=(QCString)" za projekat " + projName;
result+=(QCString)" upotrebom ";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return QCString("Dijagram nasleđivanja za klasu ") + clName + ":";
}
@@ -575,7 +575,7 @@ class TranslatorSerbian : public TranslatorAdapter_1_6_0
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -597,7 +597,7 @@ class TranslatorSerbian : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result = "Opis datoteke ";
result += fileName;
@@ -605,7 +605,7 @@ class TranslatorSerbian : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result="Opis prostora imena ";
result += namespaceName;
@@ -802,12 +802,12 @@ class TranslatorSerbian : public TranslatorAdapter_1_6_0
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Klasni dijagram za "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Graf zavisnosti datoteka za "+fName+":";
}
@@ -1087,7 +1087,7 @@ class TranslatorSerbian : public TranslatorAdapter_1_6_0
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Paket "+name;
}
@@ -1480,7 +1480,7 @@ class TranslatorSerbian : public TranslatorAdapter_1_6_0
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+="Opis direktorijuma"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1608,7 +1608,7 @@ class TranslatorSerbian : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1629,7 +1629,7 @@ class TranslatorSerbian : public TranslatorAdapter_1_6_0
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" - sažet pregled modula";
diff --git a/src/translator_sv.h b/src/translator_sv.h
index 853e265..4916694 100644
--- a/src/translator_sv.h
+++ b/src/translator_sv.h
@@ -151,7 +151,7 @@ English:
#ifndef TRANSLATOR_SE_H
#define TRANSLATOR_SE_H
-class TranslatorSwedish : public Translator
+class TranslatorSwedish : public TranslatorAdapter_1_9_2
{
public:
@@ -244,9 +244,9 @@ class TranslatorSwedish : public Translator
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Automatiskt skapad av Doxygen";
- if (s) result+=(QCString)" för "+s;
+ if (!s.isEmpty()) result+=(QCString)" för "+s;
result+=" från källkoden.";
return result;
}
@@ -607,16 +607,16 @@ class TranslatorSwedish : public Translator
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Skapad "+date;
- if (projName) result+=(QCString)" för "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" för "+projName;
result+=(QCString)" av";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Klassdiagram för "+clName;
}
@@ -692,7 +692,7 @@ class TranslatorSwedish : public Translator
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -714,7 +714,7 @@ class TranslatorSwedish : public Translator
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" filreferens";
@@ -722,7 +722,7 @@ class TranslatorSwedish : public Translator
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" namnrymdreferens";
@@ -929,12 +929,12 @@ class TranslatorSwedish : public Translator
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Samarbetsdiagram för "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Include-beroendediagram för "+fName+":";
}
@@ -1217,7 +1217,7 @@ class TranslatorSwedish : public Translator
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Paket "+name;
}
@@ -1599,7 +1599,7 @@ class TranslatorSwedish : public Translator
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" Katalogreferens"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1728,7 +1728,7 @@ class TranslatorSwedish : public Translator
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1749,7 +1749,7 @@ class TranslatorSwedish : public Translator
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Modulreferens";
@@ -1850,7 +1850,7 @@ class TranslatorSwedish : public Translator
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" Relation";
}
@@ -1887,7 +1887,7 @@ class TranslatorSwedish : public Translator
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Fil i "+name;
}
@@ -1896,7 +1896,7 @@ class TranslatorSwedish : public Translator
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Inkluderar fil i "+name;
}
@@ -1941,7 +1941,7 @@ class TranslatorSwedish : public Translator
{ return "Copyright"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Katalogberoendegraf för ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1969,11 +1969,11 @@ class TranslatorSwedish : public Translator
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+" Enum-referens"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" ärvd ifrån "+what; }
/*! Header of the sections with inherited members specific for the
@@ -2054,21 +2054,21 @@ class TranslatorSwedish : public Translator
{ return "Konstantgrupper"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Referens till konstantgrupp";
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Tjänstereferens";
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+=" Singleton-referens";
@@ -2206,7 +2206,7 @@ class TranslatorSwedish : public Translator
return "Klass";
}
}
- virtual QCString trCustomReference(const char *name)
+ virtual QCString trCustomReference(const QCString &name)
{ return QCString(name)+"referens"; }
/* Slice */
@@ -2311,7 +2311,7 @@ class TranslatorSwedish : public Translator
{
return "Undantagsdokumentation";
}
- virtual QCString trCompoundReferenceSlice(const char *clName, ClassDef::CompoundType compType, bool isLocal)
+ virtual QCString trCompoundReferenceSlice(const QCString &clName, ClassDef::CompoundType compType, bool isLocal)
{
QCString result=(QCString)clName;
if (isLocal) result+=" Lokal";
diff --git a/src/translator_tr.h b/src/translator_tr.h
index 4a68184..ef8c5a3 100644
--- a/src/translator_tr.h
+++ b/src/translator_tr.h
@@ -140,9 +140,9 @@ class TranslatorTurkish : public TranslatorAdapter_1_7_5
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Doxygen tarafından";
- if (s) result+=s+(QCString)" için ";
+ if (!s.isEmpty()) result+=s+(QCString)" için ";
result+=" kaynak koddan otomatik üretilmiştir.";
return result;
}
@@ -498,16 +498,16 @@ class TranslatorTurkish : public TranslatorAdapter_1_7_5
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=projName+(QCString)" için "+date;
- if (projName) result+=(QCString)" tarihinde ";
+ if (!projName.isEmpty()) result+=(QCString)" tarihinde ";
result+=(QCString)" üreten: ";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return clName+(QCString)" için kalıtım şeması:";
}
@@ -586,7 +586,7 @@ class TranslatorTurkish : public TranslatorAdapter_1_7_5
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -608,7 +608,7 @@ class TranslatorTurkish : public TranslatorAdapter_1_7_5
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" Dosya Referansı";
@@ -616,7 +616,7 @@ class TranslatorTurkish : public TranslatorAdapter_1_7_5
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Namespace Referansı";
@@ -814,12 +814,12 @@ class TranslatorTurkish : public TranslatorAdapter_1_7_5
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return clName+(QCString)" için işbirliği (collaboration) şeması:";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return fName+(QCString)" için içerme bağımlılık grafiği:";
}
@@ -1099,7 +1099,7 @@ class TranslatorTurkish : public TranslatorAdapter_1_7_5
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Paket "+name;
}
@@ -1493,7 +1493,7 @@ class TranslatorTurkish : public TranslatorAdapter_1_7_5
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" Dizin Referansı"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1620,7 +1620,7 @@ class TranslatorTurkish : public TranslatorAdapter_1_7_5
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1641,7 +1641,7 @@ class TranslatorTurkish : public TranslatorAdapter_1_7_5
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Modül Referansı";
@@ -1742,7 +1742,7 @@ class TranslatorTurkish : public TranslatorAdapter_1_7_5
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" İlişkisi";
}
@@ -1779,7 +1779,7 @@ class TranslatorTurkish : public TranslatorAdapter_1_7_5
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)(name) + (QCString)" dizinindeki dosya";
}
@@ -1788,7 +1788,7 @@ class TranslatorTurkish : public TranslatorAdapter_1_7_5
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)(name) + (QCString)" dizinindeki dosyayı kapsıyor";
}
diff --git a/src/translator_tw.h b/src/translator_tw.h
index 8d9658b..24ad7ed 100644
--- a/src/translator_tw.h
+++ b/src/translator_tw.h
@@ -153,9 +153,9 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="本文件由Doxygen";
- if (s) result+=(QCString)" 自 "+s;
+ if (!s.isEmpty()) result+=(QCString)" 自 "+s;
result+=" 的原始碼中自動產生.";
return result;
}
@@ -517,16 +517,16 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"產生日期:"+date;
- if (projName) result+=(QCString)", 專案:"+projName;
+ if (!projName.isEmpty()) result+=(QCString)", 專案:"+projName;
result+=(QCString)", 產生器:";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"類別"+clName+"的繼承圖:";
}
@@ -605,7 +605,7 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -627,7 +627,7 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" 檔案參考文件";
@@ -635,7 +635,7 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" 命名空間(Namespace)參考文件";
@@ -831,12 +831,12 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)""+clName+"的合作圖:";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)""+fName+"的包含相依圖:";
}
@@ -1117,7 +1117,7 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Package "+name;
}
@@ -1495,7 +1495,7 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" 目錄參考文件"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1614,7 +1614,7 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1635,7 +1635,7 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+="模組參考文件";
@@ -1730,7 +1730,7 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return QCString(name)+" 關連";
}
@@ -1767,7 +1767,7 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"檔案在"+name;
}
@@ -1776,7 +1776,7 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"含入檔案在"+name;
}
@@ -1821,7 +1821,7 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
{ return "版權聲明"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString(name)+"的目錄關連圖"+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1849,11 +1849,11 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+" 列舉型態參考"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" 繼承自 "+what; }
/*! Header of the sections with inherited members specific for the
@@ -1934,21 +1934,21 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15
{ return "常數群組"; }
/** UNO IDL constant groups */
- virtual QCString trConstantGroupReference(const char *namespaceName)
+ virtual QCString trConstantGroupReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+="常數群組參考";
return result;
}
/** UNO IDL service page title */
- virtual QCString trServiceReference(const char *sName)
+ virtual QCString trServiceReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+="服務參考";
return result;
}
/** UNO IDL singleton page title */
- virtual QCString trSingletonReference(const char *sName)
+ virtual QCString trSingletonReference(const QCString &sName)
{
QCString result=(QCString)sName;
result+="Singleton參考";
diff --git a/src/translator_ua.h b/src/translator_ua.h
index e24136c..02f9eab 100644
--- a/src/translator_ua.h
+++ b/src/translator_ua.h
@@ -106,9 +106,9 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Автоматично створено за допомогою Doxygen";
- if (s) result+=QCString(" для ")+s;
+ if (!s.isEmpty()) result+=QCString(" для ")+s;
result+=" з тексту програми.";
return result;
}
@@ -450,17 +450,17 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result="Документація ";
- if (projName) result+=QCString("до ")+projName;
+ if (!projName.isEmpty()) result+=QCString("до ")+projName;
result+=QCString(" створена ")+date;
result+=" системою";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return QCString("Схема успадкувань для ")+clName;
}
@@ -539,7 +539,7 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -578,13 +578,13 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
return QCString("Файл ")+fileName;
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
return QCString("Простір імен ")+namespaceName;
}
@@ -795,12 +795,12 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Діаграма зв'язків класу "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return QCString("Діаграма включених заголовочних файлів для ")+fName+":";
}
@@ -1078,7 +1078,7 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return QCString("Пакет ")+name;
}
@@ -1455,7 +1455,7 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result="Довідник каталогу "; result+=dirName; return result; }
/*! This returns the word directory with or without starting capital
@@ -1583,7 +1583,7 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1620,7 +1620,7 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Модуль";
@@ -1722,7 +1722,7 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
//////////////////////////////////////////////////////////////////////////
/*! directory relation for \a name */
- virtual QCString trDirRelation(const char *name)
+ virtual QCString trDirRelation(const QCString &name)
{
return "Зв'язок з "+QCString(name);
}
@@ -1759,7 +1759,7 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
* table is shown. The heading for the first column mentions the
* source file that has a relation to another file.
*/
- virtual QCString trFileIn(const char *name)
+ virtual QCString trFileIn(const QCString &name)
{
return (QCString)"Файл у "+name;
}
@@ -1768,7 +1768,7 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
* table is shown. The heading for the second column mentions the
* destination file that is included.
*/
- virtual QCString trIncludesFileIn(const char *name)
+ virtual QCString trIncludesFileIn(const QCString &name)
{
return (QCString)"Включає файли в "+name;
}
@@ -1813,7 +1813,7 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
{ return "Копірайт"; }
/*! Header for the graph showing the directory dependencies */
- virtual QCString trDirDepGraph(const char *name)
+ virtual QCString trDirDepGraph(const QCString &name)
{ return QCString("Граф залежностей каталогу для ")+name+":"; }
//////////////////////////////////////////////////////////////////////////
@@ -1841,11 +1841,11 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4
}
/*! Header of a Java enum page (Java enums are represented as classes). */
- virtual QCString trEnumReference(const char *name)
+ virtual QCString trEnumReference(const QCString &name)
{ return QCString(name)+" Перелік"; }
/*! Used for a section containing inherited members */
- virtual QCString trInheritedFrom(const char *members,const char *what)
+ virtual QCString trInheritedFrom(const QCString &members,const QCString &what)
{ return QCString(members)+" успадковано з "+what; }
/*! Header of the sections with inherited members specific for the
diff --git a/src/translator_vi.h b/src/translator_vi.h
index 272dedd..a36dee4 100644
--- a/src/translator_vi.h
+++ b/src/translator_vi.h
@@ -161,9 +161,9 @@ class TranslatorVietnamese : public TranslatorAdapter_1_6_0
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Được tạo ra bởi Doxygen";
- if (s) result+=(QCString)" cho "+s;
+ if (!s.isEmpty()) result+=(QCString)" cho "+s;
result+=" từ mã nguồn.";
return result;
}
@@ -523,16 +523,16 @@ class TranslatorVietnamese : public TranslatorAdapter_1_6_0
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Được biên soạn vào "+date;
- if (projName) result+=(QCString)" cho mã nguồn dự án "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" cho mã nguồn dự án "+projName;
result+=(QCString)" bởi";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Sơ đồ kế thừa cho "+clName+":";
}
@@ -611,7 +611,7 @@ class TranslatorVietnamese : public TranslatorAdapter_1_6_0
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -633,7 +633,7 @@ class TranslatorVietnamese : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" File Tham chiếu";
@@ -641,7 +641,7 @@ class TranslatorVietnamese : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Namespace Tham chiếu";
@@ -837,12 +837,12 @@ class TranslatorVietnamese : public TranslatorAdapter_1_6_0
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Sơ đồ liên kết cho "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Kèm theo graph phụ thuộc cho "+fName+":";
}
@@ -1122,7 +1122,7 @@ class TranslatorVietnamese : public TranslatorAdapter_1_6_0
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Gói "+name;
}
@@ -1516,7 +1516,7 @@ class TranslatorVietnamese : public TranslatorAdapter_1_6_0
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" Tham chiếu thư mục"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1643,7 +1643,7 @@ class TranslatorVietnamese : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1664,7 +1664,7 @@ class TranslatorVietnamese : public TranslatorAdapter_1_6_0
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Tham chiếu Module";
diff --git a/src/translator_za.h b/src/translator_za.h
index 8fc847e..362adfb 100644
--- a/src/translator_za.h
+++ b/src/translator_za.h
@@ -126,9 +126,9 @@ class TranslatorAfrikaans : public TranslatorAdapter_1_6_0
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
- virtual QCString trGeneratedAutomatically(const char *s)
+ virtual QCString trGeneratedAutomatically(const QCString &s)
{ QCString result="Automaties gegenereer deur Doxygen";
- if (s) result+=(QCString)" vir "+s;
+ if (!s.isEmpty()) result+=(QCString)" vir "+s;
result+=" van die bron kode af.";
return result;
}
@@ -486,16 +486,16 @@ class TranslatorAfrikaans : public TranslatorAdapter_1_6_0
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
- virtual QCString trGeneratedAt(const char *date,const char *projName)
+ virtual QCString trGeneratedAt(const QCString &date,const QCString &projName)
{
QCString result=(QCString)"Gegenereer op "+date;
- if (projName) result+=(QCString)" vir "+projName;
+ if (!projName.isEmpty()) result+=(QCString)" vir "+projName;
result+=(QCString)" deur";
return result;
}
/*! this text is put before a class diagram */
- virtual QCString trClassDiagram(const char *clName)
+ virtual QCString trClassDiagram(const QCString &clName)
{
return (QCString)"Afleidings diagram vir "+clName+":";
}
@@ -574,7 +574,7 @@ class TranslatorAfrikaans : public TranslatorAdapter_1_6_0
//////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
- virtual QCString trCompoundReference(const char *clName,
+ virtual QCString trCompoundReference(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -596,7 +596,7 @@ class TranslatorAfrikaans : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a file */
- virtual QCString trFileReference(const char *fileName)
+ virtual QCString trFileReference(const QCString &fileName)
{
QCString result=fileName;
result+=" Leër Verwysing";
@@ -604,7 +604,7 @@ class TranslatorAfrikaans : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a namespace */
- virtual QCString trNamespaceReference(const char *namespaceName)
+ virtual QCString trNamespaceReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Namespace Verwysing";
@@ -801,12 +801,12 @@ class TranslatorAfrikaans : public TranslatorAdapter_1_6_0
//////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
- virtual QCString trCollaborationDiagram(const char *clName)
+ virtual QCString trCollaborationDiagram(const QCString &clName)
{
return (QCString)"Samewerkings diagram vir "+clName+":";
}
/*! this text is put before an include dependency graph */
- virtual QCString trInclDepGraph(const char *fName)
+ virtual QCString trInclDepGraph(const QCString &fName)
{
return (QCString)"Insluitings afhanklikheid diagram vir "+fName+":";
}
@@ -1087,7 +1087,7 @@ class TranslatorAfrikaans : public TranslatorAdapter_1_6_0
}
}
/*! Used as the title of a Java package */
- virtual QCString trPackage(const char *name)
+ virtual QCString trPackage(const QCString &name)
{
return (QCString)"Pakket "+name;
}
@@ -1481,7 +1481,7 @@ class TranslatorAfrikaans : public TranslatorAdapter_1_6_0
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
- virtual QCString trDirReference(const char *dirName)
+ virtual QCString trDirReference(const QCString &dirName)
{ QCString result=dirName; result+=" Directory Verwysing"; return result; }
/*! This returns the word directory with or without starting capital
@@ -1609,7 +1609,7 @@ class TranslatorAfrikaans : public TranslatorAdapter_1_6_0
}
/*! used as the title of the HTML page of a module/type (Fortran) */
- virtual QCString trCompoundReferenceFortran(const char *clName,
+ virtual QCString trCompoundReferenceFortran(const QCString &clName,
ClassDef::CompoundType compType,
bool isTemplate)
{
@@ -1630,7 +1630,7 @@ class TranslatorAfrikaans : public TranslatorAdapter_1_6_0
return result;
}
/*! used as the title of the HTML page of a module (Fortran) */
- virtual QCString trModuleReference(const char *namespaceName)
+ virtual QCString trModuleReference(const QCString &namespaceName)
{
QCString result=namespaceName;
result+=" Module Bron";
diff --git a/src/types.h b/src/types.h
index 0038011..a3b7de1 100644
--- a/src/types.h
+++ b/src/types.h
@@ -16,7 +16,7 @@
#ifndef TYPES_H
#define TYPES_H
-#include <qcstring.h>
+#include "qcstring.h"
/** @file
* @brief This file contains a number of basic enums and types.
@@ -91,7 +91,7 @@ struct Grouping
return "???";
}
- Grouping( const char *gn, GroupPri_t p ) : groupname(gn), pri(p) {}
+ Grouping( const QCString &gn, GroupPri_t p ) : groupname(gn), pri(p) {}
QCString groupname; //!< name of the group
GroupPri_t pri; //!< priority of this definition
diff --git a/src/utf8.cpp b/src/utf8.cpp
new file mode 100644
index 0000000..a00f615
--- /dev/null
+++ b/src/utf8.cpp
@@ -0,0 +1,208 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2021 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.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#include <cstdint>
+#include <sstream>
+
+#include "utf8.h"
+#include "caseconvert.h"
+#include "textstream.h"
+
+uint8_t getUTF8CharNumBytes(char c)
+{
+ uint8_t num=1;
+ unsigned char uc = static_cast<unsigned char>(c);
+ if (uc>=0x80u) // multibyte character
+ {
+ if ((uc&0xE0u)==0xC0u)
+ {
+ num=2; // 110x.xxxx: 2 byte character
+ }
+ if ((uc&0xF0u)==0xE0u)
+ {
+ num=3; // 1110.xxxx: 3 byte character
+ }
+ if ((uc&0xF8u)==0xF0u)
+ {
+ num=4; // 1111.0xxx: 4 byte character
+ }
+ if ((uc&0xFCu)==0xF8u)
+ {
+ num=5; // 1111.10xx: 5 byte character
+ }
+ if ((uc&0xFEu)==0xFCu)
+ {
+ num=6; // 1111.110x: 6 byte character
+ }
+ }
+ return num;
+}
+
+//! Decodes a given input of utf8 data to a unicode code point
+//! given the number of bytes it's made of
+static inline uint32_t decode_utf8( const char* data , int numBytes ) noexcept
+{
+ uint32_t cp = (unsigned char)*data;
+ if (numBytes>1)
+ {
+ cp &= 0x7F >> numBytes; // Mask out the header bits
+ for (int i=1 ; i<numBytes ; i++)
+ {
+ cp = (cp<<6) | ((unsigned char)data[i]&0x3F);
+ }
+ }
+ return cp;
+}
+
+static inline uint32_t convertUTF8CharToUnicode(const char *s,size_t bytesLeft,int &len)
+{
+ if (s==0 || bytesLeft==0)
+ {
+ len=0;
+ return 0;
+ }
+ unsigned char uc = static_cast<unsigned char>(*s);
+ switch (bytesLeft)
+ {
+ default:
+ if ((uc&0xFEu)==0xFCu)// 1111110X six bytes
+ {
+ len=6;
+ return decode_utf8(s,len);
+ }
+ // fall through
+ case 5:
+ if ((uc&0xFCu)==0xF8u) // 111110XX five bytes
+ {
+ len=5;
+ return decode_utf8(s,len);
+ }
+ // fall through
+ case 4:
+ if ((uc&0xF8u)==0xF0u) // 11110XXX four bytes
+ {
+ len=4;
+ return decode_utf8(s,len);
+ }
+ // fall through
+ case 3:
+ if ((uc&0xF0u)==0xE0u) // 1110XXXX three bytes
+ {
+ len=3;
+ return decode_utf8(s,len);
+ }
+ // fall through
+ case 2:
+ if ((uc&0xE0u)==0xC0u) // 110XXXXX two bytes
+ {
+ len=2;
+ return decode_utf8(s,len);
+ }
+ // fall through
+ case 1:
+ {
+ len=1;
+ return uc;
+ }
+ }
+}
+
+std::string getUTF8CharAt(const std::string &input,size_t pos)
+{
+ if (input.length()<=pos) return std::string();
+ int numBytes=getUTF8CharNumBytes(input[pos]);
+ if (input.length()<pos+numBytes) return std::string();
+ return input.substr(pos,pos+numBytes);
+}
+
+uint32_t getUnicodeForUTF8CharAt(const std::string &input,size_t pos)
+{
+ std::string charS = getUTF8CharAt(input,pos);
+ int len;
+ return convertUTF8CharToUnicode(charS.c_str(),charS.length(),len);
+}
+
+static inline std::string caseConvert(const std::string &input,
+ const char *(*conversionFunc)(uint32_t code))
+{
+ uint32_t code;
+ TextStream result;
+ int len;
+ size_t bytesLeft = input.length();
+ const char *p = input.c_str();
+ while ((code=convertUTF8CharToUnicode(p,bytesLeft,len)))
+ {
+ const char *conv = conversionFunc(code);
+ if (conv==nullptr) // no difference between lower and upper case
+ {
+ result.write(p,len);
+ }
+ else // replace the input character with the conversion result
+ {
+ result << conv;
+ }
+ p+=len;
+ bytesLeft-=len;
+ }
+ return result.str();
+}
+
+std::string convertUTF8ToLower(const std::string &input)
+{
+ return caseConvert(input,convertUnicodeToLower);
+}
+
+std::string convertUTF8ToUpper(const std::string &input)
+{
+ return caseConvert(input,convertUnicodeToUpper);
+}
+
+const char *writeUTF8Char(TextStream &t,const char *s)
+{
+ if (s==0) return 0;
+ uint8_t len = getUTF8CharNumBytes(*s);
+ for (uint8_t i=0;i<len;i++)
+ {
+ if (s[i]==0) // detect premature end of string (due to invalid UTF8 char)
+ {
+ len=i;
+ }
+ }
+ t.write(s,len);
+ return s+len;
+}
+
+bool lastUTF8CharIsMultibyte(const std::string &input)
+{
+ // last byte is part of a multibyte UTF8 char if bit 8 is set and bit 7 is not
+ return !input.empty() && (((unsigned char)input[input.length()-1])&0xC0)==0x80;
+}
+
+bool isUTF8CharUpperCase(const std::string &input,size_t pos)
+{
+ if (input.length()<=pos) return false;
+ int len;
+ // turn the UTF8 character at position pos into a unicode value
+ uint32_t code = convertUTF8CharToUnicode(input.c_str()+pos,input.length()-pos,len);
+ // check if the character can be converted to lower case, if so it was an upper case character
+ return convertUnicodeToLower(code)!=nullptr;
+}
+
+int isUTF8NonBreakableSpace(const char *input)
+{
+ return (static_cast<unsigned char>(input[0])==0xC2 &&
+ static_cast<unsigned char>(input[1])==0xA0) ? 2 : 0;
+}
+
diff --git a/src/utf8.h b/src/utf8.h
new file mode 100644
index 0000000..08979f3
--- /dev/null
+++ b/src/utf8.h
@@ -0,0 +1,72 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2021 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.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#ifndef UTF8_H
+#define UTF8_H
+
+#include <cstdint>
+#include <string>
+
+class TextStream;
+
+/** @file
+ * @brief Various UTF8 related helper functions.
+ *
+ * See https://en.wikipedia.org/wiki/UTF-8 for details on UTF8 encoding.
+ */
+
+
+/** Converts the input string into a lower case version, also taking into account
+ * non-ASCII characters that has a lower case variant.
+ */
+std::string convertUTF8ToLower(const std::string &input);
+
+/** Converts the input string into a upper case version, also taking into account
+ * non-ASCII characters that has a upper case variant.
+ */
+std::string convertUTF8ToUpper(const std::string &input);
+
+/** Returns the UTF8 character found at byte position pos in the input string.
+ * The resulting string can be a multi byte sequence.
+ */
+std::string getUTF8CharAt(const std::string &input,size_t pos);
+
+/** Returns the 32bit Unicode value matching character at byte position pos in
+ * the UTF8 encoded input.
+ */
+uint32_t getUnicodeForUTF8CharAt(const std::string &input,size_t pos);
+
+/** Returns the number of bytes making up a single UTF8 character given the first byte
+ * in the sequence.
+ */
+uint8_t getUTF8CharNumBytes(char firstByte);
+
+/** Writes the UTF8 character pointed to by s to stream t and returns a pointer
+ * to the next character.
+ */
+const char *writeUTF8Char(TextStream &t,const char *s);
+
+/** Returns true iff the last character in input is a multibyte character. */
+bool lastUTF8CharIsMultibyte(const std::string &input);
+
+/** Returns true iff the input string at byte position pos holds an upper case character. */
+bool isUTF8CharUpperCase(const std::string &input,size_t pos);
+
+/** Check if the first character pointed at by input is a non-breakable whitespace character.
+ * Returns the byte size of the character if there is match or 0 if not.
+ */
+int isUTF8NonBreakableSpace(const char *input);
+
+#endif
diff --git a/src/util.cpp b/src/util.cpp
index 6c098e8..d45144c 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -19,21 +19,19 @@
#include <math.h>
#include <limits.h>
#include <string.h>
+#include <assert.h>
#include <mutex>
#include <unordered_set>
#include <codecvt>
-#include <iostream>
#include <algorithm>
#include <ctime>
#include <cctype>
#include <cinttypes>
+#include <sstream>
#include "md5.h"
-#include <qfileinfo.h>
-#include <qdir.h>
-
#include "regex.h"
#include "util.h"
#include "message.h"
@@ -71,6 +69,10 @@
#include "dirdef.h"
#include "htmlentity.h"
#include "symbolresolver.h"
+#include "fileinfo.h"
+#include "dir.h"
+#include "utf8.h"
+#include "textstream.h"
#define ENABLE_TRACINGSUPPORT 0
@@ -98,13 +100,13 @@ TextGeneratorOLImpl::TextGeneratorOLImpl(OutputDocInterface &od) : m_od(od)
{
}
-void TextGeneratorOLImpl::writeString(const char *s,bool keepSpaces) const
+void TextGeneratorOLImpl::writeString(const QCString &s,bool keepSpaces) const
{
- if (s==0) return;
+ if (s.isEmpty()) return;
//printf("TextGeneratorOlImpl::writeString('%s',%d)\n",s,keepSpaces);
if (keepSpaces)
{
- const char *p=s;
+ const char *p=s.data();
if (p)
{
char cs[2];
@@ -133,8 +135,8 @@ void TextGeneratorOLImpl::writeBreak(int indent) const
}
}
-void TextGeneratorOLImpl::writeLink(const char *extRef,const char *file,
- const char *anchor,const char *text
+void TextGeneratorOLImpl::writeLink(const QCString &extRef,const QCString &file,
+ const QCString &anchor,const QCString &text
) const
{
//printf("TextGeneratorOlImpl::writeLink('%s')\n",text);
@@ -161,10 +163,10 @@ const int maxInheritanceDepth = 100000;
"bla @1" => "bla"
\endverbatim
*/
-QCString removeAnonymousScopes(const char *str)
+QCString removeAnonymousScopes(const QCString &str)
{
std::string result;
- if (str==0) return result;
+ if (str.isEmpty()) return result;
// helper to check if the found delimiter starts with a colon
auto startsWithColon = [](const std::string &del)
@@ -189,7 +191,7 @@ QCString removeAnonymousScopes(const char *str)
};
static const reg::Ex re(R"([\s:]*@\d+[\s:]*)");
- std::string s = str;
+ std::string s = str.str();
reg::Iterator iter(s,re);
reg::Iterator end;
size_t p=0;
@@ -218,12 +220,13 @@ QCString removeAnonymousScopes(const char *str)
}
// replace anonymous scopes with __anonymous__ or replacement if provided
-QCString replaceAnonymousScopes(const char *s,const char *replacement)
+QCString replaceAnonymousScopes(const QCString &s,const QCString &replacement)
{
- if (s==0) return QCString();
+ if (s.isEmpty()) return s;
static const reg::Ex marker(R"(@\d+)");
- std::string result = reg::replace(s,marker,replacement?replacement:"__anonymous__");
- //printf("replaceAnonymousScopes('%s')='%s'\n",s.data(),result.data());
+ std::string result = reg::replace(s.str(),marker,
+ replacement.isEmpty() ? replacement.data() : "__anonymous__");
+ //printf("replaceAnonymousScopes('%s')='%s'\n",qPrint(s),qPrint(result));
return result;
}
@@ -236,7 +239,7 @@ QCString stripAnonymousNamespaceScope(const QCString &s)
int sl = s.length();
while ((i=getScopeFragment(s,p,&l))!=-1)
{
- //printf("Scope fragment %s\n",s.mid(i,l).data());
+ //printf("Scope fragment %s\n",qPrint(s.mid(i,l)));
if (Doxygen::namespaceLinkedMap->find(s.left(i+l))!=0)
{
if (s.at(i)!='@')
@@ -254,11 +257,11 @@ QCString stripAnonymousNamespaceScope(const QCString &s)
p=i+l;
}
done:
- //printf("stripAnonymousNamespaceScope('%s')='%s'\n",s.data(),newScope.data());
+ //printf("stripAnonymousNamespaceScope('%s')='%s'\n",qPrint(s),qPrint(newScope));
return newScope;
}
-void writePageRef(OutputDocInterface &od,const char *cn,const char *mn)
+void writePageRef(OutputDocInterface &od,const QCString &cn,const QCString &mn)
{
od.pushGeneratorState();
@@ -325,9 +328,9 @@ QCString stripFromIncludePath(const QCString &path)
* at the extension. A number of variations is allowed in both upper and
* lower case) If anyone knows or uses another extension please let me know :-)
*/
-int guessSection(const char *name)
+int guessSection(const QCString &name)
{
- QCString n=((QCString)name).lower();
+ QCString n=name.lower();
if (n.right(2)==".c" || // source
n.right(3)==".cc" ||
n.right(4)==".cxx" ||
@@ -362,7 +365,7 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName,
const Definition **typedefContext)
{
//printf("<<resolveTypeDef(%s,%s)\n",
- // context ? context->name().data() : "<none>",qualifiedName.data());
+ // context ? qPrint(context->name()) : "<none>",qPrint(qualifiedName));
QCString result;
if (qualifiedName.isEmpty())
{
@@ -395,7 +398,7 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName,
{
// split-off scope part
QCString resScopeName = qualifiedName.left(scopeIndex);
- //printf("resScopeName='%s'\n",resScopeName.data());
+ //printf("resScopeName='%s'\n",qPrint(resScopeName));
// look-up scope in context
int is,ps=0;
@@ -406,18 +409,18 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName,
QCString tmp = resolveTypeDef(mContext,qualScopePart);
if (!tmp.isEmpty()) qualScopePart=tmp;
resScope = resScope->findInnerCompound(qualScopePart);
- //printf("qualScopePart='%s' resScope=%p\n",qualScopePart.data(),resScope);
+ //printf("qualScopePart='%s' resScope=%p\n",qPrint(qualScopePart),resScope);
if (resScope==0) break;
ps=is+l;
}
}
- //printf("resScope=%s\n",resScope?resScope->name().data():"<none>");
+ //printf("resScope=%s\n",resScope? qPrint(resScope->name()) : "<none>");
// step 2: get the member
if (resScope) // no scope or scope found in the current context
{
//printf("scope found: %s, look for typedef %s\n",
- // resScope->qualifiedName().data(),resName.data());
+ // qPrint(resScope->qualifiedName()),qPrint(resName));
MemberNameLinkedMap *mnd=0;
if (resScope->definitionType()==Definition::TypeClass)
{
@@ -435,8 +438,8 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName,
{
const MemberDef *tmd = tmd_p.get();
//printf("Found member %s resScope=%s outerScope=%s mContext=%p\n",
- // tmd->name().data(), resScope->name().data(),
- // tmd->getOuterScope()->name().data(), mContext);
+ // qPrint(tmd->name()),qPrint( resScope->name()),
+ // qPrint(tmd->getOuterScope()->name()), mContext);
if (tmd->isTypedef() /*&& tmd->getOuterScope()==resScope*/)
{
SymbolResolver resolver;
@@ -457,7 +460,7 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName,
if (md)
{
//printf(">>resolveTypeDef: Found typedef name '%s' in scope '%s' value='%s' args='%s'\n",
- // qualifiedName.data(),context->name().data(),md->typeString(),md->argsString()
+ // qPrint(qualifiedName),qPrint(context->name()),md->typeString(),md->argsString()
// );
result=md->typeString();
QCString args = md->argsString();
@@ -474,7 +477,7 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName,
else
{
//printf(">>resolveTypeDef: Typedef '%s' not found in scope '%s'!\n",
- // qualifiedName.data(),context ? context->name().data() : "<global>");
+ // qPrint(qualifiedName),context ? qPrint(context->name()) : "<global>");
}
return result;
@@ -484,16 +487,36 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName,
/*! Get a class definition given its name.
* Returns 0 if the class is not found.
*/
-ClassDef *getClass(const char *n)
+ClassDef *getClass(const QCString &n)
{
- if (n==0 || n[0]=='\0') return 0;
+ if (n.isEmpty()) return 0;
return Doxygen::classLinkedMap->find(n);
}
-NamespaceDef *getResolvedNamespace(const char *name)
+
+ConceptDef *getConcept(const QCString &n)
+{
+ if (n.isEmpty()) return 0;
+ return Doxygen::conceptLinkedMap->find(n);
+}
+
+ConceptDef *getResolvedConcept(const Definition *d,const QCString &name)
+{
+ ConceptDef *cd=0;
+ while (d && d!=Doxygen::globalScope)
+ {
+ cd = getConcept(d->name()+"::"+name);
+ if (cd) return cd;
+ d = d->getOuterScope();
+ }
+ cd = getConcept(name);
+ return cd;
+}
+
+NamespaceDef *getResolvedNamespace(const QCString &name)
{
- if (name==0 || name[0]=='\0') return 0;
- auto it = Doxygen::namespaceAliasMap.find(name);
+ if (name.isEmpty()) return 0;
+ auto it = Doxygen::namespaceAliasMap.find(name.str());
if (it!=Doxygen::namespaceAliasMap.end())
{
int count=0; // recursion detection guard
@@ -506,9 +529,9 @@ NamespaceDef *getResolvedNamespace(const char *name)
}
if (count==10)
{
- warn_uncond("possible recursive namespace alias detected for %s!\n",name);
+ warn_uncond("possible recursive namespace alias detected for %s!\n",qPrint(name));
}
- return Doxygen::namespaceLinkedMap->find(it->second.data());
+ return Doxygen::namespaceLinkedMap->find(it->second);
}
else
{
@@ -809,7 +832,7 @@ QCString removeRedundantWhiteSpace(const QCString &s)
pc=c;
}
*dst++='\0';
- //printf("removeRedundantWhitespace(%s)->%s\n",s.data(),growBuf);
+ //printf("removeRedundantWhitespace(%s)->%s\n",qPrint(s),growBuf);
return growBuf;
}
@@ -887,12 +910,12 @@ bool leftScopeMatch(const QCString &scope, const QCString &name)
void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
const FileDef *fileScope,const Definition *self,
- const char *text, bool autoBreak,bool external,
+ const QCString &text, bool autoBreak,bool external,
bool keepSpaces,int indentLevel)
{
- if (text==0) return;
+ if (text.isEmpty()) return;
//printf("linkify='%s'\n",text);
- std::string txtStr=text;
+ std::string txtStr=text.str();
size_t strLen = txtStr.length();
if (strLen==0) return;
@@ -901,9 +924,9 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
reg::Iterator end;
//printf("linkifyText scope=%s fileScope=%s strtxt=%s strlen=%d external=%d\n",
- // scope?scope->name().data():"<none>",
- // fileScope?fileScope->name().data():"<none>",
- // txtStr.data(),strLen,external);
+ // scope ? qPrint(scope->name()):"<none>",
+ // fileScope ? qPrint(fileScope->name()) : "<none>",
+ // qPrint(txtStr),strLen,external);
size_t index=0;
size_t skipIndex=0;
size_t floatingIndex=0;
@@ -938,7 +961,7 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
if (i==std::string::npos) { i=splitText.find('<'); if (i!=std::string::npos) offset=0; }
if (i==std::string::npos) i=splitText.find('>');
if (i==std::string::npos) i=splitText.find(' ');
- //printf("splitText=[%s] len=%d i=%d offset=%d\n",splitText.data(),splitLength,i,offset);
+ //printf("splitText=[%s] len=%d i=%d offset=%d\n",qPrint(splitText),splitLength,i,offset);
if (i!=std::string::npos) // add a link-break at i in case of Html output
{
std::string part1 = splitText.substr(0,i+offset);
@@ -961,9 +984,9 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
}
// get word from string
std::string word=txtStr.substr(newIndex,matchLen);
- QCString matchWord = substitute(substitute(word,"\\","::"),".","::");
+ QCString matchWord = substitute(substitute(QCString(word),"\\","::"),".","::");
//printf("linkifyText word=%s matchWord=%s scope=%s\n",
- // word.data(),matchWord.data(),scope?scope->name().data():"<none>");
+ // qPrint(word),qPrint(matchWord),scope ? qPrint(scope->name()) : "<none>");
bool found=FALSE;
if (!insideString)
{
@@ -972,14 +995,15 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
const FileDef *fd=0;
const NamespaceDef *nd=0;
const GroupDef *gd=0;
- //printf("** Match word '%s'\n",matchWord.data());
+ const ConceptDef *cnd=0;
+ //printf("** Match word '%s'\n",qPrint(matchWord));
SymbolResolver resolver(fileScope);
cd=resolver.resolveClass(scope,matchWord);
const MemberDef *typeDef = resolver.getTypedef();
if (typeDef) // First look at typedef then class, see bug 584184.
{
- //printf("Found typedef %s\n",typeDef->name().data());
+ //printf("Found typedef %s\n",qPrint(typeDef->name()));
if (external ? typeDef->isLinkable() : typeDef->isLinkableInProject())
{
if (typeDef->getOuterScope()!=self)
@@ -994,7 +1018,7 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
}
if (!found && (cd || (cd=getClass(matchWord))))
{
- //printf("Found class %s\n",cd->name().data());
+ //printf("Found class %s\n",qPrint(cd->name()));
// add link to the result
if (external ? cd->isLinkable() : cd->isLinkableInProject())
{
@@ -1017,18 +1041,18 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
}
}
}
-// else if ((cd=getClass(matchWord+"-g"))) // C# generic as well
-// {
-// // add link to the result
-// if (external ? cd->isLinkable() : cd->isLinkableInProject())
-// {
-// if (cd!=self)
-// {
-// out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word);
-// found=TRUE;
-// }
-// }
-// }
+ else if ((cnd=getConcept(matchWord)))
+ {
+ // add link to the result
+ if (external ? cnd->isLinkable() : cnd->isLinkableInProject())
+ {
+ if (cnd!=self)
+ {
+ out.writeLink(cnd->getReference(),cnd->getOutputFileBase(),cnd->anchor(),word.c_str());
+ found=TRUE;
+ }
+ }
+ }
else
{
//printf(" -> nothing\n");
@@ -1050,17 +1074,17 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
matchWord = matchWord.mid(m+2);
}
- //printf("ScopeName=%s\n",scopeName.data());
- //if (!found) printf("Trying to link %s in %s\n",word.data(),scopeName.data());
+ //printf("ScopeName=%s\n",qPrint(scopeName));
+ //if (!found) printf("Trying to link %s in %s\n",qPrint(word),qPrint(scopeName));
if (!found &&
- getDefs(scopeName,matchWord,0,md,cd,fd,nd,gd) &&
+ getDefs(scopeName,matchWord,QCString(),md,cd,fd,nd,gd) &&
//(md->isTypedef() || md->isEnumerate() ||
// md->isReference() || md->isVariable()
//) &&
(external ? md->isLinkable() : md->isLinkableInProject())
)
{
- //printf("Found ref scope=%s\n",d?d->name().data():"<global>");
+ //printf("Found ref scope=%s\n",d ? qPrint(d->name()) : "<global>");
//ol.writeObjectLink(d->getReference(),d->getOutputFileBase(),
// md->anchor(),word);
if (md!=self && (self==0 || md->name()!=self->name()))
@@ -1073,7 +1097,7 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
{
out.writeLink(md->getReference(),md->getOutputFileBase(),
md->anchor(),word.c_str());
- //printf("found symbol %s\n",matchWord.data());
+ //printf("found symbol %s\n",qPrint(matchWord));
found=TRUE;
}
}
@@ -1128,8 +1152,8 @@ void writeExamples(OutputList &ol,const ExampleList &list)
ol.disable(OutputGenerator::RTF);
ol.disable(OutputGenerator::Docbook);
// link for Html / man
- //printf("writeObjectLink(file=%s)\n",e->file.data());
- ol.writeObjectLink(0,e.file,e.anchor,e.name);
+ //printf("writeObjectLink(file=%s)\n",qPrint(e->file));
+ ol.writeObjectLink(QCString(),e.file,e.anchor,e.name);
ol.popGeneratorState();
ol.pushGeneratorState();
@@ -1137,7 +1161,7 @@ void writeExamples(OutputList &ol,const ExampleList &list)
ol.disable(OutputGenerator::Html);
// link for Latex / pdf with anchor because the sources
// are not hyperlinked (not possible with a verbatim environment).
- ol.writeObjectLink(0,e.file,0,e.name);
+ ol.writeObjectLink(QCString(),e.file,QCString(),e.name);
ol.popGeneratorState();
};
@@ -1280,7 +1304,7 @@ int filterCRLF(char *buf,int len)
return dest; // length of the valid part of the buf
}
-static QCString getFilterFromList(const char *name,const StringVector &filterList,bool &found)
+static QCString getFilterFromList(const QCString &name,const StringVector &filterList,bool &found)
{
found=FALSE;
// compare the file name to the filter pattern list
@@ -1321,10 +1345,10 @@ static QCString getFilterFromList(const char *name,const StringVector &filterLis
* In case \a inSourceCode is TRUE then first the source filter list is
* considered.
*/
-QCString getFileFilter(const char* name,bool isSourceCode)
+QCString getFileFilter(const QCString &name,bool isSourceCode)
{
// sanity check
- if (name==0) return "";
+ if (name.isEmpty()) return "";
const StringVector& filterSrcList = Config_getList(FILTER_SOURCE_PATTERNS);
const StringVector& filterList = Config_getList(FILTER_PATTERNS);
@@ -1369,7 +1393,7 @@ QCString transcodeCharacterStringToUTF8(const QCString &input)
if (cd==(void *)(-1))
{
err("unsupported character conversion: '%s'->'%s'\n",
- inputEncoding.data(),outputEncoding);
+ qPrint(inputEncoding),outputEncoding);
error=TRUE;
}
if (!error)
@@ -1383,12 +1407,12 @@ QCString transcodeCharacterStringToUTF8(const QCString &input)
outputSize-=(int)oLeft;
output.resize(outputSize+1);
output.at(outputSize)='\0';
- //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,srcBuf.data());
+ //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,qPrint(srcBuf));
}
else
{
err("failed to translate characters from %s to %s: check INPUT_ENCODING\ninput=[%s]\n",
- inputEncoding.data(),outputEncoding,input.data());
+ qPrint(inputEncoding),outputEncoding,qPrint(input));
error=TRUE;
}
}
@@ -1400,42 +1424,30 @@ QCString transcodeCharacterStringToUTF8(const QCString &input)
* is TRUE the file will be filtered by any user specified input filter.
* If \a name is "-" the string will be read from standard input.
*/
-QCString fileToString(const char *name,bool filter,bool isSourceCode)
+QCString fileToString(const QCString &name,bool filter,bool isSourceCode)
{
- if (name==0 || name[0]==0) return 0;
- QFile f;
-
- bool fileOpened=FALSE;
+ if (name.isEmpty()) return QCString();
+ bool fileOpened=false;
if (name[0]=='-' && name[1]==0) // read from stdin
{
- fileOpened=f.open(IO_ReadOnly,stdin);
- if (fileOpened)
+ fileOpened=true;
+ std::string contents;
+ std::string line;
+ while (getline(std::cin,line))
{
- const int bSize=4096;
- QCString contents(bSize+1);
- int totalSize=0;
- int size;
- while ((size=f.readBlock(contents.rawData()+totalSize,bSize))==bSize)
- {
- totalSize+=bSize;
- contents.resize(totalSize+bSize+1);
- }
- totalSize = filterCRLF(contents.rawData(),totalSize+size)+2;
- contents.resize(totalSize);
- contents.at(totalSize-2)='\n'; // to help the scanner
- contents.at(totalSize-1)='\0';
- return contents;
+ contents+=line+'\n';
}
+ return contents;
}
else // read from file
{
- QFileInfo fi(name);
+ FileInfo fi(name.str());
if (!fi.exists() || !fi.isFile())
{
- err("file '%s' not found\n",name);
+ err("file '%s' not found\n",qPrint(name));
return "";
}
- BufStr buf(fi.size());
+ BufStr buf((uint)fi.size());
fileOpened=readInputFile(name,buf,filter,isSourceCode);
if (fileOpened)
{
@@ -1450,7 +1462,7 @@ QCString fileToString(const char *name,bool filter,bool isSourceCode)
}
if (!fileOpened)
{
- err("cannot open file '%s' for reading\n",name);
+ err("cannot open file '%s' for reading\n",qPrint(name));
}
return "";
}
@@ -1468,7 +1480,7 @@ static std::tm getCurrentDateTime()
if (!warnedOnce)
{
warn_uncond("Environment variable SOURCE_DATE_EPOCH does not contain a valid number; value is '%s'\n",
- sourceDateEpoch.data());
+ qPrint(sourceDateEpoch));
warnedOnce=TRUE;
}
}
@@ -1522,7 +1534,7 @@ int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level)
if (level==256)
{
warn_uncond("class %s seem to have a recursive "
- "inheritance relation!\n",cd->name().data());
+ "inheritance relation!\n",qPrint(cd->name()));
return -1;
}
int m=maxInheritanceDepth;
@@ -1549,7 +1561,7 @@ Protection classInheritedProtectionLevel(const ClassDef *cd,const ClassDef *bcd,
if (level==256)
{
err("Internal inconsistency: found class %s seem to have a recursive "
- "inheritance relation! Please send a bug report to doxygen@gmail.com\n",cd->name().data());
+ "inheritance relation! Please send a bug report to doxygen@gmail.com\n",qPrint(cd->name()));
}
else if (prot!=Private)
{
@@ -1561,17 +1573,17 @@ Protection classInheritedProtectionLevel(const ClassDef *cd,const ClassDef *bcd,
}
}
exit:
- //printf("classInheritedProtectionLevel(%s,%s)=%d\n",cd->name().data(),bcd->name().data(),prot);
+ //printf("classInheritedProtectionLevel(%s,%s)=%d\n",qPrint(cd->name()),qPrint(bcd->name()),prot);
return prot;
}
void trimBaseClassScope(const BaseClassList &bcl,QCString &s,int level=0)
{
- //printf("trimBaseClassScope level=%d '%s'\n",level,s.data());
+ //printf("trimBaseClassScope level=%d '%s'\n",level,qPrint(s));
for (const auto &bcd : bcl)
{
ClassDef *cd=bcd.classDef;
- //printf("Trying class %s\n",cd->name().data());
+ //printf("Trying class %s\n",qPrint(cd->name()));
int spos=s.find(cd->name()+"::");
if (spos!=-1)
{
@@ -1579,7 +1591,7 @@ void trimBaseClassScope(const BaseClassList &bcl,QCString &s,int level=0)
s.length()-spos-cd->name().length()-2
);
}
- //printf("base class '%s'\n",cd->name().data());
+ //printf("base class '%s'\n",qPrint(cd->name()));
if (!cd->baseClasses().empty())
{
trimBaseClassScope(cd->baseClasses(),s,level+1);
@@ -1640,11 +1652,11 @@ static void stripIrrelevantString(QCString &target,const QCString &str)
*/
void stripIrrelevantConstVolatile(QCString &s)
{
- //printf("stripIrrelevantConstVolatile(%s)=",s.data());
+ //printf("stripIrrelevantConstVolatile(%s)=",qPrint(s));
stripIrrelevantString(s,"const");
stripIrrelevantString(s,"volatile");
stripIrrelevantString(s,"final");
- //printf("%s\n",s.data());
+ //printf("%s\n",qPrint(s));
}
@@ -1685,7 +1697,7 @@ QCString getCanonicalTemplateSpec(const Definition *d,const FileDef *fs,const QC
{
templSpec = resolvedType;
}
- //printf("getCanonicalTemplateSpec(%s)=%s\n",spec.data(),templSpec.data());
+ //printf("getCanonicalTemplateSpec(%s)=%s\n",qPrint(spec),qPrint(templSpec));
return templSpec;
}
@@ -1709,9 +1721,9 @@ static QCString getCanonicalTypeForIdentifier(
symName=word;
}
//printf("getCanonicalTypeForIdentifier(%s d=%s fs=%s ,[%s->%s]) start\n",
- // word.data(),
- // d ? d->name().data() : "<null>",fs ? fs->name().data() : "<null>",
- // tSpec?tSpec->data():"<none>",templSpec.data());
+ // qPrint(word),
+ // d ? qPrint(d->name()) : "<null>", fs ? qPrint(fs->name()) : "<null>",
+ // tSpec ? qPrint(tSpec) : "<none>", qPrint(templSpec));
// lookup class / class template instance
SymbolResolver resolver(fs);
@@ -1733,23 +1745,23 @@ static QCString getCanonicalTypeForIdentifier(
//printf("cd=%p mtype=%p\n",cd,mType);
//printf(" getCanonicalTypeForIdentifier: symbol=%s word=%s cd=%s d=%s fs=%s cd->isTemplate=%d\n",
- // symName.data(),
- // word.data(),
- // cd?cd->name().data():"<none>",
- // d?d->name().data():"<none>",
- // fs?fs->name().data():"<none>",
- // cd?cd->isTemplate():-1
+ // qPrint(symName),
+ // qPrint(word),
+ // cd ? qPrint(cd->name()) : "<none>",
+ // d ? qPrint( d->name()) : "<none>",
+ // fs ? qPrint(fs->name()) : "<none>",
+ // cd ? cd->isTemplate():-1
// );
//printf(" >>>> word '%s' => '%s' templSpec=%s ts=%s tSpec=%s isTemplate=%d resolvedType=%s\n",
- // (word+templSpec).data(),
- // cd?cd->qualifiedName().data():"<none>",
- // templSpec.data(),ts.data(),
- // tSpec?tSpec->data():"<null>",
- // cd?cd->isTemplate():FALSE,
- // resolvedType.data());
+ // qPrint((word+templSpec)),
+ // cd ? qPrint(cd->qualifiedName()) : "<none>",
+ // qPrint(templSpec), qPrint(ts),
+ // tSpec ? qPrint(tSpec) : "<null>",
+ // cd ? cd->isTemplate():FALSE,
+ // qPrint(resolvedType));
- //printf(" mtype=%s\n",mType?mType->name().data():"<none>");
+ //printf(" mtype=%s\n",mType ? qPrint(mType->name()) : "<none>");
if (cd) // resolves to a known class type
{
@@ -1804,7 +1816,7 @@ static QCString getCanonicalTypeForIdentifier(
{
//result = mType->qualifiedName(); // changed after 1.7.2
//result = mType->typeString();
- //printf("word=%s typeString=%s\n",word.data(),mType->typeString());
+ //printf("word=%s typeString=%s\n",qPrint(word),mType->typeString());
if (word!=mType->typeString())
{
QCString type = mType->typeString();
@@ -1823,7 +1835,7 @@ static QCString getCanonicalTypeForIdentifier(
else // fallback
{
resolvedType = resolveTypeDef(d,word);
- //printf("typedef [%s]->[%s]\n",word.data(),resolvedType.data());
+ //printf("typedef [%s]->[%s]\n",qPrint(word),qPrint(resolvedType));
if (resolvedType.isEmpty()) // not known as a typedef either
{
result = word;
@@ -1833,7 +1845,7 @@ static QCString getCanonicalTypeForIdentifier(
result = resolvedType;
}
}
- //printf("getCanonicalTypeForIdentifier [%s]->[%s]\n",word.data(),result.data());
+ //printf("getCanonicalTypeForIdentifier [%s]->[%s]\n",qPrint(word),qPrint(result));
return result;
}
@@ -1852,8 +1864,8 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr
type.stripPrefix("typename ");
type = removeRedundantWhiteSpace(type);
- //printf("extractCanonicalType(type=%s) start: def=%s file=%s\n",type.data(),
- // d ? d->name().data() : "<null>",fs ? fs->name().data() : "<null>");
+ //printf("extractCanonicalType(type=%s) start: def=%s file=%s\n",qPrint(type),
+ // d ? qPrint(d->name()) : "<null>", fs ? qPrint(fs->name()) : "<null>");
QCString canType;
QCString templSpec,word;
@@ -1878,7 +1890,7 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr
canType += ct;
}
//printf(" word=%s templSpec=%s canType=%s ct=%s\n",
- // word.data(),templSpec.data(),canType.data(),ct.data());
+ // qPrint(word), qPrint(templSpec), qPrint(canType), qPrint(ct));
if (!templSpec.isEmpty()) // if we didn't use up the templSpec already
// (i.e. type is not a template specialization)
// then resolve any identifiers inside.
@@ -1890,7 +1902,7 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr
size_t tp=0;
// for each identifier template specifier
- //printf("adding resolved %s to %s\n",templSpec.data(),canType.data());
+ //printf("adding resolved %s to %s\n",qPrint(templSpec),qPrint(canType));
for (; it!=end ; ++it)
{
const auto &match = *it;
@@ -1907,7 +1919,7 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr
pp=p;
}
canType += type.right(type.length()-pp);
- //printf("extractCanonicalType = '%s'->'%s'\n",type.data(),canType.data());
+ //printf("extractCanonicalType = '%s'->'%s'\n",qPrint(type),qPrint(canType));
return removeRedundantWhiteSpace(canType);
}
@@ -1916,7 +1928,7 @@ static QCString extractCanonicalArgType(const Definition *d,const FileDef *fs,co
{
QCString type = arg.type.stripWhiteSpace();
QCString name = arg.name;
- //printf("----- extractCanonicalArgType(type=%s,name=%s)\n",type.data(),name.data());
+ //printf("----- extractCanonicalArgType(type=%s,name=%s)\n",qPrint(type),qPrint(name));
if ((type=="const" || type=="volatile") && !name.isEmpty())
{ // name is part of type => correct
type+=" ";
@@ -1941,10 +1953,10 @@ static bool matchArgument2(
)
{
//printf(">> match argument: %s::'%s|%s' (%s) <-> %s::'%s|%s' (%s)\n",
- // srcScope ? srcScope->name().data() : "",
- // srcA.type.data(),srcA.name.data(),srcA.canType.data(),
- // dstScope ? dstScope->name().data() : "",
- // dstA.type.data(),dstA.name.data(),dstA.canType.data());
+ // srcScope ? qPrint(srcScope->name()) : "",
+ // qPrint(srcA.type), qPrint(srcA.name), qPrint(srcA.canType),
+ // dstScope ? qPrint(dstScope->name()) : "",
+ // qPrint(dstA.type), qPrint(dstA.name), qPrint(dstA.canType));
//if (srcA->array!=dstA->array) // nomatch for char[] against char
//{
@@ -1957,8 +1969,8 @@ static bool matchArgument2(
QCString dstType = dstA.type;
stripIrrelevantConstVolatile(srcType);
stripIrrelevantConstVolatile(dstType);
- //printf("'%s'<->'%s'\n",sSrcName.data(),dstType.right(sSrcName.length()).data());
- //printf("'%s'<->'%s'\n",sDstName.data(),srcType.right(sDstName.length()).data());
+ //printf("'%s'<->'%s'\n",qPrint(sSrcName),qPrint(dstType.right(sSrcName.length())));
+ //printf("'%s'<->'%s'\n",qPrint(sDstName),qPrint(srcType.right(sDstName.length())));
if (sSrcName==dstType.right(sSrcName.length()))
{ // case "unsigned int" <-> "unsigned int i"
srcA.type+=sSrcName;
@@ -1987,7 +1999,7 @@ static bool matchArgument2(
else
{
//printf(" Canonical types do not match [%s]<->[%s]\n",
- // srcA->canType.data(),dstA->canType.data());
+ // qPrint(srcA->canType),qPrint(dstA->canType));
NOMATCH
return FALSE;
}
@@ -2087,7 +2099,7 @@ bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,cons
void mergeArguments(ArgumentList &srcAl,ArgumentList &dstAl,bool forceNameOverwrite)
{
//printf("mergeArguments '%s', '%s'\n",
- // argListToString(srcAl).data(),argListToString(dstAl).data());
+ // qPrint(argListToString(srcAl)),qPrint(argListToString(dstAl)));
if (srcAl.size()!=dstAl.size())
{
@@ -2103,12 +2115,12 @@ void mergeArguments(ArgumentList &srcAl,ArgumentList &dstAl,bool forceNameOverwr
if (srcA.defval.isEmpty() && !dstA.defval.isEmpty())
{
- //printf("Defval changing '%s'->'%s'\n",srcA.defval.data(),dstA.defval.data());
+ //printf("Defval changing '%s'->'%s'\n",qPrint(srcA.defval),qPrint(dstA.defval));
srcA.defval=dstA.defval;
}
else if (!srcA.defval.isEmpty() && dstA.defval.isEmpty())
{
- //printf("Defval changing '%s'->'%s'\n",dstA.defval.data(),srcA.defval.data());
+ //printf("Defval changing '%s'->'%s'\n",qPrint(dstA.defval),qPrint(srcA.defval));
dstA.defval=srcA.defval;
}
@@ -2127,24 +2139,24 @@ void mergeArguments(ArgumentList &srcAl,ArgumentList &dstAl,bool forceNameOverwr
if (srcA.type==dstA.type)
{
- //printf("1. merging %s:%s <-> %s:%s\n",srcA.type.data(),srcA.name.data(),dstA.type.data(),dstA.name.data());
+ //printf("1. merging %s:%s <-> %s:%s\n",qPrint(srcA.type),qPrint(srcA.name),qPrint(dstA.type),qPrint(dstA.name));
if (srcA.name.isEmpty() && !dstA.name.isEmpty())
{
- //printf("type: '%s':='%s'\n",srcA.type.data(),dstA.type.data());
- //printf("name: '%s':='%s'\n",srcA.name.data(),dstA.name.data());
+ //printf("type: '%s':='%s'\n",qPrint(srcA.type),qPrint(dstA.type));
+ //printf("name: '%s':='%s'\n",qPrint(srcA.name),qPrint(dstA.name));
srcA.type = dstA.type;
srcA.name = dstA.name;
}
else if (!srcA.name.isEmpty() && dstA.name.isEmpty())
{
- //printf("type: '%s':='%s'\n",dstA.type.data(),srcA.type.data());
- //printf("name: '%s':='%s'\n",dstA.name.data(),srcA.name.data());
+ //printf("type: '%s':='%s'\n",qPrint(dstA.type),qPrint(srcA.type));
+ //printf("name: '%s':='%s'\n",qPrint(dstA.name),qPrint(srcA.name));
dstA.type = srcA.type;
dstA.name = dstA.name;
}
else if (!srcA.name.isEmpty() && !dstA.name.isEmpty())
{
- //printf("srcA.name=%s dstA.name=%s\n",srcA.name.data(),dstA.name.data());
+ //printf("srcA.name=%s dstA.name=%s\n",qPrint(srcA.name),qPrint(dstA.name));
if (forceNameOverwrite)
{
srcA.name = dstA.name;
@@ -2164,7 +2176,7 @@ void mergeArguments(ArgumentList &srcAl,ArgumentList &dstAl,bool forceNameOverwr
}
else
{
- //printf("2. merging '%s':'%s' <-> '%s':'%s'\n",srcA.type.data(),srcA.name.data(),dstA.type.data(),dstA.name.data());
+ //printf("2. merging '%s':'%s' <-> '%s':'%s'\n",qPrint(srcA.type),qPrint(srcA.name),qPrint(dstA.type),qPrint(dstA.name));
srcA.type=srcA.type.stripWhiteSpace();
dstA.type=dstA.type.stripWhiteSpace();
if (srcA.type+" "+srcA.name==dstA.type) // "unsigned long:int" <-> "unsigned long int:bla"
@@ -2192,15 +2204,15 @@ void mergeArguments(ArgumentList &srcAl,ArgumentList &dstAl,bool forceNameOverwr
j2=dstA.type.length()-i2-2;
if (i1!=-1 && i2==-1 && srcA.type.right(j1)==dstA.type)
{
- //printf("type: '%s':='%s'\n",dstA.type.data(),srcA.type.data());
- //printf("name: '%s':='%s'\n",dstA.name.data(),srcA.name.data());
+ //printf("type: '%s':='%s'\n",qPrint(dstA.type),qPrint(srcA.type));
+ //printf("name: '%s':='%s'\n",qPrint(dstA.name),qPrint(srcA.name));
dstA.type = srcA.type.left(i1+2)+dstA.type;
dstA.name = dstA.name;
}
else if (i1==-1 && i2!=-1 && dstA.type.right(j2)==srcA.type)
{
- //printf("type: '%s':='%s'\n",srcA.type.data(),dstA.type.data());
- //printf("name: '%s':='%s'\n",dstA.name.data(),srcA.name.data());
+ //printf("type: '%s':='%s'\n",qPrint(srcA.type),qPrint(dstA.type));
+ //printf("name: '%s':='%s'\n",qPrint(dstA.name),qPrint(srcA.name));
srcA.type = dstA.type.left(i2+2)+srcA.type;
srcA.name = dstA.name;
}
@@ -2213,15 +2225,15 @@ void mergeArguments(ArgumentList &srcAl,ArgumentList &dstAl,bool forceNameOverwr
dstA.docs = srcA.docs;
}
//printf("Merge argument '%s|%s' '%s|%s'\n",
- // srcA.type.data(),srcA.name.data(),
- // dstA.type.data(),dstA.name.data());
+ // qPrint(srcA.type), qPrint(srcA.name),
+ // qPrint(dstA.type), qPrint(dstA.name));
++srcIt;
++dstIt;
}
}
static void findMembersWithSpecificName(const MemberName *mn,
- const char *args,
+ const QCString &args,
bool checkStatics,
const FileDef *currentFile,
bool checkCV,
@@ -2235,7 +2247,7 @@ static void findMembersWithSpecificName(const MemberName *mn,
const FileDef *fd=md->getFileDef();
const GroupDef *gd=md->getGroupDef();
//printf(" md->name()='%s' md->args='%s' fd=%p gd=%p current=%p ref=%s\n",
- // md->name().data(),args,fd,gd,currentFile,md->getReference().data());
+ // qPrint(md->name()),args,fd,gd,currentFile,qPrint(md->getReference()));
if (
((gd && gd->isLinkable()) || (fd && fd->isLinkable()) || md->isReference()) &&
md->getNamespaceDef()==0 && md->isLinkable() &&
@@ -2244,7 +2256,7 @@ static void findMembersWithSpecificName(const MemberName *mn,
)
{
bool match=TRUE;
- if (args && !md->isDefine() && qstrcmp(args,"()")!=0)
+ if (!args.isEmpty() && !md->isDefine() && args!="()")
{
const ArgumentList &mdAl = md->argumentList();
auto argList_p = stringToArgumentList(md->getLanguage(),args);
@@ -2286,7 +2298,7 @@ static void findMembersWithSpecificName(const MemberName *mn,
*/
bool getDefs(const QCString &scName,
const QCString &mbName,
- const char *args,
+ const QCString &args,
const MemberDef *&md,
const ClassDef *&cd,
const FileDef *&fd,
@@ -2305,7 +2317,7 @@ bool getDefs(const QCString &scName,
scopeName = substitute(scopeName,"\\","::"); // for PHP
memberName = substitute(memberName,"\\","::"); // for PHP
//printf("Search for name=%s args=%s in scope=%s forceEmpty=%d\n",
- // memberName.data(),args,scopeName.data(),forceEmptyScope);
+ // qPrint(memberName),qPrint(args),qPrint(scopeName),forceEmptyScope);
int is,im=0,pm=0;
// strip common part of the scope from the scopeName
@@ -2318,7 +2330,7 @@ bool getDefs(const QCString &scName,
pm=im+2;
}
//printf("result after scope corrections scope=%s name=%s\n",
- // scopeName.data(),memberName.data());
+ // qPrint(scopeName), qPrint(memberName));
QCString mName=memberName;
QCString mScope;
@@ -2335,15 +2347,15 @@ bool getDefs(const QCString &scName,
// handle special the case where both scope name and member scope are equal
if (mScope==scopeName) scopeName.resize(0);
- //printf("mScope='%s' mName='%s'\n",mScope.data(),mName.data());
+ //printf("mScope='%s' mName='%s'\n",qPrint(mScope),qPrint(mName));
MemberName *mn = Doxygen::memberNameLinkedMap->find(mName);
- //printf("mName=%s mn=%p\n",mName.data(),mn);
+ //printf("mName=%s mn=%p\n",qPrint(mName),mn);
if ((!forceEmptyScope || scopeName.isEmpty()) && // this was changed for bug638856, forceEmptyScope => empty scopeName
mn && !(scopeName.isEmpty() && mScope.isEmpty()))
{
- //printf(" >member name '%s' found\n",mName.data());
+ //printf(" >member name '%s' found\n",qPrint(mName));
int scopeOffset=scopeName.length();
do
{
@@ -2367,7 +2379,7 @@ bool getDefs(const QCString &scName,
fcd=resolver.resolveClass(Doxygen::globalScope,nameWithoutTemplates);
tmd=resolver.getTypedef();
}
- //printf("Trying class scope %s: fcd=%p tmd=%p\n",className.data(),fcd,tmd);
+ //printf("Trying class scope %s: fcd=%p tmd=%p\n",qPrint(className),fcd,tmd);
// todo: fill in correct fileScope!
if (fcd && // is it a documented class
fcd->isLinkable()
@@ -2376,7 +2388,7 @@ bool getDefs(const QCString &scName,
//printf(" Found fcd=%p\n",fcd);
int mdist=maxInheritanceDepth;
std::unique_ptr<ArgumentList> argList;
- if (args)
+ if (!args.isEmpty())
{
argList = stringToArgumentList(fcd->getLanguage(),args);
}
@@ -2386,7 +2398,7 @@ bool getDefs(const QCString &scName,
if (!mmd->isStrongEnumValue())
{
const ArgumentList &mmdAl = mmd->argumentList();
- bool match=args==0 ||
+ bool match = args.isEmpty() ||
matchArguments2(mmd->getOuterScope(),mmd->getFileDef(),&mmdAl,
fcd, fcd->getFileDef(),argList.get(),
checkCV);
@@ -2407,7 +2419,7 @@ bool getDefs(const QCString &scName,
}
}
}
- if (mdist==maxInheritanceDepth && args && qstrcmp(args,"()")==0)
+ if (mdist==maxInheritanceDepth && args=="()")
// no exact match found, but if args="()" an arbitrary member will do
{
//printf(" >Searching for arbitrary member\n");
@@ -2417,7 +2429,7 @@ bool getDefs(const QCString &scName,
//if (mmd->isLinkable())
//{
const ClassDef *mcd=mmd->getClassDef();
- //printf(" >Class %s found\n",mcd->name().data());
+ //printf(" >Class %s found\n",qPrint(mcd->name()));
if (mcd)
{
int m=minClassDistance(fcd,mcd);
@@ -2488,9 +2500,9 @@ bool getDefs(const QCString &scName,
//printf("Global symbol\n");
const MemberDef *fuzzy_mmd = 0;
std::unique_ptr<ArgumentList> argList;
- bool hasEmptyArgs = args && qstrcmp(args, "()") == 0;
+ bool hasEmptyArgs = args=="()";
- if (args)
+ if (!args.isEmpty())
{
argList = stringToArgumentList(SrcLangExt_Cpp, args);
}
@@ -2504,7 +2516,7 @@ bool getDefs(const QCString &scName,
continue;
}
- if (!args)
+ if (args.isEmpty())
{
fuzzy_mmd = mmd;
break;
@@ -2538,7 +2550,7 @@ bool getDefs(const QCString &scName,
// maybe an namespace, file or group member ?
//printf("Testing for global symbol scopeName='%s' mScope='%s' :: mName='%s'\n",
- // scopeName.data(),mScope.data(),mName.data());
+ // qPrint(scopeName), qPrint(mScope), qPrint(mName));
if ((mn=Doxygen::functionNameLinkedMap->find(mName))) // name is known
{
//printf(" >symbol name found\n");
@@ -2553,16 +2565,16 @@ bool getDefs(const QCString &scName,
}
else if (!mScope.isEmpty())
{
- namespaceName=mScope.copy();
+ namespaceName=mScope;
}
- //printf("Trying namespace %s\n",namespaceName.data());
+ //printf("Trying namespace %s\n",qPrint(namespaceName));
if (!namespaceName.isEmpty() &&
(fnd=Doxygen::namespaceLinkedMap->find(namespaceName)) &&
fnd->isLinkable()
)
{
//printf("Symbol inside existing namespace '%s' count=%d\n",
- // namespaceName.data(),mn->count());
+ // qPrint(namespaceName),mn->count());
bool found=FALSE;
for (const auto &mmd_p : *mn)
{
@@ -2572,7 +2584,7 @@ bool getDefs(const QCString &scName,
const MemberDef *emd = mmd->getEnumScope();
if (emd && emd->isStrong())
{
- //printf("yes match %s<->%s!\n",mScope.data(),emd->localName().data());
+ //printf("yes match %s<->%s!\n",qPrint(mScope),qPrint(emd->localName()));
if (emd->getNamespaceDef()==fnd &&
rightScopeMatch(mScope,emd->localName()))
{
@@ -2592,7 +2604,7 @@ bool getDefs(const QCString &scName,
else if (mmd->getOuterScope()==fnd /* && mmd->isLinkable() */ )
{ // namespace is found
bool match=TRUE;
- if (args && qstrcmp(args,"()")!=0)
+ if (!args.isEmpty() && args!="()")
{
const ArgumentList &mmdAl = mmd->argumentList();
auto argList_p = stringToArgumentList(mmd->getLanguage(),args);
@@ -2610,7 +2622,7 @@ bool getDefs(const QCString &scName,
}
}
}
- if (!found && args && !qstrcmp(args,"()"))
+ if (!found && args=="()")
// no exact match found, but if args="()" an arbitrary
// member will do
{
@@ -2649,9 +2661,9 @@ bool getDefs(const QCString &scName,
{
const MemberDef *mmd = mmd_p.get();
const MemberDef *tmd = mmd->getEnumScope();
- //printf("try member %s tmd=%s\n",mmd->name().data(),tmd?tmd->name().data():"<none>");
+ //printf("try member %s tmd=%s\n",qPrint(mmd->name()),tmd ? qPrint(tmd->name()) : "<none>");
int ni=namespaceName.findRev("::");
- //printf("namespaceName=%s ni=%d\n",namespaceName.data(),ni);
+ //printf("namespaceName=%s ni=%d\n",qPrint(namespaceName),ni);
bool notInNS = tmd && ni==-1 && tmd->getNamespaceDef()==0 && (mScope.isEmpty() || mScope==tmd->name());
bool sameNS = tmd && tmd->getNamespaceDef() && namespaceName.left(ni)==tmd->getNamespaceDef()->name() && namespaceName.mid(ni+2)==tmd->name();
//printf("notInNS=%d sameNS=%d\n",notInNS,sameNS);
@@ -2665,7 +2677,7 @@ bool getDefs(const QCString &scName,
gd=mmd->getGroupDef();
if (gd && gd->isLinkable()) fd=0; else gd=0;
//printf("Found scoped enum %s fd=%p gd=%p\n",
- // mmd->name().data(),fd,gd);
+ // qPrint(mmd->name()),fd,gd);
return TRUE;
}
}
@@ -2691,7 +2703,7 @@ bool getDefs(const QCString &scName,
findMembersWithSpecificName(mn,args,FALSE,currentFile,checkCV,members);
}
//printf("found %d members\n",members.count());
- if (members.size()!=1 && args && !qstrcmp(args,"()"))
+ if (members.size()!=1 && args=="()")
{
// no exact match found, but if args="()" an arbitrary
// member will do
@@ -2701,8 +2713,8 @@ bool getDefs(const QCString &scName,
{
const auto &mmd_p = *it;
const MemberDef *mmd = mmd_p.get();
- //printf("Found member '%s'\n",mmd->name().data());
- //printf("member is linkable mmd->name()='%s'\n",mmd->name().data());
+ //printf("Found member '%s'\n",qPrint(mmd->name()));
+ //printf("member is linkable mmd->name()='%s'\n",qPrint(mmd->name()));
fd=mmd->getFileDef();
gd=mmd->getGroupDef();
const MemberDef *tmd = mmd->getEnumScope();
@@ -2720,7 +2732,7 @@ bool getDefs(const QCString &scName,
{
if (currentFile)
{
- //printf("multiple results; pick one from file:%s\n", currentFile->name().data());
+ //printf("multiple results; pick one from file:%s\n",qPrint( currentFile->name()));
for (const auto &rmd : members)
{
if (rmd->getFileDef() && rmd->getFileDef()->name() == currentFile->name())
@@ -2769,7 +2781,7 @@ bool getDefs(const QCString &scName,
* - if `cd` is non zero, the scope was a class pointed to by cd.
* - if `nd` is non zero, the scope was a namespace pointed to by nd.
*/
-static bool getScopeDefs(const char *docScope,const char *scope,
+static bool getScopeDefs(const QCString &docScope,const QCString &scope,
ClassDef *&cd, NamespaceDef *&nd)
{
cd=0;nd=0;
@@ -2794,7 +2806,7 @@ static bool getScopeDefs(const char *docScope,const char *scope,
do // for each possible docScope (from largest to and including empty)
{
- QCString fullName=scopeName.copy();
+ QCString fullName=scopeName;
if (scopeOffset>0) fullName.prepend(docScopeName.left(scopeOffset)+"::");
if (((cd=getClass(fullName)) || // normal class
@@ -2823,18 +2835,18 @@ static bool getScopeDefs(const char *docScope,const char *scope,
static bool isLowerCase(QCString &s)
{
+ if (s.isEmpty()) return true;
uchar *p=(uchar*)s.data();
- if (p==0) return TRUE;
int c;
- while ((c=*p++)) if (!islower(c)) return FALSE;
- return TRUE;
+ while ((c=*p++)) if (!islower(c)) return false;
+ return true;
}
/*! Returns an object to reference to given its name and context
* @post return value TRUE implies *resContext!=0 or *resMember!=0
*/
-bool resolveRef(/* in */ const char *scName,
- /* in */ const char *name,
+bool resolveRef(/* in */ const QCString &scName,
+ /* in */ const QCString &name,
/* in */ bool inSeeBlock,
/* out */ const Definition **resContext,
/* out */ const MemberDef **resMember,
@@ -2843,7 +2855,7 @@ bool resolveRef(/* in */ const char *scName,
bool checkScope
)
{
- //printf("resolveRef(scope=%s,name=%s,inSeeBlock=%d)\n",scName,name,inSeeBlock);
+ //printf("resolveRef(scope=%s,name=%s,inSeeBlock=%d)\n",qPrint(scName),qPrint(name),inSeeBlock);
QCString tsName = name;
//bool memberScopeFirst = tsName.find('#')!=-1;
QCString fullName = substitute(tsName,"#","::");
@@ -2881,7 +2893,7 @@ bool resolveRef(/* in */ const char *scName,
return FALSE;
}
- //printf("scName=%s fullName=%s\n",scName,fullName.data());
+ //printf("scName=%s fullName=%s\n",scName,qPrint(fullName));
// check if this is a class or namespace reference
if (scName!=fullName && getScopeDefs(scName,fullName,cd,nd))
@@ -2902,7 +2914,7 @@ bool resolveRef(/* in */ const char *scName,
{
//printf("found scName=%s fullName=%s scName==fullName=%d "
// "inSeeBlock=%d scopePos=%d!\n",
- // scName,fullName.data(),scName==fullName,inSeeBlock,scopePos);
+ // scName,qPrint(fullName),scName==fullName,inSeeBlock,scopePos);
return FALSE;
}
// continue search...
@@ -2943,10 +2955,11 @@ bool resolveRef(/* in */ const char *scName,
const FileDef *fd = 0;
const NamespaceDef *nd = 0;
const GroupDef *gd = 0;
+ const ConceptDef *cnd = 0;
// check if nameStr is a member or global.
//printf("getDefs(scope=%s,name=%s,args=%s checkScope=%d)\n",
- // scopeStr.data(),nameStr.data(),argsStr.data(),checkScope);
+ // qPrint(scopeStr), qPrint(nameStr), qPrint(argsStr),checkScope);
if (getDefs(scopeStr,nameStr,argsStr,
md,cd,fd,nd,gd,
//scopePos==0 && !memberScopeFirst, // forceEmptyScope
@@ -2956,7 +2969,7 @@ bool resolveRef(/* in */ const char *scName,
)
)
{
- //printf("after getDefs checkScope=%d nameStr=%s cd=%p nd=%p\n",checkScope,nameStr.data(),cd,nd);
+ //printf("after getDefs checkScope=%d nameStr=%s cd=%p nd=%p\n",checkScope,qPrint(nameStr),cd,nd);
if (checkScope && md && md->getOuterScope()==Doxygen::globalScope &&
!md->isStrongEnumValue() &&
(!scopeStr.isEmpty() || nameStr.find("::")>0))
@@ -2977,7 +2990,7 @@ bool resolveRef(/* in */ const char *scName,
else if (gd) *resContext=gd;
else { *resContext=0; *resMember=0; return FALSE; }
//printf("member=%s (md=%p) anchor=%s linkable()=%d context=%s\n",
- // md->name().data(),md,md->anchor().data(),md->isLinkable(),(*resContext)->name().data());
+ // qPrint(md->name()), md, qPrint(md->anchor()), md->isLinkable(), qPrint((*resContext)->name()));
return TRUE;
}
else if (inSeeBlock && !nameStr.isEmpty() && (gd=Doxygen::groupLinkedMap->find(nameStr)))
@@ -2985,6 +2998,11 @@ bool resolveRef(/* in */ const char *scName,
*resContext=gd;
return TRUE;
}
+ else if ((cnd=Doxygen::conceptLinkedMap->find(nameStr)))
+ {
+ *resContext=cnd;
+ return TRUE;
+ }
else if (tsName.find('.')!=-1) // maybe a link to a file
{
bool ambig;
@@ -3013,7 +3031,7 @@ bool resolveRef(/* in */ const char *scName,
return FALSE;
}
-QCString linkToText(SrcLangExt lang,const char *link,bool isFileName)
+QCString linkToText(SrcLangExt lang,const QCString &link,bool isFileName)
{
//static bool optimizeOutputJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
QCString result=link;
@@ -3107,8 +3125,8 @@ bool generateRef(OutputDocInterface &od,const char *scName,
}
#endif
-bool resolveLink(/* in */ const char *scName,
- /* in */ const char *lr,
+bool resolveLink(/* in */ const QCString &scName,
+ /* in */ const QCString &lr,
/* in */ bool /*inSeeBlock*/,
/* out */ const Definition **resContext,
/* out */ QCString &resAnchor
@@ -3118,12 +3136,13 @@ bool resolveLink(/* in */ const char *scName,
QCString linkRef=lr;
QCString linkRefWithoutTemplates = stripTemplateSpecifiersFromScope(linkRef,FALSE);
- //printf("ResolveLink linkRef=%s\n",lr);
+ //printf("ResolveLink linkRef=%s\n",qPrint(lr));
const FileDef *fd;
const GroupDef *gd;
const PageDef *pd;
const ClassDef *cd;
const DirDef *dir;
+ const ConceptDef *cnd;
const NamespaceDef *nd;
const SectionInfo *si=0;
bool ambig;
@@ -3186,18 +3205,18 @@ bool resolveLink(/* in */ const char *scName,
resAnchor=cd->anchor();
return TRUE;
}
-// else if ((cd=getClass(linkRef+"-g"))) // C# generic link
-// {
-// *resContext=cd;
-// resAnchor=cd->anchor();
-// return TRUE;
-// }
+ else if ((cnd=getConcept(linkRef))) // C++20 concept definition
+ {
+ *resContext=cnd;
+ resAnchor=cnd->anchor();
+ return TRUE;
+ }
else if ((nd=Doxygen::namespaceLinkedMap->find(linkRef)))
{
*resContext=nd;
return TRUE;
}
- else if ((dir=Doxygen::dirLinkedMap->find(QFileInfo(linkRef).absFilePath().utf8()+"/"))
+ else if ((dir=Doxygen::dirLinkedMap->find(FileInfo(linkRef.str()).absFilePath()+"/"))
&& dir->isLinkable()) // TODO: make this location independent like filedefs
{
*resContext=dir;
@@ -3220,19 +3239,19 @@ bool resolveLink(/* in */ const char *scName,
// basis for the link's text.
// returns TRUE if a link could be generated.
-bool generateLink(OutputDocInterface &od,const char *clName,
- const char *lr,bool inSeeBlock,const char *lt)
+bool generateLink(OutputDocInterface &od,const QCString &clName,
+ const QCString &lr,bool inSeeBlock,const QCString &lt)
{
//printf("generateLink(clName=%s,lr=%s,lr=%s)\n",clName,lr,lt);
const Definition *compound = 0;
//PageDef *pageDef=0;
QCString anchor,linkText=linkToText(SrcLangExt_Unknown,lt,FALSE);
- //printf("generateLink linkText=%s\n",linkText.data());
+ //printf("generateLink linkText=%s\n",qPrint(linkText));
if (resolveLink(clName,lr,inSeeBlock,&compound,anchor))
{
if (compound) // link to compound
{
- if (lt==0 && anchor.isEmpty() && /* compound link */
+ if (lt.isEmpty() && anchor.isEmpty() && /* compound link */
compound->definitionType()==Definition::TypeGroup /* is group */
)
{
@@ -3262,17 +3281,17 @@ bool generateLink(OutputDocInterface &od,const char *clName,
}
}
-void generateFileRef(OutputDocInterface &od,const char *name,const char *text)
+void generateFileRef(OutputDocInterface &od,const QCString &name,const QCString &text)
{
//printf("generateFileRef(%s,%s)\n",name,text);
- QCString linkText = text ? text : name;
+ QCString linkText = text.isEmpty() ? text : name;
//FileInfo *fi;
FileDef *fd;
bool ambig;
if ((fd=findFileDef(Doxygen::inputNameLinkedMap,name,ambig)) &&
fd->isLinkable())
// link to documented input file
- od.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,linkText);
+ od.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),linkText);
else
od.docify(linkText);
}
@@ -3291,10 +3310,10 @@ static Cache<std::string,FindFileCacheElem> g_findFileDefCache(5000);
static std::mutex g_findFileDefMutex;
-FileDef *findFileDef(const FileNameLinkedMap *fnMap,const char *n,bool &ambig)
+FileDef *findFileDef(const FileNameLinkedMap *fnMap,const QCString &n,bool &ambig)
{
ambig=FALSE;
- if (n==0) return 0;
+ if (n.isEmpty()) return 0;
std::lock_guard<std::mutex> lock(g_findFileDefMutex);
@@ -3305,7 +3324,7 @@ FileDef *findFileDef(const FileNameLinkedMap *fnMap,const char *n,bool &ambig)
key+=n;
FindFileCacheElem *cachedResult = g_findFileDefCache.find(key.str());
- //printf("key=%s cachedResult=%p\n",key.data(),cachedResult);
+ //printf("key=%s cachedResult=%p\n",qPrint(key),cachedResult);
if (cachedResult)
{
ambig = cachedResult->isAmbig;
@@ -3317,22 +3336,21 @@ FileDef *findFileDef(const FileNameLinkedMap *fnMap,const char *n,bool &ambig)
cachedResult = g_findFileDefCache.insert(key.str(),FindFileCacheElem(0,FALSE));
}
- QCString name=QDir::cleanDirPath(n).utf8();
+ QCString name=Dir::cleanDirPath(n.str());
QCString path;
int slashPos;
const FileName *fn;
if (name.isEmpty()) goto exit;
- slashPos=QMAX(name.findRev('/'),name.findRev('\\'));
+ slashPos=std::max(name.findRev('/'),name.findRev('\\'));
if (slashPos!=-1)
{
path=name.left(slashPos+1);
name=name.right(name.length()-slashPos-1);
- //printf("path=%s name=%s\n",path.data(),name.data());
}
if (name.isEmpty()) goto exit;
if ((fn=fnMap->find(name)))
{
- //printf("fn->count()=%d\n",fn->count());
+ //printf("fn->size()=%zu\n",fn->size());
if (fn->size()==1)
{
const std::unique_ptr<FileDef> &fd = fn->front();
@@ -3378,12 +3396,12 @@ exit:
//----------------------------------------------------------------------
-QCString showFileDefMatches(const FileNameLinkedMap *fnMap,const char *n)
+QCString showFileDefMatches(const FileNameLinkedMap *fnMap,const QCString &n)
{
QCString result;
QCString name=n;
QCString path;
- int slashPos=QMAX(name.findRev('/'),name.findRev('\\'));
+ int slashPos=std::max(name.findRev('/'),name.findRev('\\'));
if (slashPos!=-1)
{
path=name.left(slashPos+1);
@@ -3405,11 +3423,11 @@ QCString showFileDefMatches(const FileNameLinkedMap *fnMap,const char *n)
//----------------------------------------------------------------------
-QCString substituteKeywords(const QCString &s,const char *title,
- const char *projName,const char *projNum,const char *projBrief)
+QCString substituteKeywords(const QCString &s,const QCString &title,
+ const QCString &projName,const QCString &projNum,const QCString &projBrief)
{
QCString result = s;
- if (title) result = substitute(result,"$title",title);
+ if (!title.isEmpty()) result = substitute(result,"$title",title);
result = substitute(result,"$datetime",dateToString(TRUE));
result = substitute(result,"$date",dateToString(FALSE));
result = substitute(result,"$year",yearToString());
@@ -3487,6 +3505,7 @@ bool hasVisibleRoot(const BaseClassList &bcl)
//----------------------------------------------------------------------
+#if 0
// copies the next UTF8 character from input stream into buffer ids
// returns the size of the character in bytes (or 0 if it is invalid)
// the character itself will be copied as a UTF-8 encoded string to ids.
@@ -3546,17 +3565,17 @@ int getUtf8Char(const char *input,char ids[MAX_UTF8_CHAR_SIZE],CaseModifier modi
}
return inputLen;
}
-
+#endif
// note that this function is not reentrant due to the use of static growBuf!
-QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscore)
+QCString escapeCharsInString(const QCString &name,bool allowDots,bool allowUnderscore)
{
+ if (name.isEmpty()) return name;
bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES);
bool allowUnicodeNames = Config_getBool(ALLOW_UNICODE_NAMES);
- if (name==0) return "";
GrowBuf growBuf;
signed char c;
- const char *p=name;
+ const char *p=name.data();
while ((c=*p++)!=0)
{
switch(c)
@@ -3592,20 +3611,20 @@ QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscor
default:
if (c<0)
{
- char ids[MAX_UTF8_CHAR_SIZE];
bool doEscape = true;
if (allowUnicodeNames)
{
- int charLen = getUtf8Char(p-1,ids);
+ int charLen = getUTF8CharNumBytes(c);
if (charLen>0)
{
- growBuf.addStr(ids);
- p+=charLen-1;
+ growBuf.addStr(p-1,charLen);
+ p+=charLen;
doEscape = false;
}
}
if (doEscape) // not a valid unicode char or escaping needed
{
+ char ids[5];
unsigned char id = (unsigned char)c;
ids[0]='_';
ids[1]='x';
@@ -3631,11 +3650,12 @@ QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscor
return growBuf.get();
}
-QCString unescapeCharsInString(const char *s)
+QCString unescapeCharsInString(const QCString &s)
{
- static bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES);
+ if (s.isEmpty()) return s;
+ bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES);
QCString result;
- const char *p = s;
+ const char *p = s.data();
if (p)
{
char c;
@@ -3710,16 +3730,16 @@ static int g_usedNamesCount=1;
* given its name, which could be a class name with template
* arguments, so special characters need to be escaped.
*/
-QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore)
+QCString convertNameToFile(const QCString &name,bool allowDots,bool allowUnderscore)
{
- if (name==0 || name[0]=='\0') return "";
+ if (name.isEmpty()) return name;
static bool shortNames = Config_getBool(SHORT_NAMES);
static bool createSubdirs = Config_getBool(CREATE_SUBDIRS);
QCString result;
if (shortNames) // use short names only
{
std::lock_guard<std::mutex> lock(g_usedNamesMutex);
- auto kv = g_usedNames.find(name);
+ auto kv = g_usedNames.find(name.str());
uint num=0;
if (kv!=g_usedNames.end())
{
@@ -3728,7 +3748,7 @@ QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore)
else
{
num = g_usedNamesCount;
- g_usedNames.insert(std::make_pair(name,g_usedNamesCount++));
+ g_usedNames.insert(std::make_pair(name.str(),g_usedNamesCount++));
}
result.sprintf("a%05d",num);
}
@@ -3758,23 +3778,22 @@ QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore)
result.prepend(QCString().sprintf("d%x/d%02x/",l1Dir,l2Dir));
}
- //printf("*** convertNameToFile(%s)->%s\n",name,result.data());
+ //printf("*** convertNameToFile(%s)->%s\n",name,qPrint(result));
return result;
}
-QCString relativePathToRoot(const char *name)
+QCString relativePathToRoot(const QCString &name)
{
QCString result;
if (Config_getBool(CREATE_SUBDIRS))
{
- if (name==0)
+ if (name.isEmpty())
{
return REL_PATH_TO_ROOT;
}
else
{
- QCString n = name;
- int i = n.findRev('/');
+ int i = name.findRev('/');
if (i!=-1)
{
result=REL_PATH_TO_ROOT;
@@ -3784,7 +3803,7 @@ QCString relativePathToRoot(const char *name)
return result;
}
-void createSubDirs(QDir &d)
+void createSubDirs(const Dir &d)
{
if (Config_getBool(CREATE_SUBDIRS))
{
@@ -3794,17 +3813,17 @@ void createSubDirs(QDir &d)
{
QCString subdir;
subdir.sprintf("d%x",l1);
- if (!d.exists(subdir) && !d.mkdir(subdir))
+ if (!d.exists(subdir.str()) && !d.mkdir(subdir.str()))
{
- term("Failed to create output directory '%s'\n",subdir.data());
+ term("Failed to create output directory '%s'\n",qPrint(subdir));
}
for (l2=0;l2<256;l2++)
{
QCString subsubdir;
subsubdir.sprintf("d%x/d%02x",l1,l2);
- if (!d.exists(subsubdir) && !d.mkdir(subsubdir))
+ if (!d.exists(subsubdir.str()) && !d.mkdir(subsubdir.str()))
{
- term("Failed to create output directory '%s'\n",subsubdir.data());
+ term("Failed to create output directory '%s'\n",qPrint(subsubdir));
}
}
}
@@ -3823,7 +3842,7 @@ void extractNamespaceName(const QCString &scopeName,
NamespaceDef *nd = 0;
if (!clName.isEmpty() && (nd=getResolvedNamespace(clName)) && getClass(clName)==0)
{ // the whole name is a namespace (and not a class)
- namespaceName=nd->name().copy();
+ namespaceName=nd->name();
className.resize(0);
goto done;
}
@@ -3831,11 +3850,11 @@ void extractNamespaceName(const QCString &scopeName,
while (p>=0 && (i=clName.findRev("::",p))!=-1)
// see if the first part is a namespace (and not a class)
{
- //printf("Trying %s\n",clName.left(i).data());
+ //printf("Trying %s\n",qPrint(clName.left(i)));
if (i>0 && (nd=getResolvedNamespace(clName.left(i))) && getClass(clName.left(i))==0)
{
//printf("found!\n");
- namespaceName=nd->name().copy();
+ namespaceName=nd->name();
className=clName.right(clName.length()-i-2);
goto done;
}
@@ -3844,18 +3863,18 @@ void extractNamespaceName(const QCString &scopeName,
//printf("not found!\n");
// not found, so we just have to guess.
- className=scopeName.copy();
+ className=scopeName;
namespaceName.resize(0);
done:
if (className.isEmpty() && !namespaceName.isEmpty() && !allowEmptyClass)
{
// class and namespace with the same name, correct to return the class.
- className=namespaceName.copy();
+ className=namespaceName;
namespaceName.resize(0);
}
- //printf("extractNamespace '%s' => '%s|%s'\n",scopeName.data(),
- // className.data(),namespaceName.data());
+ //printf("extractNamespace '%s' => '%s|%s'\n",qPrint(scopeName),
+ // qPrint(className),qPrint(namespaceName));
if (/*className.right(2)=="-g" ||*/ className.right(2)=="-p")
{
className = className.left(className.length()-2);
@@ -3865,7 +3884,7 @@ done:
QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &templ)
{
- QCString result=scope.copy();
+ QCString result=scope;
if (!templ.isEmpty() && scope.find('<')==-1)
{
int si,pi=0;
@@ -3875,7 +3894,7 @@ QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &te
((cd=getClass(scope.left(si)))==0 || cd->templateArguments().empty())
)
{
- //printf("Tried '%s'\n",(scope.left(si)+templ).data());
+ //printf("Tried '%s'\n",qPrint((scope.left(si)+templ)));
pi=si+2;
}
if (si==-1) // not nested => append template specifier
@@ -3888,7 +3907,7 @@ QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &te
}
}
//printf("insertTemplateSpecifierInScope('%s','%s')=%s\n",
- // scope.data(),templ.data(),result.data());
+ // qPrint(scope),qPrint(templ),qPrint(result));
return result;
}
@@ -3896,7 +3915,7 @@ QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &te
/*! Strips the scope from a name. Examples: A::B will return A
* and A<T>::B<N::C<D> > will return A<T>.
*/
-QCString stripScope(const char *name)
+QCString stripScope(const QCString &name)
{
QCString result = name;
int l=result.length();
@@ -3916,7 +3935,7 @@ QCString stripScope(const char *name)
{
case ':':
// only exit in the case of ::
- //printf("stripScope(%s)=%s\n",name,result.right(l-p-1).data());
+ //printf("stripScope(%s)=%s\n",name,qPrint(result.right(l-p-1)));
if (p>0 && result.at(p-1)==':' && (count==0 || skipBracket))
{
return result.right(l-p-1);
@@ -3989,11 +4008,11 @@ QCString stripScope(const char *name)
}
/*! Converts a string to a HTML id string */
-QCString convertToId(const char *s)
+QCString convertToId(const QCString &s)
{
- if (s==0) return "";
+ if (s.isEmpty()) return s;
GrowBuf growBuf;
- const char *p=s;
+ const char *p=s.data();
char c;
bool first=TRUE;
while ((c=*p++))
@@ -4022,18 +4041,18 @@ QCString convertToId(const char *s)
* that an id cannot have a digit at the first position. To overcome problems
* with double labels we always place an "a" in front
*/
-QCString correctId(QCString s)
+QCString correctId(const QCString &s)
{
if (s.isEmpty()) return s;
return "a" + s;
}
/*! Converts a string to an XML-encoded string */
-QCString convertToXML(const char *s, bool keepEntities)
+QCString convertToXML(const QCString &s, bool keepEntities)
{
- if (s==0) return "";
+ if (s.isEmpty()) return s;
GrowBuf growBuf;
- const char *p=s;
+ const char *p=s.data();
char c;
while ((c=*p++))
{
@@ -4080,13 +4099,13 @@ QCString convertToXML(const char *s, bool keepEntities)
}
/*! Converts a string to an DocBook-encoded string */
-QCString convertToDocBook(const char *s)
+QCString convertToDocBook(const QCString &s)
{
- if (s==0) return "";
+ if (s.isEmpty()) return s;
GrowBuf growBuf;
const unsigned char *q;
int cnt;
- const unsigned char *p=(const unsigned char *)s;
+ const unsigned char *p=(const unsigned char *)s.data();
char c;
while ((c=*p++))
{
@@ -4144,11 +4163,11 @@ QCString convertToDocBook(const char *s)
}
/*! Converts a string to a HTML-encoded string */
-QCString convertToHtml(const char *s,bool keepEntities)
+QCString convertToHtml(const QCString &s,bool keepEntities)
{
- if (s==0) return "";
+ if (s.isEmpty()) return s;
GrowBuf growBuf;
- const char *p=s;
+ const char *p=s.data();
char c;
while ((c=*p++))
{
@@ -4204,11 +4223,11 @@ QCString convertToHtml(const char *s,bool keepEntities)
return growBuf.get();
}
-QCString convertToJSString(const char *s)
+QCString convertToJSString(const QCString &s)
{
- if (s==0) return "";
+ if (s.isEmpty()) return s;
GrowBuf growBuf;
- const char *p=s;
+ const char *p=s.data();
char c;
while ((c=*p++))
{
@@ -4223,11 +4242,11 @@ QCString convertToJSString(const char *s)
return convertCharEntitiesToUTF8(growBuf.get());
}
-QCString convertToPSString(const char *s)
+QCString convertToPSString(const QCString &s)
{
- if (s==0) return "";
+ if (s.isEmpty()) return s;
GrowBuf growBuf;
- const char *p=s;
+ const char *p=s.data();
char c;
while ((c=*p++))
{
@@ -4244,19 +4263,18 @@ QCString convertToPSString(const char *s)
QCString convertToLaTeX(const QCString &s,bool insideTabbing,bool keepSpaces)
{
- QGString result;
- FTextStream t(&result);
+ TextStream t;
filterLatexString(t,s,insideTabbing,false,false,false,keepSpaces);
- return result.data();
+ return t.str();
}
-QCString convertCharEntitiesToUTF8(const char *str)
+QCString convertCharEntitiesToUTF8(const QCString &str)
{
- if (str==0) return QCString();
+ if (str.isEmpty()) return QCString();
- std::string s = str;
+ std::string s = str.data();
static const reg::Ex re(R"(&\a\w*;)");
reg::Iterator it(s,re);
reg::Iterator end;
@@ -4272,7 +4290,7 @@ QCString convertCharEntitiesToUTF8(const char *str)
{
growBuf.addStr(s.substr(i,p-i));
}
- std::string entity = match.str();
+ QCString entity(match.str());
DocSymbol::SymType symType = HtmlEntityMapper::instance()->name2sym(entity);
const char *code=0;
if (symType!=DocSymbol::Sym_Unknown && (code=HtmlEntityMapper::instance()->utf8(symType)))
@@ -4287,7 +4305,7 @@ QCString convertCharEntitiesToUTF8(const char *str)
}
growBuf.addStr(s.substr(i));
growBuf.addChar(0);
- //printf("convertCharEntitiesToUTF8(%s)->%s\n",s.data(),growBuf.get());
+ //printf("convertCharEntitiesToUTF8(%s)->%s\n",qPrint(s),growBuf.get());
return growBuf.get();
}
@@ -4307,7 +4325,7 @@ void addMembersToMemberGroup(MemberList *ml,
const Definition *context)
{
ASSERT(context!=0);
- //printf("addMemberToMemberGroup() context=%s\n",context->name().data());
+ //printf("addMemberToMemberGroup() context=%s\n",qPrint(context->name()));
if (ml==0) return;
struct MoveMemberInfo
@@ -4418,7 +4436,7 @@ void addMembersToMemberGroup(MemberList *ml,
* class \a name and a template argument list \a templSpec. If -1 is returned
* there are no more matches.
*/
-int extractClassNameFromType(const char *type,int &pos,QCString &name,QCString &templSpec,SrcLangExt lang)
+int extractClassNameFromType(const QCString &type,int &pos,QCString &name,QCString &templSpec,SrcLangExt lang)
{
static reg::Ex re_norm(R"(\a[\w:]*)");
static reg::Ex re_fortran(R"(\a[\w:()=]*)");
@@ -4426,8 +4444,8 @@ int extractClassNameFromType(const char *type,int &pos,QCString &name,QCString &
name.resize(0);
templSpec.resize(0);
- if (type==0) return -1;
- int typeLen=qstrlen(type);
+ if (type.isEmpty()) return -1;
+ int typeLen=(int)type.length();
if (typeLen>0)
{
if (lang == SrcLangExt_Fortran)
@@ -4438,7 +4456,7 @@ int extractClassNameFromType(const char *type,int &pos,QCString &name,QCString &
re = &re_fortran;
}
}
- std::string s = type;
+ std::string s = type.str();
reg::Iterator it(s,*re,(int)pos);
reg::Iterator end;
@@ -4482,13 +4500,13 @@ int extractClassNameFromType(const char *type,int &pos,QCString &name,QCString &
pos=i+l;
}
//printf("extractClassNameFromType([in] type=%s,[out] pos=%d,[out] name=%s,[out] templ=%s)=TRUE i=%d\n",
- // type,pos,name.data(),templSpec.data(),i);
+ // type,pos,qPrint(name),qPrint(templSpec),i);
return i;
}
}
pos = typeLen;
//printf("extractClassNameFromType([in] type=%s,[out] pos=%d,[out] name=%s,[out] templ=%s)=FALSE\n",
- // type,pos,name.data(),templSpec.data());
+ // type,pos,qPrint(name),qPrint(templSpec));
return -1;
}
@@ -4515,7 +4533,7 @@ QCString normalizeNonTemplateArgumentsInString(
size_t i = match.position();
size_t l = match.length();
result += s.substr(pi,i-pi);
- std::string n = match.str();
+ QCString n(match.str());
bool found=FALSE;
for (const Argument &formArg : formalArgs)
{
@@ -4529,7 +4547,7 @@ QCString normalizeNonTemplateArgumentsInString(
{
// try to resolve the type
SymbolResolver resolver;
- const ClassDef *cd = resolver.resolveClass(context,n.c_str());
+ const ClassDef *cd = resolver.resolveClass(context,n);
if (cd)
{
result+=cd->name();
@@ -4546,7 +4564,7 @@ QCString normalizeNonTemplateArgumentsInString(
pi=i+l;
}
result+=s.substr(pi);
- //printf("normalizeNonTemplateArgumentInString(%s)=%s\n",name.data(),result.data());
+ //printf("normalizeNonTemplateArgumentInString(%s)=%s\n",qPrint(name),qPrint(result));
return removeRedundantWhiteSpace(result);
}
@@ -4558,16 +4576,17 @@ QCString normalizeNonTemplateArgumentsInString(
* prevent recursive substitution.
*/
QCString substituteTemplateArgumentsInString(
- const std::string &name,
+ const QCString &nm,
const ArgumentList &formalArgs,
const std::unique_ptr<ArgumentList> &actualArgs)
{
//printf("substituteTemplateArgumentsInString(name=%s formal=%s actualArg=%s)\n",
- // name.data(),argListToString(formalArgs).data(),argListToString(actualArgs).data());
- if (formalArgs.empty()) return name;
- std::string result;
+ // qPrint(name),qPrint(argListToString(formalArgs)),qPrint(argListToString(actualArgs)));
+ if (formalArgs.empty()) return nm;
+ QCString result;
static const reg::Ex re(R"(\a[\w:]*)");
+ std::string name = nm.str();
reg::Iterator it(name,re);
reg::Iterator end;
size_t p=0;
@@ -4578,7 +4597,7 @@ QCString substituteTemplateArgumentsInString(
size_t i = match.position();
size_t l = match.length();
if (i>p) result += name.substr(p,i-p);
- std::string n = match.str();
+ QCString n(match.str());
ArgumentList::iterator actIt;
if (actualArgs)
{
@@ -4612,9 +4631,9 @@ QCString substituteTemplateArgumentsInString(
if (formArg.type=="class" || formArg.type=="typename" || formArg.type.left(8)=="template")
{
//printf("n=%s formArg->type='%s' formArg->name='%s' formArg->defval='%s'\n",
- // n.data(),formArg->type.data(),formArg->name.data(),formArg->defval.data());
+ // qPrint(n),qPrint(formArg->type),qPrint(formArg->name),qPrint(formArg->defval));
//printf(">> n='%s' formArg->name='%s' actArg->type='%s' actArg->name='%s'\n",
- // n.data(),formArg.name.data(),actIt!=actualArgs.end() ? actIt->type.data() : "",actIt!=actualArgs.end() ? actIt->name.data() : ""
+ // qPrint(n),qPrint(formArg.name),actIt!=actualArgs.end() ? qPrint(actIt->type) : "",actIt!=actualArgs.end() ? qPrint(actIt->name) : ""
// );
if (formArg.name==n && actualArgs && actIt!=actualArgs->end() && !actArg.type.isEmpty()) // base class is a template argument
{
@@ -4643,20 +4662,20 @@ QCString substituteTemplateArgumentsInString(
else if (formArg.name==n &&
(actualArgs==nullptr || actIt==actualArgs->end()) &&
!formArg.defval.isEmpty() &&
- formArg.defval!=name /* to prevent recursion */
+ formArg.defval!=nm /* to prevent recursion */
)
{
- result += substituteTemplateArgumentsInString(formArg.defval.str(),formalArgs,actualArgs)+" ";
+ result += substituteTemplateArgumentsInString(formArg.defval,formalArgs,actualArgs)+" ";
found=TRUE;
}
}
else if (formArg.name==n &&
(actualArgs==nullptr || actIt==actualArgs->end()) &&
!formArg.defval.isEmpty() &&
- formArg.defval!=name /* to prevent recursion */
+ formArg.defval!=nm /* to prevent recursion */
)
{
- result += substituteTemplateArgumentsInString(formArg.defval.str(),formalArgs,actualArgs)+" ";
+ result += substituteTemplateArgumentsInString(formArg.defval,formalArgs,actualArgs)+" ";
found=TRUE;
}
if (actualArgs && actIt!=actualArgs->end())
@@ -4672,8 +4691,8 @@ QCString substituteTemplateArgumentsInString(
}
result+=name.substr(p);
//printf(" Inheritance relation %s -> %s\n",
- // name.data(),result.data());
- return QCString(result).stripWhiteSpace();
+ // qPrint(name),qPrint(result));
+ return result.stripWhiteSpace();
}
@@ -4695,7 +4714,7 @@ QCString stripTemplateSpecifiersFromScope(const QCString &fullName,
int l=fullName.length();
while (i!=-1)
{
- //printf("1:result+=%s\n",fullName.mid(p,i-p).data());
+ //printf("1:result+=%s\n",qPrint(fullName.mid(p,i-p)));
int e=i+1;
int count=1;
int round=0;
@@ -4718,22 +4737,22 @@ QCString stripTemplateSpecifiersFromScope(const QCString &fullName,
// we only do the parent scope, so we stop here if needed
result+=fullName.mid(p,i-p);
- //printf(" trying %s\n",(result+fullName.mid(i,e-i)).data());
+ //printf(" trying %s\n",qPrint(result+fullName.mid(i,e-i)));
if (getClass(result+fullName.mid(i,e-i))!=0)
{
result+=fullName.mid(i,e-i);
- //printf(" 2:result+=%s\n",fullName.mid(i,e-i-1).data());
+ //printf(" 2:result+=%s\n",qPrint(fullName.mid(i,e-i-1)));
}
else if (pLastScopeStripped)
{
- //printf(" last stripped scope '%s'\n",fullName.mid(i,e-i).data());
+ //printf(" last stripped scope '%s'\n",qPrint(fullName.mid(i,e-i)));
*pLastScopeStripped=fullName.mid(i,e-i);
}
p=e;
i=fullName.find('<',p);
}
result+=fullName.right(l-p);
- //printf("3:result+=%s\n",fullName.right(l-p).data());
+ //printf("3:result+=%s\n",qPrint(fullName.right(l-p)));
return result;
}
@@ -4768,7 +4787,7 @@ QCString mergeScopes(const QCString &leftScope,const QCString &rightScope)
if (found) return result;
// case leftScope=="A" rightScope=="B" => result = "A::B"
- result=leftScope.copy();
+ result=leftScope;
if (!result.isEmpty() && !rightScope.isEmpty()) result+="::";
result+=rightScope;
return result;
@@ -4822,15 +4841,15 @@ int getScopeFragment(const QCString &s,int p,int *l)
}
found:
*l=sp-p;
- //printf("getScopeFragment(%s,%d)=%s\n",s.data(),p,s.mid(p,*l).data());
+ //printf("getScopeFragment(%s,%d)=%s\n",qPrint(s),p,qPrint(s.mid(p,*l)));
return p;
}
//----------------------------------------------------------------------------
-PageDef *addRelatedPage(const char *name,const QCString &ptitle,
+PageDef *addRelatedPage(const QCString &name,const QCString &ptitle,
const QCString &doc,
- const char *fileName,
+ const QCString &fileName,
int docLine,
int startLine,
const RefItemVector &sli,
@@ -4848,11 +4867,11 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
if (!xref && !title.isEmpty() && pd->title()!=title)
{
warn(fileName,startLine,"multiple use of page label '%s', (other occurrence: %s, line: %d)",
- name,pd->docFile().data(),pd->getStartBodyLine());
+ qPrint(name),qPrint(pd->docFile()),pd->getStartBodyLine());
}
// append documentation block to the page.
pd->setDocumentation(doc,fileName,docLine);
- //printf("Adding page docs '%s' pi=%p name=%s\n",doc.data(),pd,name);
+ //printf("Adding page docs '%s' pi=%p name=%s\n",qPrint(doc),pd,name);
// append (x)refitems to the page.
pd->setRefItems(sli);
}
@@ -4864,7 +4883,7 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
else if (baseName.right(Doxygen::htmlFileExtension.length())==Doxygen::htmlFileExtension)
baseName=baseName.left(baseName.length()-Doxygen::htmlFileExtension.length());
- //printf("Appending page '%s'\n",baseName.data());
+ //printf("Appending page '%s'\n",qPrint(baseName));
pd = Doxygen::pageLinkedMap->add(baseName,
std::unique_ptr<PageDef>(
createPageDef(fileName,docLine,baseName,doc,title)));
@@ -4906,11 +4925,11 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
{
if (si->lineNr() != -1)
{
- warn(orgFile,line,"multiple use of section label '%s', (first occurrence: %s, line %d)",pd->name().data(),si->fileName().data(),si->lineNr());
+ warn(orgFile,line,"multiple use of section label '%s', (first occurrence: %s, line %d)",qPrint(pd->name()),qPrint(si->fileName()),si->lineNr());
}
else
{
- warn(orgFile,line,"multiple use of section label '%s', (first occurrence: %s)",pd->name().data(),si->fileName().data());
+ warn(orgFile,line,"multiple use of section label '%s', (first occurrence: %s)",qPrint(pd->name()),qPrint(si->fileName()));
}
}
else
@@ -4918,10 +4937,10 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
SectionManager::instance().add(pd->name(),
file,-1,pd->title(),SectionType::Page,0,pd->getReference());
//printf("si->label='%s' si->definition=%s si->fileName='%s'\n",
- // si->label.data(),si->definition?si->definition->name().data():"<none>",
- // si->fileName.data());
- //printf(" SectionInfo: sec=%p sec->fileName=%s\n",si,si->fileName.data());
- //printf("Adding section key=%s si->fileName=%s\n",pageName.data(),si->fileName.data());
+ // qPrint(si->label),si->definition?si->definition->name().data():"<none>",
+ // qPrint(si->fileName));
+ //printf(" SectionInfo: sec=%p sec->fileName=%s\n",si,qPrint(si->fileName));
+ //printf("Adding section key=%s si->fileName=%s\n",qPrint(pageName),qPrint(si->fileName));
}
}
}
@@ -4931,11 +4950,11 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
//----------------------------------------------------------------------------
void addRefItem(const RefItemVector &sli,
- const char *key,
- const char *prefix, const char *name,const char *title,const char *args,const Definition *scope)
+ const QCString &key, const QCString &prefix, const QCString &name,
+ const QCString &title, const QCString &args, const Definition *scope)
{
//printf("addRefItem(sli=%d,key=%s,prefix=%s,name=%s,title=%s,args=%s)\n",(int)sli.size(),key,prefix,name,title,args);
- if (key && key[0]!='@') // check for @ to skip anonymous stuff (see bug427012)
+ if (!key.isEmpty() && key[0]!='@') // check for @ to skip anonymous stuff (see bug427012)
{
for (RefItem *item : sli)
{
@@ -4967,7 +4986,7 @@ bool recursivelyAddGroupListToTitle(OutputList &ol,const Definition *d,bool root
{
ol.writeString(" &raquo; ");
}
- ol.writeObjectLink(gd->getReference(),gd->getOutputFileBase(),0,gd->groupTitle());
+ ol.writeObjectLink(gd->getReference(),gd->getOutputFileBase(),QCString(),gd->groupTitle());
}
if (root)
{
@@ -4984,12 +5003,12 @@ void addGroupListToTitle(OutputList &ol,const Definition *d)
recursivelyAddGroupListToTitle(ol,d,TRUE);
}
-void filterLatexString(FTextStream &t,const char *str,
+void filterLatexString(TextStream &t,const QCString &str,
bool insideTabbing,bool insidePre,bool insideItem,bool insideTable,bool keepSpaces)
{
- if (str==0) return;
+ if (str.isEmpty()) return;
//if (strlen(str)<2) stackTrace();
- const unsigned char *p=(const unsigned char *)str;
+ const unsigned char *p=(const unsigned char *)str.data();
const unsigned char *q;
int cnt;
unsigned char c;
@@ -5136,13 +5155,12 @@ void filterLatexString(FTextStream &t,const char *str,
}
}
-QCString latexEscapeLabelName(const char *s)
+QCString latexEscapeLabelName(const QCString &s)
{
- if (s==0) return "";
- QGString result;
- QCString tmp(qstrlen(s)+1);
- FTextStream t(&result);
- const char *p=s;
+ if (s.isEmpty()) return s;
+ QCString tmp(s.length()+1);
+ TextStream t;
+ const char *p=s.data();
char c;
int i;
while ((c=*p++))
@@ -5177,16 +5195,15 @@ QCString latexEscapeLabelName(const char *s)
break;
}
}
- return result.data();
+ return t.str();
}
-QCString latexEscapeIndexChars(const char *s)
+QCString latexEscapeIndexChars(const QCString &s)
{
- if (s==0) return "";
- QGString result;
- QCString tmp(qstrlen(s)+1);
- FTextStream t(&result);
- const char *p=s;
+ if (s.isEmpty()) return s;
+ QCString tmp(s.length()+1);
+ TextStream t;
+ const char *p=s.data();
char c;
int i;
while ((c=*p++))
@@ -5212,7 +5229,7 @@ QCString latexEscapeIndexChars(const char *s)
p++;
}
tmp[i]=0;
- filterLatexString(t,tmp.data(),
+ filterLatexString(t,tmp,
true, // insideTabbing
false, // insidePre
false, // insideItem
@@ -5222,15 +5239,14 @@ QCString latexEscapeIndexChars(const char *s)
break;
}
}
- return result.data();
+ return t.str();
}
-QCString latexEscapePDFString(const char *s)
+QCString latexEscapePDFString(const QCString &s)
{
- if (s==0) return "";
- QGString result;
- FTextStream t(&result);
- const char *p=s;
+ if (s.isEmpty()) return s;
+ TextStream t;
+ const char *p=s.data();
char c;
while ((c=*p++))
{
@@ -5247,15 +5263,14 @@ QCString latexEscapePDFString(const char *s)
break;
}
}
- return result.data();
+ return t.str();
}
-QCString latexFilterURL(const char *s)
+QCString latexFilterURL(const QCString &s)
{
- if (s==0) return "";
- QGString result;
- FTextStream t(&result);
- const signed char *p=(const signed char*)s;
+ if (s.isEmpty()) return s;
+ TextStream t;
+ const signed char *p=(const signed char*)s.data();
char c;
while ((c=*p++))
{
@@ -5277,14 +5292,14 @@ QCString latexFilterURL(const char *s)
break;
}
}
- return result.data();
+ return t.str();
}
static std::mutex g_rtfFormatMutex;
static std::unordered_map<std::string,std::string> g_tagMap;
static QCString g_nextTag( "AAAAAAAAAA" );
-QCString rtfFormatBmkStr(const char *name)
+QCString rtfFormatBmkStr(const QCString &name)
{
std::lock_guard<std::mutex> lock(g_rtfFormatMutex);
@@ -5293,7 +5308,7 @@ QCString rtfFormatBmkStr(const char *name)
// supplied, and keep track of the correspondence
// between names and strings.
QCString tag = g_nextTag;
- auto result = g_tagMap.insert( std::make_pair(name, g_nextTag) );
+ auto result = g_tagMap.insert( std::make_pair(name.str(), g_nextTag.str()) );
if (result.second) // new item was added
{
@@ -5314,7 +5329,7 @@ QCString rtfFormatBmkStr(const char *name)
}
}
- //printf("Name = %s RTF_tag = %s\n",name,(*tag).data());
+ //printf("Name = %s RTF_tag = %s\n",name,qPrint(*tag)));
return tag;
}
@@ -5323,28 +5338,27 @@ bool checkExtension(const char *fName, const char *ext)
return (QCString(fName).right(QCString(ext).length())==ext);
}
-QCString addHtmlExtensionIfMissing(const char *fName)
+QCString addHtmlExtensionIfMissing(const QCString &fName)
{
- if (fName==0) return fName;
- const char *p = strchr(fName,'.');
- if (p==nullptr) // no extension
+ if (fName.isEmpty()) return fName;
+ if (fName.find('.')==-1) // no extension
{
return QCString(fName)+Doxygen::htmlFileExtension;
}
return fName;
}
-QCString stripExtensionGeneral(const char *fName, const char *ext)
+QCString stripExtensionGeneral(const QCString &fName, const QCString &ext)
{
QCString result=fName;
- if (result.right(QCString(ext).length())==QCString(ext))
+ if (result.right(ext.length())==ext)
{
- result=result.left(result.length()-QCString(ext).length());
+ result=result.left(result.length()-ext.length());
}
return result;
}
-QCString stripExtension(const char *fName)
+QCString stripExtension(const QCString &fName)
{
return stripExtensionGeneral(fName, Doxygen::htmlFileExtension);
}
@@ -5356,10 +5370,10 @@ void replaceNamespaceAliases(QCString &scope,int i)
QCString ns = scope.left(i);
if (!ns.isEmpty())
{
- auto it = Doxygen::namespaceAliasMap.find(ns.data());
+ auto it = Doxygen::namespaceAliasMap.find(ns.str());
if (it!=Doxygen::namespaceAliasMap.end())
{
- scope=it->second.data()+scope.right(scope.length()-i);
+ scope=QCString(it->second)+scope.right(scope.length()-i);
i=static_cast<int>(it->second.length());
}
}
@@ -5367,7 +5381,7 @@ void replaceNamespaceAliases(QCString &scope,int i)
}
}
-QCString stripPath(const char *s)
+QCString stripPath(const QCString &s)
{
QCString result=s;
int i=result.findRev('/');
@@ -5384,11 +5398,11 @@ QCString stripPath(const char *s)
}
/** returns \c TRUE iff string \a s contains word \a w */
-bool containsWord(const char *str,const char *word)
+bool containsWord(const QCString &str,const char *word)
{
- if (str==0 || word==0) return false;
+ if (str.isEmpty() || word==0) return false;
static const reg::Ex re(R"(\a+)");
- std::string s = str;
+ std::string s = str.str();
for (reg::Iterator it(s,re) ; it!=reg::Iterator() ; ++it)
{
if (it->str()==word) return true;
@@ -5445,8 +5459,8 @@ bool findAndRemoveWord(QCString &sentence,const char *word)
*/
QCString stripLeadingAndTrailingEmptyLines(const QCString &s,int &docLine)
{
+ if (s.isEmpty()) return QCString();
const char *p = s.data();
- if (p==0) return 0;
// search for leading empty lines
int i=0,li=-1,l=s.length();
@@ -5477,8 +5491,8 @@ QCString stripLeadingAndTrailingEmptyLines(const QCString &s,int &docLine)
// return substring
if (bi==-1) bi=l;
if (li==-1) li=0;
- if (bi<=li) return 0; // only empty lines
- //printf("docLine='%s' len=%d li=%d bi=%d\n",s.data(),s.length(),li,bi);
+ if (bi<=li) return QCString(); // only empty lines
+ //printf("docLine='%s' len=%d li=%d bi=%d\n",qPrint(s),s.length(),li,bi);
return s.mid(li,bi-li);
}
@@ -5538,17 +5552,17 @@ bool updateLanguageMapping(const QCString &extension,const QCString &language)
{
g_extLookup.erase(it); // language was already register for this ext
}
- //printf("registering extension %s\n",extName.data());
- g_extLookup.insert(std::make_pair(extName,parserId));
+ //printf("registering extension %s\n",qPrint(extName));
+ g_extLookup.insert(std::make_pair(extName.str(),parserId));
if (!Doxygen::parserManager->registerExtension(extName,p->parserName))
{
err("Failed to assign extension %s to parser %s for language %s\n",
- extName.data(),p->parserName,language.data());
+ extName.data(),p->parserName,qPrint(language));
}
else
{
//msg("Registered extension %s to language parser %s...\n",
- // extName.data(),language.data());
+ // extName.data(),qPrint(language));
}
return TRUE;
}
@@ -5624,18 +5638,18 @@ void addCodeOnlyMappings()
SrcLangExt getLanguageFromFileName(const QCString& fileName)
{
- QFileInfo fi(fileName);
- // we need only the part after the last ".", newer implementations of QFileInfo have 'suffix()' for this.
- QCString extName = fi.extension(FALSE).lower().data();
+ FileInfo fi(fileName.str());
+ // we need only the part after the last ".", newer implementations of FileInfo have 'suffix()' for this.
+ QCString extName = QCString(fi.extension(FALSE)).lower();
if (extName.isEmpty()) extName=".no_extension";
if (extName.at(0)!='.') extName.prepend(".");
auto it = g_extLookup.find(extName.str());
if (it!=g_extLookup.end()) // listed extension
{
- //printf("getLanguageFromFileName(%s)=%x\n",fi.extension().data(),*pVal);
+ //printf("getLanguageFromFileName(%s)=%x\n",qPrint(fi.extension()),*pVal);
return (SrcLangExt)it->second;
}
- //printf("getLanguageFromFileName(%s) not found!\n",fileName.data());
+ //printf("getLanguageFromFileName(%s) not found!\n",qPrint(fileName));
return SrcLangExt_Cpp; // not listed => assume C-ish language.
}
@@ -5650,7 +5664,7 @@ QCString getFileNameExtension(QCString fn)
//--------------------------------------------------------------------------
static MemberDef *getMemberFromSymbol(const Definition *scope,const FileDef *fileScope,
- const char *n)
+ const QCString &n)
{
if (scope==0 ||
(scope->definitionType()!=Definition::TypeClass &&
@@ -5678,7 +5692,7 @@ static MemberDef *getMemberFromSymbol(const Definition *scope,const FileDef *fil
replaceNamespaceAliases(explicitScopePart,explicitScopePart.length());
name = name.mid(qualifierIndex+2);
}
- //printf("explicitScopePart=%s\n",explicitScopePart.data());
+ //printf("explicitScopePart=%s\n",qPrint(explicitScopePart));
int minDistance = 10000;
MemberDef *bestMatch = 0;
@@ -5694,7 +5708,7 @@ static MemberDef *getMemberFromSymbol(const Definition *scope,const FileDef *fil
{
minDistance = distance;
bestMatch = toMemberDef(d);
- //printf("new best match %s distance=%d\n",bestMatch->qualifiedName().data(),distance);
+ //printf("new best match %s distance=%d\n",qPrint(bestMatch->qualifiedName()),distance);
}
}
}
@@ -5702,7 +5716,7 @@ static MemberDef *getMemberFromSymbol(const Definition *scope,const FileDef *fil
}
/*! Returns true iff the given name string appears to be a typedef in scope. */
-bool checkIfTypedef(const Definition *scope,const FileDef *fileScope,const char *n)
+bool checkIfTypedef(const Definition *scope,const FileDef *fileScope,const QCString &n)
{
MemberDef *bestMatch = getMemberFromSymbol(scope,fileScope,n);
@@ -5712,66 +5726,14 @@ bool checkIfTypedef(const Definition *scope,const FileDef *fileScope,const char
return FALSE;
}
-const char *writeUtf8Char(FTextStream &t,const char *s)
-{
- uchar c=(uchar)*s++;
- t << (char)c;
- if (c>=0x80) // multibyte character
- {
- if (((uchar)c&0xE0)==0xC0)
- {
- t << *s++; // 11xx.xxxx: >=2 byte character
- }
- if (((uchar)c&0xF0)==0xE0)
- {
- t << *s++; // 111x.xxxx: >=3 byte character
- }
- if (((uchar)c&0xF8)==0xF0)
- {
- t << *s++; // 1111.xxxx: >=4 byte character
- }
- if (((uchar)c&0xFC)==0xF8)
- {
- t << *s++; // 1111.1xxx: >=5 byte character
- }
- if (((uchar)c&0xFE)==0xFC)
- {
- t << *s++; // 1111.1xxx: 6 byte character
- }
- }
- return s;
-}
-
-int nextUtf8CharPosition(const QCString &utf8Str,uint len,uint startPos)
+static int nextUTF8CharPosition(const QCString &utf8Str,uint len,uint startPos)
{
- int bytes=1;
if (startPos>=len) return len;
uchar c = (uchar)utf8Str[startPos];
- if (c>=0x80) // multibyte utf-8 character
- {
- if (((uchar)c&0xE0)==0xC0)
- {
- bytes+=1; // 11xx.xxxx: >=2 byte character
- }
- if (((uchar)c&0xF0)==0xE0)
- {
- bytes+=2; // 111x.xxxx: >=3 byte character
- }
- if (((uchar)c&0xF8)==0xF0)
- {
- bytes+=3; // 1111.xxxx: >=4 byte character
- }
- if (((uchar)c&0xFC)==0xF8)
- {
- bytes+=4; // 1111.1xxx: >=5 byte character
- }
- if (((uchar)c&0xFE)==0xFC)
- {
- bytes+=5; // 1111.1xxx: 6 byte character
- }
- }
- else if (c=='&') // skip over character entities
+ int bytes=getUTF8CharNumBytes(c);
+ if (c=='&') // skip over character entities
{
+ bytes=1;
int (*matcher)(int) = 0;
c = (uchar)utf8Str[startPos+bytes];
if (c=='#') // numerical entity?
@@ -5811,29 +5773,28 @@ int nextUtf8CharPosition(const QCString &utf8Str,uint len,uint startPos)
QCString parseCommentAsText(const Definition *scope,const MemberDef *md,
const QCString &doc,const QCString &fileName,int lineNr)
{
- QGString s;
- if (doc.isEmpty()) return s.data();
- //printf("parseCommentAsText(%s)\n",doc.data());
- FTextStream t(&s);
+ if (doc.isEmpty()) return "";
+ //printf("parseCommentAsText(%s)\n",qPrint(doc));
+ TextStream t;
DocNode *root = validatingParseDoc(fileName,lineNr,
(Definition*)scope,(MemberDef*)md,doc,FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
TextDocVisitor *visitor = new TextDocVisitor(t);
root->accept(visitor);
delete visitor;
delete root;
- QCString result = convertCharEntitiesToUTF8(s.data()).stripWhiteSpace();
+ QCString result = convertCharEntitiesToUTF8(t.str().c_str()).stripWhiteSpace();
int i=0;
int charCnt=0;
int l=result.length();
- while ((i=nextUtf8CharPosition(result,l,i))<l)
+ while ((i=nextUTF8CharPosition(result,l,i))<l)
{
charCnt++;
if (charCnt>=80) break;
}
if (charCnt>=80) // try to truncate the string
{
- while ((i=nextUtf8CharPosition(result,l,i))<l && charCnt<100)
+ while ((i=nextUTF8CharPosition(result,l,i))<l && charCnt<100)
{
charCnt++;
if (result.at(i)==',' ||
@@ -5898,7 +5859,7 @@ static int findEndOfCommand(const char *s)
static QCString replaceAliasArguments(StringUnorderedSet &aliasesProcessed,
const QCString &aliasValue,const QCString &argList)
{
- //printf("----- replaceAliasArguments(val=[%s],args=[%s])\n",aliasValue.data(),argList.data());
+ //printf("----- replaceAliasArguments(val=[%s],args=[%s])\n",qPrint(aliasValue),qPrint(argList));
// first make a list of arguments from the comma separated argument list
std::vector<QCString> args;
@@ -5936,7 +5897,7 @@ static QCString replaceAliasArguments(StringUnorderedSet &aliasesProcessed,
insideMarkerId = false;
int markerLen = i-markerStart;
markerList.push_back(Marker(markerStart-1,
- atoi(aliasValue.mid(markerStart,markerLen)),
+ aliasValue.mid(markerStart,markerLen).toInt(),
markerLen+1));
}
if (c=='\\' && (pc=='@' || pc=='\\')) // found escaped backslash
@@ -5962,17 +5923,17 @@ static QCString replaceAliasArguments(StringUnorderedSet &aliasesProcessed,
{
const Marker &m = markerList.at(i);
result+=aliasValue.mid(p,m.pos-p);
- //printf("part before marker %d: '%s'\n",i,aliasValue.mid(p,m->pos-p).data());
+ //printf("part before marker %d: '%s'\n",i,qPrint(aliasValue.mid(p,m->pos-p)));
if (m.number>0 && m.number<=(int)args.size()) // valid number
{
result+=expandAliasRec(aliasesProcessed,args.at(m.number-1).str(),TRUE);
//printf("marker index=%d pos=%d number=%d size=%d replacement %s\n",i,m->pos,m->number,m->size,
- // args.at(m->number-1)->data());
+ // qPrint(args.at(m->number-1)));
}
p=m.pos+m.size; // continue after the marker
}
result+=aliasValue.right(l-p); // append remainder
- //printf("string after replacement of markers: '%s'\n",result.data());
+ //printf("string after replacement of markers: '%s'\n",qPrint(result));
// expand the result again
result = substitute(result,"\\{","{");
@@ -5984,24 +5945,24 @@ static QCString replaceAliasArguments(StringUnorderedSet &aliasesProcessed,
static QCString escapeCommas(const QCString &s)
{
- QGString result;
+ if (s.isEmpty()) return s;
+ TextStream result;
const char *p = s.data();
char c,pc=0;
while ((c=*p++))
{
if (c==',' && pc!='\\')
{
- result+="\\,";
+ result << "\\,";
}
else
{
- result+=c;
+ result << c;
}
pc=c;
}
- result+='\0';
- //printf("escapeCommas: '%s'->'%s'\n",s.data(),result.data());
- return result.data();
+ //printf("escapeCommas: '%s'->'%s'\n",qPrint(s),qPrint(result));
+ return result.str();
}
static QCString expandAliasRec(StringUnorderedSet &aliasesProcessed,const std::string &s,bool allowRecursion)
@@ -6018,7 +5979,7 @@ static QCString expandAliasRec(StringUnorderedSet &aliasesProcessed,const std::s
int i = (int)match.position();
int l = (int)match.length();
if (i>p) result+=s.substr(p,i-p);
- QCString args = extractAliasArgs(s,i+l);
+ QCString args = extractAliasArgs(QCString(s),i+l);
bool hasArgs = !args.isEmpty(); // found directly after command
int argsLen = args.length();
QCString cmd = match[1].str();
@@ -6042,18 +6003,18 @@ static QCString expandAliasRec(StringUnorderedSet &aliasesProcessed,const std::s
}
}
//printf("Found command s='%s' cmd='%s' numArgs=%d args='%s' aliasText=%s\n",
- // s.data(),cmd.data(),numArgs,args.data(),it!=Doxygen::aliasMap.end()?it->second.c_str():"<none>");
+ // qPrint(s),qPrint(cmd),numArgs,qPrint(args),it!=Doxygen::aliasMap.end()?it->second.c_str():"<none>");
if ((allowRecursion || aliasesProcessed.find(cmd.str())==aliasesProcessed.end()) &&
it!=Doxygen::aliasMap.end()) // expand the alias
{
//printf("is an alias!\n");
if (!allowRecursion) aliasesProcessed.insert(cmd.str());
- QCString val = it->second;
+ QCString val(it->second);
if (hasArgs)
{
val = replaceAliasArguments(aliasesProcessed,val,args);
//printf("replace '%s'->'%s' args='%s'\n",
- // aliasText->data(),val.data(),args.data());
+ // qPrint(aliasText),qPrint(val),qPrint(args));
}
result+=expandAliasRec(aliasesProcessed,val.str()).str();
if (!allowRecursion) aliasesProcessed.erase(cmd.str());
@@ -6069,12 +6030,12 @@ static QCString expandAliasRec(StringUnorderedSet &aliasesProcessed,const std::s
}
result+=s.substr(p);
- //printf("expandAliases '%s'->'%s'\n",s.data(),result.data());
+ //printf("expandAliases '%s'->'%s'\n",qPrint(s),qPrint(result));
return result;
}
-int countAliasArguments(const QCString argList)
+int countAliasArguments(const QCString &argList)
{
int count=1;
int l = argList.length();
@@ -6115,7 +6076,7 @@ QCString extractAliasArgs(const QCString &args,int pos)
if (bc==0)
{
- //printf("extractAliasArgs('%s')->'%s'\n",args.data(),args.mid(pos+1,i-pos-1).data());
+ //printf("extractAliasArgs('%s')->'%s'\n",qPrint(args),qPrint(args.mid(pos+1,i-pos-1)));
return args.mid(pos+1,i-pos-1);
}
}
@@ -6123,13 +6084,13 @@ QCString extractAliasArgs(const QCString &args,int pos)
return "";
}
-QCString resolveAliasCmd(const QCString aliasCmd)
+QCString resolveAliasCmd(const QCString &aliasCmd)
{
QCString result;
StringUnorderedSet aliasesProcessed;
- //printf("Expanding: '%s'\n",aliasCmd.data());
+ //printf("Expanding: '%s'\n",qPrint(aliasCmd));
result = expandAliasRec(aliasesProcessed,aliasCmd.str());
- //printf("Expanding result: '%s'->'%s'\n",aliasCmd.data(),result.data());
+ //printf("Expanding result: '%s'->'%s'\n",qPrint(aliasCmd),qPrint(result));
return result;
}
@@ -6140,9 +6101,9 @@ std::string expandAlias(const std::string &aliasName,const std::string &aliasVal
// avoid expanding this command recursively
aliasesProcessed.insert(aliasName);
// expand embedded commands
- //printf("Expanding: '%s'->'%s'\n",aliasName.data(),aliasValue.data());
+ //printf("Expanding: '%s'->'%s'\n",qPrint(aliasName),qPrint(aliasValue));
result = expandAliasRec(aliasesProcessed,aliasValue.c_str());
- //printf("Expanding result: '%s'->'%s'\n",aliasName.data(),result.data());
+ //printf("Expanding result: '%s'->'%s'\n",qPrint(aliasName),qPrint(result));
return result.str();
}
@@ -6160,7 +6121,7 @@ void writeTypeConstraints(OutputList &ol,const Definition *d,const ArgumentList
ol.endConstraintType();
ol.startConstraintDocs();
ol.generateDoc(d->docFile(),d->docLine(),d,0,a.docs,TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endConstraintDocs();
}
ol.endConstraintList();
@@ -6195,17 +6156,17 @@ void stackTrace()
#endif
}
-static int transcodeCharacterBuffer(const char *fileName,BufStr &srcBuf,int size,
- const char *inputEncoding,const char *outputEncoding)
+static int transcodeCharacterBuffer(const QCString &fileName,BufStr &srcBuf,int size,
+ const QCString &inputEncoding,const QCString &outputEncoding)
{
- if (inputEncoding==0 || outputEncoding==0) return size;
+ if (inputEncoding.isEmpty() || outputEncoding.isEmpty()) return size;
if (qstricmp(inputEncoding,outputEncoding)==0) return size;
void *cd = portable_iconv_open(outputEncoding,inputEncoding);
if (cd==(void *)(-1))
{
term("unsupported character conversion: '%s'->'%s': %s\n"
"Check the INPUT_ENCODING setting in the config file!\n",
- inputEncoding,outputEncoding,strerror(errno));
+ qPrint(inputEncoding),qPrint(outputEncoding),strerror(errno));
}
int tmpBufSize=size*4+1;
BufStr tmpBuf(tmpBufSize);
@@ -6219,42 +6180,41 @@ static int transcodeCharacterBuffer(const char *fileName,BufStr &srcBuf,int size
newSize = tmpBufSize-(int)oLeft;
srcBuf.shrink(newSize);
strncpy(srcBuf.data(),tmpBuf.data(),newSize);
- //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,srcBuf.data());
+ //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,qPrint(srcBuf));
}
else
{
term("%s: failed to translate characters from %s to %s: check INPUT_ENCODING\n",
- fileName,inputEncoding,outputEncoding);
+ qPrint(fileName),qPrint(inputEncoding),qPrint(outputEncoding));
}
portable_iconv_close(cd);
return newSize;
}
//! read a file name \a fileName and optionally filter and transcode it
-bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceCode)
+bool readInputFile(const QCString &fileName,BufStr &inBuf,bool filter,bool isSourceCode)
{
// try to open file
int size=0;
- //uint oldPos = dest.curPos();
- //printf(".......oldPos=%d\n",oldPos);
- QFileInfo fi(fileName);
+ FileInfo fi(fileName.str());
if (!fi.exists()) return FALSE;
QCString filterName = getFileFilter(fileName,isSourceCode);
if (filterName.isEmpty() || !filter)
{
- QFile f(fileName);
- if (!f.open(IO_ReadOnly))
+ std::ifstream f(fileName.str(),std::ifstream::in | std::ifstream::binary);
+ if (!f.is_open())
{
- err("could not open file %s\n",fileName);
+ err("could not open file %s\n",qPrint(fileName));
return FALSE;
}
- size=fi.size();
+ size=(int)fi.size();
// read the file
inBuf.skip(size);
- if (f.readBlock(inBuf.data()/*+oldPos*/,size)!=size)
+ f.read(inBuf.data(),size);
+ if (f.fail())
{
- err("problems while reading file %s\n",fileName);
+ err("problems while reading file %s\n",qPrint(fileName));
return FALSE;
}
}
@@ -6265,7 +6225,7 @@ bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceC
FILE *f=Portable::popen(cmd,"r");
if (!f)
{
- err("could not execute filter %s\n",filterName.data());
+ err("could not execute filter %s\n",qPrint(filterName));
return FALSE;
}
const int bufSize=1024;
@@ -6317,22 +6277,23 @@ bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceC
// and translate CR's
size=inBuf.curPos()-start;
int newSize=filterCRLF(inBuf.data()+start,size);
- //printf("filter char at %p size=%d newSize=%d\n",dest.data()+oldPos,size,newSize);
+ //printf("filter char at %p size=%d newSize=%d\n",qPrint(dest)+oldPos,size,newSize);
if (newSize!=size) // we removed chars
{
inBuf.shrink(newSize); // resize the array
- //printf(".......resizing from %d to %d result=[%s]\n",oldPos+size,oldPos+newSize,dest.data());
+ //printf(".......resizing from %d to %d result=[%s]\n",oldPos+size,oldPos+newSize,qPrint(dest));
}
inBuf.addChar(0);
return TRUE;
}
// Replace %word by word in title
-QCString filterTitle(const std::string &title)
+QCString filterTitle(const QCString &title)
{
std::string tf;
+ std::string t = title.str();
static const reg::Ex re(R"(%[a-z_A-Z]+)");
- reg::Iterator it(title,re);
+ reg::Iterator it(t,re);
reg::Iterator end;
size_t p = 0;
for (; it!=end ; ++it)
@@ -6340,11 +6301,11 @@ QCString filterTitle(const std::string &title)
const auto &match = *it;
size_t i = match.position();
size_t l = match.length();
- if (i>p) tf+=title.substr(p,i-p);
+ if (i>p) tf+=t.substr(p,i-p);
tf+=match.str().substr(1); // skip %
p=i+l;
}
- tf+=title.substr(p);
+ tf+=t.substr(p);
return tf;
}
@@ -6352,7 +6313,7 @@ QCString filterTitle(const std::string &title)
// returns TRUE if the name of the file represented by 'fi' matches
// one of the file patterns in the 'patList' list.
-bool patternMatch(const QFileInfo &fi,const StringVector &patList)
+bool patternMatch(const FileInfo &fi,const StringVector &patList)
{
bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES);
bool found = FALSE;
@@ -6365,9 +6326,9 @@ bool patternMatch(const QFileInfo &fi,const StringVector &patList)
if (!patList.empty())
{
- std::string fn = fi.fileName().data();
- std::string fp = fi.filePath().data();
- std::string afp= fi.absFilePath().data();
+ std::string fn = fi.fileName();
+ std::string fp = fi.filePath();
+ std::string afp= fi.absFilePath();
for (auto pattern: patList)
{
@@ -6380,14 +6341,16 @@ bool patternMatch(const QFileInfo &fi,const StringVector &patList)
{
pattern = QCString(pattern).lower().str();
fn = QCString(fn).lower().str();
- fp = QCString(fn).lower().str();
- afp = QCString(fn).lower().str();
+ fp = QCString(fp).lower().str();
+ afp = QCString(afp).lower().str();
}
reg::Ex re(pattern,reg::Ex::Mode::Wildcard);
- found = re.isValid() && (reg::match(fn,re) || reg::match(fp,re) || reg::match(afp,re));
+ found = re.isValid() && (reg::match(fn,re) ||
+ (fn!=fp && reg::match(fp,re)) ||
+ (fn!=afp && fp!=afp && reg::match(afp,re)));
if (found) break;
//printf("Matching '%s' against pattern '%s' found=%d\n",
- // fi->fileName().data(),pattern.data(),found);
+ // qPrint(fi->fileName()),qPrint(pattern),found);
}
}
}
@@ -6434,23 +6397,17 @@ QCString externalRef(const QCString &relPath,const QCString &ref,bool href)
/** Writes the intensity only bitmap represented by \a data as an image to
* directory \a dir using the colors defined by HTML_COLORSTYLE_*.
*/
-void writeColoredImgData(const char *dir,ColoredImgDataItem data[])
+void writeColoredImgData(const QCString &dir,ColoredImgDataItem data[])
{
static int hue = Config_getInt(HTML_COLORSTYLE_HUE);
static int sat = Config_getInt(HTML_COLORSTYLE_SAT);
static int gamma = Config_getInt(HTML_COLORSTYLE_GAMMA);
while (data->name)
{
- QCString fileName;
- fileName=(QCString)dir+"/"+data->name;
- QFile f(fileName);
- if (f.open(IO_WriteOnly))
- {
- ColoredImage img(data->width,data->height,data->content,data->alpha,
- sat,hue,gamma);
- img.save(fileName);
- }
- else
+ QCString fileName = dir+"/"+data->name;
+ ColoredImage img(data->width,data->height,data->content,data->alpha,
+ sat,hue,gamma);
+ if (!img.save(fileName))
{
fprintf(stderr,"Warning: Cannot open file %s for writing\n",data->name);
}
@@ -6464,11 +6421,11 @@ void writeColoredImgData(const char *dir,ColoredImgDataItem data[])
* valid color, based on the intensity represented by hex number AA
* and the current HTML_COLORSTYLE_* settings.
*/
-QCString replaceColorMarkers(const char *str)
+QCString replaceColorMarkers(const QCString &str)
{
- if (str==0) return QCString();
+ if (str.isEmpty()) return QCString();
std::string result;
- std::string s=str;
+ std::string s=str.str();
static const reg::Ex re(R"(##[0-9A-Fa-f][0-9A-Fa-f])");
reg::Iterator it(s,re);
reg::Iterator end;
@@ -6505,7 +6462,7 @@ QCString replaceColorMarkers(const char *str)
colStr[5]=hex[blue>>4];
colStr[6]=hex[blue&0xf];
colStr[7]=0;
- //printf("replacing %s->%s (level=%d)\n",lumStr.data(),colStr,level);
+ //printf("replacing %s->%s (level=%d)\n",qPrint(lumStr),colStr,level);
result+=colStr;
p=i+l;
}
@@ -6518,38 +6475,19 @@ QCString replaceColorMarkers(const char *str)
*/
bool copyFile(const QCString &src,const QCString &dest)
{
- QFile sf(src);
- if (sf.open(IO_ReadOnly))
+ if (!Dir().copy(src.str(),dest.str()))
{
- QFileInfo fi(src);
- QFile df(dest);
- if (df.open(IO_WriteOnly))
- {
- char *buffer = new char[fi.size()];
- sf.readBlock(buffer,fi.size());
- df.writeBlock(buffer,fi.size());
- df.flush();
- delete[] buffer;
- }
- else
- {
- err("could not write to file %s\n",dest.data());
- return FALSE;
- }
- }
- else
- {
- err("could not open user specified file %s\n",src.data());
- return FALSE;
+ err("could not copy file %s to %s\n",qPrint(src),qPrint(dest));
+ return false;
}
- return TRUE;
+ return true;
}
/** Returns the section of text, in between a pair of markers.
* Full lines are returned, excluding the lines on which the markers appear.
* \sa routine lineBlock
*/
-QCString extractBlock(const QCString text,const QCString marker)
+QCString extractBlock(const QCString &text,const QCString &marker)
{
QCString result;
int p=0,i;
@@ -6587,14 +6525,14 @@ QCString extractBlock(const QCString text,const QCString marker)
{
l2=lp;
}
- //printf("text=[%s]\n",text.mid(l1,l2-l1).data());
+ //printf("text=[%s]\n",qPrint(text.mid(l1,l2-l1)));
return l2>l1 ? text.mid(l1,l2-l1) : QCString();
}
/** Returns the line number of the line following the line with the marker.
* \sa routine extractBlock
*/
-int lineBlock(const QCString text,const QCString marker)
+int lineBlock(const QCString &text,const QCString &marker)
{
int result = 1;
int p=0,i;
@@ -6697,7 +6635,7 @@ QCString stripIndentation(const QCString &s)
{
if (s.isEmpty()) return s; // empty string -> we're done
- //printf("stripIndentation:\n%s\n------\n",s.data());
+ //printf("stripIndentation:\n%s\n------\n",qPrint(s));
// compute minimum indentation over all lines
const char *p=s.data();
char c;
@@ -6721,7 +6659,7 @@ QCString stripIndentation(const QCString &s)
if (minIndent==0) return s;
// remove minimum indentation for each line
- QGString result;
+ TextStream result;
p=s.data();
indent=0;
while ((c=*p++))
@@ -6729,7 +6667,7 @@ QCString stripIndentation(const QCString &s)
if (c=='\n') // start of new line
{
indent=0;
- result+=c;
+ result << c;
}
else if (indent<minIndent) // skip until we reach minIndent
{
@@ -6739,7 +6677,7 @@ QCString stripIndentation(const QCString &s)
int i=newIndent;
while (i>minIndent) // if a tab crosses the minIndent boundary fill the rest with spaces
{
- result+=' ';
+ result << ' ';
i--;
}
indent=newIndent;
@@ -6751,12 +6689,11 @@ QCString stripIndentation(const QCString &s)
}
else // copy anything until the end of the line
{
- result+=c;
+ result << c;
}
}
- result+='\0';
- return result.data();
+ return result.str();
}
// strip up to \a indentationLevel spaces from each line in \a doc (excluding the first line)
@@ -6805,7 +6742,7 @@ void stripIndentation(QCString &doc,const int indentationLevel)
break;
}
}
- doc.resize(dst-doc.data()+1);
+ doc.resize(static_cast<uint>(dst-doc.data())+1);
}
@@ -6823,6 +6760,7 @@ bool fileVisibleInIndex(const FileDef *fd,bool &genSourceFile)
//--------------------------------------------------------------------------------------
+#if 0
/*! @brief Get one unicode character as an unsigned integer from utf-8 string
*
* @param s utf-8 encoded string
@@ -6887,6 +6825,9 @@ uint getUtf8CodeToUpper( const QCString& s, int idx )
const uint v = getUtf8Code( s, idx );
return v < 0x7f ? toupper( v ) : v;
}
+#endif
+
+
//--------------------------------------------------------------------------------------
//
@@ -6902,14 +6843,34 @@ bool namespaceHasNestedNamespace(const NamespaceDef *nd)
return false;
}
+bool namespaceHasNestedConcept(const NamespaceDef *nd)
+{
+ for (const auto &cnd : nd->getNamespaces())
+ {
+ if (namespaceHasNestedConcept(cnd))
+ {
+ //printf("<namespaceHasVisibleChild(%s,includeClasses=%d): case2\n",qPrint(nd->name()),includeClasses);
+ return true;
+ }
+ }
+ for (const auto &cnd : nd->getConcepts())
+ {
+ if (cnd->isLinkableInProject())
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
bool namespaceHasNestedClass(const NamespaceDef *nd,bool filterClasses,ClassDef::CompoundType ct)
{
- //printf(">namespaceHasVisibleChild(%s,includeClasses=%d)\n",nd->name().data(),includeClasses);
+ //printf(">namespaceHasVisibleChild(%s,includeClasses=%d)\n",qPrint(nd->name()),includeClasses);
for (const auto &cnd : nd->getNamespaces())
{
if (namespaceHasNestedClass(cnd,filterClasses,ct))
{
- //printf("<namespaceHasVisibleChild(%s,includeClasses=%d): case2\n",nd->name().data(),includeClasses);
+ //printf("<namespaceHasVisibleChild(%s,includeClasses=%d): case2\n",qPrint(nd->name()),includeClasses);
return TRUE;
}
}
@@ -6935,7 +6896,7 @@ bool namespaceHasNestedClass(const NamespaceDef *nd,bool filterClasses,ClassDef:
{
if (cd->isLinkableInProject() && cd->templateMaster()==0)
{
- //printf("<namespaceHasVisibleChild(%s,includeClasses=%d): case3\n",nd->name().data(),includeClasses);
+ //printf("<namespaceHasVisibleChild(%s,includeClasses=%d): case3\n",qPrint(nd->name()),includeClasses);
return TRUE;
}
}
@@ -7194,32 +7155,34 @@ QCString getDotImageExtension()
return i==-1 ? imgExt : imgExt.left(i);
}
-bool openOutputFile(const char *outFile,QFile &f)
+bool openOutputFile(const QCString &outFile,std::ofstream &f)
{
+ assert(!f.is_open());
bool fileOpened=FALSE;
- bool writeToStdout=(outFile[0]=='-' && outFile[1]=='\0');
+ bool writeToStdout=outFile=="-";
if (writeToStdout) // write to stdout
{
- fileOpened = f.open(IO_WriteOnly,stdout);
+ f.basic_ios<char>::rdbuf(std::cout.rdbuf());
+ fileOpened = true;
}
else // write to file
{
- QFileInfo fi(outFile);
+ FileInfo fi(outFile.str());
if (fi.exists()) // create a backup
{
- QDir dir=fi.dir();
- QFileInfo backup(fi.fileName()+".bak");
+ Dir dir;
+ FileInfo backup(fi.fileName()+".bak");
if (backup.exists()) // remove existing backup
dir.remove(backup.fileName());
dir.rename(fi.fileName(),fi.fileName()+".bak");
}
- f.setName(outFile);
- fileOpened = f.open(IO_WriteOnly|IO_Translate);
+ f.open(outFile.str(),std::ofstream::out | std::ofstream::binary);
+ fileOpened = f.is_open();
}
return fileOpened;
}
-void writeExtraLatexPackages(FTextStream &t)
+void writeExtraLatexPackages(TextStream &t)
{
// User-specified packages
const StringVector &extraPackages = Config_getList(EXTRA_PACKAGES);
@@ -7237,7 +7200,7 @@ void writeExtraLatexPackages(FTextStream &t)
}
}
-void writeLatexSpecialFormulaChars(FTextStream &t)
+void writeLatexSpecialFormulaChars(TextStream &t)
{
unsigned char minus[4]; // Superscript minus
char *pminus = (char *)minus;
@@ -7265,7 +7228,7 @@ void writeLatexSpecialFormulaChars(FTextStream &t)
//------------------------------------------------------
// simplified way to know if this is fixed form
-bool recognizeFixedForm(const char* contents, FortranFormat format)
+bool recognizeFixedForm(const QCString &contents, FortranFormat format)
{
int column=0;
bool skipLine=FALSE;
@@ -7273,10 +7236,12 @@ bool recognizeFixedForm(const char* contents, FortranFormat format)
if (format == FortranFormat_Fixed) return TRUE;
if (format == FortranFormat_Free) return FALSE;
- for(int i=0;;i++) {
+ for (int i=0;;i++)
+ {
column++;
- switch(contents[i]) {
+ switch(contents[i])
+ {
case '\n':
column=0;
skipLine=FALSE;
@@ -7310,7 +7275,7 @@ bool recognizeFixedForm(const char* contents, FortranFormat format)
FortranFormat convertFileNameFortranParserCode(QCString fn)
{
QCString ext = getFileNameExtension(fn);
- QCString parserName = Doxygen::parserManager->getParserName(ext.data());
+ QCString parserName = Doxygen::parserManager->getParserName(ext);
if (parserName == "fortranfixed") return FortranFormat_Fixed;
else if (parserName == "fortranfree") return FortranFormat_Free;
@@ -7320,18 +7285,18 @@ FortranFormat convertFileNameFortranParserCode(QCString fn)
//------------------------------------------------------------------------
/// Clear a text block \a s from \a begin to \a end markers
-QCString clearBlock(const char *s,const char *begin,const char *end)
+QCString clearBlock(const QCString &s,const QCString &begin,const QCString &end)
{
- if (s==0 || begin==0 || end==0) return s;
+ if (s.isEmpty() || begin.isEmpty() || end.isEmpty()) return s;
const char *p, *q;
- int beginLen = qstrlen(begin);
- int endLen = qstrlen(end);
+ int beginLen = (int)begin.length();
+ int endLen = (int)end.length();
int resLen = 0;
- for (p=s; (q=strstr(p,begin))!=0; p=q+endLen)
+ for (p=s.data(); (q=strstr(p,begin.data()))!=0; p=q+endLen)
{
resLen+=(int)(q-p);
p=q+beginLen;
- if ((q=strstr(p,end))==0)
+ if ((q=strstr(p,end.data()))==0)
{
resLen+=beginLen;
break;
@@ -7342,15 +7307,15 @@ QCString clearBlock(const char *s,const char *begin,const char *end)
QCString result(resLen+1);
char *r;
- for (r=result.rawData(), p=s; (q=strstr(p,begin))!=0; p=q+endLen)
+ for (r=result.rawData(), p=s.data(); (q=strstr(p,begin.data()))!=0; p=q+endLen)
{
int l = (int)(q-p);
memcpy(r,p,l);
r+=l;
p=q+beginLen;
- if ((q=strstr(p,end))==0)
+ if ((q=strstr(p,end.data()))==0)
{
- memcpy(r,begin,beginLen);
+ memcpy(r,begin.data(),beginLen);
r+=beginLen;
break;
}
@@ -7428,7 +7393,7 @@ QCString removeEmptyLines(const QCString &s)
}
}
out.addChar('\0');
- //printf("removeEmptyLines(%s)=%s\n",s.data(),out.data());
+ //printf("removeEmptyLines(%s)=%s\n",qPrint(s),qPrint(out));
return out.data();
}
@@ -7484,3 +7449,17 @@ int findIndex(const std::string &s,const reg::Ex &re)
return reg::search(s,match,re) ? (int)match.position() : -1;
}
+/// create a string where the string in the vector are joined by the given delimiter
+std::string join(const StringVector &sv,const std::string &delimiter)
+{
+ std::string result;
+ bool first=true;
+ for (const auto &s : sv)
+ {
+ if (!first) result+=delimiter;
+ first=false;
+ result+=s;
+ }
+ return result;
+}
+
diff --git a/src/util.h b/src/util.h
index 1d98f8b..67a2cbf 100644
--- a/src/util.h
+++ b/src/util.h
@@ -1,8 +1,6 @@
/******************************************************************************
*
- *
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2021 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
@@ -26,6 +24,7 @@
#include <unordered_map>
#include <algorithm>
#include <functional>
+#include <fstream>
#include <ctype.h>
#include "types.h"
@@ -36,6 +35,8 @@
#include "namespacedef.h"
#include "outputgen.h"
#include "regex.h"
+#include "dir.h"
+#include "conceptdef.h"
//--------------------------------------------------------------------
@@ -52,13 +53,9 @@ class GroupDef;
struct TagInfo;
class PageDef;
class SectionInfo;
-class QDir;
class Definition;
class BufStr;
-class QFileInfo;
-class QStrList;
-class FTextStream;
-class QFile;
+class FileInfo;
//--------------------------------------------------------------------
@@ -67,10 +64,10 @@ class TextGeneratorIntf
{
public:
virtual ~TextGeneratorIntf() {}
- virtual void writeString(const char *,bool) const = 0;
+ virtual void writeString(const QCString &,bool) const = 0;
virtual void writeBreak(int indent) const = 0;
- virtual void writeLink(const char *extRef,const char *file,
- const char *anchor,const char *text
+ virtual void writeLink(const QCString &extRef,const QCString &file,
+ const QCString &anchor,const QCString &text
) const = 0;
};
@@ -80,10 +77,10 @@ class TextGeneratorOLImpl : public TextGeneratorIntf
public:
virtual ~TextGeneratorOLImpl() {}
TextGeneratorOLImpl(OutputDocInterface &od);
- void writeString(const char *s,bool keepSpaces) const;
+ void writeString(const QCString &s,bool keepSpaces) const;
void writeBreak(int indent) const;
- void writeLink(const char *extRef,const char *file,
- const char *anchor,const char *text
+ void writeLink(const QCString &extRef,const QCString &file,
+ const QCString &anchor,const QCString &text
) const;
private:
OutputDocInterface &m_od;
@@ -100,20 +97,20 @@ void linkifyText(const TextGeneratorIntf &ol,
const Definition *scope,
const FileDef *fileScope,
const Definition *self,
- const char *text,
+ const QCString &text,
bool autoBreak=FALSE,
bool external=TRUE,
bool keepSpaces=FALSE,
int indentLevel=0
);
-QCString fileToString(const char *name,bool filter=FALSE,bool isSourceCode=FALSE);
+QCString fileToString(const QCString &name,bool filter=FALSE,bool isSourceCode=FALSE);
QCString dateToString(bool);
bool getDefs(const QCString &scopeName,
const QCString &memberName,
- const char *,
+ const QCString &args,
const MemberDef *&md,
const ClassDef *&cd,
const FileDef *&fd,
@@ -124,10 +121,10 @@ bool getDefs(const QCString &scopeName,
bool checkCV=FALSE
);
-QCString getFileFilter(const char* name,bool isSourceCode);
+QCString getFileFilter(const QCString &name,bool isSourceCode);
-bool resolveRef(/* in */ const char *scName,
- /* in */ const char *name,
+bool resolveRef(/* in */ const QCString &scName,
+ /* in */ const QCString &name,
/* in */ bool inSeeBlock,
/* out */ const Definition **resContext,
/* out */ const MemberDef **resMember,
@@ -136,8 +133,8 @@ bool resolveRef(/* in */ const char *scName,
/* in */ bool checkScope = FALSE
);
-bool resolveLink(/* in */ const char *scName,
- /* in */ const char *lr,
+bool resolveLink(/* in */ const QCString &scName,
+ /* in */ const QCString &lr,
/* in */ bool inSeeBlock,
/* out */ const Definition **resContext,
/* out */ QCString &resAnchor
@@ -146,13 +143,13 @@ bool resolveLink(/* in */ const char *scName,
//bool generateRef(OutputDocInterface &od,const char *,
// const char *,bool inSeeBlock,const char * =0);
-bool generateLink(OutputDocInterface &od,const char *,
- const char *,bool inSeeBlock,const char *);
+bool generateLink(OutputDocInterface &od,const QCString &,
+ const QCString &,bool inSeeBlock,const QCString &);
-void generateFileRef(OutputDocInterface &od,const char *,
- const char *linkTxt=0);
+void generateFileRef(OutputDocInterface &od,const QCString &,
+ const QCString &linkTxt=QCString());
-void writePageRef(OutputDocInterface &od,const char *cn,const char *mn);
+void writePageRef(OutputDocInterface &od,const QCString &cn,const QCString &mn);
QCString getCanonicalTemplateSpec(const Definition *d,const FileDef *fs,const QCString& spec);
@@ -170,31 +167,39 @@ QCString clearBlock(const char *s,const char *begin,const char *end);
QCString selectBlock(const QCString& s,const QCString &name,bool enable, OutputGenerator::OutputType o);
QCString removeEmptyLines(const QCString &s);
-QCString resolveDefines(const char *n);
-
-ClassDef *getClass(const char *key);
-inline ClassDefMutable *getClassMutable(const char *key)
+ClassDef *getClass(const QCString &key);
+inline ClassDefMutable *getClassMutable(const QCString &key)
{
return toClassDefMutable(getClass(key));
}
+ConceptDef *getConcept(const QCString &key);
+inline ConceptDefMutable *getConceptMutable(const QCString &key)
+{
+ return toConceptDefMutable(getConcept(key));
+}
+ConceptDef *getResolvedConcept(const Definition *scope,const QCString &name);
-NamespaceDef *getResolvedNamespace(const char *key);
-inline NamespaceDefMutable *getResolvedNamespaceMutable(const char *key)
+NamespaceDef *getResolvedNamespace(const QCString &key);
+inline NamespaceDefMutable *getResolvedNamespaceMutable(const QCString &key)
{
return toNamespaceDefMutable(getResolvedNamespace(key));
}
-FileDef *findFileDef(const FileNameLinkedMap *fnMap,const char *n,
+FileDef *findFileDef(const FileNameLinkedMap *fnMap,const QCString &n,
bool &ambig);
-QCString showFileDefMatches(const FileNameLinkedMap *fnMap,const char *n);
+QCString showFileDefMatches(const FileNameLinkedMap *fnMap,const QCString &n);
-int guessSection(const char *name);
+int guessSection(const QCString &name);
inline bool isId(int c)
{
return c=='_' || c>=128 || c<0 || isalnum(c);
}
+inline bool isIdJS(int c)
+{
+ return c>=128 || c<0 || isalnum(c);
+}
QCString removeRedundantWhiteSpace(const QCString &s);
@@ -216,25 +221,26 @@ bool rightScopeMatch(const QCString &scope, const QCString &name);
bool leftScopeMatch(const QCString &scope, const QCString &name);
-QCString substituteKeywords(const QCString &s,const char *title,
- const char *projName,const char *projNum,const char *projBrief);
+QCString substituteKeywords(const QCString &s,const QCString &title,
+ const QCString &projName,const QCString &projNum,const QCString &projBrief);
int getPrefixIndex(const QCString &name);
-QCString removeAnonymousScopes(const char *s);
+QCString removeAnonymousScopes(const QCString &s);
-QCString replaceAnonymousScopes(const char *s,const char *replacement=0);
+QCString replaceAnonymousScopes(const QCString &s,const QCString &replacement=QCString());
bool hasVisibleRoot(const BaseClassList &bcl);
bool classHasVisibleChildren(const ClassDef *cd);
bool namespaceHasNestedNamespace(const NamespaceDef *nd);
+bool namespaceHasNestedConcept(const NamespaceDef *nd);
bool namespaceHasNestedClass(const NamespaceDef *nd,bool filterClasses,ClassDef::CompoundType ct);
bool classVisibleInIndex(const ClassDef *cd);
int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level=0);
Protection classInheritedProtectionLevel(const ClassDef *cd,const ClassDef *bcd,Protection prot=Public,int level=0);
-QCString convertNameToFile(const char *name,bool allowDots=FALSE,bool allowUnderscore=FALSE);
+QCString convertNameToFile(const QCString &name,bool allowDots=FALSE,bool allowUnderscore=FALSE);
void extractNamespaceName(const QCString &scopeName,
QCString &className,QCString &namespaceName,
@@ -242,22 +248,22 @@ void extractNamespaceName(const QCString &scopeName,
QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &templ);
-QCString stripScope(const char *name);
+QCString stripScope(const QCString &name);
-QCString convertToId(const char *s);
-QCString correctId(QCString s);
+QCString convertToId(const QCString &s);
+QCString correctId(const QCString &s);
-QCString convertToHtml(const char *s,bool keepEntities=TRUE);
+QCString convertToHtml(const QCString &s,bool keepEntities=TRUE);
QCString convertToLaTeX(const QCString &s,bool insideTabbing=FALSE,bool keepSpaces=FALSE);
-QCString convertToXML(const char *s, bool keepEntities=FALSE);
+QCString convertToXML(const QCString &s, bool keepEntities=FALSE);
-QCString convertToDocBook(const char *s);
+QCString convertToDocBook(const QCString &s);
-QCString convertToJSString(const char *s);
+QCString convertToJSString(const QCString &s);
-QCString convertToPSString(const char *s);
+QCString convertToPSString(const QCString &s);
QCString getOverloadDocs();
@@ -265,7 +271,7 @@ void addMembersToMemberGroup(/* in,out */ MemberList *ml,
/* in,out */ MemberGroupList *pMemberGroups,
/* in */ const Definition *context);
-int extractClassNameFromType(const char *type,int &pos,
+int extractClassNameFromType(const QCString &type,int &pos,
QCString &name,QCString &templSpec,SrcLangExt=SrcLangExt_Unknown);
QCString normalizeNonTemplateArgumentsInString(
@@ -274,7 +280,7 @@ QCString normalizeNonTemplateArgumentsInString(
const ArgumentList &formalArgs);
QCString substituteTemplateArgumentsInString(
- const std::string &name,
+ const QCString &name,
const ArgumentList &formalArgs,
const std::unique_ptr<ArgumentList> &actualArgs);
@@ -292,17 +298,17 @@ int getScopeFragment(const QCString &s,int p,int *l);
int filterCRLF(char *buf,int len);
void addRefItem(const RefItemVector &sli,
- const char *key,
- const char *prefix,
- const char *name,
- const char *title,
- const char *args,
+ const QCString &key,
+ const QCString &prefix,
+ const QCString &name,
+ const QCString &title,
+ const QCString &args,
const Definition *scope);
-PageDef *addRelatedPage(const char *name,
+PageDef *addRelatedPage(const QCString &name,
const QCString &ptitle,
const QCString &doc,
- const char *fileName,
+ const QCString &fileName,
int docLine,
int startLine,
const RefItemVector &sli = RefItemVector(),
@@ -312,34 +318,34 @@ PageDef *addRelatedPage(const char *name,
SrcLangExt lang=SrcLangExt_Unknown
);
-QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscore=FALSE);
-QCString unescapeCharsInString(const char *s);
+QCString escapeCharsInString(const QCString &name,bool allowDots,bool allowUnderscore=FALSE);
+QCString unescapeCharsInString(const QCString &s);
void addGroupListToTitle(OutputList &ol,const Definition *d);
-void filterLatexString(FTextStream &t,const char *str,
+void filterLatexString(TextStream &t,const QCString &str,
bool insideTabbing,
bool insidePre,
bool insideItem,
bool insideTable,
bool keepSpaces);
-QCString latexEscapeLabelName(const char *s);
-QCString latexEscapeIndexChars(const char *s);
-QCString latexEscapePDFString(const char *s);
-QCString latexFilterURL(const char *s);
+QCString latexEscapeLabelName(const QCString &s);
+QCString latexEscapeIndexChars(const QCString &s);
+QCString latexEscapePDFString(const QCString &s);
+QCString latexFilterURL(const QCString &s);
-QCString rtfFormatBmkStr(const char *name);
+QCString rtfFormatBmkStr(const QCString &name);
-QCString linkToText(SrcLangExt lang,const char *link,bool isFileName);
+QCString linkToText(SrcLangExt lang,const QCString &link,bool isFileName);
bool checkExtension(const char *fName, const char *ext);
-QCString addHtmlExtensionIfMissing(const char *fName);
+QCString addHtmlExtensionIfMissing(const QCString &fName);
-QCString stripExtensionGeneral(const char *fName, const char *ext);
+QCString stripExtensionGeneral(const QCString &fName, const QCString &ext);
-QCString stripExtension(const char *fName);
+QCString stripExtension(const QCString &fName);
void replaceNamespaceAliases(QCString &scope,int i);
@@ -347,13 +353,13 @@ int computeQualifiedIndex(const QCString &name);
void addDirPrefix(QCString &fileName);
-QCString relativePathToRoot(const char *name);
+QCString relativePathToRoot(const QCString &name);
-void createSubDirs(QDir &d);
+void createSubDirs(const Dir &d);
-QCString stripPath(const char *s);
+QCString stripPath(const QCString &s);
-bool containsWord(const char *s,const char *word);
+bool containsWord(const QCString &s,const char *word);
bool findAndRemoveWord(QCString &s,const char *word);
@@ -365,7 +371,7 @@ QCString getFileNameExtension(QCString fn);
void initDefaultExtensionMapping();
void addCodeOnlyMappings();
-bool checkIfTypedef(const Definition *scope,const FileDef *fileScope,const char *n);
+bool checkIfTypedef(const Definition *scope,const FileDef *fileScope,const QCString &n);
QCString parseCommentAsText(const Definition *scope,const MemberDef *member,const QCString &doc,const QCString &fileName,int lineNr);
@@ -375,27 +381,26 @@ QCString recodeString(const QCString &str,const char *fromEncoding,const char *t
QCString extractAliasArgs(const QCString &args,int pos);
-int countAliasArguments(const QCString argList);
+int countAliasArguments(const QCString &argList);
-QCString resolveAliasCmd(const QCString aliasCmd);
+QCString resolveAliasCmd(const QCString &aliasCmd);
std::string expandAlias(const std::string &aliasName,const std::string &aliasValue);
void writeTypeConstraints(OutputList &ol,const Definition *d,const ArgumentList &al);
-QCString convertCharEntitiesToUTF8(const char *s);
+QCString convertCharEntitiesToUTF8(const QCString &s);
void stackTrace();
-bool readInputFile(const char *fileName,BufStr &inBuf,
+bool readInputFile(const QCString &fileName,BufStr &inBuf,
bool filter=TRUE,bool isSourceCode=FALSE);
-QCString filterTitle(const std::string &title);
+QCString filterTitle(const QCString &title);
-bool patternMatch(const QFileInfo &fi,const StringVector &patList);
+bool patternMatch(const FileInfo &fi,const StringVector &patList);
QCString externalLinkTarget(const bool parent = false);
QCString externalRef(const QCString &relPath,const QCString &ref,bool href);
int nextUtf8CharPosition(const QCString &utf8Str,uint len,uint startPos);
-const char *writeUtf8Char(FTextStream &t,const char *s);
void writeMarkerList(OutputList &ol,const std::string &markerText,size_t numMarkers,
std::function<void(size_t)> replaceFunc);
@@ -410,12 +415,12 @@ struct ColoredImgDataItem
unsigned char *alpha;
};
-void writeColoredImgData(const char *dir,ColoredImgDataItem data[]);
-QCString replaceColorMarkers(const char *str);
+void writeColoredImgData(const QCString &dir,ColoredImgDataItem data[]);
+QCString replaceColorMarkers(const QCString &str);
bool copyFile(const QCString &src,const QCString &dest);
-QCString extractBlock(const QCString text,const QCString marker);
-int lineBlock(const QCString text,const QCString marker);
+QCString extractBlock(const QCString &text,const QCString &marker);
+int lineBlock(const QCString &text,const QCString &marker);
bool isURL(const QCString &url);
@@ -432,19 +437,6 @@ QCString getDotImageExtension();
bool fileVisibleInIndex(const FileDef *fd,bool &genSourceFile);
-const int MAX_UTF8_CHAR_LEN = 4;
-const int MAX_UTF8_CHAR_SIZE = MAX_UTF8_CHAR_LEN+1; // include 0 terminator
-enum class CaseModifier
-{
- None,
- ToUpper,
- ToLower
-};
-int getUtf8Char(const char *input,char ids[MAX_UTF8_CHAR_SIZE],CaseModifier modifier=CaseModifier::None);
-uint getUtf8Code( const QCString& s, int idx );
-uint getUtf8CodeToLower( const QCString& s, int idx );
-uint getUtf8CodeToUpper( const QCString& s, int idx );
-
QCString extractDirection(QCString &docs);
void convertProtectionLevel(
@@ -455,16 +447,17 @@ void convertProtectionLevel(
);
bool mainPageHasTitle();
-bool openOutputFile(const char *outFile,QFile &f);
-void writeExtraLatexPackages(FTextStream &t);
-void writeLatexSpecialFormulaChars(FTextStream &t);
+bool openOutputFile(const QCString &outFile,std::ofstream &f);
+void writeExtraLatexPackages(TextStream &t);
+void writeLatexSpecialFormulaChars(TextStream &t);
StringVector split(const std::string &s,const std::string &delimiter);
StringVector split(const std::string &s,const reg::Ex &delimiter);
int findIndex(const StringVector &sv,const std::string &s);
int findIndex(const std::string &s,const reg::Ex &re);
+std::string join(const StringVector &s,const std::string &delimiter);
-bool recognizeFixedForm(const char* contents, FortranFormat format);
+bool recognizeFixedForm(const QCString &contents, FortranFormat format);
FortranFormat convertFileNameFortranParserCode(QCString fn);
#endif
diff --git a/src/vhdlcode.h b/src/vhdlcode.h
index 48c15bb..c563a8f 100644
--- a/src/vhdlcode.h
+++ b/src/vhdlcode.h
@@ -29,11 +29,11 @@ class VHDLCodeParser : public CodeParserInterface
VHDLCodeParser();
virtual ~VHDLCodeParser();
void parseCode(CodeOutputInterface &codeOutIntf,
- const char *scopeName,
+ const QCString &scopeName,
const QCString &input,
SrcLangExt lang,
bool isExampleBlock,
- const char *exampleName=0,
+ const QCString &exampleName=QCString(),
FileDef *fileDef=0,
int startLine=-1,
int endLine=-1,
diff --git a/src/vhdlcode.l b/src/vhdlcode.l
index c363a23..1fc1858 100644
--- a/src/vhdlcode.l
+++ b/src/vhdlcode.l
@@ -37,8 +37,6 @@
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
-#include <qdir.h>
-#include <qcstringlist.h>
#include "vhdlcode.h"
#include "entry.h"
@@ -112,27 +110,27 @@ struct vhdlcodeYY_state
};
-static void writeFont(yyscan_t yyscanner,const char *s,const char* text);
+static void writeFont(yyscan_t yyscanner,const char *s,const QCString &text);
static void generateMemLink(yyscan_t yyscanner,CodeOutputInterface &ol,QCString &clName,QCString& memberName);
static bool writeColoredWord(yyscan_t yyscanner,QCString& word );
-static void generateClassOrGlobalLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *clName, bool typeOnly=false, const char *curr_class=0);
+static void generateClassOrGlobalLink(yyscan_t yyscanner,CodeOutputInterface &ol,const QCString &clName, bool typeOnly=false, const QCString &curr_class=QCString());
static void setCurrentDoc(yyscan_t yyscanner,const QCString &anchor);
static bool checkVhdlString(yyscan_t yyscanner,QCString &name);
-static void addToSearchIndex(yyscan_t yyscanner,const char *text);
+static void addToSearchIndex(yyscan_t yyscanner,const QCString &text);
static void startCodeLine(yyscan_t yyscanner);
static void endCodeLine(yyscan_t yyscanner);
static void nextCodeLine(yyscan_t yyscanner);
-static void writeWord(yyscan_t yyscanner,const char *word,const char* curr_class=0,bool classLink=false);
-static void codifyLines(yyscan_t yyscanner,const char *text,const char *cl=0,bool classlink=false,bool comment=false);
+static void writeWord(yyscan_t yyscanner,const QCString &word,const QCString &curr_class=QCString(),bool classLink=false);
+static void codifyLines(yyscan_t yyscanner,const QCString &text,const QCString &cl=QCString(),bool classlink=false,bool comment=false);
static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
const Definition *d,
- const char *text);
+ const QCString &text);
static void generateFuncLink(yyscan_t yyscanner,CodeOutputInterface &ol,const MemberDef* mdef);
static int countLines(yyscan_t yyscanner);
static void endFontClass(yyscan_t yyscanner);
static void startFontClass(yyscan_t yyscanner,const char *s);
static void appStringLower(QCString& qcs,const char* text);
-static void codifyMapLines(yyscan_t yyscanner,const char *text);
+static void codifyMapLines(yyscan_t yyscanner,const QCString &text);
static void writeFuncProto(yyscan_t yyscanner);
static void writeProcessProto(yyscan_t yyscanner);
static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
@@ -230,7 +228,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
if (ql.size()>=2)
{
unsigned int index=0;
- QCString t1=ql[0];
+ QCString t1(ql[0]);
char cc=t1.at(index);
while (cc==' ' || cc=='\t')
{
@@ -261,7 +259,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
}
codifyLines(yyscanner,"=>");
index=0;
- QCString s2=ql[1];
+ QCString s2(ql[1]);
t1=s2;
cc=t1.at(index);
while (cc==' ' || cc=='\t')
@@ -289,7 +287,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
}
else
{
- codifyLines(yyscanner,yytext,yyextra->currClass.data());
+ codifyLines(yyscanner,yytext,yyextra->currClass);
}
BEGIN(Map);
}
@@ -355,7 +353,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
<ParseType>{ENDEFUNC} {
QCString tt(yytext);
- codifyLines(yyscanner,yytext,yyextra->currClass.data());
+ codifyLines(yyscanner,yytext,yyextra->currClass);
tt=tt.lower();
VhdlDocGen::deleteAllChars(tt,';');
tt.stripWhiteSpace();
@@ -376,12 +374,12 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
}
<ParseType>{END1} {
- codifyLines(yyscanner,yytext,yyextra->currClass.data());
+ codifyLines(yyscanner,yytext,yyextra->currClass);
yyextra->vhdlKeyDict.clear();
}
<ParseType>^{B}*("begin "|"begin") {
- codifyLines(yyscanner,yytext,yyextra->currClass.data());
+ codifyLines(yyscanner,yytext,yyextra->currClass);
yyextra->isFuncProto=false;
}
@@ -389,7 +387,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
yyextra->funcProto.append(yytext);
if (yyextra->isProto)
{
- codifyLines(yyscanner,yytext,yyextra->currClass.data());
+ codifyLines(yyscanner,yytext,yyextra->currClass);
}
}
@@ -414,7 +412,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
if (VhdlDocGen::isNumber(val.str()))
{
startFontClass(yyscanner,"vhdllogic");
- codifyLines(yyscanner,yytext,yyextra->currClass.data());
+ codifyLines(yyscanner,yytext,yyextra->currClass);
endFontClass(yyscanner);
}
else
@@ -424,7 +422,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
}
else
{
- codifyLines(yyscanner,yytext,yyextra->currClass.data());
+ codifyLines(yyscanner,yytext,yyextra->currClass);
}
}
}
@@ -574,26 +572,25 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
}
<ParsePackage>[^:;]* { //found package
- QCString temp(yytext);
- QCStringList strl=QCStringList::split(".",temp);
- if (strl.count()>2)
+ StringVector strl=split(yytext,".");
+ if (strl.size()>2)
{
- QCString s1=strl[0];
- QCString s2=strl[1];
- QCString s3=strl[2];
+ std::string s1=strl[0];
+ std::string s2=strl[1];
+ std::string s3=strl[2];
s1.append(".");
- s3.prepend(".");
- codifyLines(yyscanner,s1.data(),yyextra->currClass.data());
- ClassDef *cd=VhdlDocGen::getPackageName(s2);
+ s3.insert(0,".");
+ codifyLines(yyscanner,s1.c_str(),yyextra->currClass);
+ ClassDef *cd=VhdlDocGen::getPackageName(s2.c_str());
if (cd)
{
- generateClassOrGlobalLink(yyscanner,*yyextra->code,s2.data());
+ generateClassOrGlobalLink(yyscanner,*yyextra->code,s2.c_str());
}
else
{
- codifyLines(yyscanner,s2.data());
+ codifyLines(yyscanner,s2.c_str());
}
- codifyLines(yyscanner,s3.data());
+ codifyLines(yyscanner,s3.c_str());
}
else
{
@@ -609,27 +606,27 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
if (j>0)
{
QCString left=tt.left(j+1);
- codifyLines(yyscanner,left.data());
+ codifyLines(yyscanner,left);
tt=tt.right(tt.length()-j-1);
- left=VhdlDocGen::getIndexWord(tt.data(),0);
+ left=VhdlDocGen::getIndexWord(tt,0);
if (!left.isEmpty())
{
if (left.contains('('))
{
j=left.find('(',false);
QCString name=left.left(j);
- generateClassOrGlobalLink(yyscanner,*yyextra->code,name.data());
+ generateClassOrGlobalLink(yyscanner,*yyextra->code,name);
yyextra->PortMapComp=name;
name=tt.right(tt.length()-name.length());
- codifyLines(yyscanner,name.data());
+ codifyLines(yyscanner,name);
}
else
{
- generateClassOrGlobalLink(yyscanner,*yyextra->code,left.data());
- tt.stripPrefix(left.data()); //=tt.right(tt.length()-left.length()-1);
+ generateClassOrGlobalLink(yyscanner,*yyextra->code,left);
+ tt.stripPrefix(left); //=tt.right(tt.length()-left.length()-1);
yyextra->PortMapComp=left;
- codifyLines(yyscanner,tt.data());
+ codifyLines(yyscanner,tt);
}
}
}
@@ -637,11 +634,11 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
{
if (tt.contains(':',false))
{
- codifyMapLines(yyscanner,tt.data());
+ codifyMapLines(yyscanner,tt);
}
else
{
- codifyLines(yyscanner,tt.data());
+ codifyLines(yyscanner,tt);
}
}
yyextra->braceCount=1;
@@ -654,7 +651,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
temp=temp.stripWhiteSpace();
VhdlDocGen::deleteAllChars(temp,'\n');
yyextra->tempComp=temp;
- codifyLines(yyscanner,yytext,temp.data(),true);
+ codifyLines(yyscanner,yytext,temp,true);
yyextra->braceCount=0;
yyextra->isComponent=true;
BEGIN(ParseComponent);
@@ -670,7 +667,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
temp+=VhdlDocGen::getIndexWord(yytext,1);
yyextra->currClass=temp;
VhdlDocGen::deleteAllChars(temp,'\n');
- codifyLines(yyscanner,yytext,temp.data(),true);
+ codifyLines(yyscanner,yytext,temp,true);
yyextra->isPackageBody=false;
}
@@ -678,12 +675,12 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
<Bases>^{B}*("package "){BN}*("body"){BN}*{FUNCNAME} { // found package body
QCString ss(yytext);
QCString temp=VhdlDocGen::getIndexWord(yytext,2);
- QCStringList ql=QCStringList::split(temp,ss);
- QCString ll=ql[0];
- codifyLines(yyscanner,ll.data(),yyextra->currClass.data());
+ StringVector ql=split(yytext,temp.str());
+ std::string ll=ql[0];
+ codifyLines(yyscanner,ll.c_str(),yyextra->currClass);
temp=temp.stripWhiteSpace();
temp.prepend("_");
- generateClassOrGlobalLink(yyscanner,*yyextra->code,temp.data());
+ generateClassOrGlobalLink(yyscanner,*yyextra->code,temp);
yyextra->currClass.resize(0);
yyextra->currClass=temp;
yyextra->isProto=false;
@@ -746,13 +743,13 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
}
<Bases>"end"{BN}+"architecture"{BN}+{FUNCNAME} {
- codifyLines(yyscanner,yytext,yyextra->currClass.data(),true);
+ codifyLines(yyscanner,yytext,yyextra->currClass,true);
yyextra->currArch = false;
}
<Bases>"end"{BN}+{FUNCNAME} {
if (yyextra->currArch)
{
- codifyLines(yyscanner,yytext,yyextra->currClass.data(),true);
+ codifyLines(yyscanner,yytext,yyextra->currClass,true);
yyextra->currArch = false;
}
else
@@ -775,7 +772,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
if (!writeColoredWord(yyscanner,temp))
{
- generateClassOrGlobalLink(yyscanner,*yyextra->code,temp.data());
+ generateClassOrGlobalLink(yyscanner,*yyextra->code,temp);
}
}
<End>";" {
@@ -813,7 +810,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
}
<Bases>^{B}*("use"){BN}+("entity"|"component")[^\n]* {
- codifyLines(yyscanner,yytext,yyextra->currClass.data(),true);
+ codifyLines(yyscanner,yytext,yyextra->currClass,true);
}
@@ -862,7 +859,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
<Bases>^{B}*{XILINX}/[^a-zA-Z0-9_] {
writeWord(yyscanner,yytext);
- //codifyLines(yyscanner,yytext,yyextra->currClass.data(),true);
+ //codifyLines(yyscanner,yytext,yyextra->currClass,true);
}
<Bases>^{B}*"set_"[^\n]* {
@@ -972,7 +969,7 @@ static bool checkVhdlString(yyscan_t yyscanner,QCString &name)
else
{
startFontClass(yyscanner,"keyword");
- yyextra->code->codify(name.data());
+ yyextra->code->codify(name);
endFontClass(yyscanner);
}
return true;
@@ -981,14 +978,14 @@ static bool checkVhdlString(yyscan_t yyscanner,QCString &name)
if (VhdlDocGen::isNumber(name.str()))
{
startFontClass(yyscanner,"vhdllogic");
- yyextra->code->codify(name.data());
+ yyextra->code->codify(name);
endFontClass(yyscanner);
return true;
}
return false;
}
-static void addToSearchIndex(yyscan_t yyscanner,const char *text)
+static void addToSearchIndex(yyscan_t yyscanner,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (Doxygen::searchIndex)
@@ -1014,14 +1011,14 @@ static void startCodeLine(yyscan_t yyscanner)
// if ((yyextra->yyLineNr % 500) == 0)
// fprintf(stderr,"\n starting Line %d:",yyextra->yyLineNr);
const Definition *d = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
- //printf("startCodeLine %d d=%s\n", yyextra->yyLineNr,d ? d->name().data() : "<null>");
+ //printf("startCodeLine %d d=%s\n", yyextra->yyLineNr,qPrint(d ? d->name()) : "<null>");
if (!yyextra->includeCodeFragment && d)
{
yyextra->currentDefinition = d;
yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
if (!yyextra->tempComp.isEmpty() && yyextra->currentMemberDef )
{
- //ClassDef *cf=VhdlDocGen::getClass(yyextra->tempComp.data());
+ //ClassDef *cf=VhdlDocGen::getClass(yyextra->tempComp);
QCString nn=yyextra->currentMemberDef->name();
const MemberDef* mdeff=VhdlDocGen::findMember(yyextra->tempComp,nn);
if (mdeff)
@@ -1043,13 +1040,13 @@ static void startCodeLine(yyscan_t yyscanner)
{
yyextra->code->writeLineNumber(d->getReference(),
d->getOutputFileBase(),
- 0,yyextra->yyLineNr);
+ QCString(),yyextra->yyLineNr);
setCurrentDoc(yyscanner,lineAnchor);
}
}
else
{
- yyextra->code->writeLineNumber(0,0,0,yyextra->yyLineNr);
+ yyextra->code->writeLineNumber(QCString(),QCString(),QCString(),yyextra->yyLineNr);
}
}
yyextra->code->startCodeLine(yyextra->sourceFileDef);
@@ -1087,7 +1084,7 @@ static void nextCodeLine(yyscan_t yyscanner)
* and will be linked.
*/
-static void writeWord(yyscan_t yyscanner,const char *word,const char* curr_class,bool classLink)
+static void writeWord(yyscan_t yyscanner,const QCString &word,const QCString &curr_class,bool classLink)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
bool found=false;
@@ -1105,8 +1102,8 @@ static void writeWord(yyscan_t yyscanner,const char *word,const char* curr_class
if (!writeColoredWord(yyscanner,temp)) // is it a keyword ?
{
//if (VhdlDocGen::findKeyWord(temp))
- // writeFont(yyscanner,"vhdlkeyword",temp.data());
- //printf("writeWord: %s\n",temp.data());
+ // writeFont(yyscanner,"vhdlkeyword",temp);
+ //printf("writeWord: %s\n",qPrint(temp));
if (!tclass.isEmpty())
{
if (!classLink)
@@ -1122,7 +1119,7 @@ static void writeWord(yyscan_t yyscanner,const char *word,const char* curr_class
{
if (!checkVhdlString(yyscanner,temp))
{
- yyextra->code->codify(temp.data());
+ yyextra->code->codify(temp);
}
}
}
@@ -1159,16 +1156,16 @@ static void writeWord(yyscan_t yyscanner,const char *word,const char* curr_class
}
else
{
- QCString qc(temp.data());
+ QCString qc(temp);
if (VhdlDocGen::isNumber(qc.str()))
{
startFontClass(yyscanner,"vhdllogic");
- yyextra->code->codify(temp.data());
+ yyextra->code->codify(temp);
endFontClass(yyscanner);
}
else
{
- yyextra->code->codify(temp.data());
+ yyextra->code->codify(temp);
}
}
}
@@ -1179,12 +1176,12 @@ static void writeWord(yyscan_t yyscanner,const char *word,const char* curr_class
/*! write a code fragment 'text' that may span multiple lines, inserting
* line numbers for each line.
*/
-static void codifyLines(yyscan_t yyscanner,const char *text,const char *cl,bool classlink,bool comment)
+static void codifyLines(yyscan_t yyscanner,const QCString &text,const QCString &cl,bool classlink,bool comment)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- if (text==0) return;
+ if (text.isEmpty()) return;
//printf("codifyLines(%d,\"%s\")\n",yyextra->yyLineNr,text);
- const char *p=text,*sp=p;
+ const char *p=text.data(),*sp=p;
char c;
bool done=false;
while (!done)
@@ -1198,7 +1195,7 @@ static void codifyLines(yyscan_t yyscanner,const char *text,const char *cl,bool
line = line.left((int)(p-sp)-1);
if (comment)
{
- writeFont(yyscanner,"comment",line.data());
+ writeFont(yyscanner,"comment",line);
}
else
{
@@ -1227,9 +1224,10 @@ static void codifyLines(yyscan_t yyscanner,const char *text,const char *cl,bool
*/
static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
const Definition *d,
- const char *text)
+ const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ if (text.isEmpty()) return;
static bool sourceTooltips = Config_getBool(SOURCE_TOOLTIPS);
TooltipManager::instance().addTooltip(ol,d);
QCString ref = d->getReference();
@@ -1241,7 +1239,7 @@ static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
tooltip = d->briefDescriptionAsTooltip();
}
bool done=false;
- char *p=(char *)text;
+ char *p=(char *)text.rawData();
while (!done)
{
char *sp=p;
@@ -1267,7 +1265,7 @@ static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
*/
static void generateFuncLink(yyscan_t yyscanner,CodeOutputInterface &ol,const MemberDef* mdef)
{
- //printf("generateFuncLink(FuncName=%s)\n",mdef->name().data());
+ //printf("generateFuncLink(FuncName=%s)\n",qPrint(mdef->name()));
QCString memberName=mdef->name();
if (mdef->isLinkable()) // is it a linkable class
@@ -1276,7 +1274,7 @@ static void generateFuncLink(yyscan_t yyscanner,CodeOutputInterface &ol,const Me
addToSearchIndex(yyscanner,memberName);
return;
}
- codifyLines(yyscanner,memberName.data());
+ codifyLines(yyscanner,memberName);
addToSearchIndex(yyscanner,memberName);
} // generateFuncLink
@@ -1286,7 +1284,7 @@ static void generateMemLink(yyscan_t yyscanner,CodeOutputInterface &ol,QCString
if (memberName.isEmpty()) return;
if (clName.isEmpty())
{
- codifyLines(yyscanner,memberName.data());
+ codifyLines(yyscanner,memberName);
return;
}
@@ -1297,7 +1295,7 @@ static void generateMemLink(yyscan_t yyscanner,CodeOutputInterface &ol,QCString
//bool isLocal=false;
const MemberDef *md=VhdlDocGen::findMember(className,memberName);
- ClassDef *po=VhdlDocGen::getClass(className.data());
+ ClassDef *po=VhdlDocGen::getClass(className);
if (md==0 && po && (VhdlDocGen::VhdlClasses)po->protection()==VhdlDocGen::PACKBODYCLASS)
{
@@ -1313,12 +1311,13 @@ static void generateMemLink(yyscan_t yyscanner,CodeOutputInterface &ol,QCString
return;
}
// nothing found, just write out the word
- codifyLines(yyscanner,memberName.data());
+ codifyLines(yyscanner,memberName);
addToSearchIndex(yyscanner,memberName);
}// generateMemLink
-static void generateClassOrGlobalLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *clName, bool /*typeOnly*/, const char *curr_class)
+static void generateClassOrGlobalLink(yyscan_t yyscanner,CodeOutputInterface &ol,
+ const QCString &clName, bool /*typeOnly*/, const QCString &curr_class)
{
QCString className=clName;
@@ -1328,8 +1327,8 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,CodeOutputInterface &ol
//MemberDef *md=0;
//bool isLocal=false;
className.stripPrefix("_");
- cd = getClass(className.data());
- if (!cd && curr_class)
+ cd = getClass(className);
+ if (!cd && !curr_class.isEmpty())
{
QCString cls = curr_class;
QCString suffix = "::";
@@ -1412,10 +1411,10 @@ static void startFontClass(yyscan_t yyscanner,const char *s)
yyextra->currentFontClass=s;
}
-static void writeFont(yyscan_t yyscanner,const char *s,const char* text)
+static void writeFont(yyscan_t yyscanner,const char *s,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- if (s==0 || text==0) return;
+ if (s==0 || text.isEmpty()) return;
//printf("writeFont(yyscanner,%d,\"%s\")\n",yyextra->yyLineNr,text);
yyextra->code->startFontClass(s);
yyextra->code->codify(text);
@@ -1432,16 +1431,16 @@ static void appStringLower(QCString& qcs,const char* text)
}
/* writes and links a port map statement */
-static void codifyMapLines(yyscan_t yyscanner,const char *text)
+static void codifyMapLines(yyscan_t yyscanner,const QCString &text)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- if (text==0) return;
+ if (text.isEmpty()) return;
QCString temp;
//bool dot=false;
int wordCounter=0;
QCString ctemp;
- //printf("codifyMapLines(%d,\"%s\")\n",yyextra->yyLineNr,text);
- const char *p=text; //,*sp=p;
+ //printf("codifyMapLines(%d,\"%s\")\n",yyextra->yyLineNr,qPrint(text));
+ const char *p=text.data();
char c;
bool done=false;
while (!done)
@@ -1480,7 +1479,7 @@ static void codifyMapLines(yyscan_t yyscanner,const char *text)
}
}
ctemp.fill(c,1);
- codifyLines(yyscanner,ctemp.data());
+ codifyLines(yyscanner,ctemp);
ctemp.resize(0);
temp.resize(0);
}//while
@@ -1498,13 +1497,13 @@ static void writeFuncProto(yyscan_t yyscanner)
if (name.isEmpty())
{
- codifyLines(yyscanner,yyextra->funcProto.data(),yyextra->currClass.data());
+ codifyLines(yyscanner,yyextra->funcProto,yyextra->currClass);
return;
}
- QCStringList qlist=QCStringList::split(name,yyextra->funcProto);
- QCString temp=qlist[0];
- codifyLines(yyscanner,temp.data(),yyextra->currClass.data());
- yyextra->funcProto.stripPrefix(temp.data());
+ StringVector qlist=split(yyextra->funcProto.str(),name.str());
+ QCString temp(qlist[0]);
+ codifyLines(yyscanner,temp,yyextra->currClass);
+ yyextra->funcProto.stripPrefix(temp);
temp.resize(0);
temp=yyextra->currClass;
if (yyextra->isPackageBody)
@@ -1516,12 +1515,12 @@ static void writeFuncProto(yyscan_t yyscanner)
if (mdef)
{
generateFuncLink(yyscanner,*yyextra->code,mdef);
- yyextra->funcProto.stripPrefix(name.data());
- codifyLines(yyscanner,yyextra->funcProto.data(),yyextra->currClass.data());
+ yyextra->funcProto.stripPrefix(name);
+ codifyLines(yyscanner,yyextra->funcProto,yyextra->currClass);
}
else
{
- codifyLines(yyscanner,yyextra->funcProto.data(),yyextra->currClass.data());
+ codifyLines(yyscanner,yyextra->funcProto,yyextra->currClass);
}
}// writeFuncProto
@@ -1530,7 +1529,7 @@ static void writeFuncProto(yyscan_t yyscanner)
static void writeProcessProto(yyscan_t yyscanner)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- codifyLines(yyscanner,yyextra->funcProto.data(),yyextra->currClass.data());
+ codifyLines(yyscanner,yyextra->funcProto,yyextra->currClass);
yyextra->vhdlKeyDict.clear();
}// writeProcessProto
@@ -1542,7 +1541,7 @@ static bool writeColoredWord(yyscan_t yyscanner,QCString& word )
const char *ss=VhdlDocGen::findKeyWord(qcs);
if (ss)
{
- writeFont(yyscanner,ss,word.data());
+ writeFont(yyscanner,ss,word);
return true;
}
return false;
@@ -1576,11 +1575,11 @@ void VHDLCodeParser::resetCodeParserState()
}
void VHDLCodeParser::parseCode(CodeOutputInterface &od,
- const char *className,
+ const QCString &className,
const QCString &s,
SrcLangExt,
bool exBlock,
- const char *exName,
+ const QCString &exName,
FileDef *fd,
int startLine,
int endLine,
@@ -1594,7 +1593,7 @@ void VHDLCodeParser::parseCode(CodeOutputInterface &od,
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
//printf("***parseCode() exBlock=%d exName=%s fd=%p\n",exBlock,exName,fd);
if (s.isEmpty()) return;
- printlex(yy_flex_debug, true, __FILE__, fd ? fd->fileName().data(): NULL);
+ printlex(yy_flex_debug, true, __FILE__, fd ? qPrint(fd->fileName()): NULL);
if (memberDef)
{
const ClassDef *dd=memberDef->getClassDef();
@@ -1602,7 +1601,7 @@ void VHDLCodeParser::parseCode(CodeOutputInterface &od,
}
resetCodeParserState();
yyextra->code = &od;
- yyextra->inputString = s;
+ yyextra->inputString = s.data();
yyextra->inputPosition = 0;
yyextra->currentFontClass = 0;
yyextra->needsTermination = false;
@@ -1667,7 +1666,7 @@ void VHDLCodeParser::parseCode(CodeOutputInterface &od,
// write the tooltips
TooltipManager::instance().writeTooltips(od);
- printlex(yy_flex_debug, false, __FILE__, fd ? fd->fileName().data(): NULL);
+ printlex(yy_flex_debug, false, __FILE__, fd ? qPrint(fd->fileName()): NULL);
}
#if USE_STATE2STRING
diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp
index 86110a8..f0763db 100644
--- a/src/vhdldocgen.cpp
+++ b/src/vhdldocgen.cpp
@@ -27,13 +27,11 @@
#include <map>
#include <algorithm>
-#include <qcstring.h>
-#include <qfileinfo.h>
-#include <qcstringlist.h>
/* --------------------------------------------------------------- */
// local includes
+#include "qcstring.h"
#include "vhdldocgen.h"
#include "message.h"
#include "config.h"
@@ -63,25 +61,26 @@
#include "VhdlParser.h"
#include "regex.h"
#include "plantuml.h"
+#include "textstream.h"
//#define DEBUGFLOW
#define theTranslator_vhdlType theTranslator->trVhdlType
-static void initUCF(Entry* root,const char* type,QCString & qcs,int line,QCString & fileName,QCString & brief);
+static void initUCF(Entry* root,const QCString &type,QCString &qcs,int line,const QCString & fileName,QCString & brief);
static void writeUCFLink(const MemberDef* mdef,OutputList &ol);
static void addInstance(ClassDefMutable* entity, ClassDefMutable* arch, ClassDefMutable *inst,
const std::shared_ptr<Entry> &cur);
//---------- create svg -------------------------------------------------------------
static void createSVG();
-static void startDot(FTextStream &t);
-static void startTable(FTextStream &t,const QCString &className);
+static void startDot(TextStream &t);
+static void startTable(TextStream &t,const QCString &className);
static std::vector<const MemberDef *> getPorts(const ClassDef *cd);
-static void writeVhdlEntityToolTip(FTextStream& t,ClassDef *cd);
-static void endDot(FTextStream &t);
-static void writeTable(const std::vector<const MemberDef*> &portList,FTextStream & t);
-static void endTable(FTextStream &t);
-static void writeClassToDot(FTextStream &t,ClassDef* cd);
-static void writeVhdlDotLink(FTextStream &t,const QCString &a,const QCString &b,const QCString &style);
+static void writeVhdlEntityToolTip(TextStream& t,ClassDef *cd);
+static void endDot(TextStream &t);
+static void writeTable(const std::vector<const MemberDef*> &portList,TextStream & t);
+static void endTable(TextStream &t);
+static void writeClassToDot(TextStream &t,ClassDef* cd);
+static void writeVhdlDotLink(TextStream &t,const QCString &a,const QCString &b,const QCString &style);
static const MemberDef *flowMember=0;
void VhdlDocGen::setFlowMember( const MemberDef* mem)
@@ -97,11 +96,11 @@ void VhdlDocGen::setFlowMember( const MemberDef* mem)
//--------------------------------------------------------------------------------------------------
-static void codify(FTextStream &t,const char *str)
+static void codify(TextStream &t,const QCString &str)
{
- if (str)
+ if (!str.isEmpty())
{
- const char *p=str;
+ const char *p=str.data();
char c;
while (*p)
{
@@ -136,7 +135,7 @@ static void writeLink(const MemberDef* mdef,OutputList &ol)
static void startFonts(const QCString& q, const char *keyword,OutputList& ol)
{
ol.startFontClass(keyword);
- ol.docify(q.data());
+ ol.docify(q);
ol.endFontClass();
}
@@ -189,14 +188,13 @@ void VhdlDocGen::writeOverview()
QCString ov =Config_getString(HTML_OUTPUT);
QCString fileName=ov+"/vhdl_design.dot";
- QFile f(fileName);
- FTextStream t(&f);
-
- if (!f.open(IO_WriteOnly))
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- err("Warning: Cannot open file %s for writing\n",fileName.data());
+ err("Warning: Cannot open file %s for writing\n",qPrint(fileName));
return;
}
+ TextStream t(&f);
startDot(t);
@@ -227,20 +225,21 @@ void VhdlDocGen::writeOverview()
dotn+=cd->name();
QCString csc=bClass->name()+":";
csc+=bClass->name();
- // fprintf(stderr,"\n <%s| %s>",dotn.data(),csc.data());
- writeVhdlDotLink(t,dotn,csc,0);
+ // fprintf(stderr,"\n <%s| %s>",qPrint(dotn),qPrint(csc));
+ writeVhdlDotLink(t,dotn,csc,QCString());
}
}// for
endDot(t);
// writePortLinks(t);
+ t.flush();
f.close();
createSVG();
}
//------------------------------------------------------------------------------------------------------------------------------------------------------
-static void startDot(FTextStream &t)
+static void startDot(TextStream &t)
{
t << " digraph G { \n";
t << "rankdir=LR \n";
@@ -248,18 +247,18 @@ static void startDot(FTextStream &t)
t << "stylesheet=\"doxygen.css\"\n";
}
-static void endDot(FTextStream &t)
+static void endDot(TextStream &t)
{
t <<" } \n";
}
-static void startTable(FTextStream &t,const QCString &className)
+static void startTable(TextStream &t,const QCString &className)
{
t << className <<" [ shape=none , fontname=\"arial\", fontcolor=\"blue\" , \n";
t << "label=<<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\">\n";
}
-static void writeVhdlDotLink(FTextStream &t,
+static void writeVhdlDotLink(TextStream &t,
const QCString &a,const QCString &b,const QCString &style)
{
t << a << "->" << b;
@@ -289,7 +288,7 @@ static QCString formatBriefNote(const QCString &brief,ClassDef * cd)
return vForm;
}
-static void writeVhdlEntityToolTip(FTextStream& t,ClassDef *cd)
+static void writeVhdlEntityToolTip(TextStream& t,ClassDef *cd)
{
QCString brief=cd->briefDescription();
@@ -310,7 +309,7 @@ static void writeVhdlEntityToolTip(FTextStream& t,ClassDef *cd)
writeVhdlDotLink(t,dotn,node,"dotted");
}
-static void writeColumn(FTextStream &t,const MemberDef *md,bool start)
+static void writeColumn(TextStream &t,const MemberDef *md,bool start)
{
QCString toolTip;
@@ -343,7 +342,7 @@ static void writeColumn(FTextStream &t,const MemberDef *md,bool start)
t<<" TOOLTIP=\"";
if (!toolTip.isEmpty())
{
- codify(t,toolTip.data());
+ codify(t,toolTip);
}
else
{
@@ -351,7 +350,7 @@ static void writeColumn(FTextStream &t,const MemberDef *md,bool start)
if (!largs.isEmpty())
{
largs=substitute(largs,"%"," ");
- codify(t,largs.data());
+ codify(t,largs);
}
}
t << "\" ";
@@ -393,13 +392,13 @@ static void writeColumn(FTextStream &t,const MemberDef *md,bool start)
}
}
-static void endTable(FTextStream &t)
+static void endTable(TextStream &t)
{
t << "</TABLE>>\n";
t << "] \n";
}
-static void writeClassToDot(FTextStream &t,ClassDef* cd)
+static void writeClassToDot(TextStream &t,ClassDef* cd)
{
t << "<TR><TD COLSPAN=\"2\" BGCOLOR=\"yellow\" ";
t << "PORT=\"";
@@ -433,9 +432,9 @@ static std::vector<const MemberDef*> getPorts(const ClassDef *cd)
return portList;
}
-//writeColumn(FTextStream &t,QCString name,bool start)
+//writeColumn(TextStream &t,QCString name,bool start)
-static void writeTable(const std::vector<const MemberDef*> &portList,FTextStream & t)
+static void writeTable(const std::vector<const MemberDef*> &portList,TextStream & t)
{
std::vector<const MemberDef *> inPorts;
std::vector<const MemberDef *> outPorts;
@@ -580,9 +579,9 @@ const char* VhdlDocGen::findKeyWord(const QCString& kw)
return 0;
}
-ClassDef *VhdlDocGen::getClass(const char *name)
+ClassDef *VhdlDocGen::getClass(const QCString &name)
{
- if (name==0 || name[0]=='\0') return 0;
+ if (name.isEmpty()) return 0;
return Doxygen::classLinkedMap->find(QCString(name).stripWhiteSpace());
}
@@ -601,7 +600,7 @@ const MemberDef* VhdlDocGen::findMember(const QCString& className, const QCStrin
const MemberDef *mdef=0;
cd=getClass(className);
- //printf("VhdlDocGen::findMember(%s,%s)=%p\n",className.data(),memName.data(),cd);
+ //printf("VhdlDocGen::findMember(%s,%s)=%p\n",qPrint(className),qPrint(memName),cd);
if (cd==0) return 0;
mdef=VhdlDocGen::findMemberDef(cd,memName,MemberListType_variableMembers);
@@ -698,7 +697,7 @@ const MemberDef* VhdlDocGen::findMember(const QCString& className, const QCStrin
const MemberDef* VhdlDocGen::findMemberDef(ClassDef* cd,const QCString& key,MemberListType type)
{
QCString keyType=cd->symbolName()+"@"+key;
- //printf("\n %s | %s | %s",cd->symbolName().data(),key.data(,),keyType.data());
+ //printf("\n %s | %s | %s",qPrint(cd->symbolName()),key.data(,),qPrint(keyType));
auto it = g_varMap.find(keyType.str());
if (it!=g_varMap.end())
@@ -716,7 +715,7 @@ const MemberDef* VhdlDocGen::findMemberDef(ClassDef* cd,const QCString& key,Memb
return 0;
}
//int l=ml->count();
- // fprintf(stderr,"\n loading entity %s %s: %d",cd->symbolName().data(),keyType.data(),l);
+ // fprintf(stderr,"\n loading entity %s %s: %d",qPrint(cd->symbolName()),qPrint(keyType),l);
for (const auto &md : *ml)
{
@@ -769,7 +768,7 @@ void VhdlDocGen::findAllPackages( ClassDef *cdef)
const MemberDef* VhdlDocGen::findFunction(const QCString& funcname, const QCString& package)
{
- ClassDef *cdef=getClass(package.data());
+ ClassDef *cdef=getClass(package);
if (cdef==0) return 0;
MemberList *mem=cdef->getMemberList(MemberListType_pubMethods);
@@ -852,18 +851,21 @@ void VhdlDocGen::writeInlineClassLink(const ClassDef* cd ,OutputList& ol)
if (ii==VhdlDocGen::PACKAGE_BODY)
{
nn.stripPrefix("_");
- cd=getClass(nn.data());
+ cd=getClass(nn);
}
else if (ii==VhdlDocGen::PACKAGE)
{
nn.prepend("_");
- cd=getClass(nn.data());
+ cd=getClass(nn);
}
else if (ii==VhdlDocGen::ARCHITECTURE)
{
- QCStringList qlist=QCStringList::split("-",nn);
- nn=qlist[1];
- cd=VhdlDocGen::getClass(nn.data());
+ StringVector qlist=split(nn.str(),"-");
+ if (qlist.size()>1)
+ {
+ nn=qlist[1];
+ cd=VhdlDocGen::getClass(nn);
+ }
}
QCString opp;
@@ -872,15 +874,18 @@ void VhdlDocGen::writeInlineClassLink(const ClassDef* cd ,OutputList& ol)
VhdlDocGen::findAllArchitectures(ql,cd);
for (const auto &s : ql)
{
- QCStringList qlist=QCStringList::split("-",s);
- QCString s1=qlist[0];
- QCString s2=qlist[1];
- s1.stripPrefix("_");
- if (ql.size()==1) s1.resize(0);
- ClassDef *cc = getClass(s);
- if (cc)
+ StringVector qlist=split(s.str(),"-");
+ if (qlist.size()>2)
{
- VhdlDocGen::writeVhdlLink(cc,ol,type,s2,s1);
+ QCString s1(qlist[0]);
+ QCString s2(qlist[1]);
+ s1.stripPrefix("_");
+ if (ql.size()==1) s1.resize(0);
+ ClassDef *cc = getClass(s);
+ if (cc)
+ {
+ VhdlDocGen::writeVhdlLink(cc,ol,type,s2,s1);
+ }
}
}
}
@@ -920,10 +925,10 @@ const ClassDef* VhdlDocGen::findArchitecture(const ClassDef *cd)
for (const auto &citer : *Doxygen::classLinkedMap)
{
QCString jj=citer->name();
- QCStringList ql=QCStringList::split(":",jj);
- if (ql.count()>1)
+ StringVector ql=split(jj.str(),":");
+ if (ql.size()>1)
{
- if (ql[0]==nn )
+ if (QCString(ql[0])==nn)
{
return citer.get();
}
@@ -939,16 +944,16 @@ void VhdlDocGen::writeVhdlLink(const ClassDef* ccd ,OutputList& ol,QCString& typ
{
if (ccd==0) return;
ol.startBold();
- ol.docify(type.data());
+ ol.docify(type);
ol.endBold();
nn.stripPrefix("_");
- ol.writeObjectLink(ccd->getReference(),ccd->getOutputFileBase(),0,nn.data());
+ ol.writeObjectLink(ccd->getReference(),ccd->getOutputFileBase(),QCString(),nn);
if (!behav.isEmpty())
{
behav.prepend(" ");
ol.startBold();
- ol.docify(behav.data());
+ ol.docify(behav);
ol.endBold();
}
@@ -981,7 +986,7 @@ void VhdlDocGen::prepareComment(QCString& qcs)
* @param ret Stores the return type
* @param doc ???
*/
-void VhdlDocGen::parseFuncProto(const char* text,QCString& name,QCString& ret,bool doc)
+void VhdlDocGen::parseFuncProto(const QCString &text,QCString& name,QCString& ret,bool doc)
{
int index,end;
QCString s1(text);
@@ -1012,7 +1017,7 @@ void VhdlDocGen::parseFuncProto(const char* text,QCString& name,QCString& ret,bo
int s=s1.find(' ');
if (s==-1) s=s1.find('\t');
if (i==-1 || i<s)
- s1=VhdlDocGen::getIndexWord(s1.data(),1);
+ s1=VhdlDocGen::getIndexWord(s1,1);
else // s<i, s=start of name, i=end of name
s1=s1.mid(s,(i-s));
@@ -1031,14 +1036,14 @@ void VhdlDocGen::parseFuncProto(const char* text,QCString& name,QCString& ret,bo
* returns the n'th word of a string
*/
-QCString VhdlDocGen::getIndexWord(const char* c,int index)
+QCString VhdlDocGen::getIndexWord(const QCString &c,int index)
{
static const reg::Ex reg(R"([\s|])");
- auto ql=split(c,reg);
+ auto ql=split(c.str(),reg);
if ((size_t)index < ql.size())
{
- return ql[index];
+ return QCString(ql[index]);
}
return "";
@@ -1251,7 +1256,7 @@ void VhdlDocGen::formatString(const QCString &s, OutputList& ol,const MemberDef*
index=temp.length();
}// for
temp=temp.stripWhiteSpace();
- // printf("\n [%s]",qcs.data());
+ // printf("\n [%s]",qPrint(qcs));
VhdlDocGen::writeFormatString(temp,ol,mdef);
}
@@ -1363,7 +1368,7 @@ void VhdlDocGen::writeFunctionProto(OutputList& ol,const ArgumentList &al,const
else
startFonts(w,"vhdlchar",ol);
- if (arg.attrib)
+ if (!arg.attrib.isEmpty())
startFonts(arg.attrib,"vhdlchar",ol);
sem=TRUE;
@@ -1375,8 +1380,8 @@ void VhdlDocGen::writeFunctionProto(OutputList& ol,const ArgumentList &al,const
}
ol.startBold();
ol.docify(" )");
- const char *exp=mdef->excpString();
- if (exp)
+ QCString exp=mdef->excpString();
+ if (!exp.isEmpty())
{
ol.insertMemberAlign();
ol.startBold();
@@ -1532,57 +1537,57 @@ QCString VhdlDocGen::convertArgumentListToString(const ArgumentList &al,bool fun
void VhdlDocGen::writeVhdlDeclarations(const MemberList* ml,
OutputList& ol,const GroupDef* gd,const ClassDef* cd,const FileDef *fd,const NamespaceDef* nd)
{
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::LIBRARY,FALSE),0,FALSE,VhdlDocGen::LIBRARY);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::USE,FALSE),0,FALSE,VhdlDocGen::USE);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::FUNCTION,FALSE),0,FALSE,VhdlDocGen::FUNCTION);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::COMPONENT,FALSE),0,FALSE,VhdlDocGen::COMPONENT);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::CONSTANT,FALSE),0,FALSE,VhdlDocGen::CONSTANT);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::TYPE,FALSE),0,FALSE,VhdlDocGen::TYPE);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::SUBTYPE,FALSE),0,FALSE,VhdlDocGen::SUBTYPE);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::GENERIC,FALSE),0,FALSE,VhdlDocGen::GENERIC);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::PORT,FALSE),0,FALSE,VhdlDocGen::PORT);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::PROCESS,FALSE),0,FALSE,VhdlDocGen::PROCESS);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::SIGNAL,FALSE),0,FALSE,VhdlDocGen::SIGNAL);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::ATTRIBUTE,FALSE),0,FALSE,VhdlDocGen::ATTRIBUTE);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::PROCEDURE,FALSE),0,FALSE,VhdlDocGen::PROCEDURE);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::RECORD,FALSE),0,FALSE,VhdlDocGen::RECORD);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::UNITS,FALSE),0,FALSE,VhdlDocGen::UNITS);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::SHAREDVARIABLE,FALSE),0,FALSE,VhdlDocGen::SHAREDVARIABLE);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::VFILE,FALSE),0,FALSE,VhdlDocGen::VFILE);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::GROUP,FALSE),0,FALSE,VhdlDocGen::GROUP);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::INSTANTIATION,FALSE),0,FALSE,VhdlDocGen::INSTANTIATION);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::ALIAS,FALSE),0,FALSE,VhdlDocGen::ALIAS);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::MISCELLANEOUS,TRUE),0,FALSE,VhdlDocGen::MISCELLANEOUS);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::LIBRARY,FALSE),QCString(),FALSE,VhdlDocGen::LIBRARY);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::USE,FALSE),QCString(),FALSE,VhdlDocGen::USE);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::FUNCTION,FALSE),QCString(),FALSE,VhdlDocGen::FUNCTION);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::COMPONENT,FALSE),QCString(),FALSE,VhdlDocGen::COMPONENT);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::CONSTANT,FALSE),QCString(),FALSE,VhdlDocGen::CONSTANT);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::TYPE,FALSE),QCString(),FALSE,VhdlDocGen::TYPE);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::SUBTYPE,FALSE),QCString(),FALSE,VhdlDocGen::SUBTYPE);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::GENERIC,FALSE),QCString(),FALSE,VhdlDocGen::GENERIC);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::PORT,FALSE),QCString(),FALSE,VhdlDocGen::PORT);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::PROCESS,FALSE),QCString(),FALSE,VhdlDocGen::PROCESS);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::SIGNAL,FALSE),QCString(),FALSE,VhdlDocGen::SIGNAL);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::ATTRIBUTE,FALSE),QCString(),FALSE,VhdlDocGen::ATTRIBUTE);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::PROCEDURE,FALSE),QCString(),FALSE,VhdlDocGen::PROCEDURE);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::RECORD,FALSE),QCString(),FALSE,VhdlDocGen::RECORD);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::UNITS,FALSE),QCString(),FALSE,VhdlDocGen::UNITS);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::SHAREDVARIABLE,FALSE),QCString(),FALSE,VhdlDocGen::SHAREDVARIABLE);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::VFILE,FALSE),QCString(),FALSE,VhdlDocGen::VFILE);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::GROUP,FALSE),QCString(),FALSE,VhdlDocGen::GROUP);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::INSTANTIATION,FALSE),QCString(),FALSE,VhdlDocGen::INSTANTIATION);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::ALIAS,FALSE),QCString(),FALSE,VhdlDocGen::ALIAS);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::MISCELLANEOUS,TRUE),QCString(),FALSE,VhdlDocGen::MISCELLANEOUS);
// configurations must be added to global file definitions.
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::CONFIG,FALSE),0,FALSE,VhdlDocGen::CONFIG);
- VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::UCF_CONST,FALSE),0,FALSE,VhdlDocGen::UCF_CONST);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::CONFIG,FALSE),QCString(),FALSE,VhdlDocGen::CONFIG);
+ VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::UCF_CONST,FALSE),QCString(),FALSE,VhdlDocGen::UCF_CONST);
}
void VhdlDocGen::correctMemberProperties(MemberDefMutable *md)
{
- if (qstrcmp(md->argsString(),"package")==0)
+ if (md->argsString()=="package")
{
md->setMemberSpecifiers(VhdlDocGen::INSTANTIATION);
}
- else if (qstrcmp(md->argsString(),"configuration")==0)
+ else if (md->argsString()=="configuration")
{
md->setMemberSpecifiers(VhdlDocGen::CONFIG);
}
- else if (qstrcmp(md->typeString(),"library")==0)
+ else if (md->typeString()=="library")
{
md->setMemberSpecifiers(VhdlDocGen::LIBRARY);
}
- else if (qstrcmp(md->typeString(),"use")==0)
+ else if (md->typeString()=="use")
{
md->setMemberSpecifiers(VhdlDocGen::USE);
}
- else if (qstricmp(md->typeString(),"misc")==0)
+ else if (md->typeString().lower()=="misc")
{
md->setMemberSpecifiers(VhdlDocGen::MISCELLANEOUS);
}
- else if (qstricmp(md->typeString(),"ucf_const")==0)
+ else if (md->typeString().lower()=="ucf_const")
{
md->setMemberSpecifiers(VhdlDocGen::UCF_CONST);
}
@@ -1692,7 +1697,7 @@ bool VhdlDocGen::writeVHDLTypeDocumentation(const MemberDef* mdef, const Definit
return hasParams;
}
-void VhdlDocGen::writeTagFile(MemberDefMutable *mdef,FTextStream &tagFile)
+void VhdlDocGen::writeTagFile(MemberDefMutable *mdef,TextStream &tagFile)
{
tagFile << " <member kind=\"";
if (VhdlDocGen::isGeneric(mdef)) tagFile << "generic";
@@ -1717,21 +1722,21 @@ void VhdlDocGen::writeTagFile(MemberDefMutable *mdef,FTextStream &tagFile)
if (VhdlDocGen::isAlias(mdef)) tagFile << "alias";
if (VhdlDocGen::isCompInst(mdef)) tagFile << "configuration";
- tagFile << "\">" << endl;
- tagFile << " <type>" << convertToXML(mdef->typeString()) << "</type>" << endl;
- tagFile << " <name>" << convertToXML(mdef->name()) << "</name>" << endl;
- tagFile << " <anchorfile>" << convertToXML(mdef->getOutputFileBase()) << Doxygen::htmlFileExtension << "</anchorfile>" << endl;
- tagFile << " <anchor>" << convertToXML(mdef->anchor()) << "</anchor>" << endl;
+ tagFile << "\">\n";
+ tagFile << " <type>" << convertToXML(mdef->typeString()) << "</type>\n";
+ tagFile << " <name>" << convertToXML(mdef->name()) << "</name>\n";
+ tagFile << " <anchorfile>" << convertToXML(mdef->getOutputFileBase()) << Doxygen::htmlFileExtension << "</anchorfile>\n";
+ tagFile << " <anchor>" << convertToXML(mdef->anchor()) << "</anchor>\n";
if (VhdlDocGen::isVhdlFunction(mdef))
- tagFile << " <arglist>" << convertToXML(VhdlDocGen::convertArgumentListToString(mdef->argumentList(),TRUE)) << "</arglist>" << endl;
+ tagFile << " <arglist>" << convertToXML(VhdlDocGen::convertArgumentListToString(mdef->argumentList(),TRUE)) << "</arglist>\n";
else if (VhdlDocGen::isProcedure(mdef))
- tagFile << " <arglist>" << convertToXML(VhdlDocGen::convertArgumentListToString(mdef->argumentList(),FALSE)) << "</arglist>" << endl;
+ tagFile << " <arglist>" << convertToXML(VhdlDocGen::convertArgumentListToString(mdef->argumentList(),FALSE)) << "</arglist>\n";
else
- tagFile << " <arglist>" << convertToXML(mdef->argsString()) << "</arglist>" << endl;
+ tagFile << " <arglist>" << convertToXML(mdef->argsString()) << "</arglist>\n";
mdef->writeDocAnchorsToTagFile(tagFile);
- tagFile << " </member>" << endl;
+ tagFile << " </member>\n";
}
/* writes a vhdl type declaration */
@@ -1772,8 +1777,8 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDefMutable* mdef,OutputList &o
// start a new member declaration
uint isAnonymous = (bool)(annoClassDef); // || m_impl->annMemb || m_impl->annEnumType;
- ///printf("startMemberItem for %s\n",name().data());
- int mm=mdef->getMemberSpecifiers();
+ ///printf("startMemberItem for %s\n",qPrint(name()));
+ uint64_t mm=mdef->getMemberSpecifiers();
if (mm==VhdlDocGen::MISCELLANEOUS)
isAnonymous=3;
@@ -1783,7 +1788,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDefMutable* mdef,OutputList &o
bool detailsVisible = mdef->isDetailedSectionLinkable();
if (!detailsVisible) // && !m_impl->annMemb)
{
- QCString doxyName=mdef->name().copy();
+ QCString doxyName=mdef->name();
if (!cname.isEmpty()) doxyName.prepend(cname+"::");
QCString doxyArgs=mdef->argsString();
ol.startDoxyAnchor(cfname,cname,mdef->anchor(),doxyName,doxyArgs);
@@ -1842,12 +1847,12 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDefMutable* mdef,OutputList &o
ol.docify(" ");
QCString name=theTranslator_vhdlType(VhdlDocGen::PACKAGE,TRUE);
ol.startBold();
- ol.docify(name.data());
+ ol.docify(name);
name.resize(0);
ol.endBold();
name+=" <"+mdef->name()+">";
ol.startEmphasis();
- ol.writeObjectLink(kl->getReference(),kl->getOutputFileBase(),0,name.data());
+ ol.writeObjectLink(kl->getReference(),kl->getOutputFileBase(),QCString(),name);
ol.popGeneratorState();
}
break;
@@ -1910,7 +1915,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDefMutable* mdef,OutputList &o
}
largs.prepend("::");
- largs.prepend(mdef->name().data());
+ largs.prepend(mdef->name());
ol.writeObjectLink(mdef->getReference(),
cfname,
mdef->anchor(),
@@ -1937,7 +1942,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDefMutable* mdef,OutputList &o
{
nn=mdef->name();
}
- kl=getClass(nn.data());
+ kl=getClass(nn);
if (kl)
{
nn=kl->getOutputFileBase();
@@ -1953,7 +1958,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDefMutable* mdef,OutputList &o
{
name+=mdef->name()+"> ";
}
- ol.writeObjectLink(kl->getReference(),kl->getOutputFileBase(),0,name.data());
+ ol.writeObjectLink(kl->getReference(),kl->getOutputFileBase(),QCString(),name);
ol.endEmphasis();
ol.popGeneratorState();
}
@@ -2000,17 +2005,15 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDefMutable* mdef,OutputList &o
ol.endDoxyAnchor(cfname,mdef->anchor());
}
- // name().data(),annoClassDef,annEnumType);
- // if(mm!=VhdlDocGen::MISCELLANEOUS)
ol.endMemberItem();
if (!mdef->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC) /* && !annMemb */)
{
QCString s=mdef->briefDescription();
- ol.startMemberDescription(mdef->anchor(), NULL, mm == VhdlDocGen::PORT);
+ ol.startMemberDescription(mdef->anchor(), QCString(), mm == VhdlDocGen::PORT);
ol.generateDoc(mdef->briefFile(),mdef->briefLine(),
mdef->getOuterScope()?mdef->getOuterScope():d,
- mdef,s.data(),TRUE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ mdef,s,TRUE,FALSE,
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
if (detailsVisible)
{
ol.pushGeneratorState();
@@ -2023,7 +2026,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDefMutable* mdef,OutputList &o
}
else // local link
{
- ol.startTextLink(0,mdef->anchor());
+ ol.startTextLink(QCString(),mdef->anchor());
}
ol.endTextLink();
//ol.startEmphasis();
@@ -2039,7 +2042,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDefMutable* mdef,OutputList &o
void VhdlDocGen::writePlainVHDLDeclarations(
const MemberList* mlist,OutputList &ol,
- const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,int specifier)
+ const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,uint64_t specifier)
{
StringSet pack;
@@ -2050,7 +2053,7 @@ void VhdlDocGen::writePlainVHDLDeclarations(
MemberDefMutable *md = toMemberDefMutable(imd);
if (md)
{
- int mems=md->getMemberSpecifiers();
+ uint64_t mems=md->getMemberSpecifiers();
if (md->isBriefSectionVisible() && (mems==specifier) && (mems!=VhdlDocGen::LIBRARY) )
{
if (first) { ol.startMemberList();first=FALSE; }
@@ -2092,22 +2095,22 @@ static bool membersHaveSpecificType(const MemberList *ml,uint64 type)
void VhdlDocGen::writeVHDLDeclarations(const MemberList* ml,OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
- const char *title,const char *subtitle,bool /*showEnumValues*/,int type)
+ const QCString &title,const QCString &subtitle,bool /*showEnumValues*/,int type)
{
if (!membersHaveSpecificType(ml,type)) return;
- if (title)
+ if (!title.isEmpty())
{
ol.startMemberHeader(convertToId(title),type == VhdlDocGen::PORT ? 3 : 2);
ol.parseText(title);
ol.endMemberHeader();
ol.docify(" ");
}
- if (subtitle && subtitle[0]!=0)
+ if (!subtitle.isEmpty())
{
ol.startMemberSubtitle();
ol.generateDoc("[generated]",-1,0,0,subtitle,FALSE,FALSE,
- 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endMemberSubtitle();
} //printf("memberGroupList=%p\n",memberGroupList);
@@ -2117,7 +2120,7 @@ void VhdlDocGen::writeVHDLDeclarations(const MemberList* ml,OutputList &ol,
{
if (membersHaveSpecificType(&mg->members(),type))
{
- //printf("mg->header=%s\n",mg->header().data());
+ //printf("mg->header=%s\n",qPrint(mg->header()));
bool hasHeader=mg->header()!="[NOHEADER]";
ol.startMemberGroupHeader(hasHeader);
if (hasHeader)
@@ -2130,7 +2133,7 @@ void VhdlDocGen::writeVHDLDeclarations(const MemberList* ml,OutputList &ol,
//printf("Member group has docs!\n");
ol.startMemberGroupDocs();
ol.generateDoc("[generated]",-1,0,0,mg->documentation()+"\n",FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endMemberGroupDocs();
}
ol.startMemberGroup();
@@ -2149,7 +2152,7 @@ bool VhdlDocGen::writeClassType( const ClassDef * cd,
QCString qcs = theTranslator->trVhdlType(id+2,TRUE);
cname=VhdlDocGen::getClassName(cd);
ol.startBold();
- ol.writeString(qcs.data());
+ ol.writeString(qcs);
ol.writeString(" ");
ol.endBold();
//ol.insertMemberAlign();
@@ -2212,11 +2215,11 @@ void VhdlDocGen::writeSource(const MemberDefMutable *mdef,OutputList& ol,const Q
ol.pushGeneratorState();
ol.startCodeFragment("DoxyCode");
intf->parseCode( ol, // codeOutIntf
- 0, // scope
+ QCString(), // scope
codeFragment, // input
SrcLangExt_VHDL, // lang
FALSE, // isExample
- 0, // exampleName
+ QCString(), // exampleName
const_cast<FileDef*>(mdef->getFileDef()), // fileDef
mdef->getStartBodyLine(), // startLine
mdef->getEndBodyLine(), // endLine
@@ -2258,7 +2261,7 @@ QCString VhdlDocGen::convertFileNameToClassName(QCString name)
return n;
}
-void VhdlDocGen::parseUCF(const char* input, Entry* entity,QCString fileName,bool altera)
+void VhdlDocGen::parseUCF(const char* input, Entry* entity,const QCString &fileName,bool altera)
{
QCString ucFile(input);
int lineNo=0;
@@ -2293,18 +2296,18 @@ void VhdlDocGen::parseUCF(const char* input, Entry* entity,QCString fileName,b
temp.stripPrefix("set_location_assignment");
- initUCF(entity,0,temp,lineNo,fileName,brief);
+ initUCF(entity,QCString(),temp,lineNo,fileName,brief);
}
else
{
static const reg::Ex ee(R"([\s=])");
int in=findIndex(temp.str(),ee);
QCString ff=temp.left(in);
- temp.stripPrefix(ff.data());
+ temp.stripPrefix(ff);
ff.append("#");
if (!temp.isEmpty())
{
- initUCF(entity,ff.data(),temp,lineNo,fileName,brief);
+ initUCF(entity,ff,temp,lineNo,fileName,brief);
}
}
}
@@ -2314,11 +2317,11 @@ void VhdlDocGen::parseUCF(const char* input, Entry* entity,QCString fileName,b
}// while
}
-static void initUCF(Entry* root,const char* type,QCString & qcs,int line,QCString & fileName,QCString & brief)
+static void initUCF(Entry* root,const QCString &type,QCString &qcs,
+ int line,const QCString &fileName,QCString & brief)
{
if (qcs.isEmpty())return;
QCString n;
- // bool bo=(qstricmp(type,qcs.data())==0);
VhdlDocGen::deleteAllChars(qcs,';');
qcs=qcs.stripWhiteSpace();
@@ -2330,7 +2333,6 @@ static void initUCF(Entry* root,const char* type,QCString & qcs,int line,QCStr
{
n=type;
VhdlDocGen::deleteAllChars(n,'#');
- type="";
}
else
{
@@ -2358,7 +2360,7 @@ static void initUCF(Entry* root,const char* type,QCString & qcs,int line,QCStr
}
current->name= n+"_";
- current->name.append(VhdlDocGen::getRecordNumber().data());
+ current->name.append(VhdlDocGen::getRecordNumber());
if (!brief.isEmpty())
{
@@ -2382,7 +2384,7 @@ static void writeUCFLink(const MemberDef* mdef,OutputList &ol)
if (!equ)
{
- ol.writeString(n.data());
+ ol.writeString(n);
ol.docify(" ");
ol.insertMemberAlign();
}
@@ -2467,11 +2469,11 @@ QCString VhdlDocGen::parseForBinding(QCString & entity,QCString & arch)
// find class with upper/lower letters
-ClassDef* VhdlDocGen::findVhdlClass(const char *className )
+ClassDef* VhdlDocGen::findVhdlClass(const QCString &className )
{
for (const auto &cd : *Doxygen::classLinkedMap)
{
- if (qstricmp(className,cd->name().data())==0)
+ if (qstricmp(className.data(),qPrint(cd->name()))==0)
{
return cd.get();
}
@@ -2515,8 +2517,8 @@ void VhdlDocGen::computeVhdlComponentRelations()
entity=cur->type;
}
- ClassDefMutable *classEntity= toClassDefMutable(VhdlDocGen::findVhdlClass(entity.data()));
- inst=VhdlDocGen::getIndexWord(cur->args.data(),0);
+ ClassDefMutable *classEntity= toClassDefMutable(VhdlDocGen::findVhdlClass(entity));
+ inst=VhdlDocGen::getIndexWord(cur->args,0);
ClassDefMutable *cd=toClassDefMutable(Doxygen::classLinkedMap->find(inst));
ClassDefMutable *ar=toClassDefMutable(Doxygen::classLinkedMap->find(cur->args));
@@ -2526,7 +2528,7 @@ void VhdlDocGen::computeVhdlComponentRelations()
}
// if (classEntity==0)
- // err("%s:%d:Entity:%s%s",cur->fileName.data(),cur->startLine,entity.data()," could not be found");
+ // err("%s:%d:Entity:%s%s",qPrint(cur->fileName),cur->startLine,qPrint(entity)," could not be found");
addInstance(classEntity,ar,cd,cur);
}
@@ -2550,12 +2552,12 @@ static void addInstance(ClassDefMutable* classEntity, ClassDefMutable* ar,
if (classEntity==cd) return;
bName=classEntity->name();
- // fprintf(stderr,"\naddInstance %s to %s %s %s\n", classEntity->name().data(),cd->name().data(),ar->name().data(),cur->name);
- n1=classEntity->name().data();
+ // fprintf(stderr,"\naddInstance %s to %s %s %s\n",qPrint( classEntity->name()),qPrint(cd->name()),qPrint(ar->name()),cur->name);
+ n1=classEntity->name();
if (!cd->isBaseClass(classEntity, true, 0))
{
- cd->insertBaseClass(classEntity,n1,Public,Normal,0);
+ cd->insertBaseClass(classEntity,n1,Public,Normal,QCString());
}
else
{
@@ -2564,7 +2566,7 @@ static void addInstance(ClassDefMutable* classEntity, ClassDefMutable* ar,
if (!VhdlDocGen::isSubClass(classEntity,cd,true,0))
{
- classEntity->insertSubClass(cd,Public,Normal,0);
+ classEntity->insertSubClass(cd,Public,Normal,QCString());
classEntity->setLanguage(SrcLangExt_VHDL);
}
@@ -2572,14 +2574,14 @@ ferr:
QCString uu=cur->name;
std::unique_ptr<MemberDefMutable> md { createMemberDef(
ar->getDefFileName(), cur->startLine,cur->startColumn,
- n1,uu,uu, 0,
+ n1,uu,uu, QCString(),
Public, Normal, cur->stat,Member,
MemberType_Variable,
ArgumentList(),
ArgumentList(),
"") };
- if (ar->getOutputFileBase())
+ if (!ar->getOutputFileBase().isEmpty())
{
TagInfo tg;
tg.anchor = 0;
@@ -2588,13 +2590,13 @@ ferr:
md->setTagInfo(&tg);
}
- //fprintf(stderr,"\n%s%s%s\n",md->name().data(),cur->brief.data(),cur->doc.data());
+ //fprintf(stderr,"\n%s%s%s\n",qPrint(md->name()),qPrint(cur->brief),qPrint(cur->doc));
md->setLanguage(SrcLangExt_VHDL);
md->setMemberSpecifiers(VhdlDocGen::INSTANTIATION);
md->setBriefDescription(cur->brief,cur->briefFile,cur->briefLine);
md->setBodySegment(cur->startLine,cur->startLine,-1) ;
- md->setDocumentation(cur->doc.data(),cur->docFile.data(),cur->docLine);
+ md->setDocumentation(cur->doc,cur->docFile,cur->docLine);
FileDef *fd=ar->getFileDef();
md->setBodyDef(fd);
ar->insertMember(md.get());
@@ -2610,7 +2612,7 @@ void VhdlDocGen::writeRecordUnit(QCString & largs,QCString & ltype,OutputList&
if (i>0)
{
//sets the real record member name
- const_cast<MemberDefMutable*>(mdef)->setName(mdef->name().left(i).data());
+ const_cast<MemberDefMutable*>(mdef)->setName(mdef->name().left(i));
}
writeLink(mdef,ol);
@@ -2629,14 +2631,14 @@ void VhdlDocGen::writeRecUnitDocu(
QCString largs)
{
- QCStringList ql=QCStringList::split("#",largs);
- uint len=ql.count();
+ StringVector ql=split(largs.str(),"#");
+ size_t len=ql.size();
ol.startParameterList(TRUE);
bool first=TRUE;
- for(uint i=0;i<len;i++)
+ for(size_t i=0;i<len;i++)
{
- QCString n=ql[i];
+ QCString n=QCString(ql[i]);
ol.startParameterType(first,"");
ol.endParameterType();
ol.startParameterName(TRUE);
@@ -2660,7 +2662,7 @@ void VhdlDocGen::writeRecUnitDocu(
bool VhdlDocGen::isSubClass(ClassDef* cd,ClassDef *scd, bool followInstances,int level)
{
bool found=FALSE;
- //printf("isBaseClass(cd=%s) looking for %s\n",name().data(),bcd->name().data());
+ //printf("isBaseClass(cd=%s) looking for %s\n",qPrint(name()),qPrint(bcd->name()));
if (level>255)
{
err("Possible recursive class relation while inside %s and looking for %s\n",qPrint(cd->name()),qPrint(scd->name()));
@@ -2672,7 +2674,7 @@ bool VhdlDocGen::isSubClass(ClassDef* cd,ClassDef *scd, bool followInstances,int
{
const ClassDef *ccd=bcd.classDef;
if (!followInstances && ccd->templateMaster()) ccd=ccd->templateMaster();
- //printf("isSubClass() subclass %s\n",ccd->name().data());
+ //printf("isSubClass() subclass %s\n",qPrint(ccd->name()));
if (ccd==scd)
{
found=TRUE;
@@ -2751,12 +2753,12 @@ void VhdlDocGen::createFlowChart(const MemberDef *mdef)
mdList.push_back(mdef);
}
- //fprintf(stderr,"\n create flow mem %s %p\n",mdef->name().data(),mdef);
+ //fprintf(stderr,"\n create flow mem %s %p\n",qPrint(mdef->name()),mdef);
int actualStart= mdef->getStartBodyLine();
int actualEnd=mdef->getEndBodyLine();
const FileDef* fd=mdef->getFileDef();
- bool b=readCodeFragment( fd->absFilePath().data(), actualStart,actualEnd,codeFragment);
+ bool b=readCodeFragment( fd->absFilePath(), actualStart,actualEnd,codeFragment);
if (!b) return;
auto parser { Doxygen::parserManager->getOutlineParser(".vhd") };
@@ -2895,7 +2897,7 @@ void alignText(QCString & q)
q.append(" ...");
- QCString str(q.data());
+ QCString str(q);
QCString temp;
while (str.length()>80)
@@ -2939,7 +2941,7 @@ void FlowChart::printNode(const FlowChart& flo)
q=" ";
}
QCString nn=flo.exp.stripWhiteSpace();
- printf("\nYES: %s%s[%d,%d]",q.data(),nn.data(),flo.stamp,flo.id);
+ printf("\nYES: %s%s[%d,%d]",qPrint(q),qPrint(nn),flo.stamp,flo.id);
}
else
{
@@ -3028,7 +3030,7 @@ void FlowChart::colTextNodes()
const FlowChart &ftemp = flowList[j+1];
if (ftemp.type & EMPTY)
{
- FlowChart fc(TEXT_NO,"empty ",0);
+ FlowChart fc(TEXT_NO,"empty ",QCString());
fc.stamp = flo.stamp;
flowList.insert(flowList.begin()+j+1,fc);
}
@@ -3052,18 +3054,18 @@ void FlowChart::delFlowList()
flowList.clear();
}
-void FlowChart::alignCommentNode(FTextStream &t,QCString com)
+void FlowChart::alignCommentNode(TextStream &t,QCString com)
{
uint max=0;
QCString s;
- QCStringList ql=QCStringList::split("\n",com);
- for (uint j=0;j<ql.count();j++)
+ StringVector ql=split(com.str(),"\n");
+ for (size_t j=0;j<ql.size();j++)
{
- s=(QCString)ql[j];
+ s=ql[j];
if (max<s.length()) max=s.length();
}
- s=ql.last();
+ s=ql.back();
int diff=max-s.length();
QCString n(1);
@@ -3072,23 +3074,23 @@ void FlowChart::alignCommentNode(FTextStream &t,QCString com)
n.fill(' ',2*diff);
n.append(".");
s+=n;
- ql.remove(ql.last());
- ql.append(s);
+ ql.pop_back();
+ ql.push_back(s.str());
}
- for (uint j=0;j<ql.count();j++)
+ for (size_t j=0;j<ql.size();j++)
{
s=ql[j];
- if (j<ql.count()-1)
+ if (j<ql.size()-1)
{
s+="\n";
}
- FlowChart::codify(t,s.data());
+ FlowChart::codify(t,s);
}
}
-void FlowChart::buildCommentNodes(FTextStream & t)
+void FlowChart::buildCommentNodes(TextStream & t)
{
size_t size=flowList.size();
bool begin=false;
@@ -3173,11 +3175,11 @@ void FlowChart::buildCommentNodes(FTextStream & t)
}// for;
}
-void FlowChart::codify(FTextStream &t,const char *str)
+void FlowChart::codify(TextStream &t,const QCString &str)
{
- if (str)
+ if (!str.isEmpty())
{
- const char *p=str;
+ const char *p=str.data();
char c;
while (*p)
{
@@ -3200,7 +3202,7 @@ FlowChart::~FlowChart()
{
}
-FlowChart::FlowChart(int typ,const char * t,const char* ex,const char* lab)
+FlowChart::FlowChart(int typ,const QCString &t,const QCString &ex,const QCString &lab)
{
stamp=ifcounter;
@@ -3227,7 +3229,7 @@ FlowChart::FlowChart(int typ,const char * t,const char* ex,const char* lab)
id=nodeCounter++;
}
-void FlowChart::addFlowChart(int type,const char* text,const char* exp, const char *label)
+void FlowChart::addFlowChart(int type,const QCString &text,const QCString &exp, const QCString &label)
{
if (!VhdlDocGen::getFlowMember()) return;
@@ -3235,12 +3237,12 @@ void FlowChart::addFlowChart(int type,const char* text,const char* exp, const ch
QCString expression(exp);
- if (text)
+ if (!text.isEmpty())
{
typeString=substitute(typeString,";","\n");
}
- if (exp)
+ if (!exp.isEmpty())
{
expression=substitute(expression,"\"","\\\"");
}
@@ -3386,7 +3388,7 @@ void FlowChart::createSVG()
//const MemberDef *m=VhdlDocGen::getFlowMember();
//if (m)
- // fprintf(stderr,"\n creating flowchart : %s %s in file %s \n",theTranslator->trVhdlType(m->getMemberSpecifiers(),TRUE),m->name().data(),m->getFileDef()->name().data());
+ // fprintf(stderr,"\n creating flowchart : %s %s in file %s \n",theTranslator->trVhdlType(m->getMemberSpecifiers(),TRUE),qPrint(m->name()),qPrint(m->getFileDef()->name()));
QCString dir=" -o \""+ov+qcs+"\"";
ov+="/flow_design.dot";
@@ -3399,7 +3401,7 @@ void FlowChart::createSVG()
}
}
-void FlowChart::startDot(FTextStream &t)
+void FlowChart::startDot(TextStream &t)
{
t << " digraph G { \n";
t << "rankdir=TB \n";
@@ -3407,7 +3409,7 @@ void FlowChart::startDot(FTextStream &t)
t << "stylesheet=\"doxygen.css\"\n";
}
-void FlowChart::endDot(FTextStream &t)
+void FlowChart::endDot(TextStream &t)
{
t << " } \n";
}
@@ -3418,14 +3420,13 @@ void FlowChart::writeFlowChart()
QCString ov = Config_getString(HTML_OUTPUT);
QCString fileName = ov+"/flow_design.dot";
- QFile f(fileName);
- FTextStream t(&f);
-
- if (!f.open(IO_WriteOnly))
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- err("Cannot open file %s for writing\n",fileName.data());
+ err("Cannot open file %s for writing\n",qPrint(fileName));
return;
}
+ TextStream t(&f);
colTextNodes();
// buildCommentNodes(t);
@@ -3438,6 +3439,7 @@ void FlowChart::writeFlowChart()
{
printUmlTree();
delFlowList();
+ t.flush();
f.close();
return;
}
@@ -3452,11 +3454,12 @@ void FlowChart::writeFlowChart()
FlowChart::endDot(t);
delFlowList();
+ t.flush();
f.close();
FlowChart::createSVG();
}// writeFlowChart
-void FlowChart::writeShape(FTextStream &t,const FlowChart &fl)
+void FlowChart::writeShape(TextStream &t,const FlowChart &fl)
{
if (fl.type & EEND) return;
QCString var;
@@ -3497,7 +3500,7 @@ void FlowChart::writeShape(FTextStream &t,const FlowChart &fl)
QCString kl;
if (exit) kl=fl.text+" ";
- if (fl.label)
+ if (!fl.label.isEmpty())
{
kl+=fl.label+":"+exp+var;
}
@@ -3558,14 +3561,14 @@ void FlowChart::writeShape(FTextStream &t,const FlowChart &fl)
}
-void FlowChart::writeEdge(FTextStream &t,const FlowChart &fl_from,const FlowChart &fl_to,int i)
+void FlowChart::writeEdge(TextStream &t,const FlowChart &fl_from,const FlowChart &fl_to,int i)
{
bool b=fl_from.type & STARTL;
bool c=fl_to.type & STARTL;
#ifdef DEBUGFLOW
- QCString s1(getNodeName(fl_from.id).data());
- QCString s2(getNodeName(fl_to.id).data());
+ QCString s1(getNodeName(fl_from.id));
+ QCString s2(getNodeName(fl_to.id));
auto it = g_keyMap.find(s1.str());
auto it1 = g_keyMap.find(s2.str());
// checks if the link is connected to a valid node
@@ -3576,7 +3579,7 @@ void FlowChart::writeEdge(FTextStream &t,const FlowChart &fl_from,const FlowChar
writeEdge(t,fl_from.id,fl_to.id,i,b,c);
}
-void FlowChart::writeEdge(FTextStream &t,int fl_from,int fl_to,int i,bool bFrom,bool bTo)
+void FlowChart::writeEdge(TextStream &t,int fl_from,int fl_to,int i,bool bFrom,bool bTo)
{
QCString label,col;
@@ -3597,10 +3600,10 @@ void FlowChart::writeEdge(FTextStream &t,int fl_from,int fl_to,int i,bool bFrom,
}
t << "edge [color=\""+col+"\",label=\""+label+"\"]\n";
- t << getNodeName(fl_from).data();
+ t << getNodeName(fl_from);
if (bFrom) t << ":s";
t << "->";
- t << getNodeName(fl_to).data();
+ t << getNodeName(fl_to);
if (bTo) t << ":n";
t << "\n";
}
@@ -3631,7 +3634,7 @@ void FlowChart::alignFuncProc( QCString & q,const ArgumentList &al,bool isFunc)
attl+=arg.type;
if (--index) attl+=",\n"; else attl+="\n";
- attl.prepend(prev.data());
+ attl.prepend(prev);
temp+=attl;
}
@@ -3688,7 +3691,7 @@ size_t FlowChart::findLabel(size_t index,const QCString &label)
return j;
}
}
- err("could not find label: %s",label.data());
+ err("could not find label: %s",qPrint(label));
return 0;
}
@@ -3768,7 +3771,7 @@ size_t FlowChart::getNextIfLink(const FlowChart &fl,size_t index)
return getNextNode(endifNode,stamp);
}
-void FlowChart::writeFlowLinks(FTextStream &t)
+void FlowChart::writeFlowLinks(TextStream &t)
{
size_t size=flowList.size();
if (size<2) return;
@@ -3864,7 +3867,7 @@ void FlowChart::writeFlowLinks(FTextStream &t)
{
size_t z;
bool b = kind==NEXT_NO;
- if (fll.exp)
+ if (!fll.exp.isEmpty())
{
writeEdge(t,fll,flowList[j+1],1);
}
diff --git a/src/vhdldocgen.h b/src/vhdldocgen.h
index 3a55b45..207e449 100644
--- a/src/vhdldocgen.h
+++ b/src/vhdldocgen.h
@@ -21,7 +21,7 @@
* vhdl documents
*/
-#include <qcstring.h>
+#include "qcstring.h"
#include "layout.h"
#include "arguments.h"
#include "entry.h"
@@ -31,17 +31,17 @@ class ClassDef;
class MemberList;
class MemberDef;
class MemberDefMutable;
-class FTextStream;
class OutputList;
class Definition;
class GroupDef;
class FileDef;
class NamespaceDef;
+class TextStream;
struct Argument;
struct VhdlConfNode
{
- VhdlConfNode(const char* a,const char* b,const char* config,const char* cs,bool leaf)
+ VhdlConfNode(const QCString &a,const QCString &b,const QCString &config,const QCString &cs,bool leaf)
{
arch=a; // architecture e.g. for iobuffer
arch=arch.lower();
@@ -116,10 +116,10 @@ class VhdlDocGen
static bool isSubClass(ClassDef* cd,ClassDef *scd, bool followInstances,int level);
- static QCString getIndexWord(const char* ,int index);
+ static QCString getIndexWord(const QCString &,int index);
static bool deleteCharRev(QCString &s,char c);
static void deleteAllChars(QCString &s,char c);
- static void parseFuncProto(const char* text,
+ static void parseFuncProto(const QCString &text,
QCString& name,
QCString& ret,
bool doc=false);
@@ -136,13 +136,13 @@ class VhdlDocGen
static const MemberDef* findMemberDef(ClassDef* cd,
const QCString& key,
MemberListType type);
- static ClassDef *getClass(const char *name);
+ static ClassDef *getClass(const QCString &name);
static const MemberDef* findFunction(const QCString& name,
const QCString& package);
static QCString getClassTitle(const ClassDef*);
static void writeInlineClassLink(const ClassDef*,
OutputList &ol);
- static void writeTagFile(MemberDefMutable *mdef,FTextStream &tagFile);
+ static void writeTagFile(MemberDefMutable *mdef,TextStream &tagFile);
static bool isConstraint(const MemberDef *mdef);
static bool isConfig(const MemberDef *mdef);
@@ -194,11 +194,11 @@ class VhdlDocGen
static void writePlainVHDLDeclarations(const MemberList* ml,OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
- int specifier);
+ uint64_t specifier);
static void writeVHDLDeclarations(const MemberList* ml,OutputList &ol,
const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
- const char *title,const char *subtitle,bool showEnumValues,int type);
+ const QCString &title,const QCString &subtitle,bool showEnumValues,int type);
static bool writeClassType(const ClassDef *,OutputList &ol ,QCString & cname);
@@ -210,10 +210,9 @@ class VhdlDocGen
static bool isNumber(const std::string& s);
static QCString getProtectionName(int prot);
- static void parseUCF(const char* input,Entry* entity,QCString f,bool vendor);
+ static void parseUCF(const char* input,Entry* entity,const QCString &f,bool vendor);
static const ClassDef* findArchitecture(const ClassDef *cd);
- //static const ClassDef* findArchitecture(QCString identifier, QCString entity_name);
static void correctMemberProperties(MemberDefMutable *md);
@@ -222,14 +221,14 @@ class VhdlDocGen
static QCString parseForConfig(QCString & entity,QCString & arch);
static QCString parseForBinding(QCString & entity,QCString & arch);
static void addBaseClass(ClassDef* cd,ClassDef *ent);
- static ClassDef* findVhdlClass(const char *className );
+ static ClassDef* findVhdlClass(const QCString &className );
static void writeOverview(OutputList &ol);
static void writeOverview();
// flowcharts
static void createFlowChart(const MemberDef*);
- //static void addFlowImage(const FTextStream &,const QCString &);
+ //static void addFlowImage(const TextStream &,const QCString &);
static void setFlowMember( const MemberDef *flowMember);
static const MemberDef *getFlowMember();
@@ -289,13 +288,13 @@ class FlowChart
//---------- create svg -------------------------------------------------------------
static void createSVG();
- static void startDot(FTextStream &t);
- static void endDot(FTextStream &t);
- static void codify(FTextStream &t,const char *str);
- static void writeShape(FTextStream &t,const FlowChart &fl);
- static void writeEdge(FTextStream &t,int fl_from,int fl_to,int i,bool bFrom=FALSE,bool bTo=FALSE);
- static void writeEdge(FTextStream &t,const FlowChart &fl_from,const FlowChart &fl_to,int i);
- static void writeFlowLinks(FTextStream &t);
+ static void startDot(TextStream &t);
+ static void endDot(TextStream &t);
+ static void codify(TextStream &t,const QCString &str);
+ static void writeShape(TextStream &t,const FlowChart &fl);
+ static void writeEdge(TextStream &t,int fl_from,int fl_to,int i,bool bFrom=FALSE,bool bTo=FALSE);
+ static void writeEdge(TextStream &t,const FlowChart &fl_from,const FlowChart &fl_to,int i);
+ static void writeFlowLinks(TextStream &t);
static QCString getNodeName(int n);
static void colTextNodes();
@@ -310,7 +309,7 @@ class FlowChart
static void delFlowList();
static const char* getNodeType(int c);
- static void addFlowChart(int type,const char* text,const char* exp,const char * label=0);
+ static void addFlowChart(int type,const QCString &text,const QCString &exp,const QCString &label=QCString());
static void moveToPrevLevel();
static int getTimeStamp();
static void writeFlowChart();
@@ -318,13 +317,13 @@ class FlowChart
static QCString convertNameToFileName();
static void printNode(const FlowChart& n);
static void printFlowTree();
- static void buildCommentNodes(FTextStream &t);
- static void alignCommentNode(FTextStream &t,QCString com);
+ static void buildCommentNodes(TextStream &t);
+ static void alignCommentNode(TextStream &t,QCString com);
static void printUmlTree();
static QCString printPlantUmlNode(const FlowChart &flo,bool,bool);
- FlowChart(int typ,const char* t,const char* ex,const char* label=0);
+ FlowChart(int typ,const QCString &t,const QCString &ex,const QCString &label=QCString());
~FlowChart();
private:
diff --git a/src/vhdljjparser.cpp b/src/vhdljjparser.cpp
index 9eaf167..963f3ec 100644
--- a/src/vhdljjparser.cpp
+++ b/src/vhdljjparser.cpp
@@ -12,8 +12,7 @@
#include <string>
-#include <qcstring.h>
-#include <qfileinfo.h>
+#include "qcstring.h"
#include "containers.h"
#include "vhdljjparser.h"
#include "vhdldocgen.h"
@@ -58,7 +57,7 @@ static EntryList g_instFiles;
struct VHDLOutlineParser::Private
{
- void parseVhdlfile(const char *fileName,const char* inputBuffer,bool inLine);
+ void parseVhdlfile(const QCString &fileName,const char* inputBuffer,bool inLine);
VHDLOutlineParser *thisParser = 0;
VhdlParser *vhdlParser = 0;
@@ -87,20 +86,20 @@ struct VHDLOutlineParser::Private
};
-void VHDLOutlineParser::Private::parseVhdlfile(const char *fileName,
+void VHDLOutlineParser::Private::parseVhdlfile(const QCString &fileName,
const char* inputBuffer,bool inLine)
{
JAVACC_STRING_TYPE s =inputBuffer;
CharStream *stream = new CharStream(s.c_str(), (int)s.size(), 1, 1);
VhdlParserTokenManager *tokenManager = new VhdlParserTokenManager(stream);
- VhdlTokenManagerErrorHandler *tokErrHandler=new VhdlTokenManagerErrorHandler(fileName);
+ VhdlTokenManagerErrorHandler *tokErrHandler=new VhdlTokenManagerErrorHandler(fileName.data());
vhdlParser=new VhdlParser(tokenManager);
vhdlParser->setOutlineParser(thisParser);
vhdlParser->setSharedState(&shared);
tokenManager->setLexParser(vhdlParser);
tokenManager->ReInit(stream,0);
tokenManager->setErrorHandler(tokErrHandler);
- VhdlErrorHandler *parserErrHandler=new VhdlErrorHandler(fileName);
+ VhdlErrorHandler *parserErrHandler=new VhdlErrorHandler(fileName.data());
vhdlParser->setErrorHandler(parserErrHandler);
try
{
@@ -130,7 +129,7 @@ VHDLOutlineParser::~VHDLOutlineParser()
{
}
-void VHDLOutlineParser::parseInput(const char *fileName,const char *fileBuf,
+void VHDLOutlineParser::parseInput(const QCString &fileName,const char *fileBuf,
const std::shared_ptr<Entry> &root, ClangTUParser *)
{
VhdlParser::SharedState *s = &p->shared;
@@ -139,7 +138,7 @@ void VHDLOutlineParser::parseInput(const char *fileName,const char *fileBuf,
// fprintf(stderr,"\n ============= %s\n ==========\n",fileBuf);
- bool inLine = (fileName==0 || strlen(fileName)==0);
+ bool inLine = fileName.isEmpty();
p->yyFileName=fileName;
@@ -253,8 +252,9 @@ static int idCounter;
* end;
*/
-QString VHDLOutlineParser::getNameID(){
- return QString::number(idCounter++,10);
+QCString VHDLOutlineParser::getNameID()
+{
+ return QCString().setNum(idCounter++);
}
void VHDLOutlineParser::handleFlowComment(const char* doc)
@@ -266,7 +266,7 @@ void VHDLOutlineParser::handleFlowComment(const char* doc)
QCString qcs(doc);
qcs=qcs.stripWhiteSpace();
qcs.stripPrefix("--#");
- FlowChart::addFlowChart(FlowChart::COMMENT_NO,0,0,qcs.data());
+ FlowChart::addFlowChart(FlowChart::COMMENT_NO,QCString(),QCString(),qcs);
}
}
@@ -318,12 +318,13 @@ int VHDLOutlineParser::checkInlineCode(QCString &doc)
code = stripLeadingAndTrailingEmptyLines(code, iLine);
int val = code.contains('\n');
VhdlDocGen::prepareComment(p->strComment);
- QCStringList ql = QCStringList::split('\n', p->strComment);
+ StringVector ql = split(p->strComment.str(),"\n");
QCString co;
QCString na;
- for (QCString qcs : ql)
+ for (const auto &qcs_ : ql)
{
+ QCString qcs(qcs_);
qcs = qcs.simplifyWhiteSpace();
if (findRe(qcs,csRe)!=-1)
{
@@ -379,7 +380,7 @@ int VHDLOutlineParser::checkInlineCode(QCString &doc)
return 1;
}
-void VHDLOutlineParser::handleCommentBlock(const char *doc1, bool brief)
+void VHDLOutlineParser::handleCommentBlock(const QCString &doc1, bool brief)
{
int position = 0;
bool needsEntry = FALSE;
@@ -461,7 +462,7 @@ void VHDLOutlineParser::handleCommentBlock(const char *doc1, bool brief)
p->strComment.resize(0);
}
-void VHDLOutlineParser::parsePrototype(const char *text)
+void VHDLOutlineParser::parsePrototype(const QCString &text)
{
p->varName=text;
p->varr=TRUE;
@@ -521,9 +522,9 @@ void VHDLOutlineParser::addVhdlType(const char *n,int startLine,int section,
spec= VhdlDocGen::GENERIC;
}
- QCStringList ql=QCStringList::split(",",name);
+ StringVector ql=split(name.str(),",");
- for (uint u=0;u<ql.count();u++)
+ for (size_t u=0;u<ql.size();u++)
{
s->current->name=ql[u];
s->current->startLine=startLine;
@@ -583,11 +584,11 @@ void VHDLOutlineParser::createFunction(const char *imp,uint64 spec,const char *f
VhdlDocGen::deleteAllChars(s->current->args,' ');
if (!fname.isEmpty())
{
- QCStringList q1=QCStringList::split(",",fname);
- for (uint ii=0;ii<q1.count();ii++)
+ StringVector q1=split(fname.str(),",");
+ for (const auto &name : q1)
{
Argument arg;
- arg.name=q1[ii];
+ arg.name=name;
s->current->argList.push_back(arg);
}
}
@@ -617,7 +618,7 @@ void VHDLOutlineParser::pushLabel( QCString &label,QCString & val)
QCString VHDLOutlineParser::popLabel(QCString & q)
{
int i=q.findRev("|");
- if (i<0) return "";
+ if (i<0) return QCString();
q = q.left(i);
return q;
}
@@ -630,12 +631,12 @@ void VHDLOutlineParser::addProto(const char *s1,const char *s2,const char *s3,
VhdlParser::SharedState *s = &p->shared;
(void)s5; // avoid unused warning
QCString name=s2;
- QCStringList ql=QCStringList::split(",",name);
+ StringVector ql=split(name.str(),",");
- for (uint u=0;u<ql.count();u++)
+ for (const auto &n : ql)
{
Argument arg;
- arg.name=ql[u];
+ arg.name=n;
if (s3)
{
arg.type=s3;
@@ -763,9 +764,9 @@ void VHDLOutlineParser::createFlow()
q+=")";
}
- q.prepend(VhdlDocGen::getFlowMember()->name().data());
+ q.prepend(VhdlDocGen::getFlowMember()->name());
- FlowChart::addFlowChart(FlowChart::START_NO,q,0);
+ FlowChart::addFlowChart(FlowChart::START_NO,q,QCString());
if (s->currP==VhdlDocGen::FUNCTION)
{
@@ -780,7 +781,7 @@ void VHDLOutlineParser::createFlow()
ret="end process ";
}
- FlowChart::addFlowChart(FlowChart::END_NO,ret,0);
+ FlowChart::addFlowChart(FlowChart::END_NO,ret,QCString());
// FlowChart::printFlowList();
FlowChart::writeFlowChart();
s->currP=0;
@@ -848,7 +849,7 @@ void VHDLOutlineParser::error_skipto(int kind)
p->vhdlParser->getNextToken(); // step to next token
op=p->vhdlParser->getToken(1); // get first token
if (op==0) break;
- //fprintf(stderr,"\n %s",t->image.data());
+ //fprintf(stderr,"\n %s",qPrint(t->image));
} while (op->kind != kind);
p->vhdlParser->clearError();
// The above loop consumes tokens all the way up to a token of
diff --git a/src/vhdljjparser.h b/src/vhdljjparser.h
index b074511..542f48d 100755
--- a/src/vhdljjparser.h
+++ b/src/vhdljjparser.h
@@ -4,7 +4,6 @@
#include <vector>
#include <memory>
#include <string>
-#include <qcstringlist.h>
#include "parserintf.h"
#include <stdio.h>
@@ -12,11 +11,11 @@
#include <assert.h>
#include <ctype.h>
-#include <qfile.h>
#include "types.h"
#include "entry.h"
#include "vhdldocgen.h"
#include "config.h"
+#include "util.h"
enum { GEN_SEC=0x1, PARAM_SEC,CONTEXT_SEC,PROTECTED_SEC } ;
//void parserVhdlfile(const char* inputBuffer);
@@ -30,13 +29,13 @@ class VHDLOutlineParser : public OutlineParserInterface
public:
VHDLOutlineParser();
virtual ~VHDLOutlineParser();
- void parseInput(const char * fileName,
+ void parseInput(const QCString &fileName,
const char *fileBuf,
const std::shared_ptr<Entry> &root,
ClangTUParser *clangParser);
bool needsPreprocessing(const QCString &) const { return TRUE; }
- void parsePrototype(const char *text);
+ void parsePrototype(const QCString &text);
// interface for generated parser code
@@ -51,7 +50,7 @@ class VHDLOutlineParser : public OutlineParserInterface
void createFunction(const char *impure,uint64 spec,const char *fname);
void addVhdlType(const char *n,int startLine,int section, uint64 spec,const char* args,const char* type,Protection prot);
void addCompInst(const char *n, const char* instName, const char* comp,int iLine);
- void handleCommentBlock(const char* doc,bool brief);
+ void handleCommentBlock(const QCString &doc,bool brief);
void handleFlowComment(const char*);
void initEntry(Entry *e);
void newEntry();
@@ -66,7 +65,7 @@ class VHDLOutlineParser : public OutlineParserInterface
void setMultCommentLine();
bool checkMultiComment(QCString& qcs,int line);
void insertEntryAtLine(std::shared_ptr<Entry> ce,int line);
- QString getNameID();
+ QCString getNameID();
int checkInlineCode(QCString & doc);
private:
struct Private;
diff --git a/src/xmlcode.h b/src/xmlcode.h
index 5a35506..93b05b7 100644
--- a/src/xmlcode.h
+++ b/src/xmlcode.h
@@ -33,11 +33,11 @@ class XMLCodeParser : public CodeParserInterface
XMLCodeParser();
virtual ~XMLCodeParser();
void parseCode(CodeOutputInterface &codeOutIntf,
- const char *scopeName,
+ const QCString &scopeName,
const QCString &input,
SrcLangExt,
bool isExampleBlock,
- const char *exampleName=0,
+ const QCString &exampleName=QCString(),
FileDef *fileDef=0,
int startLine=-1,
int endLine=-1,
diff --git a/src/xmlcode.l b/src/xmlcode.l
index 65406d4..ff3d247 100644
--- a/src/xmlcode.l
+++ b/src/xmlcode.l
@@ -246,7 +246,7 @@ static void startCodeLine(yyscan_t yyscanner)
yyextra->currentDefinition = d;
yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
//yyextra->insideBody = false;
- yyextra->classScope = d->name().copy();
+ yyextra->classScope = d->name();
QCString lineAnchor;
lineAnchor.sprintf("l%05d",yyextra->yyLineNr);
if (yyextra->currentMemberDef)
@@ -260,13 +260,13 @@ static void startCodeLine(yyscan_t yyscanner)
{
yyextra->code->writeLineNumber(d->getReference(),
d->getOutputFileBase(),
- 0,yyextra->yyLineNr);
+ QCString(),yyextra->yyLineNr);
setCurrentDoc(yyscanner,lineAnchor);
}
}
else
{
- yyextra->code->writeLineNumber(0,0,0,yyextra->yyLineNr);
+ yyextra->code->writeLineNumber(QCString(),QCString(),QCString(),yyextra->yyLineNr);
}
}
@@ -395,11 +395,11 @@ void XMLCodeParser::resetCodeParserState()
}
void XMLCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
- const char *scopeName,
+ const QCString &scopeName,
const QCString &input,
SrcLangExt,
bool isExampleBlock,
- const char *exampleName,
+ const QCString &exampleName,
FileDef *fileDef,
int startLine,
int endLine,
@@ -415,10 +415,10 @@ void XMLCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
if (input.isEmpty()) return;
- printlex(yy_flex_debug, true, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
+ printlex(yy_flex_debug, true, __FILE__, fileDef ? qPrint(fileDef->fileName()): NULL);
yyextra->code = &codeOutIntf;
- yyextra->inputString = input;
+ yyextra->inputString = input.data();
yyextra->inputPosition = 0;
yyextra->currentFontClass = 0;
yyextra->needsTermination = false;
@@ -443,7 +443,7 @@ void XMLCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
if (isExampleBlock && fileDef==0)
{
// create a dummy filedef for the example
- yyextra->sourceFileDef = createFileDef("",(exampleName?exampleName:"generated"));
+ yyextra->sourceFileDef = createFileDef("",(!exampleName.isEmpty()?exampleName:QCString("generated")));
cleanupSourceDef = true;
}
@@ -471,7 +471,7 @@ void XMLCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
yyextra->sourceFileDef=0;
}
- printlex(yy_flex_debug, false, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
+ printlex(yy_flex_debug, false, __FILE__, fileDef ? qPrint(fileDef->fileName()): NULL);
}
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp
index 56d6f55..eb6269a 100644
--- a/src/xmldocvisitor.cpp
+++ b/src/xmldocvisitor.cpp
@@ -13,8 +13,6 @@
*
*/
-#include <qfileinfo.h>
-
#include "xmldocvisitor.h"
#include "docparser.h"
#include "language.h"
@@ -30,13 +28,14 @@
#include "htmlentity.h"
#include "emoji.h"
#include "filedef.h"
+#include "fileinfo.h"
static void visitCaption(XmlDocVisitor *parent, const DocNodeList &children)
{
for (const auto &n : children) n->accept(parent);
}
-static void visitPreStart(FTextStream &t, const char *cmd, bool doCaption,
+static void visitPreStart(TextStream &t, const char *cmd, bool doCaption,
XmlDocVisitor *parent, const DocNodeList &children,
const QCString &name, bool writeType, DocImage::Type type, const QCString &width,
const QCString &height, const QCString &alt = QCString(""), bool inlineImage = FALSE)
@@ -83,12 +82,12 @@ static void visitPreStart(FTextStream &t, const char *cmd, bool doCaption,
t << ">";
}
-static void visitPostEnd(FTextStream &t, const char *cmd)
+static void visitPostEnd(TextStream &t, const char *cmd)
{
- t << "</" << cmd << ">" << endl;
+ t << "</" << cmd << ">\n";
}
-XmlDocVisitor::XmlDocVisitor(FTextStream &t,CodeOutputInterface &ci,const char *langExt)
+XmlDocVisitor::XmlDocVisitor(TextStream &t,CodeOutputInterface &ci,const QCString &langExt)
: DocVisitor(DocVisitor_XML), m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE),
m_langExt(langExt)
{
@@ -332,8 +331,8 @@ void XmlDocVisitor::visit(DocInclude *inc)
case DocInclude::IncWithLines:
{
m_t << "<programlisting filename=\"" << inc->file() << "\">";
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
getCodeParser(inc->extension()).parseCode(m_ci,inc->context(),
inc->text(),
langExt,
@@ -423,8 +422,8 @@ void XmlDocVisitor::visit(DocInclude *inc)
case DocInclude::SnipWithLines:
{
m_t << "<programlisting filename=\"" << inc->file() << "\">";
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
getCodeParser(inc->extension()).parseCode(m_ci,
inc->context(),
extractBlock(inc->text(),inc->blockId()),
@@ -453,7 +452,7 @@ void XmlDocVisitor::visit(DocInclude *inc)
void XmlDocVisitor::visit(DocIncOperator *op)
{
//printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
- // op->type(),op->isFirst(),op->isLast(),op->text().data());
+ // op->type(),op->isFirst(),op->isLast(),qPrint(op->text()));
if (op->isFirst())
{
if (!m_hide)
@@ -474,8 +473,8 @@ void XmlDocVisitor::visit(DocIncOperator *op)
FileDef *fd = 0;
if (!op->includeFileName().isEmpty())
{
- QFileInfo cfi( op->includeFileName() );
- fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( op->includeFileName().str() );
+ fd = createFileDef( cfi.dirPath(), cfi.fileName() );
}
getCodeParser(locLangExt).parseCode(m_ci,op->context(),
@@ -500,7 +499,7 @@ void XmlDocVisitor::visit(DocIncOperator *op)
}
else
{
- if (!m_hide) m_t << endl;
+ if (!m_hide) m_t << "\n";
}
}
@@ -591,7 +590,7 @@ void XmlDocVisitor::visitPre(DocPara *)
void XmlDocVisitor::visitPost(DocPara *)
{
if (m_hide) return;
- m_t << "</para>" << endl;
+ m_t << "</para>\n";
}
void XmlDocVisitor::visitPre(DocRoot *)
@@ -696,10 +695,10 @@ void XmlDocVisitor::visitPre(DocSection *s)
if (m_hide) return;
m_t << "<sect" << s->level() << " id=\"" << s->file();
if (!s->anchor().isEmpty()) m_t << "_1" << s->anchor();
- m_t << "\">" << endl;
+ m_t << "\">\n";
m_t << "<title>";
filter(convertCharEntitiesToUTF8(s->title()));
- m_t << "</title>" << endl;
+ m_t << "</title>\n";
}
void XmlDocVisitor::visitPost(DocSection *s)
@@ -884,7 +883,7 @@ void XmlDocVisitor::visitPre(DocInternal *)
void XmlDocVisitor::visitPost(DocInternal *)
{
if (m_hide) return;
- m_t << "</internal>" << endl;
+ m_t << "</internal>\n";
}
void XmlDocVisitor::visitPre(DocHRef *href)
@@ -938,19 +937,7 @@ void XmlDocVisitor::visitPre(DocImage *img)
bool ambig;
if (url.isEmpty() && (fd=findFileDef(Doxygen::imageNameLinkedMap,img->name(),ambig)))
{
- QFile inImage(fd->absFilePath());
- QFile outImage(Config_getString(XML_OUTPUT)+"/"+baseName.data());
- if (inImage.open(IO_ReadOnly))
- {
- if (outImage.open(IO_WriteOnly))
- {
- char *buffer = new char[inImage.size()];
- inImage.readBlock(buffer,inImage.size());
- outImage.writeBlock(buffer,inImage.size());
- outImage.flush();
- delete[] buffer;
- }
- }
+ copyFile(fd->absFilePath(),Config_getString(XML_OUTPUT)+"/"+baseName);
}
}
@@ -1034,19 +1021,19 @@ void XmlDocVisitor::visitPre(DocSecRefItem *ref)
void XmlDocVisitor::visitPost(DocSecRefItem *)
{
if (m_hide) return;
- m_t << "</tocitem>" << endl;
+ m_t << "</tocitem>\n";
}
void XmlDocVisitor::visitPre(DocSecRefList *)
{
if (m_hide) return;
- m_t << "<toclist>" << endl;
+ m_t << "<toclist>\n";
}
void XmlDocVisitor::visitPost(DocSecRefList *)
{
if (m_hide) return;
- m_t << "</toclist>" << endl;
+ m_t << "</toclist>\n";
}
//void XmlDocVisitor::visitPre(DocLanguage *l)
@@ -1058,7 +1045,7 @@ void XmlDocVisitor::visitPost(DocSecRefList *)
//void XmlDocVisitor::visitPost(DocLanguage *)
//{
// if (m_hide) return;
-// m_t << "</language>" << endl;
+// m_t << "</language>\n";
//}
void XmlDocVisitor::visitPre(DocParamSect *s)
@@ -1084,14 +1071,14 @@ void XmlDocVisitor::visitPre(DocParamSect *s)
void XmlDocVisitor::visitPost(DocParamSect *)
{
if (m_hide) return;
- m_t << "</parameterlist>" << endl;
+ m_t << "</parameterlist>\n";
}
void XmlDocVisitor::visitPre(DocParamList *pl)
{
if (m_hide) return;
- m_t << "<parameteritem>" << endl;
- m_t << "<parameternamelist>" << endl;
+ m_t << "<parameteritem>\n";
+ m_t << "<parameternamelist>\n";
for (const auto &param : pl->parameters())
{
if (!pl->paramTypes().empty())
@@ -1109,11 +1096,11 @@ void XmlDocVisitor::visitPre(DocParamList *pl)
}
else if (type->kind()==DocNode::Kind_Sep)
{
- m_t << "</parametertype>" << endl;
+ m_t << "</parametertype>\n";
m_t << "<parametertype>";
}
}
- m_t << "</parametertype>" << endl;
+ m_t << "</parametertype>\n";
}
m_t << "<parametername";
if (pl->direction()!=DocParamSect::Unspecified)
@@ -1142,17 +1129,17 @@ void XmlDocVisitor::visitPre(DocParamList *pl)
{
visit((DocLinkedWord*)param.get());
}
- m_t << "</parametername>" << endl;
+ m_t << "</parametername>\n";
}
- m_t << "</parameternamelist>" << endl;
- m_t << "<parameterdescription>" << endl;
+ m_t << "</parameternamelist>\n";
+ m_t << "<parameterdescription>\n";
}
void XmlDocVisitor::visitPost(DocParamList *)
{
if (m_hide) return;
- m_t << "</parameterdescription>" << endl;
- m_t << "</parameteritem>" << endl;
+ m_t << "</parameterdescription>\n";
+ m_t << "</parameteritem>\n";
}
void XmlDocVisitor::visitPre(DocXRefItem *x)
@@ -1179,7 +1166,7 @@ void XmlDocVisitor::visitPost(DocXRefItem *x)
void XmlDocVisitor::visitPre(DocInternalRef *ref)
{
if (m_hide) return;
- startLink(0,ref->file(),ref->anchor());
+ startLink(QCString(),ref->file(),ref->anchor());
}
void XmlDocVisitor::visitPost(DocInternalRef *)
@@ -1230,14 +1217,14 @@ void XmlDocVisitor::visitPost(DocParBlock *)
}
-void XmlDocVisitor::filter(const char *str)
+void XmlDocVisitor::filter(const QCString &str)
{
m_t << convertToXML(str);
}
void XmlDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor)
{
- //printf("XmlDocVisitor: file=%s anchor=%s\n",file.data(),anchor.data());
+ //printf("XmlDocVisitor: file=%s anchor=%s\n",qPrint(file),qPrint(anchor));
m_t << "<ref refid=\"" << file;
if (!anchor.isEmpty()) m_t << "_1" << anchor;
m_t << "\" kindref=\"";
diff --git a/src/xmldocvisitor.h b/src/xmldocvisitor.h
index 60270b8..f4b2a71 100644
--- a/src/xmldocvisitor.h
+++ b/src/xmldocvisitor.h
@@ -19,10 +19,12 @@
#ifndef _XMLDOCVISITOR_H
#define _XMLDOCVISITOR_H
+#include <iostream>
+
+#include "qcstring.h"
#include "docvisitor.h"
-#include <qcstring.h>
+#include "textstream.h"
-class FTextStream;
class CodeOutputInterface;
class QCString;
@@ -30,7 +32,7 @@ class QCString;
class XmlDocVisitor : public DocVisitor
{
public:
- XmlDocVisitor(FTextStream &t,CodeOutputInterface &ci,const char *langExt);
+ XmlDocVisitor(TextStream &t,CodeOutputInterface &ci,const QCString &langExt);
//--------------------------------------
// visitor functions for leaf nodes
@@ -144,7 +146,7 @@ class XmlDocVisitor : public DocVisitor
// helper functions
//--------------------------------------
- void filter(const char *str);
+ void filter(const QCString &str);
void startLink(const QCString &ref,const QCString &file,
const QCString &anchor);
void endLink();
@@ -153,7 +155,7 @@ class XmlDocVisitor : public DocVisitor
// state variables
//--------------------------------------
- FTextStream &m_t;
+ TextStream &m_t;
CodeOutputInterface &m_ci;
bool m_insidePre;
bool m_hide;
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index 3f74da1..4e931cd 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -15,9 +15,7 @@
#include <stdlib.h>
-#include <qdir.h>
-#include <qfile.h>
-
+#include "textstream.h"
#include "xmlgen.h"
#include "doxygen.h"
#include "message.h"
@@ -47,6 +45,8 @@
#include "section.h"
#include "htmlentity.h"
#include "resourcemgr.h"
+#include "dir.h"
+#include "utf8.h"
// no debug info
#define XML_DB(x) do {} while(0)
@@ -107,13 +107,15 @@ static const char *xmlSectionMapper(MemberListType ml)
}
-inline void writeXMLString(FTextStream &t,const char *s)
+inline void writeXMLString(TextStream &t,const QCString &s)
{
t << convertToXML(s);
}
-inline void writeXMLCodeString(FTextStream &t,const char *s, int &col)
+inline void writeXMLCodeString(TextStream &t,const QCString &str, int &col)
{
+ if (str.isEmpty()) return;
+ const char *s = str.data();
char c;
while ((c=*s++))
{
@@ -140,34 +142,32 @@ inline void writeXMLCodeString(FTextStream &t,const char *s, int &col)
// encode invalid XML characters (see http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char)
t << "<sp value=\"" << int(c) << "\"/>";
break;
- default: s=writeUtf8Char(t,s-1); col++; break;
+ default: s=writeUTF8Char(t,s-1); col++; break;
}
}
}
-static void writeXMLHeader(FTextStream &t)
+static void writeXMLHeader(TextStream &t)
{
- t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
+ t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";;
t << "<doxygen xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
t << "xsi:noNamespaceSchemaLocation=\"compound.xsd\" ";
t << "version=\"" << getDoxygenVersion() << "\" ";
t << "xml:lang=\"" << theTranslator->trISOLang() << "\"";
- t << ">" << endl;
+ t << ">\n";
}
static void writeCombineScript()
{
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/combine.xslt";
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
+ std::ofstream t(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!t.is_open())
{
- err("Cannot open file %s for writing!\n",fileName.data());
+ err("Cannot open file %s for writing!\n",qPrint(fileName));
return;
}
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
t <<
"<!-- XSLT script to combine the generated output into a single file. \n"
@@ -188,16 +188,16 @@ static void writeCombineScript()
}
-void writeXMLLink(FTextStream &t,const char *extRef,const char *compoundId,
- const char *anchorId,const char *text,const char *tooltip)
+void writeXMLLink(TextStream &t,const QCString &extRef,const QCString &compoundId,
+ const QCString &anchorId,const QCString &text,const QCString &tooltip)
{
t << "<ref refid=\"" << compoundId;
- if (anchorId) t << "_1" << anchorId;
+ if (!anchorId.isEmpty()) t << "_1" << anchorId;
t << "\" kindref=\"";
- if (anchorId) t << "member"; else t << "compound";
+ if (!anchorId.isEmpty()) t << "member"; else t << "compound";
t << "\"";
- if (extRef) t << " external=\"" << extRef << "\"";
- if (tooltip) t << " tooltip=\"" << convertToXML(tooltip) << "\"";
+ if (!extRef.isEmpty()) t << " external=\"" << extRef << "\"";
+ if (!tooltip.isEmpty()) t << " tooltip=\"" << convertToXML(tooltip) << "\"";
t << ">";
writeXMLString(t,text);
t << "</ref>";
@@ -207,26 +207,26 @@ void writeXMLLink(FTextStream &t,const char *extRef,const char *compoundId,
class TextGeneratorXMLImpl : public TextGeneratorIntf
{
public:
- TextGeneratorXMLImpl(FTextStream &t): m_t(t) {}
- void writeString(const char *s,bool /*keepSpaces*/) const
+ TextGeneratorXMLImpl(TextStream &t): m_t(t) {}
+ void writeString(const QCString &s,bool /*keepSpaces*/) const
{
writeXMLString(m_t,s);
}
void writeBreak(int) const {}
- void writeLink(const char *extRef,const char *file,
- const char *anchor,const char *text
+ void writeLink(const QCString &extRef,const QCString &file,
+ const QCString &anchor,const QCString &text
) const
{
- writeXMLLink(m_t,extRef,file,anchor,text,0);
+ writeXMLLink(m_t,extRef,file,anchor,text,QCString());
}
private:
- FTextStream &m_t;
+ TextStream &m_t;
};
//-------------------------------------------------------------------------------------------
/** Generator for producing XML formatted source code. */
-void XMLCodeGenerator::codify(const char *text)
+void XMLCodeGenerator::codify(const QCString &text)
{
XML_DB(("(codify \"%s\")\n",text));
if (m_insideCodeLine && !m_insideSpecialHL && m_normalHLNeedStartTag)
@@ -236,9 +236,9 @@ void XMLCodeGenerator::codify(const char *text)
}
writeXMLCodeString(m_t,text,m_col);
}
-void XMLCodeGenerator::writeCodeLink(const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip)
+void XMLCodeGenerator::writeCodeLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip)
{
XML_DB(("(writeCodeLink)\n"));
if (m_insideCodeLine && !m_insideSpecialHL && m_normalHLNeedStartTag)
@@ -247,10 +247,10 @@ void XMLCodeGenerator::writeCodeLink(const char *ref,const char *file,
m_normalHLNeedStartTag=FALSE;
}
writeXMLLink(m_t,ref,file,anchor,name,tooltip);
- m_col+=qstrlen(name);
+ m_col+=name.length();
}
-void XMLCodeGenerator::writeTooltip(const char *, const DocLinkInfo &, const char *,
- const char *, const SourceLinkInfo &, const SourceLinkInfo &
+void XMLCodeGenerator::writeTooltip(const QCString &, const DocLinkInfo &, const QCString &,
+ const QCString &, const SourceLinkInfo &, const SourceLinkInfo &
)
{
XML_DB(("(writeToolTip)\n"));
@@ -291,13 +291,13 @@ void XMLCodeGenerator::endCodeLine()
m_t << "</highlight>";
m_normalHLNeedStartTag=TRUE;
}
- m_t << "</codeline>" << endl; // non DocBook
+ m_t << "</codeline>\n"; // non DocBook
m_lineNumber = -1;
m_refId.resize(0);
m_external.resize(0);
m_insideCodeLine=FALSE;
}
-void XMLCodeGenerator::startFontClass(const char *colorClass)
+void XMLCodeGenerator::startFontClass(const QCString &colorClass)
{
XML_DB(("(startFontClass)\n"));
if (m_insideCodeLine && !m_insideSpecialHL && !m_normalHLNeedStartTag)
@@ -314,23 +314,23 @@ void XMLCodeGenerator::endFontClass()
m_t << "</highlight>"; // non DocBook
m_insideSpecialHL=FALSE;
}
-void XMLCodeGenerator::writeCodeAnchor(const char *)
+void XMLCodeGenerator::writeCodeAnchor(const QCString &)
{
XML_DB(("(writeCodeAnchor)\n"));
}
-void XMLCodeGenerator::writeLineNumber(const char *extRef,const char *compId,
- const char *anchorId,int l)
+void XMLCodeGenerator::writeLineNumber(const QCString &extRef,const QCString &compId,
+ const QCString &anchorId,int l)
{
XML_DB(("(writeLineNumber)\n"));
// we remember the information provided here to use it
// at the <codeline> start tag.
m_lineNumber = l;
- if (compId)
+ if (!compId.isEmpty())
{
m_refId=compId;
- if (anchorId) m_refId+=(QCString)"_1"+anchorId;
+ if (!anchorId.isEmpty()) m_refId+=(QCString)"_1"+anchorId;
m_isMemberRef = anchorId!=0;
- if (extRef) m_external=extRef;
+ if (!extRef.isEmpty()) m_external=extRef;
}
}
void XMLCodeGenerator::finish()
@@ -338,19 +338,19 @@ void XMLCodeGenerator::finish()
if (m_insideCodeLine) endCodeLine();
}
-void XMLCodeGenerator::startCodeFragment(const char *)
+void XMLCodeGenerator::startCodeFragment(const QCString &)
{
- m_t << " <programlisting>" << endl;
+ m_t << " <programlisting>\n";
}
-void XMLCodeGenerator::endCodeFragment(const char *)
+void XMLCodeGenerator::endCodeFragment(const QCString &)
{
- m_t << " </programlisting>" << endl;
+ m_t << " </programlisting>\n";
}
//-------------------------------------------------------------------------------------------
-static void writeTemplateArgumentList(FTextStream &t,
+static void writeTemplateArgumentList(TextStream &t,
const ArgumentList &al,
const Definition *scope,
const FileDef *fileScope,
@@ -360,50 +360,55 @@ static void writeTemplateArgumentList(FTextStream &t,
indentStr.fill(' ',indent);
if (al.hasParameters())
{
- t << indentStr << "<templateparamlist>" << endl;
+ t << indentStr << "<templateparamlist>\n";
for (const Argument &a : al)
{
- t << indentStr << " <param>" << endl;
+ t << indentStr << " <param>\n";
if (!a.type.isEmpty())
{
t << indentStr << " <type>";
linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a.type);
- t << "</type>" << endl;
+ t << "</type>\n";
}
if (!a.name.isEmpty())
{
- t << indentStr << " <declname>" << convertToXML(a.name) << "</declname>" << endl;
- t << indentStr << " <defname>" << convertToXML(a.name) << "</defname>" << endl;
+ t << indentStr << " <declname>" << convertToXML(a.name) << "</declname>\n";
+ t << indentStr << " <defname>" << convertToXML(a.name) << "</defname>\n";
}
if (!a.defval.isEmpty())
{
t << indentStr << " <defval>";
linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a.defval);
- t << "</defval>" << endl;
+ t << "</defval>\n";
}
if (!a.typeConstraint.isEmpty())
{
t << indentStr << " <typeconstraint>";
linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a.typeConstraint);
- t << "</typeconstraint>" << endl;
+ t << "</typeconstraint>\n";
}
- t << indentStr << " </param>" << endl;
+ t << indentStr << " </param>\n";
}
- t << indentStr << "</templateparamlist>" << endl;
+ t << indentStr << "</templateparamlist>\n";
}
}
-static void writeMemberTemplateLists(const MemberDef *md,FTextStream &t)
+static void writeMemberTemplateLists(const MemberDef *md,TextStream &t)
{
writeTemplateArgumentList(t,md->templateArguments(),md->getClassDef(),md->getFileDef(),8);
}
-static void writeTemplateList(const ClassDef *cd,FTextStream &t)
+static void writeTemplateList(const ClassDef *cd,TextStream &t)
+{
+ writeTemplateArgumentList(t,cd->templateArguments(),cd,cd->getFileDef(),4);
+}
+
+static void writeTemplateList(const ConceptDef *cd,TextStream &t)
{
- writeTemplateArgumentList(t,cd->templateArguments(),cd,0,4);
+ writeTemplateArgumentList(t,cd->getTemplateParameterList(),cd,cd->getFileDef(),4);
}
-static void writeXMLDocBlock(FTextStream &t,
+static void writeXMLDocBlock(TextStream &t,
const QCString &fileName,
int lineNr,
const Definition *scope,
@@ -414,7 +419,7 @@ static void writeXMLDocBlock(FTextStream &t,
if (stext.isEmpty()) return;
// convert the documentation string into an abstract syntax tree
DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,text,FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
// create a code generator
XMLCodeGenerator *xmlCodeGen = new XMLCodeGenerator(t);
// create a parse tree visitor for XML
@@ -428,7 +433,7 @@ static void writeXMLDocBlock(FTextStream &t,
}
-void writeXMLCodeBlock(FTextStream &t,FileDef *fd)
+void writeXMLCodeBlock(TextStream &t,FileDef *fd)
{
auto intf=Doxygen::parserManager->getCodeParser(fd->getDefFileExtension());
SrcLangExt langExt = getLanguageFromFileName(fd->getDefFileExtension());
@@ -436,11 +441,11 @@ void writeXMLCodeBlock(FTextStream &t,FileDef *fd)
XMLCodeGenerator *xmlGen = new XMLCodeGenerator(t);
xmlGen->startCodeFragment("DoxyCode");
intf->parseCode(*xmlGen, // codeOutIntf
- 0, // scopeName
+ QCString(), // scopeName
fileToString(fd->absFilePath(),Config_getBool(FILTER_SOURCE_FILES)),
langExt, // lang
FALSE, // isExampleBlock
- 0, // exampleName
+ QCString(), // exampleName
fd, // fileDef
-1, // startLine
-1, // endLine
@@ -453,7 +458,7 @@ void writeXMLCodeBlock(FTextStream &t,FileDef *fd)
delete xmlGen;
}
-static void writeMemberReference(FTextStream &t,const Definition *def,const MemberDef *rmd,const char *tagName)
+static void writeMemberReference(TextStream &t,const Definition *def,const MemberDef *rmd,const QCString &tagName)
{
QCString scope = rmd->getScopeString();
QCString name = rmd->name();
@@ -472,7 +477,7 @@ static void writeMemberReference(FTextStream &t,const Definition *def,const Memb
t << " endline=\"" << rmd->getEndBodyLine() << "\"";
}
}
- t << ">" << convertToXML(name) << "</" << tagName << ">" << endl;
+ t << ">" << convertToXML(name) << "</" << tagName << ">\n";
}
@@ -510,7 +515,7 @@ static QCString memberOutputFileBase(const MemberDef *md)
}
-static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream &t,const Definition *def)
+static void generateXMLForMember(const MemberDef *md,TextStream &ti,TextStream &t,const Definition *def)
{
// + declaration/definition arg lists
@@ -558,7 +563,7 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
ti << " <member refid=\"" << memberOutputFileBase(md)
<< "_1" << md->anchor() << "\" kind=\"" << memType << "\"><name>"
- << convertToXML(md->name()) << "</name></member>" << endl;
+ << convertToXML(md->name()) << "</name></member>\n";
QCString scopeName;
if (md->getClassDef())
@@ -788,7 +793,7 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
t << "\"";
}
- t << ">" << endl;
+ t << ">\n";
if (md->memberType()!=MemberType_Define &&
md->memberType()!=MemberType_Enumeration
@@ -799,33 +804,33 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
stripQualifiers(typeStr);
t << " <type>";
linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,typeStr);
- t << "</type>" << endl;
- t << " <definition>" << convertToXML(md->definition()) << "</definition>" << endl;
- t << " <argsstring>" << convertToXML(md->argsString()) << "</argsstring>" << endl;
+ t << "</type>\n";
+ t << " <definition>" << convertToXML(md->definition()) << "</definition>\n";
+ t << " <argsstring>" << convertToXML(md->argsString()) << "</argsstring>\n";
}
if (md->memberType() == MemberType_Enumeration)
{
t << " <type>";
linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,md->enumBaseType());
- t << "</type>" << endl;
+ t << "</type>\n";
}
- t << " <name>" << convertToXML(md->name()) << "</name>" << endl;
+ t << " <name>" << convertToXML(md->name()) << "</name>\n";
if (md->memberType() == MemberType_Property)
{
if (md->isReadable())
- t << " <read>" << convertToXML(md->getReadAccessor()) << "</read>" << endl;
+ t << " <read>" << convertToXML(md->getReadAccessor()) << "</read>\n";
if (md->isWritable())
- t << " <write>" << convertToXML(md->getWriteAccessor()) << "</write>" << endl;
+ t << " <write>" << convertToXML(md->getWriteAccessor()) << "</write>\n";
}
- if (md->memberType()==MemberType_Variable && md->bitfieldString())
+ if (md->memberType()==MemberType_Variable && !md->bitfieldString().isEmpty())
{
QCString bitfield = md->bitfieldString();
if (bitfield.at(0)==':') bitfield=bitfield.mid(1);
- t << " <bitfield>" << convertToXML(bitfield) << "</bitfield>" << endl;
+ t << " <bitfield>" << convertToXML(bitfield) << "</bitfield>\n";
}
const MemberDef *rmd = md->reimplements();
@@ -833,22 +838,22 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
{
t << " <reimplements refid=\""
<< memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">"
- << convertToXML(rmd->name()) << "</reimplements>" << endl;
+ << convertToXML(rmd->name()) << "</reimplements>\n";
}
for (const auto &rbmd : md->reimplementedBy())
{
t << " <reimplementedby refid=\""
<< memberOutputFileBase(rbmd) << "_1" << rbmd->anchor() << "\">"
- << convertToXML(rbmd->name()) << "</reimplementedby>" << endl;
+ << convertToXML(rbmd->name()) << "</reimplementedby>\n";
}
if (md->isFriendClass()) // for friend classes we show a link to the class as a "parameter"
{
- t << " <param>" << endl;
+ t << " <param>\n";
t << " <type>";
linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,md->name());
- t << "</type>" << endl;
- t << " </param>" << endl;
+ t << "</type>\n";
+ t << " </param>\n";
}
else if (isFunc) //function
{
@@ -866,83 +871,89 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
defArg = &(*defIt);
++defIt;
}
- t << " <param>" << endl;
+ t << " <param>\n";
if (!a.attrib.isEmpty())
{
t << " <attributes>";
writeXMLString(t,a.attrib);
- t << "</attributes>" << endl;
+ t << "</attributes>\n";
}
if (!a.type.isEmpty())
{
t << " <type>";
linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a.type);
- t << "</type>" << endl;
+ t << "</type>\n";
}
if (!a.name.isEmpty())
{
t << " <declname>";
writeXMLString(t,a.name);
- t << "</declname>" << endl;
+ t << "</declname>\n";
}
if (defArg && !defArg->name.isEmpty() && defArg->name!=a.name)
{
t << " <defname>";
writeXMLString(t,defArg->name);
- t << "</defname>" << endl;
+ t << "</defname>\n";
}
if (!a.array.isEmpty())
{
t << " <array>";
writeXMLString(t,a.array);
- t << "</array>" << endl;
+ t << "</array>\n";
}
if (!a.defval.isEmpty())
{
t << " <defval>";
linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a.defval);
- t << "</defval>" << endl;
+ t << "</defval>\n";
}
if (defArg && defArg->hasDocumentation())
{
t << " <briefdescription>";
writeXMLDocBlock(t,md->getDefFileName(),md->getDefLine(),
md->getOuterScope(),md,defArg->docs);
- t << "</briefdescription>" << endl;
+ t << "</briefdescription>\n";
}
- t << " </param>" << endl;
+ t << " </param>\n";
}
}
}
else if (md->memberType()==MemberType_Define &&
- md->argsString()) // define
+ !md->argsString().isEmpty()) // define
{
if (md->argumentList().empty()) // special case for "foo()" to
// distinguish it from "foo".
{
- t << " <param></param>" << endl;
+ t << " <param></param>\n";
}
else
{
for (const Argument &a : md->argumentList())
{
- t << " <param><defname>" << a.type << "</defname></param>" << endl;
+ t << " <param><defname>" << a.type << "</defname></param>\n";
}
}
}
+ if (!md->requiresClause().isEmpty())
+ {
+ t << " <requiresclause>";
+ linkifyText(TextGeneratorXMLImpl(t),md,md->getFileDef(),md,md->requiresClause());
+ t << " </requiresclause>\n";
+ }
if (md->hasOneLineInitializer() || md->hasMultiLineInitializer())
{
t << " <initializer>";
linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,md->initializer());
- t << "</initializer>" << endl;
+ t << "</initializer>\n";
}
- if (md->excpString())
+ if (!md->excpString().isEmpty())
{
t << " <exceptions>";
linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,md->excpString());
- t << "</exceptions>" << endl;
+ t << "</exceptions>\n";
}
if (md->memberType()==MemberType_Enumeration) // enum
@@ -951,7 +962,7 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
{
ti << " <member refid=\"" << memberOutputFileBase(md)
<< "_1" << emd->anchor() << "\" kind=\"enumvalue\"><name>"
- << convertToXML(emd->name()) << "</name></member>" << endl;
+ << convertToXML(emd->name()) << "</name></member>\n";
t << " <enumvalue id=\"" << memberOutputFileBase(md) << "_1"
<< emd->anchor() << "\" prot=\"";
@@ -962,34 +973,34 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
case Private: t << "private"; break;
case Package: t << "package"; break;
}
- t << "\">" << endl;
+ t << "\">\n";
t << " <name>";
writeXMLString(t,emd->name());
- t << "</name>" << endl;
+ t << "</name>\n";
if (!emd->initializer().isEmpty())
{
t << " <initializer>";
writeXMLString(t,emd->initializer());
- t << "</initializer>" << endl;
+ t << "</initializer>\n";
}
- t << " <briefdescription>" << endl;
+ t << " <briefdescription>\n";
writeXMLDocBlock(t,emd->briefFile(),emd->briefLine(),emd->getOuterScope(),emd,emd->briefDescription());
- t << " </briefdescription>" << endl;
- t << " <detaileddescription>" << endl;
+ t << " </briefdescription>\n";
+ t << " <detaileddescription>\n";
writeXMLDocBlock(t,emd->docFile(),emd->docLine(),emd->getOuterScope(),emd,emd->documentation());
- t << " </detaileddescription>" << endl;
- t << " </enumvalue>" << endl;
+ t << " </detaileddescription>\n";
+ t << " </enumvalue>\n";
}
}
- t << " <briefdescription>" << endl;
+ t << " <briefdescription>\n";
writeXMLDocBlock(t,md->briefFile(),md->briefLine(),md->getOuterScope(),md,md->briefDescription());
- t << " </briefdescription>" << endl;
- t << " <detaileddescription>" << endl;
+ t << " </briefdescription>\n";
+ t << " <detaileddescription>\n";
writeXMLDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
- t << " </detaileddescription>" << endl;
- t << " <inbodydescription>" << endl;
+ t << " </detaileddescription>\n";
+ t << " <inbodydescription>\n";
writeXMLDocBlock(t,md->docFile(),md->inbodyLine(),md->getOuterScope(),md,md->inbodyDocumentation());
- t << " </inbodydescription>" << endl;
+ t << " </inbodydescription>\n";
if (md->getDefLine()!=-1)
{
t << " <location file=\""
@@ -1012,7 +1023,7 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
<< md->getDeclLine() << "\" declcolumn=\""
<< md->getDeclColumn() << "\"";
}
- t << "/>" << endl;
+ t << "/>\n";
}
//printf("md->getReferencesMembers()=%p\n",md->getReferencesMembers());
@@ -1027,7 +1038,7 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
writeMemberReference(t,def,refmd,"referencedby");
}
- t << " </memberdef>" << endl;
+ t << " </memberdef>\n";
}
// namespace members are also inserted in the file scope, but
@@ -1039,9 +1050,9 @@ static bool memberVisible(const Definition *d,const MemberDef *md)
md->getNamespaceDef()==0;
}
-static void generateXMLSection(const Definition *d,FTextStream &ti,FTextStream &t,
- const MemberList *ml,const char *kind,const char *header=0,
- const char *documentation=0)
+static void generateXMLSection(const Definition *d,TextStream &ti,TextStream &t,
+ const MemberList *ml,const QCString &kind,const QCString &header=QCString(),
+ const QCString &documentation=QCString())
{
if (ml==0) return;
int count=0;
@@ -1055,16 +1066,16 @@ static void generateXMLSection(const Definition *d,FTextStream &ti,FTextStream &
}
if (count==0) return; // empty list
- t << " <sectiondef kind=\"" << kind << "\">" << endl;
- if (header)
+ t << " <sectiondef kind=\"" << kind << "\">\n";
+ if (!header.isEmpty())
{
- t << " <header>" << convertToXML(header) << "</header>" << endl;
+ t << " <header>" << convertToXML(header) << "</header>\n";
}
- if (documentation)
+ if (!documentation.isEmpty())
{
t << " <description>";
writeXMLDocBlock(t,d->docFile(),d->docLine(),d,0,documentation);
- t << "</description>" << endl;
+ t << "</description>\n";
}
for (const auto &md : *ml)
{
@@ -1073,12 +1084,12 @@ static void generateXMLSection(const Definition *d,FTextStream &ti,FTextStream &
generateXMLForMember(md,ti,t,d);
}
}
- t << " </sectiondef>" << endl;
+ t << " </sectiondef>\n";
}
-static void writeListOfAllMembers(const ClassDef *cd,FTextStream &t)
+static void writeListOfAllMembers(const ClassDef *cd,TextStream &t)
{
- t << " <listofallmembers>" << endl;
+ t << " <listofallmembers>\n";
for (auto &mni : cd->memberNameInfoLinkedMap())
{
for (auto &mi : *mni)
@@ -1110,14 +1121,14 @@ static void writeListOfAllMembers(const ClassDef *cd,FTextStream &t)
t << " ambiguityscope=\"" << convertToXML(mi->ambiguityResolutionScope()) << "\"";
}
t << "><scope>" << convertToXML(cd->name()) << "</scope><name>" <<
- convertToXML(md->name()) << "</name></member>" << endl;
+ convertToXML(md->name()) << "</name></member>\n";
}
}
}
- t << " </listofallmembers>" << endl;
+ t << " </listofallmembers>\n";
}
-static void writeInnerClasses(const ClassLinkedRefMap &cl,FTextStream &t)
+static void writeInnerClasses(const ClassLinkedRefMap &cl,TextStream &t)
{
for (const auto &cd : cl)
{
@@ -1132,12 +1143,12 @@ static void writeInnerClasses(const ClassLinkedRefMap &cl,FTextStream &t)
case Private: t << "private"; break;
case Package: t << "package"; break;
}
- t << "\">" << convertToXML(cd->name()) << "</innerclass>" << endl;
+ t << "\">" << convertToXML(cd->name()) << "</innerclass>\n";
}
}
}
-static void writeInnerNamespaces(const NamespaceLinkedRefMap &nl,FTextStream &t)
+static void writeInnerNamespaces(const NamespaceLinkedRefMap &nl,TextStream &t)
{
for (const auto &nd : nl)
{
@@ -1145,21 +1156,21 @@ static void writeInnerNamespaces(const NamespaceLinkedRefMap &nl,FTextStream &t)
{
t << " <innernamespace refid=\"" << nd->getOutputFileBase()
<< "\"" << (nd->isInline() ? " inline=\"yes\"" : "")
- << ">" << convertToXML(nd->name()) << "</innernamespace>" << endl;
+ << ">" << convertToXML(nd->name()) << "</innernamespace>\n";
}
}
}
-static void writeInnerFiles(const FileList &fl,FTextStream &t)
+static void writeInnerFiles(const FileList &fl,TextStream &t)
{
for (const auto &fd : fl)
{
t << " <innerfile refid=\"" << fd->getOutputFileBase()
- << "\">" << convertToXML(fd->name()) << "</innerfile>" << endl;
+ << "\">" << convertToXML(fd->name()) << "</innerfile>\n";
}
}
-static void writeInnerPages(const PageLinkedRefMap &pl,FTextStream &t)
+static void writeInnerPages(const PageLinkedRefMap &pl,TextStream &t)
{
for (const auto &pd : pl)
{
@@ -1168,33 +1179,53 @@ static void writeInnerPages(const PageLinkedRefMap &pl,FTextStream &t)
{
t << "_" << pd->name();
}
- t << "\">" << convertToXML(pd->title()) << "</innerpage>" << endl;
+ t << "\">" << convertToXML(pd->title()) << "</innerpage>\n";
}
}
-static void writeInnerGroups(const GroupList &gl,FTextStream &t)
+static void writeInnerGroups(const GroupList &gl,TextStream &t)
{
for (const auto &sgd : gl)
{
t << " <innergroup refid=\"" << sgd->getOutputFileBase()
<< "\">" << convertToXML(sgd->groupTitle())
- << "</innergroup>" << endl;
+ << "</innergroup>\n";
}
}
-static void writeInnerDirs(const DirList *dl,FTextStream &t)
+static void writeInnerDirs(const DirList *dl,TextStream &t)
{
if (dl)
{
for(const auto subdir : *dl)
{
t << " <innerdir refid=\"" << subdir->getOutputFileBase()
- << "\">" << convertToXML(subdir->displayName()) << "</innerdir>" << endl;
+ << "\">" << convertToXML(subdir->displayName()) << "</innerdir>\n";
+ }
+ }
+}
+
+static void writeIncludeInfo(const IncludeInfo *ii,TextStream &t)
+{
+ if (ii)
+ {
+ QCString nm = ii->includeName;
+ if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
+ if (!nm.isEmpty())
+ {
+ t << " <includes";
+ if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
+ {
+ t << " refid=\"" << ii->fileDef->getOutputFileBase() << "\"";
+ }
+ t << " local=\"" << (ii->local ? "yes" : "no") << "\">";
+ t << nm;
+ t << "</includes>\n";
}
}
}
-static void generateXMLForClass(const ClassDef *cd,FTextStream &ti)
+static void generateXMLForClass(const ClassDef *cd,TextStream &ti)
{
// + brief description
// + detailed description
@@ -1218,22 +1249,21 @@ static void generateXMLForClass(const ClassDef *cd,FTextStream &ti)
if (cd->templateMaster()!=0) return; // skip generated template instances.
if (cd->isArtificial()) return; // skip artificially created classes
- msg("Generating XML output for class %s\n",cd->name().data());
+ msg("Generating XML output for class %s\n",qPrint(cd->name()));
ti << " <compound refid=\"" << classOutputFileBase(cd)
<< "\" kind=\"" << cd->compoundTypeString()
- << "\"><name>" << convertToXML(cd->name()) << "</name>" << endl;
+ << "\"><name>" << convertToXML(cd->name()) << "</name>\n";
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/"+ classOutputFileBase(cd)+".xml";
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- err("Cannot open file %s for writing!\n",fileName.data());
+ err("Cannot open file %s for writing!\n",qPrint(fileName));
return;
}
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
+ TextStream t(&f);
writeXMLHeader(t);
t << " <compounddef id=\""
@@ -1250,10 +1280,10 @@ static void generateXMLForClass(const ClassDef *cd,FTextStream &ti)
if (cd->isFinal()) t << "\" final=\"yes";
if (cd->isSealed()) t << "\" sealed=\"yes";
if (cd->isAbstract()) t << "\" abstract=\"yes";
- t << "\">" << endl;
+ t << "\">\n";
t << " <compoundname>";
writeXMLString(t,cd->name());
- t << "</compoundname>" << endl;
+ t << "</compoundname>\n";
for (const auto &bcd : cd->baseClasses())
{
t << " <basecompoundref ";
@@ -1288,7 +1318,7 @@ static void generateXMLForClass(const ClassDef *cd,FTextStream &ti)
{
t << convertToXML(bcd.classDef->displayName());
}
- t << "</basecompoundref>" << endl;
+ t << "</basecompoundref>\n";
}
for (const auto &bcd : cd->subClasses())
{
@@ -1310,26 +1340,10 @@ static void generateXMLForClass(const ClassDef *cd,FTextStream &ti)
case Pure: t << "pure-virtual"; break;
}
t << "\">" << convertToXML(bcd.classDef->displayName())
- << "</derivedcompoundref>" << endl;
+ << "</derivedcompoundref>\n";
}
- const IncludeInfo *ii=cd->includeInfo();
- if (ii)
- {
- QCString nm = ii->includeName;
- if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
- if (!nm.isEmpty())
- {
- t << " <includes";
- if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
- {
- t << " refid=\"" << ii->fileDef->getOutputFileBase() << "\"";
- }
- t << " local=\"" << (ii->local ? "yes" : "no") << "\">";
- t << nm;
- t << "</includes>" << endl;
- }
- }
+ writeIncludeInfo(cd->includeInfo(),t);
writeInnerClasses(cd->getClasses(),t);
@@ -1348,25 +1362,32 @@ static void generateXMLForClass(const ClassDef *cd,FTextStream &ti)
}
}
- t << " <briefdescription>" << endl;
+ if (!cd->requiresClause().isEmpty())
+ {
+ t << " <requiresclause>";
+ linkifyText(TextGeneratorXMLImpl(t),cd,cd->getFileDef(),0,cd->requiresClause());
+ t << " </requiresclause>\n";
+ }
+
+ t << " <briefdescription>\n";
writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription());
- t << " </briefdescription>" << endl;
- t << " <detaileddescription>" << endl;
+ t << " </briefdescription>\n";
+ t << " <detaileddescription>\n";
writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,0,cd->documentation());
- t << " </detaileddescription>" << endl;
+ t << " </detaileddescription>\n";
DotClassGraph inheritanceGraph(cd,Inheritance);
if (!inheritanceGraph.isTrivial())
{
- t << " <inheritancegraph>" << endl;
+ t << " <inheritancegraph>\n";
inheritanceGraph.writeXML(t);
- t << " </inheritancegraph>" << endl;
+ t << " </inheritancegraph>\n";
}
DotClassGraph collaborationGraph(cd,Collaboration);
if (!collaborationGraph.isTrivial())
{
- t << " <collaborationgraph>" << endl;
+ t << " <collaborationgraph>\n";
collaborationGraph.writeXML(t);
- t << " </collaborationgraph>" << endl;
+ t << " </collaborationgraph>\n";
}
t << " <location file=\""
<< convertToXML(stripFromPath(cd->getDefFileName())) << "\" line=\""
@@ -1382,15 +1403,59 @@ static void generateXMLForClass(const ClassDef *cd,FTextStream &ti)
t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\""
<< cd->getEndBodyLine() << "\"";
}
- t << "/>" << endl;
+ t << "/>\n";
writeListOfAllMembers(cd,t);
- t << " </compounddef>" << endl;
- t << "</doxygen>" << endl;
+ t << " </compounddef>\n";
+ t << "</doxygen>\n";
- ti << " </compound>" << endl;
+ ti << " </compound>\n";
}
-static void generateXMLForNamespace(const NamespaceDef *nd,FTextStream &ti)
+static void generateXMLForConcept(const ConceptDef *cd,TextStream &ti)
+{
+ if (cd->isReference() || cd->isHidden()) return; // skip external references.
+
+ ti << " <compound refid=\"" << cd->getOutputFileBase()
+ << "\" kind=\"concept\"" << "><name>"
+ << convertToXML(cd->name()) << "</name>\n";
+
+ QCString outputDirectory = Config_getString(XML_OUTPUT);
+ QCString fileName=outputDirectory+"/"+cd->getOutputFileBase()+".xml";
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
+ {
+ err("Cannot open file %s for writing!\n",qPrint(fileName));
+ return;
+ }
+ TextStream t(&f);
+ writeXMLHeader(t);
+ t << " <compounddef id=\"" << cd->getOutputFileBase()
+ << "\" kind=\"concept\">\n";
+ t << " <compoundname>";
+ writeXMLString(t,cd->name());
+ t << "</compoundname>\n";
+ writeIncludeInfo(cd->includeInfo(),t);
+ writeTemplateList(cd,t);
+ t << " <initializer>";
+ linkifyText(TextGeneratorXMLImpl(t),cd,cd->getFileDef(),0,cd->initializer());
+ t << " </initializer>\n";
+ t << " <briefdescription>\n";
+ writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription());
+ t << " </briefdescription>\n";
+ t << " <detaileddescription>\n";
+ writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,0,cd->documentation());
+ t << " </detaileddescription>\n";
+ t << " <location file=\""
+ << convertToXML(stripFromPath(cd->getDefFileName())) << "\" line=\""
+ << cd->getDefLine() << "\"" << " column=\""
+ << cd->getDefColumn() << "\"/>\n" ;
+ t << " </compounddef>\n";
+ t << "</doxygen>\n";
+
+ ti << " </compound>\n";
+}
+
+static void generateXMLForNamespace(const NamespaceDef *nd,TextStream &ti)
{
// + contained class definitions
// + contained namespace definitions
@@ -1405,28 +1470,27 @@ static void generateXMLForNamespace(const NamespaceDef *nd,FTextStream &ti)
ti << " <compound refid=\"" << nd->getOutputFileBase()
<< "\" kind=\"namespace\"" << "><name>"
- << convertToXML(nd->name()) << "</name>" << endl;
+ << convertToXML(nd->name()) << "</name>\n";
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/"+nd->getOutputFileBase()+".xml";
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- err("Cannot open file %s for writing!\n",fileName.data());
+ err("Cannot open file %s for writing!\n",qPrint(fileName));
return;
}
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
+ TextStream t(&f);
writeXMLHeader(t);
t << " <compounddef id=\"" << nd->getOutputFileBase()
<< "\" kind=\"namespace\" "
<< (nd->isInline()?"inline=\"yes\" ":"")
<< "language=\""
- << langToString(nd->getLanguage()) << "\">" << endl;
+ << langToString(nd->getLanguage()) << "\">\n";
t << " <compoundname>";
writeXMLString(t,nd->name());
- t << "</compoundname>" << endl;
+ t << "</compoundname>\n";
writeInnerClasses(nd->getClasses(),t);
writeInnerNamespaces(nd->getNamespaces(),t);
@@ -1445,23 +1509,23 @@ static void generateXMLForNamespace(const NamespaceDef *nd,FTextStream &ti)
}
}
- t << " <briefdescription>" << endl;
+ t << " <briefdescription>\n";
writeXMLDocBlock(t,nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription());
- t << " </briefdescription>" << endl;
- t << " <detaileddescription>" << endl;
+ t << " </briefdescription>\n";
+ t << " <detaileddescription>\n";
writeXMLDocBlock(t,nd->docFile(),nd->docLine(),nd,0,nd->documentation());
- t << " </detaileddescription>" << endl;
+ t << " </detaileddescription>\n";
t << " <location file=\""
<< convertToXML(stripFromPath(nd->getDefFileName())) << "\" line=\""
<< nd->getDefLine() << "\"" << " column=\""
- << nd->getDefColumn() << "\"/>" << endl ;
- t << " </compounddef>" << endl;
- t << "</doxygen>" << endl;
+ << nd->getDefColumn() << "\"/>\n" ;
+ t << " </compounddef>\n";
+ t << "</doxygen>\n";
- ti << " </compound>" << endl;
+ ti << " </compound>\n";
}
-static void generateXMLForFile(FileDef *fd,FTextStream &ti)
+static void generateXMLForFile(FileDef *fd,TextStream &ti)
{
// + includes files
// + includedby files
@@ -1481,26 +1545,25 @@ static void generateXMLForFile(FileDef *fd,FTextStream &ti)
ti << " <compound refid=\"" << fd->getOutputFileBase()
<< "\" kind=\"file\"><name>" << convertToXML(fd->name())
- << "</name>" << endl;
+ << "</name>\n";
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/"+fd->getOutputFileBase()+".xml";
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- err("Cannot open file %s for writing!\n",fileName.data());
+ err("Cannot open file %s for writing!\n",qPrint(fileName));
return;
}
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
+ TextStream t(&f);
writeXMLHeader(t);
t << " <compounddef id=\"" << fd->getOutputFileBase()
<< "\" kind=\"file\" language=\""
- << langToString(fd->getLanguage()) << "\">" << endl;
+ << langToString(fd->getLanguage()) << "\">\n";
t << " <compoundname>";
writeXMLString(t,fd->name());
- t << "</compoundname>" << endl;
+ t << "</compoundname>\n";
for (const auto &inc : fd->includeFileList())
{
@@ -1511,7 +1574,7 @@ static void generateXMLForFile(FileDef *fd,FTextStream &ti)
}
t << " local=\"" << (inc.local ? "yes" : "no") << "\">";
t << inc.includeName;
- t << "</includes>" << endl;
+ t << "</includes>\n";
}
for (const auto &inc : fd->includedByFileList())
@@ -1523,23 +1586,23 @@ static void generateXMLForFile(FileDef *fd,FTextStream &ti)
}
t << " local=\"" << (inc.local ? "yes" : "no") << "\">";
t << inc.includeName;
- t << "</includedby>" << endl;
+ t << "</includedby>\n";
}
DotInclDepGraph incDepGraph(fd,FALSE);
if (!incDepGraph.isTrivial())
{
- t << " <incdepgraph>" << endl;
+ t << " <incdepgraph>\n";
incDepGraph.writeXML(t);
- t << " </incdepgraph>" << endl;
+ t << " </incdepgraph>\n";
}
DotInclDepGraph invIncDepGraph(fd,TRUE);
if (!invIncDepGraph.isTrivial())
{
- t << " <invincdepgraph>" << endl;
+ t << " <invincdepgraph>\n";
invIncDepGraph.writeXML(t);
- t << " </invincdepgraph>" << endl;
+ t << " </invincdepgraph>\n";
}
writeInnerClasses(fd->getClasses(),t);
@@ -1559,24 +1622,24 @@ static void generateXMLForFile(FileDef *fd,FTextStream &ti)
}
}
- t << " <briefdescription>" << endl;
+ t << " <briefdescription>\n";
writeXMLDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription());
- t << " </briefdescription>" << endl;
- t << " <detaileddescription>" << endl;
+ t << " </briefdescription>\n";
+ t << " <detaileddescription>\n";
writeXMLDocBlock(t,fd->docFile(),fd->docLine(),fd,0,fd->documentation());
- t << " </detaileddescription>" << endl;
+ t << " </detaileddescription>\n";
if (Config_getBool(XML_PROGRAMLISTING))
{
writeXMLCodeBlock(t,fd);
}
- t << " <location file=\"" << convertToXML(stripFromPath(fd->getDefFileName())) << "\"/>" << endl;
- t << " </compounddef>" << endl;
- t << "</doxygen>" << endl;
+ t << " <location file=\"" << convertToXML(stripFromPath(fd->getDefFileName())) << "\"/>\n";
+ t << " </compounddef>\n";
+ t << "</doxygen>\n";
- ti << " </compound>" << endl;
+ ti << " </compound>\n";
}
-static void generateXMLForGroup(const GroupDef *gd,FTextStream &ti)
+static void generateXMLForGroup(const GroupDef *gd,TextStream &ti)
{
// + members
// + member groups
@@ -1593,24 +1656,23 @@ static void generateXMLForGroup(const GroupDef *gd,FTextStream &ti)
if (gd->isReference()) return; // skip external references
ti << " <compound refid=\"" << gd->getOutputFileBase()
- << "\" kind=\"group\"><name>" << convertToXML(gd->name()) << "</name>" << endl;
+ << "\" kind=\"group\"><name>" << convertToXML(gd->name()) << "</name>\n";
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/"+gd->getOutputFileBase()+".xml";
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- err("Cannot open file %s for writing!\n",fileName.data());
+ err("Cannot open file %s for writing!\n",qPrint(fileName));
return;
}
+ TextStream t(&f);
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
writeXMLHeader(t);
t << " <compounddef id=\""
- << gd->getOutputFileBase() << "\" kind=\"group\">" << endl;
- t << " <compoundname>" << convertToXML(gd->name()) << "</compoundname>" << endl;
- t << " <title>" << convertToXML(gd->groupTitle()) << "</title>" << endl;
+ << gd->getOutputFileBase() << "\" kind=\"group\">\n";
+ t << " <compoundname>" << convertToXML(gd->name()) << "</compoundname>\n";
+ t << " <title>" << convertToXML(gd->groupTitle()) << "</title>\n";
writeInnerFiles(gd->getFiles(),t);
writeInnerClasses(gd->getClasses(),t);
@@ -1632,58 +1694,57 @@ static void generateXMLForGroup(const GroupDef *gd,FTextStream &ti)
}
}
- t << " <briefdescription>" << endl;
+ t << " <briefdescription>\n";
writeXMLDocBlock(t,gd->briefFile(),gd->briefLine(),gd,0,gd->briefDescription());
- t << " </briefdescription>" << endl;
- t << " <detaileddescription>" << endl;
+ t << " </briefdescription>\n";
+ t << " <detaileddescription>\n";
writeXMLDocBlock(t,gd->docFile(),gd->docLine(),gd,0,gd->documentation());
- t << " </detaileddescription>" << endl;
- t << " </compounddef>" << endl;
- t << "</doxygen>" << endl;
+ t << " </detaileddescription>\n";
+ t << " </compounddef>\n";
+ t << "</doxygen>\n";
- ti << " </compound>" << endl;
+ ti << " </compound>\n";
}
-static void generateXMLForDir(DirDef *dd,FTextStream &ti)
+static void generateXMLForDir(DirDef *dd,TextStream &ti)
{
if (dd->isReference()) return; // skip external references
ti << " <compound refid=\"" << dd->getOutputFileBase()
<< "\" kind=\"dir\"><name>" << convertToXML(dd->displayName())
- << "</name>" << endl;
+ << "</name>\n";
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/"+dd->getOutputFileBase()+".xml";
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- err("Cannot open file %s for writing!\n",fileName.data());
+ err("Cannot open file %s for writing!\n",qPrint(fileName));
return;
}
+ TextStream t(&f);
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
writeXMLHeader(t);
t << " <compounddef id=\""
- << dd->getOutputFileBase() << "\" kind=\"dir\">" << endl;
- t << " <compoundname>" << convertToXML(dd->displayName()) << "</compoundname>" << endl;
+ << dd->getOutputFileBase() << "\" kind=\"dir\">\n";
+ t << " <compoundname>" << convertToXML(dd->displayName()) << "</compoundname>\n";
writeInnerDirs(&dd->subDirs(),t);
writeInnerFiles(dd->getFiles(),t);
- t << " <briefdescription>" << endl;
+ t << " <briefdescription>\n";
writeXMLDocBlock(t,dd->briefFile(),dd->briefLine(),dd,0,dd->briefDescription());
- t << " </briefdescription>" << endl;
- t << " <detaileddescription>" << endl;
+ t << " </briefdescription>\n";
+ t << " <detaileddescription>\n";
writeXMLDocBlock(t,dd->docFile(),dd->docLine(),dd,0,dd->documentation());
- t << " </detaileddescription>" << endl;
- t << " <location file=\"" << convertToXML(stripFromPath(dd->name())) << "\"/>" << endl;
- t << " </compounddef>" << endl;
- t << "</doxygen>" << endl;
+ t << " </detaileddescription>\n";
+ t << " <location file=\"" << convertToXML(stripFromPath(dd->name())) << "\"/>\n";
+ t << " </compounddef>\n";
+ t << "</doxygen>\n";
- ti << " </compound>" << endl;
+ ti << " </compound>\n";
}
-static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample)
+static void generateXMLForPage(PageDef *pd,TextStream &ti,bool isExample)
{
// + name
// + title
@@ -1703,24 +1764,23 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample)
ti << " <compound refid=\"" << pageName
<< "\" kind=\"" << kindName << "\"><name>" << convertToXML(pd->name())
- << "</name>" << endl;
+ << "</name>\n";
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/"+pageName+".xml";
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- err("Cannot open file %s for writing!\n",fileName.data());
+ err("Cannot open file %s for writing!\n",qPrint(fileName));
return;
}
+ TextStream t(&f);
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
writeXMLHeader(t);
t << " <compounddef id=\"" << pageName;
- t << "\" kind=\"" << kindName << "\">" << endl;
+ t << "\" kind=\"" << kindName << "\">\n";
t << " <compoundname>" << convertToXML(pd->name())
- << "</compoundname>" << endl;
+ << "</compoundname>\n";
if (pd==Doxygen::mainPage.get()) // main page is special
{
@@ -1734,7 +1794,7 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample)
title = Config_getString(PROJECT_NAME);
}
t << " <title>" << convertToXML(convertCharEntitiesToUTF8(title))
- << "</title>" << endl;
+ << "</title>\n";
}
else
{
@@ -1742,14 +1802,14 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample)
if (si)
{
t << " <title>" << convertToXML(filterTitle(convertCharEntitiesToUTF8(si->title()).str()))
- << "</title>" << endl;
+ << "</title>\n";
}
}
writeInnerPages(pd->getSubPages(),t);
const SectionRefs &sectionRefs = pd->getSectionRefs();
if (pd->localToc().isXmlEnabled() && !sectionRefs.empty())
{
- t << " <tableofcontents>" << endl;
+ t << " <tableofcontents>\n";
int level=1,l;
bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE };
int maxLevel = pd->localToc().xmlLevel();
@@ -1757,31 +1817,31 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample)
{
if (isSection(si->type()))
{
- //printf(" level=%d title=%s\n",level,si->title.data());
+ //printf(" level=%d title=%s\n",level,qPrint(si->title));
int nextLevel = (int)si->type();
if (nextLevel>level)
{
for (l=level;l<nextLevel;l++)
{
- if (l < maxLevel) t << " <tableofcontents>" << endl;
+ if (l < maxLevel) t << " <tableofcontents>\n";
}
}
else if (nextLevel<level)
{
for (l=level;l>nextLevel;l--)
{
- if (l <= maxLevel && inLi[l]) t << " </tocsect>" << endl;
+ if (l <= maxLevel && inLi[l]) t << " </tocsect>\n";
inLi[l]=FALSE;
- if (l <= maxLevel) t << " </tableofcontents>" << endl;
+ if (l <= maxLevel) t << " </tableofcontents>\n";
}
}
if (nextLevel <= maxLevel)
{
- if (inLi[nextLevel]) t << " </tocsect>" << endl;
+ if (inLi[nextLevel]) t << " </tocsect>\n";
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;
+ t << " <tocsect>\n";
+ t << " <name>" << (si->title().isEmpty()?si->label():titleDoc) << "</name>\n";
+ t << " <reference>" << convertToXML(pageName) << "_1" << convertToXML(si->label()) << "</reference>\n";
inLi[nextLevel]=TRUE;
level = nextLevel;
}
@@ -1789,19 +1849,19 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample)
}
while (level>1 && level <= maxLevel)
{
- if (inLi[level]) t << " </tocsect>" << endl;
+ if (inLi[level]) t << " </tocsect>\n";
inLi[level]=FALSE;
- t << " </tableofcontents>" << endl;
+ t << " </tableofcontents>\n";
level--;
}
- if (level <= maxLevel && inLi[level]) t << " </tocsect>" << endl;
+ if (level <= maxLevel && inLi[level]) t << " </tocsect>\n";
inLi[level]=FALSE;
- t << " </tableofcontents>" << endl;
+ t << " </tableofcontents>\n";
}
- t << " <briefdescription>" << endl;
+ t << " <briefdescription>\n";
writeXMLDocBlock(t,pd->briefFile(),pd->briefLine(),pd,0,pd->briefDescription());
- t << " </briefdescription>" << endl;
- t << " <detaileddescription>" << endl;
+ t << " </briefdescription>\n";
+ t << " <detaileddescription>\n";
if (isExample)
{
writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,0,
@@ -1812,19 +1872,20 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample)
writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,0,
pd->documentation());
}
- t << " </detaileddescription>" << endl;
+ t << " </detaileddescription>\n";
- t << " <location file=\"" << convertToXML(stripFromPath(pd->getDefFileName())) << "\"/>" << endl;
+ t << " <location file=\"" << convertToXML(stripFromPath(pd->getDefFileName())) << "\"/>\n";
- t << " </compounddef>" << endl;
- t << "</doxygen>" << endl;
+ t << " </compounddef>\n";
+ t << "</doxygen>\n";
- ti << " </compound>" << endl;
+ ti << " </compound>\n";
}
void generateXML()
{
// + classes
+ // + concepts
// + namespaces
// + files
// + groups
@@ -1832,111 +1893,120 @@ void generateXML()
// - examples
QCString outputDirectory = Config_getString(XML_OUTPUT);
- QDir xmlDir(outputDirectory);
+ Dir xmlDir(outputDirectory.str());
createSubDirs(xmlDir);
ResourceMgr::instance().copyResource("xml.xsd",outputDirectory);
ResourceMgr::instance().copyResource("index.xsd",outputDirectory);
QCString fileName=outputDirectory+"/compound.xsd";
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
+ std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- err("Cannot open file %s for writing!\n",fileName.data());
+ err("Cannot open file %s for writing!\n",qPrint(fileName));
return;
}
-
- // write compound.xsd, but replace special marker with the entities
- QCString compound_xsd = ResourceMgr::instance().getAsString("compound.xsd");
- const char *startLine = compound_xsd.data();
- while (*startLine)
{
- // find end of the line
- const char *endLine = startLine+1;
- while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
- int len=endLine-startLine;
- if (len>0)
+ TextStream t(&f);
+
+ // write compound.xsd, but replace special marker with the entities
+ QCString compound_xsd = ResourceMgr::instance().getAsString("compound.xsd");
+ const char *startLine = compound_xsd.data();
+ while (*startLine)
{
- QCString s(len+1);
- qstrncpy(s.rawData(),startLine,len);
- s[len]='\0';
- if (s.find("<!-- Automatically insert here the HTML entities -->")!=-1)
- {
- FTextStream t(&f);
- HtmlEntityMapper::instance()->writeXMLSchema(t);
- }
- else
+ // find end of the line
+ const char *endLine = startLine+1;
+ while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
+ int len=static_cast<int>(endLine-startLine);
+ if (len>0)
{
- f.writeBlock(startLine,len);
+ QCString s(len+1);
+ qstrncpy(s.rawData(),startLine,len);
+ s[len]='\0';
+ if (s.find("<!-- Automatically insert here the HTML entities -->")!=-1)
+ {
+ HtmlEntityMapper::instance()->writeXMLSchema(t);
+ }
+ else
+ {
+ t.write(startLine,len);
+ }
}
+ startLine=endLine;
}
- startLine=endLine;
}
f.close();
fileName=outputDirectory+"/index.xml";
- f.setName(fileName);
- if (!f.open(IO_WriteOnly))
+ f.open(fileName.str(),std::ofstream::out | std::ofstream::binary);
+ if (!f.is_open())
{
- err("Cannot open file %s for writing!\n",fileName.data());
+ err("Cannot open file %s for writing!\n",qPrint(fileName));
return;
}
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
+ else
+ {
+ TextStream t(&f);
- // write index header
- t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
- t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
- t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
- t << "version=\"" << getDoxygenVersion() << "\" ";
- t << "xml:lang=\"" << theTranslator->trISOLang() << "\"";
- t << ">" << endl;
+ // write index header
+ t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";;
+ t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
+ t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
+ t << "version=\"" << getDoxygenVersion() << "\" ";
+ t << "xml:lang=\"" << theTranslator->trISOLang() << "\"";
+ t << ">\n";
- for (const auto &cd : *Doxygen::classLinkedMap)
- {
- generateXMLForClass(cd.get(),t);
- }
- for (const auto &nd : *Doxygen::namespaceLinkedMap)
- {
- msg("Generating XML output for namespace %s\n",nd->name().data());
- generateXMLForNamespace(nd.get(),t);
- }
- for (const auto &fn : *Doxygen::inputNameLinkedMap)
- {
- for (const auto &fd : *fn)
+ for (const auto &cd : *Doxygen::classLinkedMap)
{
- msg("Generating XML output for file %s\n",fd->name().data());
- generateXMLForFile(fd.get(),t);
+ generateXMLForClass(cd.get(),t);
+ }
+ for (const auto &cd : *Doxygen::conceptLinkedMap)
+ {
+ msg("Generating XML output for concept %s\n",qPrint(cd->name()));
+ generateXMLForConcept(cd.get(),t);
+ }
+ for (const auto &nd : *Doxygen::namespaceLinkedMap)
+ {
+ msg("Generating XML output for namespace %s\n",qPrint(nd->name()));
+ generateXMLForNamespace(nd.get(),t);
+ }
+ for (const auto &fn : *Doxygen::inputNameLinkedMap)
+ {
+ for (const auto &fd : *fn)
+ {
+ msg("Generating XML output for file %s\n",qPrint(fd->name()));
+ generateXMLForFile(fd.get(),t);
+ }
+ }
+ for (const auto &gd : *Doxygen::groupLinkedMap)
+ {
+ msg("Generating XML output for group %s\n",qPrint(gd->name()));
+ generateXMLForGroup(gd.get(),t);
+ }
+ for (const auto &pd : *Doxygen::pageLinkedMap)
+ {
+ msg("Generating XML output for page %s\n",qPrint(pd->name()));
+ generateXMLForPage(pd.get(),t,FALSE);
+ }
+ for (const auto &dd : *Doxygen::dirLinkedMap)
+ {
+ msg("Generate XML output for dir %s\n",qPrint(dd->name()));
+ generateXMLForDir(dd.get(),t);
+ }
+ for (const auto &pd : *Doxygen::exampleLinkedMap)
+ {
+ msg("Generating XML output for example %s\n",qPrint(pd->name()));
+ generateXMLForPage(pd.get(),t,TRUE);
+ }
+ if (Doxygen::mainPage)
+ {
+ msg("Generating XML output for the main page\n");
+ generateXMLForPage(Doxygen::mainPage.get(),t,FALSE);
}
- }
- for (const auto &gd : *Doxygen::groupLinkedMap)
- {
- msg("Generating XML output for group %s\n",gd->name().data());
- generateXMLForGroup(gd.get(),t);
- }
- for (const auto &pd : *Doxygen::pageLinkedMap)
- {
- msg("Generating XML output for page %s\n",pd->name().data());
- generateXMLForPage(pd.get(),t,FALSE);
- }
- for (const auto &dd : *Doxygen::dirLinkedMap)
- {
- msg("Generate XML output for dir %s\n",dd->name().data());
- generateXMLForDir(dd.get(),t);
- }
- for (const auto &pd : *Doxygen::exampleLinkedMap)
- {
- msg("Generating XML output for example %s\n",pd->name().data());
- generateXMLForPage(pd.get(),t,TRUE);
- }
- if (Doxygen::mainPage)
- {
- msg("Generating XML output for the main page\n");
- generateXMLForPage(Doxygen::mainPage.get(),t,FALSE);
- }
- //t << " </compoundlist>" << endl;
- t << "</doxygenindex>" << endl;
+ //t << " </compoundlist>\n";
+ t << "</doxygenindex>\n";
+ }
writeCombineScript();
}
diff --git a/src/xmlgen.h b/src/xmlgen.h
index 27bb10b..ec67906 100644
--- a/src/xmlgen.h
+++ b/src/xmlgen.h
@@ -15,37 +15,39 @@
#include "outputgen.h"
+class TextStream;
+
class XMLCodeGenerator : public CodeOutputInterface
{
public:
- XMLCodeGenerator(FTextStream &t) : m_t(t), m_lineNumber(-1), m_isMemberRef(FALSE), m_col(0),
+ XMLCodeGenerator(TextStream &t) : m_t(t), m_lineNumber(-1), m_isMemberRef(FALSE), m_col(0),
m_insideCodeLine(FALSE), m_normalHLNeedStartTag(TRUE), m_insideSpecialHL(FALSE) {}
virtual ~XMLCodeGenerator() { }
- void codify(const char *text);
- void writeCodeLink(const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip);
- void writeTooltip(const char *, const DocLinkInfo &, const char *,
- const char *, const SourceLinkInfo &, const SourceLinkInfo &
- );
- void startCodeLine(bool);
- void endCodeLine();
- void startFontClass(const char *colorClass);
- void endFontClass();
- void writeCodeAnchor(const char *);
- void writeLineNumber(const char *extRef,const char *compId,
- const char *anchorId,int l);
- void setCurrentDoc(const Definition *,const char *,bool){}
- void addWord(const char *,bool){}
- void startCodeFragment(const char *);
- void endCodeFragment(const char *);
+ void codify(const QCString &text) override;
+ void writeCodeLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip) override;
+ void writeTooltip(const QCString &, const DocLinkInfo &, const QCString &,
+ const QCString &, const SourceLinkInfo &, const SourceLinkInfo &
+ ) override;
+ void startCodeLine(bool) override;
+ void endCodeLine() override;
+ void startFontClass(const QCString &colorClass) override;
+ void endFontClass() override;
+ void writeCodeAnchor(const QCString &) override;
+ void writeLineNumber(const QCString &extRef,const QCString &compId,
+ const QCString &anchorId,int l) override;
+ void setCurrentDoc(const Definition *,const QCString &,bool) override {}
+ void addWord(const QCString &,bool) override {}
+ void startCodeFragment(const QCString &) override;
+ void endCodeFragment(const QCString &) override;
void finish();
private:
- FTextStream &m_t;
+ TextStream &m_t;
QCString m_refId;
QCString m_external;
int m_lineNumber;